Skip to content

Commit ec223f6

Browse files
authored
style: cs-fixer apply global_namespace_import (#148)
Signed-off-by: Jan Kowalleck <[email protected]> Signed-off-by: Jan Kowalleck <[email protected]>
1 parent a31656c commit ec223f6

File tree

52 files changed

+169
-99
lines changed

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

+169
-99
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@
3838
'@Symfony' => true,
3939
'@Symfony:risky' => true,
4040
'declare_strict_types' => true,
41-
'phpdoc_order' => true,
4241
'header_comment' => ['header' => $header],
42+
'global_namespace_import' => true,
4343
'fopen_flags' => ['b_mode' => true],
44+
'phpdoc_order' => true,
4445
'phpdoc_to_comment' => [
4546
'ignored_tags' => [
4647
// 'psalm-var', // needed when PSALM introduced some issues that only manual hints can solve

src/Core/Collections/BomRefRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Models\BomRef;
2728

2829
/**
2930
* Unique collection of {@see \CycloneDX\Core\Models\BomRef}.
3031
*
3132
* @author jkowalleck
3233
*/
33-
class BomRefRepository implements \Countable
34+
class BomRefRepository implements Countable
3435
{
3536
/**
3637
* @var BomRef[]

src/Core/Collections/ComponentRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Models\Component;
2728

2829
/**
2930
* Unique collection of {@see \CycloneDX\Core\Models\Component}.
3031
*
3132
* @author jkowalleck
3233
*/
33-
class ComponentRepository implements \Countable
34+
class ComponentRepository implements Countable
3435
{
3536
/**
3637
* @var Component[]

src/Core/Collections/ExternalReferenceRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Models\ExternalReference;
2728

2829
/**
2930
* Unique collection of {@see \CycloneDX\Core\Models\ExternalReference}.
3031
*
3132
* @author jkowalleck
3233
*/
33-
class ExternalReferenceRepository implements \Countable
34+
class ExternalReferenceRepository implements Countable
3435
{
3536
/**
3637
* @var ExternalReference[]

src/Core/Collections/HashDictionary.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Enums\HashAlgorithm;
2728
use DomainException;
2829

@@ -31,7 +32,7 @@
3132
*
3233
* @author jkowalleck
3334
*/
34-
class HashDictionary implements \Countable
35+
class HashDictionary implements Countable
3536
{
3637
/**
3738
* @var string[] dictionary of hashes

src/Core/Collections/LicenseRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Models\License\DisjunctiveLicenseWithId;
2728
use CycloneDX\Core\Models\License\DisjunctiveLicenseWithName;
2829
use CycloneDX\Core\Models\License\LicenseExpression;
@@ -34,7 +35,7 @@
3435
*
3536
* @author jkowalleck
3637
*/
37-
class LicenseRepository implements \Countable
38+
class LicenseRepository implements Countable
3839
{
3940
/**
4041
* @var DisjunctiveLicenseWithId[]|DisjunctiveLicenseWithName[]|LicenseExpression[]

src/Core/Collections/ToolRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323

2424
namespace CycloneDX\Core\Collections;
2525

26+
use Countable;
2627
use CycloneDX\Core\Models\Tool;
2728

2829
/**
2930
* Unique collection of {@see \CycloneDX\Core\Models\Tool}.
3031
*
3132
* @author jkowalleck
3233
*/
33-
class ToolRepository implements \Countable
34+
class ToolRepository implements Countable
3435
{
3536
/**
3637
* @var Tool[]

src/Core/Serialization/DOM/Normalizers/ExternalReferenceRepositoryNormalizer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525

2626
use CycloneDX\Core\Collections\ExternalReferenceRepository;
2727
use CycloneDX\Core\Serialization\DOM\_BaseNormalizer;
28+
use DomainException;
2829
use DOMElement;
30+
use UnexpectedValueException;
2931

3032
/**
3133
* @author jkowalleck
@@ -45,7 +47,7 @@ public function normalize(ExternalReferenceRepository $repo): array
4547
foreach ($repo->getItems() as $externalReference) {
4648
try {
4749
$externalReferences[] = $normalizer->normalize($externalReference);
48-
} catch (\DomainException|\UnexpectedValueException) {
50+
} catch (DomainException|UnexpectedValueException) {
4951
// pass
5052
}
5153
}

src/Core/Validation/Exceptions/FailedLoadingSchemaException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
namespace CycloneDX\Core\Validation\Exceptions;
2525

26-
class FailedLoadingSchemaException extends \RuntimeException
26+
use RuntimeException;
27+
28+
class FailedLoadingSchemaException extends RuntimeException
2729
{
2830
}

src/Core/Validation/ValidationError.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
namespace CycloneDX\Core\Validation;
2525

26+
use Throwable;
27+
2628
/**
2729
* @author jkowalleck
2830
*/
@@ -56,7 +58,7 @@ public function getError(): ?object
5658
/**
5759
* @internal as this function may be affected by breaking changes without notice
5860
*/
59-
public static function fromThrowable(\Throwable $error): static
61+
public static function fromThrowable(Throwable $error): static
6062
{
6163
$instance = new static($error->getMessage());
6264
$instance->error = $error;

0 commit comments

Comments
 (0)