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

LocaleBlacklistRule::getJsProperties()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 6
loc 6
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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
Documentation introduced by
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