OrganizationRole   A
last analyzed

Complexity

Total Complexity 17

Size/Duplication

Total Lines 267
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 17
lcom 1
cbo 1
dl 267
loc 267
rs 10
c 0
b 0
f 0

17 Methods

Rating   Name   Duplication   Size   Complexity  
A additionalType() 4 4 1
A alternateName() 4 4 1
A description() 4 4 1
A disambiguatingDescription() 4 4 1
A endDate() 4 4 1
A identifier() 4 4 1
A image() 4 4 1
A mainEntityOfPage() 4 4 1
A name() 4 4 1
A namedPosition() 4 4 1
A numberedPosition() 4 4 1
A potentialAction() 4 4 1
A roleName() 4 4 1
A sameAs() 4 4 1
A startDate() 4 4 1
A subjectOf() 4 4 1
A url() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace Spatie\SchemaOrg;
4
5
use \Spatie\SchemaOrg\Contracts\OrganizationRoleContract;
6
use \Spatie\SchemaOrg\Contracts\IntangibleContract;
7
use \Spatie\SchemaOrg\Contracts\RoleContract;
8
use \Spatie\SchemaOrg\Contracts\ThingContract;
9
10
/**
11
 * A subclass of Role used to describe roles within organizations.
12
 *
13
 * @see http://schema.org/OrganizationRole
14
 *
15
 */
