From 9ab469be7e2a0de876b80adc93b059dc294c7422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Carlos=20Ch=C3=A1vez?= Date: Wed, 9 Dec 2020 22:41:51 +0100 Subject: [PATCH] chore: move Exceptions to root directory. --- .../InvalidReferenceArgumentException.php | 2 +- .../{Exceptions => }/InvalidReferencesSetException.php | 2 +- .../{Exceptions => }/InvalidSpanOptionException.php | 2 +- src/OpenTracing/Mock/MockTracer.php | 4 ++-- src/OpenTracing/Reference.php | 6 +++--- src/OpenTracing/ScopeManager.php | 2 +- src/OpenTracing/StartSpanOptions.php | 4 ++-- src/OpenTracing/Tracer.php | 6 +++--- .../{Exceptions => }/UnsupportedFormatException.php | 4 ++-- tests/OpenTracing/Mock/MockTracerTest.php | 4 ++-- tests/OpenTracing/ReferenceTest.php | 8 ++++---- tests/OpenTracing/StartSpanOptionsTest.php | 2 +- 12 files changed, 23 insertions(+), 23 deletions(-) rename src/OpenTracing/{Exceptions => }/InvalidReferenceArgumentException.php (96%) rename src/OpenTracing/{Exceptions => }/InvalidReferencesSetException.php (95%) rename src/OpenTracing/{Exceptions => }/InvalidSpanOptionException.php (99%) rename src/OpenTracing/{Exceptions => }/UnsupportedFormatException.php (77%) diff --git a/src/OpenTracing/Exceptions/InvalidReferenceArgumentException.php b/src/OpenTracing/InvalidReferenceArgumentException.php similarity index 96% rename from src/OpenTracing/Exceptions/InvalidReferenceArgumentException.php rename to src/OpenTracing/InvalidReferenceArgumentException.php index 3c8f4ff..1283603 100644 --- a/src/OpenTracing/Exceptions/InvalidReferenceArgumentException.php +++ b/src/OpenTracing/InvalidReferenceArgumentException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OpenTracing\Exceptions; +namespace OpenTracing; use InvalidArgumentException; diff --git a/src/OpenTracing/Exceptions/InvalidReferencesSetException.php b/src/OpenTracing/InvalidReferencesSetException.php similarity index 95% rename from src/OpenTracing/Exceptions/InvalidReferencesSetException.php rename to src/OpenTracing/InvalidReferencesSetException.php index c096a2f..de7d907 100644 --- a/src/OpenTracing/Exceptions/InvalidReferencesSetException.php +++ b/src/OpenTracing/InvalidReferencesSetException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OpenTracing\Exceptions; +namespace OpenTracing; use DomainException; diff --git a/src/OpenTracing/Exceptions/InvalidSpanOptionException.php b/src/OpenTracing/InvalidSpanOptionException.php similarity index 99% rename from src/OpenTracing/Exceptions/InvalidSpanOptionException.php rename to src/OpenTracing/InvalidSpanOptionException.php index 6bcc590..f9b8003 100644 --- a/src/OpenTracing/Exceptions/InvalidSpanOptionException.php +++ b/src/OpenTracing/InvalidSpanOptionException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OpenTracing\Exceptions; +namespace OpenTracing; use InvalidArgumentException; diff --git a/src/OpenTracing/Mock/MockTracer.php b/src/OpenTracing/Mock/MockTracer.php index e2e5ee5..f4f4577 100644 --- a/src/OpenTracing/Mock/MockTracer.php +++ b/src/OpenTracing/Mock/MockTracer.php @@ -4,8 +4,8 @@ namespace OpenTracing\Mock; -use OpenTracing\Exceptions\InvalidReferenceArgumentException; -use OpenTracing\Exceptions\UnsupportedFormatException; +use OpenTracing\InvalidReferenceArgumentException; +use OpenTracing\UnsupportedFormatException; use OpenTracing\Scope; use OpenTracing\ScopeManager; use OpenTracing\Span; diff --git a/src/OpenTracing/Reference.php b/src/OpenTracing/Reference.php index e57b58f..7dadf17 100644 --- a/src/OpenTracing/Reference.php +++ b/src/OpenTracing/Reference.php @@ -4,7 +4,7 @@ namespace OpenTracing; -use OpenTracing\Exceptions\InvalidReferenceArgumentException; +use OpenTracing\InvalidReferenceArgumentException; final class Reference { @@ -12,14 +12,14 @@ final class Reference * A Span may be the ChildOf a parent Span. In a ChildOf reference, * the parent Span depends on the child Span in some capacity. */ - const CHILD_OF = 'child_of'; + public const CHILD_OF = 'child_of'; /** * Some parent Spans do not depend in any way on the result of their * child Spans. In these cases, we say merely that the child Span * FollowsFrom the parent Span in a causal sense. */ - const FOLLOWS_FROM = 'follows_from'; + public const FOLLOWS_FROM = 'follows_from'; /** * @var string diff --git a/src/OpenTracing/ScopeManager.php b/src/OpenTracing/ScopeManager.php index ce4f7a2..db5fcaa 100644 --- a/src/OpenTracing/ScopeManager.php +++ b/src/OpenTracing/ScopeManager.php @@ -9,7 +9,7 @@ */ interface ScopeManager { - const DEFAULT_FINISH_SPAN_ON_CLOSE = true; + public const DEFAULT_FINISH_SPAN_ON_CLOSE = true; /** * Activates an `Span`, so that it is used as a parent when creating new spans. diff --git a/src/OpenTracing/StartSpanOptions.php b/src/OpenTracing/StartSpanOptions.php index 9a0eb2b..28b73ff 100644 --- a/src/OpenTracing/StartSpanOptions.php +++ b/src/OpenTracing/StartSpanOptions.php @@ -6,8 +6,8 @@ use DateTime; use DateTimeInterface; -use OpenTracing\Exceptions\InvalidReferencesSetException; -use OpenTracing\Exceptions\InvalidSpanOptionException; +use OpenTracing\InvalidReferencesSetException; +use OpenTracing\InvalidSpanOptionException; final class StartSpanOptions { diff --git a/src/OpenTracing/Tracer.php b/src/OpenTracing/Tracer.php index a81b33f..391a515 100644 --- a/src/OpenTracing/Tracer.php +++ b/src/OpenTracing/Tracer.php @@ -4,9 +4,9 @@ namespace OpenTracing; -use OpenTracing\Exceptions\InvalidReferencesSetException; -use OpenTracing\Exceptions\InvalidSpanOptionException; -use OpenTracing\Exceptions\UnsupportedFormatException; +use OpenTracing\UnsupportedFormatException; +use OpenTracing\InvalidSpanOptionException; +use OpenTracing\InvalidReferencesSetException; interface Tracer { diff --git a/src/OpenTracing/Exceptions/UnsupportedFormatException.php b/src/OpenTracing/UnsupportedFormatException.php similarity index 77% rename from src/OpenTracing/Exceptions/UnsupportedFormatException.php rename to src/OpenTracing/UnsupportedFormatException.php index e5ed3a8..dd4ef56 100644 --- a/src/OpenTracing/Exceptions/UnsupportedFormatException.php +++ b/src/OpenTracing/UnsupportedFormatException.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace OpenTracing\Exceptions; +namespace OpenTracing; use UnexpectedValueException; @@ -17,6 +17,6 @@ final class UnsupportedFormatException extends UnexpectedValueException */ public static function forFormat(string $format): UnsupportedFormatException { - return new self(sprintf('The format \'%s\' is not supported.', $format)); + return new self(sprintf('The format "%s" is not supported.', $format)); } } diff --git a/tests/OpenTracing/Mock/MockTracerTest.php b/tests/OpenTracing/Mock/MockTracerTest.php index 17de1f9..ab2faf1 100644 --- a/tests/OpenTracing/Mock/MockTracerTest.php +++ b/tests/OpenTracing/Mock/MockTracerTest.php @@ -4,8 +4,8 @@ namespace OpenTracing\Tests\Mock; -use OpenTracing\Exceptions\InvalidReferenceArgumentException; -use OpenTracing\Exceptions\UnsupportedFormatException; +use OpenTracing\InvalidReferenceArgumentException; +use OpenTracing\UnsupportedFormatException; use OpenTracing\Mock\MockTracer; use OpenTracing\NoopSpanContext; use OpenTracing\Reference; diff --git a/tests/OpenTracing/ReferenceTest.php b/tests/OpenTracing/ReferenceTest.php index 87e1d98..cb971a2 100644 --- a/tests/OpenTracing/ReferenceTest.php +++ b/tests/OpenTracing/ReferenceTest.php @@ -4,11 +4,11 @@ namespace OpenTracing\Tests; -use OpenTracing\Exceptions\InvalidReferenceArgumentException; -use OpenTracing\NoopSpanContext; -use OpenTracing\Reference; -use PHPUnit\Framework\TestCase; use TypeError; +use PHPUnit\Framework\TestCase; +use OpenTracing\Reference; +use OpenTracing\NoopSpanContext; +use OpenTracing\InvalidReferenceArgumentException; /** * @covers Reference diff --git a/tests/OpenTracing/StartSpanOptionsTest.php b/tests/OpenTracing/StartSpanOptionsTest.php index 3195c33..d7e1504 100644 --- a/tests/OpenTracing/StartSpanOptionsTest.php +++ b/tests/OpenTracing/StartSpanOptionsTest.php @@ -5,7 +5,7 @@ namespace OpenTracing\Tests; use DateTime; -use OpenTracing\Exceptions\InvalidSpanOptionException; +use OpenTracing\InvalidSpanOptionException; use OpenTracing\NoopSpanContext; use OpenTracing\Reference; use OpenTracing\StartSpanOptions;