Completed
Push — master ( 1de9b7...830752 )
by Kristof
38:46 queued 24:09
created

AdminBundle/Twig/GoogleSignInTwigExtension.php (2 issues)

Upgrade to new PHP Analysis Engine

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_Extension;
6
7
/**
8
 * Class GoogleSignInTwigExtension
9
 */
10
class GoogleSignInTwigExtension extends Twig_Extension
11
{
12
    private $enabled;
13
14
    private $clientId;
15
16
    public function __construct($enabled, $clientId)
17
    {
18
        $this->enabled = $enabled;
19
        $this->clientId = $clientId;
20
    }
21
22
    /**
23
     * Returns a list of functions to add to the existing list.
24
     *
25
     * @return array An array of functions
0 ignored issues
show
Consider making the return type a bit more specific; maybe use \Twig_SimpleFunction[].

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.

Loading history...
26
     */
27
    public function getFunctions()
28
    {
29
        return array(
30
            new \Twig_SimpleFunction('google_signin_enabled', array($this, 'isGoogleSignInEnabled')),
31
            new \Twig_SimpleFunction('google_signin_client_id', array($this, 'getClientId')),
32
        );
33
    }
34
35
    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 @return annotation as described here.

Loading history...
36
    {
37
        return $this->enabled;
38
    }
39
40
    /**
41
     * @return mixed
42
     */
43
    public function getClientId()
44
    {
45
        return $this->clientId;
46
    }
47
}
48