Skip to content

Commit 60ccbbe

Browse files
authored
slack interfaces/protocols (#253)
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent 2d51103 commit 60ccbbe

File tree

7 files changed

+9
-25
lines changed

7 files changed

+9
-25
lines changed

HISTORY.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ All notable changes to this project will be documented in this file.
140140
* BREAKING: renamed namespace to `Serialization` ([#5] via [#146])
141141
* `SerializerInterface` interface
142142
* BREAKING: renamed to `Serializer` ([#133] via [#155])
143-
* BREAKING: existing method `serialize()` got a new optional parameter `$prettyPrint` (via [#155])
143+
* BREAKING: method `serialize()` got a new optional parameter `$prettyPrint` (via [#155])
144+
* BREAKING: method `serialize()` may throw `\Throwable`, was `\Exception` (via [#253])
144145
* `BaseSerializer` abstract class
145146
* BREAKING: complete redesign (via [#155])
146147
* `{Json,Xml}Serializer` class
@@ -187,6 +188,8 @@ All notable changes to this project will be documented in this file.
187188
* BREAKING: removed deprecated method `setSpec()` (via [#144])
188189
* `ValidatorInterface` interface
189190
* BREAKING: renamed interface to `Validator` ([#133] via [#143])
191+
* Removed specification of constructor `__construct()` (via [#253])
192+
* Removed specification of method `getSpec()` (via [#253])
190193
* `Validators\{Json,Xml}Validator` classes
191194
* Added support for CycloneDX v1.4 ([#57] via [#65])
192195
* `Validators\JsonValidator` classes
@@ -241,6 +244,7 @@ All notable changes to this project will be documented in this file.
241244
[#241]: https://github.com/CycloneDX/cyclonedx-php-library/pull/241
242245
[#247]: https://github.com/CycloneDX/cyclonedx-php-library/issues/247
243246
[#249]: https://github.com/CycloneDX/cyclonedx-php-library/pull/249
247+
[#253]: https://github.com/CycloneDX/cyclonedx-php-library/pull/253
244248

245249
## 1.6.3 - 2022-09-15
246250

src/Core/Serialization/BaseSerializer.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ abstract protected function realNormalize(Bom $bom) /* : TNormalizedBom */;
111111
*
112112
* @throws Exception
113113
*
114-
* @psalm-return non-empty-string
115-
*
116114
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
117115
*/
118116
abstract protected function realSerialize(/* TNormalizedBom */ $normalizedBom, ?bool $prettyPrint): string;

src/Core/Serialization/Serializer.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,20 @@
2424
namespace CycloneDX\Core\Serialization;
2525

2626
use CycloneDX\Core\Models\Bom;
27-
use Exception;
27+
use Throwable;
2828

2929
/**
3030
* @author jkowalleck
3131
*/
3232
interface Serializer
3333
{
3434
/**
35-
* Serialize a {@see \CycloneDX\Core\Models\Bom} to {@see string}.
35+
* Serialize a {@see \CycloneDX\Core\Models\Bom} to string.
3636
*
3737
* @param Bom $bom the BOM to serialize
3838
* @param bool $prettyPrint whether to beatify the resulting string. A `null` value means no preference.
3939
*
40-
* @throws Exception
41-
*
42-
* @psalm-return non-empty-string
40+
* @throws Throwable
4341
*
4442
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
4543
*/

src/Core/Serialization/XmlSerializer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,9 @@ protected function realSerialize(/* DOMElement */ $normalizedBom, ?bool $prettyP
7474
$document->formatOutput = $prettyPrint;
7575
}
7676

77-
// option LIBXML_NOEMPTYTAG might lead to errors in consumers
77+
// option LIBXML_NOEMPTYTAG might lead to errors in consumers, do not use it.
7878
$xml = $document->saveXML();
7979
\assert(false !== $xml);
80-
\assert('' !== $xml);
8180

8281
return $xml;
8382
}

src/Core/Validation/Validator.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,10 @@
2323

2424
namespace CycloneDX\Core\Validation;
2525

26-
use CycloneDX\Core\Spec\Spec;
27-
2826
/**
2927
* @author jkowalleck
3028
*/
3129
interface Validator
3230
{
33-
public function __construct(Spec $spec);
34-
35-
public function getSpec(): Spec;
36-
37-
/**
38-
* @psalm-param non-empty-string $string
39-
*/
4031
public function validateString(string $string): ?ValidationError;
4132
}

src/Core/Validation/Validators/JsonValidator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ protected static function listSchemaFiles(): array
5555
}
5656

5757
/**
58-
* @psalm-param non-empty-string $string
59-
*
6058
* @throws FailedLoadingSchemaException if schema file unknown or not readable
6159
* @throws JsonException if loading the JSON failed
6260
*/

src/Core/Validation/Validators/XmlValidator.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ protected static function listSchemaFiles(): array
5353
}
5454

5555
/**
56-
* @psalm-param non-empty-string $string
57-
*
5856
* @throws FailedLoadingSchemaException if schema file unknown or not readable
5957
* @throws DOMException if loading the DOM failed
6058
*/
@@ -99,8 +97,6 @@ private function validateDomWithSchema(DOMDocument $doc): ?LibXMLError
9997
}
10098

10199
/**
102-
* @psalm-param non-empty-string $xml
103-
*
104100
* @throws DOMException if loading the DOM failed
105101
*/
106102
private function loadDomFromXml(string $xml): DOMDocument

0 commit comments

Comments
 (0)