sonata-project / SonataClassificationBundle

@@ -15,19 +15,19 @@
Loading
15 15
16 16
abstract class Collection implements CollectionInterface
17 17
{
18 -
    protected ?string $name = null;
18 +
    private ?string $name = null;
19 19
20 -
    protected ?string $slug = null;
20 +
    private ?string $slug = null;
21 21
22 -
    protected bool $enabled = false;
22 +
    private bool $enabled = false;
23 23
24 -
    protected ?string $description = null;
24 +
    private ?string $description = null;
25 25
26 -
    protected ?\DateTimeInterface $createdAt = null;
26 +
    private ?\DateTimeInterface $createdAt = null;
27 27
28 -
    protected ?\DateTimeInterface $updatedAt = null;
28 +
    private ?\DateTimeInterface $updatedAt = null;
29 29
30 -
    protected ?ContextInterface $context = null;
30 +
    private ?ContextInterface $context = null;
31 31
32 32
    public function __toString(): string
33 33
    {
@@ -41,37 +41,37 @@
Loading
41 41
        $this->setSlug($name);
42 42
    }
43 43
44 -
    public function getName(): ?string
44 +
    final public function getName(): ?string
45 45
    {
46 46
        return $this->name;
47 47
    }
48 48
49 -
    public function setEnabled(bool $enabled): void
49 +
    final public function setEnabled(bool $enabled): void
50 50
    {
51 51
        $this->enabled = $enabled;
52 52
    }
53 53
54 -
    public function getEnabled(): bool
54 +
    final public function getEnabled(): bool
55 55
    {
56 56
        return $this->enabled;
57 57
    }
58 58
59 -
    public function setSlug(?string $slug): void
59 +
    final public function setSlug(?string $slug): void
60 60
    {
61 61
        $this->slug = Tag::slugify($slug ?? '');
62 62
    }
63 63
64 -
    public function getSlug(): ?string
64 +
    final public function getSlug(): ?string
65 65
    {
66 66
        return $this->slug;
67 67
    }
68 68
69 -
    public function setDescription(?string $description): void
69 +
    final public function setDescription(?string $description): void
70 70
    {
71 71
        $this->description = $description;
72 72
    }
73 73
74 -
    public function getDescription(): ?string
74 +
    final public function getDescription(): ?string
75 75
    {
76 76
        return $this->description;
77 77
    }
@@ -87,32 +87,32 @@
Loading
87 87
        $this->setUpdatedAt(new \DateTime());
88 88
    }
89 89
90 -
    public function setCreatedAt(?\DateTimeInterface $createdAt): void
90 +
    final public function setCreatedAt(?\DateTimeInterface $createdAt): void
91 91
    {
92 92
        $this->createdAt = $createdAt;
93 93
    }
94 94
95 -
    public function getCreatedAt(): ?\DateTimeInterface
95 +
    final public function getCreatedAt(): ?\DateTimeInterface
96 96
    {
97 97
        return $this->createdAt;
98 98
    }
99 99
100 -
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
100 +
    final public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
101 101
    {
102 102
        $this->updatedAt = $updatedAt;
103 103
    }
104 104
105 -
    public function getUpdatedAt(): ?\DateTimeInterface
105 +
    final public function getUpdatedAt(): ?\DateTimeInterface
106 106
    {
107 107
        return $this->updatedAt;
108 108
    }
109 109
110 -
    public function setContext(?ContextInterface $context): void
110 +
    final public function setContext(?ContextInterface $context): void
111 111
    {
112 112
        $this->context = $context;
113 113
    }
114 114
115 -
    public function getContext(): ?ContextInterface
115 +
    final public function getContext(): ?ContextInterface
116 116
    {
117 117
        return $this->context;
118 118
    }

