Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/validate-json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function getUrlFromPath($path)
/**
* Take a HTTP header value and split it up into parts.
*
* @param $headerValue
* @return array Key "_value" contains the main value, all others
* as given in the header value
*/
Expand Down
1 change: 0 additions & 1 deletion src/JsonSchema/Constraints/EnumConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

namespace JsonSchema\Constraints;
use JsonSchema\Validator;
use JsonSchema\Entity\JsonPointer;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/Constraints/ObjectConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function validateElement($element, $matches, $objectDefinition = null, Js
*
* @param \stdClass $element Element to validate
* @param \stdClass $objectDefinition ObjectConstraint definition
* @param JsoinPointer|null $path Path?
* @param JsonPointer|null $path Path?
*/
public function validateDefinition($element, $objectDefinition = null, JsonPointer $path = null)
{
Expand Down
7 changes: 4 additions & 3 deletions src/JsonSchema/Constraints/TypeConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ public function check($value = null, $schema = null, JsonPointer $path = null, $
*
* @param mixed $value Value to validate
* @param array $type TypeConstraints to check agains
* @param array $wording An array of wordings of the valid types of the array $type
* @param array $validTypesWording An array of wordings of the valid types of the array $type
* @param boolean $isValid The current validation value
* @param $path
*/
protected function validateTypesArray($value, array $type, &$validTypesWording, &$isValid,
$path) {
Expand Down Expand Up @@ -111,10 +112,10 @@ protected function validateTypesArray($value, array $type, &$validTypesWording,
*/
protected function implodeWith(array $elements, $delimiter = ', ', $listEnd = false) {
if ($listEnd === false || !isset($elements[1])) {
return implode(', ', $elements);
return implode($delimiter, $elements);
}
$lastElement = array_slice($elements, -1);
$firsElements = join(', ', array_slice($elements, 0, -1));
$firsElements = join($delimiter, array_slice($elements, 0, -1));
$implodedElements = array_merge(array($firsElements), $lastElement);
return join(" $listEnd ", $implodedElements);
}
Expand Down
2 changes: 1 addition & 1 deletion src/JsonSchema/Uri/Retrievers/AbstractRetriever.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* AbstractRetriever implements the default shared behavior
* that all decendant Retrievers should inherit
* that all descendant Retrievers should inherit
* @author Steven Garcia <[email protected]>
*/
abstract class AbstractRetriever implements UriRetrieverInterface
Expand Down
3 changes: 2 additions & 1 deletion src/JsonSchema/Uri/Retrievers/FileGetContents.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace JsonSchema\Uri\Retrievers;

use JsonSchema\Exception\ResourceNotFoundException;
use JsonSchema\Validator;

/**
* Tries to retrieve JSON schemas from a URI using file_get_contents()
Expand Down Expand Up @@ -83,5 +82,7 @@ protected static function getContentTypeMatchInHeader($header)
if (0 < preg_match("/Content-Type:(\V*)/ims", $header, $match)) {
return trim($match[1]);
}

return null;
}
}
1 change: 0 additions & 1 deletion src/JsonSchema/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

namespace JsonSchema;

use JsonSchema\Constraints\SchemaConstraint;
use JsonSchema\Constraints\Constraint;
use JsonSchema\Entity\JsonPointer;

Expand Down