1 | <?php |
||
15 | class Admin extends Fol |
||
16 | { |
||
17 | private $entities = []; |
||
18 | |||
19 | public $title = 'Folk'; |
||
20 | public $description = 'Universal CMS'; |
||
21 | |||
22 | public function __construct($url) |
||
31 | |||
32 | /** |
||
33 | * @return ResponseInterface |
||
34 | */ |
||
35 | public function __invoke(ServerRequestInterface $request) |
||
41 | |||
42 | public function getRoute($name, array $data = array(), array $query = null) |
||
43 | { |
||
44 | return $this->getUrl($this['router']->getGenerator()->generate($name, $data)).($query ? '?'.http_build_query($query) : ''); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Set the admin entities. |
||
49 | * |
||
50 | * @param array $entities |
||
51 | */ |
||
52 | public function setEntities(array $entities) |
||
62 | |||
63 | /** |
||
64 | * Add a new entity. |
||
65 | * |
||
66 | * @param EntityInterface $entity |
||
67 | */ |
||
68 | public function addEntity(EntityInterface $entity) |
||
76 | |||
77 | /** |
||
78 | * Return an entity. |
||
79 | * |
||
80 | * @param string $name |
||
81 | * |
||
82 | * @return EntityInterface|null |
||
83 | */ |
||
84 | public function getEntity($name) |
||
88 | |||
89 | /** |
||
90 | * Return all entities. |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | public function getAllEntities() |
||
98 | } |
||
99 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: