1 | <?php |
||
5 | class UriKeywordVoter extends BaseVoter implements VoterInterface |
||
6 | { |
||
7 | public function vote($uri = null) |
||
19 | |||
20 | protected function setDefaultTarget() |
||
26 | |||
27 | protected function getDefaultAssets() |
||
40 | |||
41 | /* |
||
42 | public function setAssets($assets) |
||
43 | { |
||
44 | // skip checks for performance |
||
45 | // if (!is_array($assets)) { |
||
46 | // throw new \Exception('Assets of '.static::class.' must be an array'); |
||
47 | // } |
||
48 | // if (count($assets) != count($assets, COUNT_RECURSIVE)) { |
||
49 | // throw new \Exception('Assets of '.static::class.' must be a one-dimensional array'); |
||
50 | // } |
||
51 | |||
52 | $this->assets = $assets; |
||
53 | |||
54 | return $this; |
||
55 | } |
||
56 | */ |
||
57 | } |
||
58 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: