Completed
Push — develop ( 4c8faa...5d0cc3 )
by Evan
03:17
created

Model::typeId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Silk\Term;
4
5
use stdClass;
0 ignored issues
show
introduced by
Use classes must be in alphabetical order.
Loading history...
6
use WP_Term;
7
use Silk\Taxonomy\Taxonomy;
8
use Silk\Type\Model as BaseModel;
9
use Illuminate\Support\Collection;
10
use Silk\Term\Exception\TermNotFoundException;
11
use Silk\Term\Exception\TaxonomyMismatchException;
12
13
/**
14
 * @property-read WP_Term $term
15
 * @property int    $term_id
16
 * @property string $name
17
 * @property string $slug
18
 * @property string $term_group
19
 * @property int    $term_taxonomy_id
20
 * @property string $taxonomy
21
 * @property string $description
22
 * @property int    $parent
23
 * @property int    $count
24
 */
25
abstract class Model extends BaseModel
26
{
0 ignored issues
show
introduced by
Opening brace of a class must be on the same line as the definition
Loading history...
27
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
28
     * The term's taxonomy
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
29
     * @var string
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
30
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
31
    const TAXONOMY = '';
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
32
33
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
34
     * The object type in WordPress
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
35
     * @var string
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
36
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
37
    const OBJECT_TYPE = 'term';
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
38
39
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
40
     * The primary ID property on the object
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
41
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
42
    const ID_PROPERTY = 'term_id';
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
43
44
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
45
     * Model Constructor.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
46
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
47
     * @param mixed $term  WP_Term to fill data from
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
48
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
49
     * @throws TaxonomyMismatchException
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
TaxonomyMismatchException => \Silk\Term\Exception\TaxonomyMismatchException
Loading history...
50
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
51
    public function __construct(WP_Term $term = null)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
52
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
53
        if (! $term) {
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
54
            $term = new WP_Term(new stdClass);
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
introduced by
Calling class constructors must always include parentheses
Loading history...
55
            $term->taxonomy = static::TAXONOMY;
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
56
        } elseif ($term->taxonomy != static::TAXONOMY) {
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
57
            throw new TaxonomyMismatchException();
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
58
        }
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
59
60
        $this->object = $term;
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
61
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
62
63
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
64
     * Create a new instance from a WP_Term object.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
65
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
66
     * @param  WP_Term $term [description]
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
WP_Term => \WP_Term
Loading history...
67
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
68
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
69
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
70
    public static function fromWpTerm(WP_Term $term)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
71
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
72
        return new static($term);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
73
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
74
75
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
76
     * Create a new instance from a term ID.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
77
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
78
     * @param  int|string $id  Term ID
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
79
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
80
     * @throws TermNotFoundException
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
TermNotFoundException => \Silk\Term\Exception\TermNotFoundException
Loading history...
81
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
82
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
83
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
84
    public static function fromID($id)
1 ignored issue
show
Duplication introduced by
This method 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...
introduced by
4 spaces found, expected 1 tabs
Loading history...
85
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
86
        if (! $term = get_term_by('id', (int) $id, static::TAXONOMY)) {
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
Conditional inline assignment not allowed
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
87
            throw new TermNotFoundException("No term found with ID $id.");
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
88
        }
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
89
90
        return static::fromWpTerm($term);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
91
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
92
93
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
94
     * Create a new instance from a slug.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
95
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
96
     * @param  string $slug  Term slug
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
97
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
98
     * @throws TermNotFoundException
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
TermNotFoundException => \Silk\Term\Exception\TermNotFoundException
Loading history...
99
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
100
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
101
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
102
    public static function fromSlug($slug)
1 ignored issue
show
Duplication introduced by
This method 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...
introduced by
4 spaces found, expected 1 tabs
Loading history...
103
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
104
        if (! $term = get_term_by('slug', $slug, static::TAXONOMY)) {
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
Conditional inline assignment not allowed
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
105
            throw new TermNotFoundException("No term found with slug '$slug'.");
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
106
        }
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
107
108
        return static::fromWpTerm($term);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
109
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
110
111
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
112
     * Create a new instance from an array of attributes.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
113
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
114
     * @param  array  $attributes [description]
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
115
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
116
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
117
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
118
    public static function fromArray(array $attributes)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
119
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
120
        return new static(
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
121
            new WP_Term((object) $attributes)
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
122
        );
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
123
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
124
125
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
126
     * Create a new term, and get the instance for it.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
127
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
128
     * @param  array $attributes  Term attributes
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
129
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
130
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
131
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
132
    public static function create(array $attributes = [])
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
133
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
134
        return static::fromArray(
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
135
            Collection::make($attributes)
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
136
                ->except([static::ID_PROPERTY, 'term_taxonomy_id'])
0 ignored issues
show
introduced by
16 spaces found, expected 4 tabs
Loading history...
137
                ->put('taxonomy', static::TAXONOMY)
0 ignored issues
show
introduced by
16 spaces found, expected 4 tabs
Loading history...
138
                ->toArray()
0 ignored issues
show
introduced by
16 spaces found, expected 4 tabs
Loading history...
139
        )->save();
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
140
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
141
142
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
143
     * Check if this term exists in the database.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
144
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
145
     * @return boolean
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
boolean => bool
Loading history...
146
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
147
    public function exists()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
148
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
149
        return $this->id && ((bool) term_exists((int) $this->id, static::TAXONOMY));
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
150
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
151
152
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
153
     * Check if this term exists in the database as the child of the given parent.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
154
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
155
     * @param  int|string|object  $parent  integer Parent term ID
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
There should be no space around pipes in doc blocks.
Loading history...
156
     *                                     string  Parent term slug or name
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
157
     *                                     object  The parent term object/model.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
158
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
159
     * @return boolean                     True if the this term and the parent
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
boolean => bool
Loading history...
160
     *                                     exist in the database, and the instance
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
161
     *                                     is a child of the given parent;
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
162
     *                                     otherwise false
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
163
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
164
    public function isChildOf($parent)
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
165
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
166
        if (isset($parent->term_id)) {
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
167
            $parent = $parent->term_id;
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
168
        }
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
169
170
        return (bool) term_exists((int) $this->id, static::TAXONOMY, $parent);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
introduced by
No whitespace should be between cast and variable.
Loading history...
171
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
172
173
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
174
     * Get the parent term instance.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
175
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
176
     * @return static
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
177
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
178
    public function parent()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
179
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
180
        return static::fromID($this->object->parent);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
181
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
182
183
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
184
     * Get all ancestors of this term as a collection.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
185
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
186
     * @return Collection
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Collection => \Illuminate\Support\Collection
Loading history...
187
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
188
    public function ancestors()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
189
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
190
        return Collection::make(get_ancestors($this->id, static::TAXONOMY, 'taxonomy'))
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
191
            ->map(function ($term_ID) {
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
192
                return static::fromID($term_ID);
0 ignored issues
show
introduced by
16 spaces found, expected 4 tabs
Loading history...
193
            });
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
194
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
195
196
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
197
     * Get the Taxonomy model.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
198
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
199
     * @return Taxonomy|\Silk\Taxonomy\Builder
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Taxonomy => \Silk\Taxonomy\Taxonomy
Loading history...
200
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
201
    public static function taxonomy()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
202
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
203
        return Taxonomy::make(static::TAXONOMY);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
204
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
205
206
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
207
     * Start a new query for terms of this type.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
208
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
209
     * @return QueryBuilder
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Invalid class name "QueryBuilder"
Loading history...
210
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
211
    public function newQuery()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
212
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
213
        return QueryBuilder::make()->setModel($this);
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
214
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
215
216
    /**
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
217
     * Get the array of actions and their respective handler classes.
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
218
     *
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
219
     * @return array
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
220
     */
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
221
    protected function actionClasses()
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
222
    {
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
introduced by
Opening brace of a function must be on the same line as the definition
Loading history...
223
        return [
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
224
            'save'   => Action\TermSaver::class,
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
introduced by
Double space found
Loading history...
introduced by
Use statement Action\TermSaver for TermSaver should be in use block.
Loading history...
225
            'load'   => Action\TermLoader::class,
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
introduced by
Double space found
Loading history...
introduced by
Use statement Action\TermLoader for TermLoader should be in use block.
Loading history...
226
            'delete' => Action\TermDeleter::class,
0 ignored issues
show
introduced by
12 spaces found, expected 3 tabs
Loading history...
introduced by
Use statement Action\TermDeleter for TermDeleter should be in use block.
Loading history...
227
        ];
0 ignored issues
show
introduced by
8 spaces found, expected 2 tabs
Loading history...
228
    }
0 ignored issues
show
introduced by
4 spaces found, expected 1 tabs
Loading history...
229
}
0 ignored issues
show
introduced by
Closing brace of a class must have a new line between itself and the last content.
Loading history...
230