| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class BrowserExtension extends Twig_Extension |
||
|
|
|||
| 10 | { |
||
| 11 | protected $short_functions; |
||
| 12 | |||
| 13 | public function __construct($container) |
||
| 16 | } |
||
| 17 | |||
| 18 | public function getFunctions() |
||
| 19 | { |
||
| 20 | $array = [ |
||
| 21 | new Twig_SimpleFunction('sludio_is_ie', [ |
||
| 22 | $this, |
||
| 23 | 'isIE', |
||
| 24 | ]), |
||
| 25 | ]; |
||
| 26 | |||
| 27 | $short_array = [ |
||
| 28 | new Twig_SimpleFunction('is_ie', [ |
||
| 29 | $this, |
||
| 30 | 'isIE', |
||
| 31 | ]), |
||
| 32 | ]; |
||
| 33 | |||
| 34 | if ($this->short_functions) { |
||
| 35 | return array_merge($array, $short_array); |
||
| 36 | } else { |
||
| 37 | return $array; |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getName() |
||
| 42 | { |
||
| 43 | return 'sludio_helper.twig.browser_extension'; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function isIE() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
This check marks property names that have not been written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes
databaseConnectionString.