Skip to content

Commit ead8c8a

Browse files
committed
Fix: Run 'composer style-fix'
1 parent 4467de9 commit ead8c8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+488
-488
lines changed

src/JsonSchema/ConstraintError.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function getMessage()
9898
self::PROPERTIES_MIN => 'Must contain a minimum of %d properties',
9999
self::PROPERTIES_MAX => 'Must contain no more than %d properties',
100100
self::TYPE => '%s value found, but %s is required',
101-
self::UNIQUE_ITEMS => 'There are no duplicates allowed in the array'
101+
self::UNIQUE_ITEMS => 'There are no duplicates allowed in the array',
102102
);
103103

104104
if (!isset($messages[$name])) {

src/JsonSchema/Constraints/BaseConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function addError(ConstraintError $constraint, JsonPointer $path = null,
6060
}, array_values($more)))),
6161
'constraint' => array(
6262
'name' => $name,
63-
'params' => $more
63+
'params' => $more,
6464
),
6565
'context' => $this->factory->getErrorContext(),
6666
);

src/JsonSchema/Constraints/CollectionConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ protected function validateItems(&$value, $schema = null, JsonPointer $path = nu
130130
array(
131131
'item' => $i,
132132
'property' => $k,
133-
'additionalItems' => $schema->additionalItems
133+
'additionalItems' => $schema->additionalItems,
134134
)
135135
);
136136
}

src/JsonSchema/Constraints/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Factory
6060
'enum' => 'JsonSchema\Constraints\EnumConstraint',
6161
'format' => 'JsonSchema\Constraints\FormatConstraint',
6262
'schema' => 'JsonSchema\Constraints\SchemaConstraint',
63-
'validator' => 'JsonSchema\Validator'
63+
'validator' => 'JsonSchema\Validator',
6464
);
6565

