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\AdminBundle\Twig; |
||
4 | |||
5 | use Twig_Environment; |
||
6 | use Twig_Extension; |
||
7 | |||
8 | /** |
||
9 | * Class GoogleSignInTwigExtension |
||
10 | * @package Kunstmaan\AdminBundle\Twig |
||
11 | */ |
||
12 | class GoogleSignInTwigExtension extends Twig_Extension |
||
13 | { |
||
14 | private $enabled; |
||
15 | private $clientId; |
||
16 | |||
17 | public function __construct($enabled, $clientId) |
||
18 | { |
||
19 | $this->enabled = $enabled; |
||
20 | $this->clientId = $clientId; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Returns a list of functions to add to the existing list. |
||
25 | * |
||
26 | * @return array An array of functions |
||
0 ignored issues
–
show
|
|||
27 | */ |
||
28 | public function getFunctions() |
||
29 | { |
||
30 | return array( |
||
31 | new \Twig_SimpleFunction('google_signin_enabled', array($this, 'isGoogleSignInEnabled')), |
||
32 | new \Twig_SimpleFunction('google_signin_client_id', array($this, 'getClientId')), |
||
33 | ); |
||
34 | } |
||
35 | |||
36 | public function isGoogleSignInEnabled() |
||
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a
Loading history...
|
|||
37 | { |
||
38 | return $this->enabled; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return mixed |
||
43 | */ |
||
44 | public function getClientId() |
||
45 | { |
||
46 | return $this->clientId; |
||
47 | } |
||
48 | |||
49 | } |
||
50 |
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.