Completed
Push — master ( 06c1ce...67d37c )
by Jeroen
06:20
created

Service/Rule/LocaleRuleService.php (1 issue)

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\LeadGenerationBundle\Service\Rule;
4
5
use Kunstmaan\LeadGenerationBundle\Entity\Rule\AbstractRule;
6
use Kunstmaan\LeadGenerationBundle\Service\RuleServiceInterface;
7
use Symfony\Component\HttpFoundation\Request;
8
use Symfony\Component\HttpFoundation\RequestStack;
9
10
class LocaleRuleService implements RuleServiceInterface
11
{
12
    /** @var Request */
13
    private $request;
14
15
    /**
16
     * LocaleRuleService constructor.
17
     *
18
     * @param RequestStack $requestStack
19
     */
20
    public function __construct(RequestStack $requestStack)
21
    {
22
        $this->request = $requestStack->getCurrentRequest();
23
    }
24
25
    /**
26
     * @param AbstractRule $rule
27
     *
28
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use array<string,string>.

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...
29
     */
30
    public function getJsProperties(AbstractRule $rule)
31
    {
32
        return array(
33
            'requestlocale' => $this->request->getLocale(),
34
        );
35
    }
36
}
37