6666
/**

src/JsonSchema/Constraints/FormatConstraint.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function check(&$element, $schema = null, JsonPointer $path = null, $i =
3636
if (!$date = $this->validateDateTime($element, 'Y-m-d')) {
3737
$this->addError(ConstraintError::FORMAT_DATE(), $path, array(
3838
'date' => $element,
39-
'format' => $schema->format
39+
'format' => $schema->format,
4040
)
4141
);
4242
}
@@ -56,7 +56,7 @@ public function check(&$element, $schema = null, JsonPointer $path = null, $i =
5656
if (null === Rfc3339::createFromString($element)) {
5757
$this->addError(ConstraintError::FORMAT_DATE_TIME(), $path, array(
5858
'dateTime' => json_encode($element),
59-
'format' => $schema->format
59+
'format' => $schema->format,
6060
)
6161
);
6262
}
@@ -66,15 +66,15 @@ public function check(&$element, $schema = null, JsonPointer $path = null, $i =
6666
if (!$this->validateDateTime($element, 'U')) {
6767
$this->addError(ConstraintError::FORMAT_DATE_UTC(), $path, array(
6868
'value' => $element,
69-
'format' => $schema->format));
69+
'format' => $schema->format, ));
7070
}
7171
break;
7272

7373
case 'regex':
7474
if (!$this->validateRegex($element)) {
7575
$this->addError(ConstraintError::FORMAT_REGEX(), $path, array(
7676
'value' => $element,
77-
'format' => $schema->format
77+
'format' => $schema->format,
7878
)
7979
);
8080
}
@@ -204,7 +204,7 @@ protected function validateColor($color)
204204
{
205205
if (in_array(strtolower($color), array('aqua', 'black', 'blue', 'fuchsia',
206206
'gray', 'green', 'lime', 'maroon', 'navy', 'olive', 'orange', 'purple',
207-
'red', 'silver', 'teal', 'white', 'yellow'))) {
207+
'red', 'silver', 'teal', 'white', 'yellow', ))) {
208208
return true;
209209
}
210210

src/JsonSchema/Constraints/ObjectConstraint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function validateElement($element, $matches, $schema = null, JsonPointer
118118
if ($require && !$this->getProperty($element, $require)) {
119119
$this->addError(ConstraintError::REQUIRES(), $path, array(
120120
'property' => $i,
121-
'requiredProperty' => $require
121+
'requiredProperty' => $require,
122122
));
123123
}
124124

src/JsonSchema/Constraints/TypeConstraint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function check(&$value = null, $schema = null, JsonPointer $path = null,
7171
}
7272
$this->addError(ConstraintError::TYPE(), $path, array(
7373
'found' => gettype($value),
74-
'expected' => $this->implodeWith($wording, ', ', 'or')
74+
'expected' => $this->implodeWith($wording, ', ', 'or'),
7575
));
7676
}
7777
}
@@ -134,10 +134,10 @@ protected function implodeWith(array $elements, $delimiter = ', ', $listEnd = fa
134134
return implode($delimiter, $elements);
135135
}
136136
$lastElement = array_slice($elements, -1);
137-
$firsElements = join($delimiter, array_slice($elements, 0, -1));
137+
$firsElements = implode($delimiter, array_slice($elements, 0, -1));
138138
$implodedElements = array_merge(array($firsElements), $lastElement);
139139

140-
return join(" $listEnd ", $implodedElements);
140+
return implode(" $listEnd ", $implodedElements);
141141
}
142142

143143
/**

src/JsonSchema/Constraints/UndefinedConstraint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ protected function validateCommonProperties(&$value, $schema = null, JsonPointer
136136
$this->addError(
137137
ConstraintError::REQUIRED(),
138138
$this->incrementPath($path ?: new JsonPointer(''), $required), array(
139-
'property' => $required
139+
'property' => $required,
140140
)
141141
);
142142
}
@@ -378,7 +378,7 @@ protected function validateDependencies($value, $dependencies, JsonPointer $path
378378
if (!$this->getTypeCheck()->propertyExists($value, $dependency)) {
379379
$this->addError(ConstraintError::DEPENDENCIES(), $path, array(
380380
'key' => $key,
381-
'dependency' => $dependency
381+
'dependency' => $dependency,
382382
));
383383
}
384384
} elseif (is_array($dependency)) {
@@ -387,7 +387,7 @@ protected function validateDependencies($value, $dependencies, JsonPointer $path
387387
if (!$this->getTypeCheck()->propertyExists($value, $d)) {
388388
$this->addError(ConstraintError::DEPENDENCIES(), $path, array(
389389
'key' => $key,
390-
'dependency' => $dependency
390+
'dependency' => $dependency,
391391
));
392392
}
393393
}

src/JsonSchema/Uri/UriResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function parse($uri)
3535
$components = array(
3636
'scheme' => $match[2],
3737
'authority' => $match[4],
38-
'path' => $match[5]
38+
'path' => $match[5],
3939
);
4040
}
4141
if (7 < count($match)) {

src/JsonSchema/Uri/UriRetriever.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class UriRetriever implements BaseUriRetrieverInterface
2929
*/
3030
protected $translationMap = array(
3131
// use local copies of the spec schemas
32-
'|^https?://json-schema.org/draft-(0[34])/schema#?|' => 'package://dist/schema/json-schema-draft-$1.json'
32+
'|^https?://json-schema.org/draft-(0[34])/schema#?|' => 'package://dist/schema/json-schema-draft-$1.json',
3333
);
3434