@@ -18,28 +18,28 @@
Loading
18 18
19 19
abstract class Category implements CategoryInterface
20 20
{
21 -
    protected ?string $name = null;
21 +
    private ?string $name = null;
22 22
23 -
    protected ?string $slug = null;
23 +
    private ?string $slug = null;
24 24
25 -
    protected bool $enabled = false;
25 +
    private bool $enabled = false;
26 26
27 -
    protected ?string $description = null;
27 +
    private ?string $description = null;
28 28
29 -
    protected ?\DateTimeInterface $createdAt = null;
29 +
    private ?\DateTimeInterface $createdAt = null;
30 30
31 -
    protected ?\DateTimeInterface $updatedAt = null;
31 +
    private ?\DateTimeInterface $updatedAt = null;
32 32
33 -
    protected ?int $position = null;
33 +
    private ?int $position = null;
34 34
35 35
    /**
36 36
     * @var Collection<int, CategoryInterface>
37 37
     */
38 -
    protected Collection $children;
38 +
    private Collection $children;
39 39
40 -
    protected ?CategoryInterface $parent = null;
40 +
    private ?CategoryInterface $parent = null;
41 41
42 -
    protected ?ContextInterface $context = null;
42 +
    private ?ContextInterface $context = null;
43 43
44 44
    public function __construct()
45 45
    {
@@ -51,44 +51,44 @@
Loading
51 51
        return $this->getName() ?? 'n/a';
52 52
    }
53 53
54 -
    public function setName(?string $name): void
54 +
    final public function setName(?string $name): void
55 55
    {
56 56
        $this->name = $name;
57 57
58 58
        $this->setSlug($name);
59 59
    }
60 60
61 -
    public function getName(): ?string
61 +
    final public function getName(): ?string
62 62
    {
63 63
        return $this->name;
64 64
    }
65 65
66 -
    public function setEnabled(bool $enabled): void
66 +
    final public function setEnabled(bool $enabled): void
67 67
    {
68 68
        $this->enabled = $enabled;
69 69
    }
70 70
71 -
    public function getEnabled(): bool
71 +
    final public function getEnabled(): bool
72 72
    {
73 73
        return $this->enabled;
74 74
    }
75 75
76 -
    public function setSlug(?string $slug): void
76 +
    final public function setSlug(?string $slug): void
77 77
    {
78 78
        $this->slug = Tag::slugify($slug ?? '');
79 79
    }
80 80
81 -
    public function getSlug(): ?string
81 +
    final public function getSlug(): ?string
82 82
    {
83 83
        return $this->slug;
84 84
    }
85 85
86 -
    public function setDescription(?string $description): void
86 +
    final public function setDescription(?string $description): void
87 87
    {
88 88
        $this->description = $description;
89 89
    }
90 90
91 -
    public function getDescription(): ?string
91 +
    final public function getDescription(): ?string
92 92
    {
93 93
        return $this->description;
94 94
    }
@@ -104,37 +104,37 @@
Loading
104 104
        $this->setUpdatedAt(new \DateTime());
105 105
    }
106 106
107 -
    public function setCreatedAt(?\DateTimeInterface $createdAt): void
107 +
    final public function setCreatedAt(?\DateTimeInterface $createdAt): void
108 108
    {
109 109
        $this->createdAt = $createdAt;
110 110
    }
111 111
112 -
    public function getCreatedAt(): ?\DateTimeInterface
112 +
    final public function getCreatedAt(): ?\DateTimeInterface
113 113
    {
114 114
        return $this->createdAt;
115 115
    }
116 116
117 -
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
117 +
    final public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
118 118
    {
119 119
        $this->updatedAt = $updatedAt;
120 120
    }
121 121
122 -
    public function getUpdatedAt(): ?\DateTimeInterface
122 +
    final public function getUpdatedAt(): ?\DateTimeInterface
123 123
    {
124 124
        return $this->updatedAt;
125 125
    }
126 126
127 -
    public function setPosition(?int $position): void
127 +
    final public function setPosition(?int $position): void
128 128
    {
129 129
        $this->position = $position;
130 130
    }
131 131
132 -
    public function getPosition(): ?int
132 +
    final public function getPosition(): ?int
133 133
    {
134 134
        return $this->position;
135 135
    }
136 136
137 -
    public function addChild(CategoryInterface $child, bool $nested = false): void
137 +
    final public function addChild(CategoryInterface $child, bool $nested = false): void
138 138
    {
139 139
        $this->children[] = $child;
140 140
@@ -147,7 +147,7 @@
Loading
147 147
        }
148 148
    }
149 149
150 -
    public function removeChild(CategoryInterface $childToDelete): void
150 +
    final public function removeChild(CategoryInterface $childToDelete): void
