Переделка для composer autoload

This commit is contained in:
origami11 2017-02-09 14:57:40 +03:00
parent ad69746347
commit b5641db607
100 changed files with 14 additions and 325 deletions

22
src/adapter.php Normal file
View file

@ -0,0 +1,22 @@
<?php
/**
* Интерфейс к массиву и обьекту как к коллекции
*/
class Adapter
{
protected $adaptee;
public function __construct ($adaptee)
{
$this->adaptee = $adaptee;
}
public function get($name)
{
if (is_array ($this->adaptee)) {
return $this->adaptee[$name];
} else {
return $this->adaptee->$name;
}
}
}