3535
/**
@@ -229,7 +229,7 @@ public function parse($uri)
229229
$components = array(
230230
'scheme' => $match[2],
231231
'authority' => $match[4],
232-
'path' => $match[5]
232+
'path' => $match[5],
233233
);
234234
}
235235

tests/Constraints/AdditionalPropertiesTest.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ public function getInvalidTests()
4343
'constraint' => array(
4444
'name' => 'additionalProp',
4545
'params' => array(
46-
'property' => 'additionalProp'
47-
)
46+
'property' => 'additionalProp',
47+
),
4848
),
49-
'context' => Validator::ERROR_DOCUMENT_VALIDATION
50-
)
51-
)
49+
'context' => Validator::ERROR_DOCUMENT_VALIDATION,
50+
),
51+
),
5252
),
5353
array(
5454
'{
@@ -61,7 +61,7 @@ public function getInvalidTests()
6161
"prop":{"type":"string"}
6262
},
6363
"additionalProperties": false
64-
}'
64+
}',
6565
),
6666
array(
6767
'{
@@ -74,7 +74,7 @@ public function getInvalidTests()
7474
"prop":{"type":"string"}
7575
},
7676
"additionalProperties": {"type":"string"}
77-
}'
77+
}',
7878
),
7979
array(
8080
'{
@@ -87,7 +87,7 @@ public function getInvalidTests()
8787
"prop":{"type":"string"}
8888
},
8989
"additionalProperties": {"type":"string"}
90-
}'
90+
}',
9191
),
9292
array(
9393
'{
@@ -99,7 +99,7 @@ public function getInvalidTests()
9999
"additionalProperties": {
100100
"type": "boolean"
101101
}
102-
}'
102+
}',
103103
),
104104
array(
105105
'{
@@ -109,7 +109,7 @@ public function getInvalidTests()
109109
'{
110110
"type": "object",
111111
"additionalProperties": false
112-
}'
112+
}',
113113
),
114114
);
115115
}
@@ -127,7 +127,7 @@ public function getValidTests()
127127
"properties":{
128128
"prop":{"type":"string"}
129129
}
130-
}'
130+
}',
131131
),
132132
array(
133133
'{
@@ -139,7 +139,7 @@ public function getValidTests()
139139
"properties":{
140140
"prop":{"type":"string"}
141141
}
142-
}'
142+
}',
143143
),
144144
array(
145145
'{
@@ -152,7 +152,7 @@ public function getValidTests()
152152
"prop":{"type":"string"}
153153
},
154154
"additionalProperties": {"type":"string"}
155-
}'
155+
}',
156156
),
157157
array(
158158
'{
@@ -165,7 +165,7 @@ public function getValidTests()
165165
"prop":{"type":"string"}
166166
},
167167
"additionalProperties": true
168-
}'
168+
}',
169169
),
170170
array(
171171
'{
@@ -177,7 +177,7 @@ public function getValidTests()
177177
"additionalProperties": {
178178
"type": "string"
179179
}
180-
}'
180+
}',
181181
),
182182
array(
183183
'{
@@ -187,7 +187,7 @@ public function getValidTests()
187187
'{
188188
"type": "object",
189189
"additionalProperties": true
190-
}'
190+
}',
191191
),
192192
);
193193
}

tests/Constraints/ArraysTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function getInvalidTests()
2828
"items":{"type":"number"}
2929
}
3030
}
31-
}'
31+
}',
3232
),
3333
array(
3434
'{
@@ -43,7 +43,7 @@ public function getInvalidTests()
4343
"additionalItems":{"type":"boolean"}
4444
}
4545
}
46-
}'
46+
}',
4747
),
4848
array(
4949
'{
@@ -57,7 +57,7 @@ public function getInvalidTests()
5757
"items":{"type":["number","boolean"]}
5858
}
5959
}
60-
}'
60+
}',
6161
),
6262
array(
6363
'{"data": [1, 2, 3, "foo"]}',
@@ -70,8 +70,8 @@ public function getInvalidTests()
7070
"additionalItems": {"type": "integer"}
7171
}
7272
}
73-
}'
74-
)
73+
}',
74+
),
7575
);
7676
}
7777

@@ -87,7 +87,7 @@ public function getValidTests()
8787
"properties":{
8888
"array":{"type":"array"}
8989
}
90-
}'
90+
}',
9191
),
9292
array(
9393
'{
@@ -102,7 +102,7 @@ public function getValidTests()
102102
"additionalItems": {"type": "string"}
103103
}
104104
}
105-
}'
105+
}',
106106
),
107107
array(
108108
'{"data": [1, 2, 3, 4]}',
@@ -115,7 +115,7 @@ public function getValidTests()
115115
"additionalItems": {"type": "integer"}
116116
}
117117
}
118-
}'
118+
}',
119119
),
120120
array(
121121
'{"data": [1, "foo", false]}',
@@ -127,7 +127,7 @@ public function getValidTests()
127127
"items": []
128128
}
129129
}
130-
}'
130+
}',
131131
),
132132
array(
133133
'{"data": [1, "foo", false]}',
@@ -139,7 +139,7 @@ public function getValidTests()
139139
"items": {}
140140
}
141141
}
142-
}'
142+
}',
143143
),
144144
array(
145145
'{"data": [1, 2, 3, 4, 5]}',
@@ -151,7 +151,7 @@ public function getValidTests()
151151
"additionalItems": false
152152
}
153153
}
154-
}'
154+
}',
155155
),
156156
array( // test more schema items than array items
157157
'{"data": [1, 2]}',
@@ -167,8 +167,8 @@ public function getValidTests()
167167
]
168168
}
169169
}
170-
}'
171-
)
170+
}',
171+
),
172172
);
173173
}
174174
}

0 commit comments

Comments
 (0)