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

Entity/Rule/LocaleBlacklistRule.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\Entity\Rule;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Kunstmaan\LeadGenerationBundle\Form\Rule\LocaleBlackListAdminType;
7
use Symfony\Component\Validator\Constraints as Assert;
8
9
/**
10
 * @ORM\Entity
11
 * @ORM\Table(name="kuma_rule_locale_blacklist")
12
 */
13 View Code Duplication
class LocaleBlacklistRule extends AbstractRule
14
{
15
    /**
16
     * @var string
17
     * @ORM\Column(name="locale", type="text", nullable=true)
18
     * @Assert\NotBlank()
19
     */
20
    private $locale;
21
22
    /**
23
     * @return string
24
     */
25 1
    public function getLocale()
26
    {
27 1
        return $this->locale;
28
    }
29
30
    /**
31
     * @param string $locale
32
     *
33
     * @return LocaleWhitelistRule
0 ignored issues
show
Should the return type not be LocaleBlacklistRule?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
34
     */
35 1
    public function setLocale($locale)
36
    {
37 1
        $this->locale = $locale;
38
39 1
        return $this;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45 1
    public function getJsObjectClass()
46
    {
47 1
        return 'LocaleBlacklistRule';
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53 1
    public function getJsProperties()
54
    {
55
        return array(
56 1
            'locale' => $this->getLocale(),
57
        );
58
    }
59
60
    /**
61
     * @return string
62
     */
63 1
    public function getService()
64
    {
65 1
        return 'kunstmaan_lead_generation.rule.service.localeruleservice';
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71 1
    public function getJsFilePath()
72
    {
73 1
        return '/bundles/kunstmaanleadgeneration/js/rule/LocaleBlacklistRule.js';
74
    }
75
76
    /**
77
     * @return string
78
     */
79 1
    public function getAdminType()
80
    {
81 1
        return LocaleBlackListAdminType::class;
82
    }
83
}
84