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 Spatie\SchemaOrg; |
||
4 | |||
5 | /** |
||
6 | * A property-value pair, e.g. representing a feature of a product or place. Use |
||
7 | * the 'name' property for the name of the property. If there is an additional |
||
8 | * human-readable version of the value, put that into the 'description' |
||
9 | * property. |
||
10 | * |
||
11 | * Always use specific schema.org properties when a) they exist and b) you can |
||
12 | * populate them. Using PropertyValue as a substitute will typically not trigger |
||
13 | * the same effect as using the original, specific property. |
||
14 | * |
||
15 | * @see http://schema.org/PropertyValue |
||
16 | */ |
||
17 | View Code Duplication | class PropertyValue extends StructuredValue |
|
0 ignored issues
–
show
|
|||
18 | { |
||
19 | /** |
||
20 | * The upper value of some characteristic or property. |
||
21 | * |
||
22 | * @param float|float[]|int|int[] $maxValue |
||
23 | * |
||
24 | * @return static |
||
25 | * |
||
26 | * @see http://schema.org/maxValue |
||
27 | */ |
||
28 | public function maxValue($maxValue) |
||
29 | { |
||
30 | return $this->setProperty('maxValue', $maxValue); |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * The lower value of some characteristic or property. |
||
35 | * |
||
36 | * @param float|float[]|int|int[] $minValue |
||
37 | * |
||
38 | * @return static |
||
39 | * |
||
40 | * @see http://schema.org/minValue |
||
41 | */ |
||
42 | public function minValue($minValue) |
||
43 | { |
||
44 | return $this->setProperty('minValue', $minValue); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * A commonly used identifier for the characteristic represented by the |
||
49 | * property, e.g. a manufacturer or a standard code for a property. |
||
50 | * propertyID can be |
||
51 | * (1) a prefixed string, mainly meant to be used with standards for product |
||
52 | * properties; (2) a site-specific, non-prefixed string (e.g. the primary |
||
53 | * key of the property or the vendor-specific id of the property), or (3) |
||
54 | * a URL indicating the type of the property, either pointing to an external |
||
55 | * vocabulary, or a Web resource that describes the property (e.g. a |
||
56 | * glossary entry). |
||
57 | * Standards bodies should promote a standard prefix for the identifiers of |
||
58 | * properties from their standards. |
||
59 | * |
||
60 | * @param string|string[] $propertyID |
||
61 | * |
||
62 | * @return static |
||
63 | * |
||
64 | * @see http://schema.org/propertyID |
||
65 | */ |
||
66 | public function propertyID($propertyID) |
||
67 | { |
||
68 | return $this->setProperty('propertyID', $propertyID); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * The unit of measurement given using the UN/CEFACT Common Code (3 |
||
73 | * characters) or a URL. Other codes than the UN/CEFACT Common Code may be |
||
74 | * used with a prefix followed by a colon. |
||
75 | * |
||
76 | * @param string|string[] $unitCode |
||
77 | * |
||
78 | * @return static |
||
79 | * |
||
80 | * @see http://schema.org/unitCode |
||
81 | */ |
||
82 | public function unitCode($unitCode) |
||
83 | { |
||
84 | return $this->setProperty('unitCode', $unitCode); |
||
85 | } |
||
86 | |||
87 | /** |
||
88 | * A string or text indicating the unit of measurement. Useful if you cannot |
||
89 | * provide a standard unit code for |
||
90 | * <a href='unitCode'>unitCode</a>. |
||
91 | * |
||
92 | * @param string|string[] $unitText |
||
93 | * |
||
94 | * @return static |
||
95 | * |
||
96 | * @see http://schema.org/unitText |
||
97 | */ |
||
98 | public function unitText($unitText) |
||
99 | { |
||
100 | return $this->setProperty('unitText', $unitText); |
||
101 | } |
||
102 | |||
103 | /** |
||
104 | * The value of the quantitative value or property value node. |
||
105 | * |
||
106 | * * For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type |
||
107 | * for values is 'Number'. |
||
108 | * * For [[PropertyValue]], it can be 'Text;', 'Number', 'Boolean', or |
||
109 | * 'StructuredValue'. |
||
110 | * |
||
111 | * @param StructuredValue|StructuredValue[]|bool|bool[]|float|float[]|int|int[]|string|string[] $value |
||
112 | * |
||
113 | * @return static |
||
114 | * |
||
115 | * @see http://schema.org/value |
||
116 | */ |
||
117 | public function value($value) |
||
118 | { |
||
119 | return $this->setProperty('value', $value); |
||
120 | } |
||
121 | |||
122 | /** |
||
123 | * A pointer to a secondary value that provides additional information on |
||
124 | * the original value, e.g. a reference temperature. |
||
125 | * |
||
126 | * @param Enumeration|Enumeration[]|PropertyValue|PropertyValue[]|QualitativeValue|QualitativeValue[]|QuantitativeValue|QuantitativeValue[]|StructuredValue|StructuredValue[] $valueReference |
||
127 | * |
||
128 | * @return static |
||
129 | * |
||
130 | * @see http://schema.org/valueReference |
||
131 | */ |
||
132 | public function valueReference($valueReference) |
||
133 | { |
||
134 | return $this->setProperty('valueReference', $valueReference); |
||
135 | } |
||
136 | |||
137 | } |
||
138 |
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.