16 View Code Duplication
class OrganizationRole extends BaseType implements OrganizationRoleContract, IntangibleContract, RoleContract, ThingContract
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...
17
{
18
    /**
19
     * An additional type for the item, typically used for adding more specific
20
     * types from external vocabularies in microdata syntax. This is a
21
     * relationship between something and a class that the thing is in. In RDFa
22
     * syntax, it is better to use the native RDFa syntax - the 'typeof'
23
     * attribute - for multiple types. Schema.org tools may have only weaker
24
     * understanding of extra types, in particular those defined externally.
25
     *
26
     * @param string|string[] $additionalType
27
     *
28
     * @return static
29
     *
30
     * @see http://schema.org/additionalType
31
     */
32
    public function additionalType($additionalType)
33
    {
34
        return $this->setProperty('additionalType', $additionalType);
35
    }
36
37
    /**
38
     * An alias for the item.
39
     *
40
     * @param string|string[] $alternateName
41
     *
42
     * @return static
43
     *
44
     * @see http://schema.org/alternateName
45
     */
46
    public function alternateName($alternateName)
47
    {
48
        return $this->setProperty('alternateName', $alternateName);
49
    }
50
51
    /**
52
     * A description of the item.
53
     *
54
     * @param string|string[] $description
55
     *
56
     * @return static
57
     *
58
     * @see http://schema.org/description
59
     */
60
    public function description($description)
61
    {
62
        return $this->setProperty('description', $description);
63
    }
64
65
    /**
66
     * A sub property of description. A short description of the item used to
67
     * disambiguate from other, similar items. Information from other properties
68
     * (in particular, name) may be necessary for the description to be useful
69
     * for disambiguation.
70
     *
71
     * @param string|string[] $disambiguatingDescription
72
     *
73
     * @return static
74
     *
75
     * @see http://schema.org/disambiguatingDescription
76
     */
77
    public function disambiguatingDescription($disambiguatingDescription)
78
    {
79
        return $this->setProperty('disambiguatingDescription', $disambiguatingDescription);
80
    }
81
82
    /**
83
     * The end date and time of the item (in [ISO 8601 date
84
     * format](http://en.wikipedia.org/wiki/ISO_8601)).
85
     *
86
     * @param \DateTimeInterface|\DateTimeInterface[] $endDate
87
     *
88
     * @return static
89
     *
90
     * @see http://schema.org/endDate
91
     */
92
    public function endDate($endDate)
93
    {
94
        return $this->setProperty('endDate', $endDate);
95
    }
96
97
    /**
98
     * The identifier property represents any kind of identifier for any kind of
99
     * [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides
100
     * dedicated properties for representing many of these, either as textual
101
     * strings or as URL (URI) links. See [background
102
     * notes](/docs/datamodel.html#identifierBg) for more details.
103
     *
104
     * @param \Spatie\SchemaOrg\Contracts\PropertyValueContract|\Spatie\SchemaOrg\Contracts\PropertyValueContract[]|string|string[] $identifier
105
     *
106
     * @return static
107
     *
108
     * @see http://schema.org/identifier
109
     */
110
    public function identifier($identifier)
111
    {
112
        return $this->setProperty('identifier', $identifier);
113
    }
114
115
    /**
116
     * An image of the item. This can be a [[URL]] or a fully described
117
     * [[ImageObject]].
118
     *
119
     * @param \Spatie\SchemaOrg\Contracts\ImageObjectContract|\Spatie\SchemaOrg\Contracts\ImageObjectContract[]|string|string[] $image
120
     *
121
     * @return static
122
     *
123
     * @see http://schema.org/image
124
     */
125
    public function image($image)
126
    {
127
        return $this->setProperty('image', $image);
128
    }
129
130
    /**
131
     * Indicates a page (or other CreativeWork) for which this thing is the main
132
     * entity being described. See [background
133
     * notes](/docs/datamodel.html#mainEntityBackground) for details.
134
     *
135
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|string|string[] $mainEntityOfPage
136
     *
137
     * @return static
138
     *
139
     * @see http://schema.org/mainEntityOfPage
140
     */
141
    public function mainEntityOfPage($mainEntityOfPage)
142
    {
143
        return $this->setProperty('mainEntityOfPage', $mainEntityOfPage);
144
    }
145
146
    /**
147
     * The name of the item.
148
     *
149
     * @param string|string[] $name
150
     *
151
     * @return static
152
     *
153
     * @see http://schema.org/name
154
     */
155
    public function name($name)
156
    {
157
        return $this->setProperty('name', $name);
158
    }
159
160
    /**
161
     * A position played, performed or filled by a person or organization, as
162
     * part of an organization. For example, an athlete in a SportsTeam might
163
     * play in the position named 'Quarterback'.
164
     *
165
     * @param string|string[] $namedPosition
166
     *
167
     * @return static
168
     *
169
     * @see http://schema.org/namedPosition
170
     */
171
    public function namedPosition($namedPosition)
172
    {
173
        return $this->setProperty('namedPosition', $namedPosition);
174
    }
175
176
    /**
177
     * A number associated with a role in an organization, for example, the
178
     * number on an athlete's jersey.
179
     *
180
     * @param float|float[]|int|int[] $numberedPosition
181
     *
182
     * @return static
183
     *
184
     * @see http://schema.org/numberedPosition
185
     */
186
    public function numberedPosition($numberedPosition)
187
    {
188
        return $this->setProperty('numberedPosition', $numberedPosition);
189
    }
190
191
    /**
192
     * Indicates a potential Action, which describes an idealized action in
193
     * which this thing would play an 'object' role.
194
     *
195
     * @param \Spatie\SchemaOrg\Contracts\ActionContract|\Spatie\SchemaOrg\Contracts\ActionContract[] $potentialAction
196
     *
197
     * @return static
198
     *
199
     * @see http://schema.org/potentialAction
200
     */
201
    public function potentialAction($potentialAction)
202
    {
203
        return $this->setProperty('potentialAction', $potentialAction);
204
    }
205
206
    /**
207
     * A role played, performed or filled by a person or organization. For
208
     * example, the team of creators for a comic book might fill the roles named
209
     * 'inker', 'penciller', and 'letterer'; or an athlete in a SportsTeam might
210
     * play in the position named 'Quarterback'.
211
     *
212
     * @param string|string[] $roleName
213
     *
214
     * @return static
215
     *
216
     * @see http://schema.org/roleName
217
     */
218
    public function roleName($roleName)
219
    {
220
        return $this->setProperty('roleName', $roleName);
221
    }
222
223
    /**
224
     * URL of a reference Web page that unambiguously indicates the item's
225
     * identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or
226
     * official website.
227
     *
228
     * @param string|string[] $sameAs
229
     *
230
     * @return static
231
     *
232
     * @see http://schema.org/sameAs
233
     */
234
    public function sameAs($sameAs)
235
    {
236
        return $this->setProperty('sameAs', $sameAs);
237
    }
238
239
    /**
240
     * The start date and time of the item (in [ISO 8601 date
241
     * format](http://en.wikipedia.org/wiki/ISO_8601)).
242
     *
243
     * @param \DateTimeInterface|\DateTimeInterface[] $startDate
244
     *
245
     * @return static
246
     *
247
     * @see http://schema.org/startDate
248
     */
249
    public function startDate($startDate)
250
    {
251
        return $this->setProperty('startDate', $startDate);
252
    }
253
254
    /**
255
     * A CreativeWork or Event about this Thing.
256
     *
257
     * @param \Spatie\SchemaOrg\Contracts\CreativeWorkContract|\Spatie\SchemaOrg\Contracts\CreativeWorkContract[]|\Spatie\SchemaOrg\Contracts\EventContract|\Spatie\SchemaOrg\Contracts\EventContract[] $subjectOf
258
     *
259
     * @return static
260
     *
261
     * @see http://schema.org/subjectOf
262
     */
263
    public function subjectOf($subjectOf)
264
    {
265
        return $this->setProperty('subjectOf', $subjectOf);
266
    }
267
268
    /**
269
     * URL of the item.
270
     *
271
     * @param string|string[] $url
272
     *
273
     * @return static
274
     *
275
     * @see http://schema.org/url
276
     */
277
    public function url($url)
278
    {
279
        return $this->setProperty('url', $url);
280
    }
281
282
}
283