Skip to content

Commit

Permalink
fixed ValidatorInterface::validateString() parameter to be non-empt…
Browse files Browse the repository at this point in the history
…y string

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
  • Loading branch information
jkowalleck committed Jan 31, 2022
1 parent 8198254 commit 8d56a7b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

## unreleased

* Fixed
* `CycloneDX\Core\Validation\ValidatorInterface::validateString()` and implementations
are documented as `non-empty-string`, were undocumented `string` before. (via [#63])

[#63]: https://github.com/CycloneDX/cyclonedx-php-library/pull/63

## 1.4.0 - 2021-12-20

* Added
Expand Down
3 changes: 3 additions & 0 deletions src/Core/Validation/ValidatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ public function __construct(SpecInterface $spec);

public function getSpec(): SpecInterface;

/**
* @psalm-param non-empty-string $string
*/
public function validateString(string $string): ?ValidationError;
}
2 changes: 2 additions & 0 deletions src/Core/Validation/Validators/JsonValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ protected static function listSchemaFiles(): array
}

/**
* @psalm-param non-empty-string $string
*
* @throws FailedLoadingSchemaException if schema file unknown or not readable
* @throws JsonException if loading the JSON failed
*
Expand Down
4 changes: 4 additions & 0 deletions src/Core/Validation/Validators/XmlValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ protected static function listSchemaFiles(): array
}

/**
* @psalm-param non-empty-string $string
*
* @throws FailedLoadingSchemaException if schema file unknown or not readable
* @throws DOMException if loading the DOM failed
*
Expand Down Expand Up @@ -97,6 +99,8 @@ private function validateDomWithSchema(DOMDocument $doc): ?\LibXMLError
}

/**
* @psalm-param non-empty-string $xml
*
* @throws DOMException if loading the DOM failed
*/
private function loadDomFromXml(string $xml): DOMDocument
Expand Down

0 comments on commit 8d56a7b

Please sign in to comment.