151 151
    {
152 152
        foreach ($this->getChildren() as $pos => $child) {
153 153
            if (null !== $childToDelete->getId() && $child->getId() === $childToDelete->getId()) {
@@ -164,12 +164,12 @@
Loading
164 164
        }
165 165
    }
166 166
167 -
    public function getChildren(): Collection
167 +
    final public function getChildren(): Collection
168 168
    {
169 169
        return $this->children;
170 170
    }
171 171
172 -
    public function setChildren(array $children): void
172 +
    final public function setChildren(array $children): void
173 173
    {
174 174
        $this->children = new ArrayCollection();
175 175
@@ -178,12 +178,12 @@
Loading
178 178
        }
179 179
    }
180 180
181 -
    public function hasChildren(): bool
181 +
    final public function hasChildren(): bool
182 182
    {
183 183
        return \count($this->children) > 0;
184 184
    }
185 185
186 -
    public function setParent(?CategoryInterface $parent = null, bool $nested = false): void
186 +
    final public function setParent(?CategoryInterface $parent = null, bool $nested = false): void
187 187
    {
188 188
        $this->parent = $parent;
189 189
@@ -192,17 +192,17 @@
Loading
192 192
        }
193 193
    }
194 194
195 -
    public function getParent(): ?CategoryInterface
195 +
    final public function getParent(): ?CategoryInterface
196 196
    {
197 197
        return $this->parent;
198 198
    }
199 199
200 -
    public function setContext(?ContextInterface $context): void
200 +
    final public function setContext(?ContextInterface $context): void
201 201
    {
202 202
        $this->context = $context;
203 203
    }
204 204
205 -
    public function getContext(): ?ContextInterface
205 +
    final public function getContext(): ?ContextInterface
206 206
    {
207 207
        return $this->context;
208 208
    }

