Skip to content

Commit

Permalink
ValidatorInterface::validateString() and implementations are docume…
Browse files Browse the repository at this point in the history
…nted as `non-empty-string`

Merge pull request #63 from CycloneDX/dependabot/composer/tools/psalm/vimeo/psalm-4.19.0
  • Loading branch information
jkowalleck authored Jan 31, 2022
2 parents cdcd295 + 8d56a7b commit 66a5105
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 1 deletion.
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
2 changes: 1 addition & 1 deletion tools/psalm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "metapackage",
"require-dev": {
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "4.18.1"
"vimeo/psalm": "4.19.0"
},
"prefer-stable": true,
"config": {
Expand Down

0 comments on commit 66a5105

Please sign in to comment.