These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Kunstmaan\UtilitiesBundle\Twig; |
||
4 | |||
5 | use Kunstmaan\UtilitiesBundle\Helper\SlugifierInterface; |
||
6 | |||
7 | class UtilitiesTwigExtension extends \Twig_Extension |
||
8 | { |
||
9 | /** |
||
10 | * @var SlugifierInterface |
||
11 | */ |
||
12 | private $slugifier; |
||
13 | |||
14 | /** |
||
15 | * @param $slugifier |
||
16 | */ |
||
17 | public function __construct($slugifier) |
||
18 | { |
||
19 | $this->slugifier = $slugifier; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * Returns a list of filters. |
||
24 | * |
||
25 | * @return array An array of filters |
||
0 ignored issues
–
show
|
|||
26 | */ |
||
27 | public function getFilters() |
||
28 | { |
||
29 | return array( |
||
30 | new \Twig_SimpleFilter('slugify', [$this, 'slugify']), |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @param string $text |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | public function slugify($text) |
||
40 | { |
||
41 | return $this->slugifier->slugify($text); |
||
42 | } |
||
43 | } |
||
44 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.