@@ -17,71 +17,71 @@
Loading
17 17
18 18
abstract class Tag implements TagInterface
19 19
{
20 -
    protected ?string $name = null;
20 +
    private ?string $name = null;
21 21
22 -
    protected ?string $slug = null;
22 +
    private ?string $slug = null;
23 23
24 -
    protected ?\DateTimeInterface $createdAt = null;
24 +
    private ?\DateTimeInterface $createdAt = null;
25 25
26 -
    protected ?\DateTimeInterface $updatedAt = null;
26 +
    private ?\DateTimeInterface $updatedAt = null;
27 27
28 -
    protected bool $enabled = false;
28 +
    private bool $enabled = false;
29 29
30 -
    protected ?ContextInterface $context = null;
30 +
    private ?ContextInterface $context = null;
31 31
32 32
    public function __toString(): string
33 33
    {
34 34
        return $this->getName() ?? 'n/a';
35 35
    }
36 36
37 -
    public function setName(?string $name): void
37 +
    final public function setName(?string $name): void
38 38
    {
39 39
        $this->name = $name;
40 40
41 41
        $this->setSlug($name);
42 42
    }
43 43
44 -
    public function getName(): ?string
44 +
    final public function getName(): ?string
45 45
    {
46 46
        return $this->name;
47 47
    }
48 48
49 -
    public function setEnabled(bool $enabled): void
49 +
    final public function setEnabled(bool $enabled): void
50 50
    {
51 51
        $this->enabled = $enabled;
52 52
    }
53 53
54 -
    public function getEnabled(): bool
54 +
    final public function getEnabled(): bool
55 55
    {
56 56
        return $this->enabled;
57 57
    }
58 58
59 -
    public function setSlug(?string $slug): void
59 +
    final public function setSlug(?string $slug): void
60 60
    {
61 61
        $this->slug = self::slugify($slug ?? '');
62 62
    }
63 63
64 -
    public function getSlug(): ?string
64 +
    final public function getSlug(): ?string
65 65
    {
66 66
        return $this->slug;
67 67
    }
68 68
69 -
    public function setCreatedAt(?\DateTimeInterface $createdAt): void
69 +
    final public function setCreatedAt(?\DateTimeInterface $createdAt): void
70 70
    {
71 71
        $this->createdAt = $createdAt;
72 72
    }
73 73
74 -
    public function getCreatedAt(): ?\DateTimeInterface
74 +
    final public function getCreatedAt(): ?\DateTimeInterface
75 75
    {
76 76
        return $this->createdAt;
77 77
    }
78 78
79 -
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
79 +
    final public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
80 80
    {
81 81
        $this->updatedAt = $updatedAt;
82 82
    }
83 83
84 -
    public function getUpdatedAt(): ?\DateTimeInterface
84 +
    final public function getUpdatedAt(): ?\DateTimeInterface
85 85
    {
86 86
        return $this->updatedAt;
87 87
    }
@@ -93,10 +93,8 @@
Loading
93 93
94 94
    /**
95 95
     * @see http://snipplr.com/view/22741/slugify-a-string-in-php/.
96 -
     *
97 -
     * @static
98 96
     */
99 -
    public static function slugify(string $text): string
97 +
    final public static function slugify(string $text): string
100 98
    {
101 99
        $text = Slugify::create()->slugify($text);
102 100
@@ -107,12 +105,12 @@
Loading
107 105
        return $text;
108 106
    }
109 107
110 -
    public function setContext(?ContextInterface $context): void
108 +
    final public function setContext(?ContextInterface $context): void
111 109
    {
112 110
        $this->context = $context;
113 111
    }
114 112
115 -
    public function getContext(): ?ContextInterface
113 +
    final public function getContext(): ?ContextInterface
116 114
    {
117 115
        return $this->context;
118 116
    }

@@ -15,57 +15,57 @@
Loading
15 15
16 16
abstract class Context implements ContextInterface
17 17
{
18 -
    protected ?string $id = null;
18 +
    private ?string $id = null;
19 19
20 -
    protected ?string $name = null;
20 +
    private ?string $name = null;
21 21
22 -
    protected ?\DateTimeInterface $createdAt = null;
22 +
    private ?\DateTimeInterface $createdAt = null;
23 23
24 -
    protected ?\DateTimeInterface $updatedAt = null;
24 +
    private ?\DateTimeInterface $updatedAt = null;
25 25
26 -
    protected bool $enabled = false;
26 +
    private bool $enabled = false;
27 27
28 28
    public function __toString(): string
29 29
    {
30 30
        return $this->getName() ?? 'n/a';
31 31
    }
32 32
33 -
    public function setName(?string $name): void
33 +
    final public function setName(?string $name): void
34 34
    {
35 35
        $this->name = $name;
36 36
    }
37 37
38 -
    public function getName(): ?string
38 +
    final public function getName(): ?string
39 39
    {
40 40
        return $this->name;
41 41
    }
42 42
43 -
    public function setEnabled(bool $enabled): void
43 +
    final public function setEnabled(bool $enabled): void
44 44
    {
45 45
        $this->enabled = $enabled;
46 46
    }
47 47
48 -
    public function getEnabled(): bool
48 +
    final public function getEnabled(): bool
49 49
    {
50 50
        return $this->enabled;
51 51
    }
52 52
53 -
    public function setCreatedAt(?\DateTimeInterface $createdAt): void
53 +
    final public function setCreatedAt(?\DateTimeInterface $createdAt): void
54 54
    {
55 55
        $this->createdAt = $createdAt;
56 56
    }
57 57
58 -
    public function getCreatedAt(): ?\DateTimeInterface
58 +
    final public function getCreatedAt(): ?\DateTimeInterface
59 59
    {
60 60
        return $this->createdAt;
61 61
    }
62 62
63 -
    public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
63 +
    final public function setUpdatedAt(?\DateTimeInterface $updatedAt): void
64 64
    {
65 65
        $this->updatedAt = $updatedAt;
66 66
    }
67 67
68 -
    public function getUpdatedAt(): ?\DateTimeInterface
68 +
    final public function getUpdatedAt(): ?\DateTimeInterface
69 69
    {
70 70
        return $this->updatedAt;
71 71
    }
@@ -75,12 +75,12 @@
Loading
75 75
        $this->setUpdatedAt(new \DateTime());
76 76
    }
77 77
78 -
    public function setId(?string $id): void
78 +
    final public function setId(?string $id): void
79 79
    {
80 80
        $this->id = $id;
81 81
    }
82 82
83 -
    public function getId(): ?string
83 +
    final public function getId(): ?string
84 84
    {
85 85
        return $this->id;
86 86
    }
Files Complexity Coverage
src 348 55.37%
Project Totals (36 files) 348 55.37%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading