diff --git a/src/Console/MatrixFactory.php b/src/Console/MatrixFactory.php index 9888c53..5dd60b8 100644 --- a/src/Console/MatrixFactory.php +++ b/src/Console/MatrixFactory.php @@ -4,7 +4,7 @@ namespace TypistTech\PhpMatrix\Console; -use TypistTech\PhpMatrix\MatrixInterface; +use TypistTech\PhpMatrix\Matrices\MatrixInterface; class MatrixFactory { diff --git a/src/Console/Mode.php b/src/Console/Mode.php index 6649afc..f29d3a1 100644 --- a/src/Console/Mode.php +++ b/src/Console/Mode.php @@ -4,10 +4,10 @@ namespace TypistTech\PhpMatrix\Console; -use TypistTech\PhpMatrix\Matrix; -use TypistTech\PhpMatrix\MatrixInterface; -use TypistTech\PhpMatrix\MinorOnlyMatrix; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Matrices\Matrix; +use TypistTech\PhpMatrix\Matrices\MatrixInterface; +use TypistTech\PhpMatrix\Matrices\MinorOnlyMatrix; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; enum Mode: string { diff --git a/src/Console/Source.php b/src/Console/Source.php index 0d193cb..26b546d 100644 --- a/src/Console/Source.php +++ b/src/Console/Source.php @@ -6,7 +6,7 @@ use TypistTech\PhpMatrix\Releases\OfflineReleases; use TypistTech\PhpMatrix\Releases\PhpNetReleases; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; enum Source: string { diff --git a/src/Matrix.php b/src/Matrices/Matrix.php similarity index 72% rename from src/Matrix.php rename to src/Matrices/Matrix.php index ce78757..479b7ec 100644 --- a/src/Matrix.php +++ b/src/Matrices/Matrix.php @@ -2,9 +2,11 @@ declare(strict_types=1); -namespace TypistTech\PhpMatrix; +namespace TypistTech\PhpMatrix\Matrices; use Composer\Semver\Semver; +use TypistTech\PhpMatrix\Exceptions\UnexpectedValueException as AppUnexpectedValueException; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; use UnexpectedValueException; readonly class Matrix implements MatrixInterface @@ -24,7 +26,7 @@ public function satisfiedBy(string $constraint): array $constraint ); } catch (UnexpectedValueException $e) { - throw new Exceptions\UnexpectedValueException( + throw new AppUnexpectedValueException( $e->getMessage(), previous: $e ); diff --git a/src/MatrixInterface.php b/src/Matrices/MatrixInterface.php similarity index 80% rename from src/MatrixInterface.php rename to src/Matrices/MatrixInterface.php index d673fdb..2c4b047 100644 --- a/src/MatrixInterface.php +++ b/src/Matrices/MatrixInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TypistTech\PhpMatrix; +namespace TypistTech\PhpMatrix\Matrices; interface MatrixInterface { diff --git a/src/MinorOnlyMatrix.php b/src/Matrices/MinorOnlyMatrix.php similarity index 87% rename from src/MinorOnlyMatrix.php rename to src/Matrices/MinorOnlyMatrix.php index 14f1ae9..1c2b18f 100644 --- a/src/MinorOnlyMatrix.php +++ b/src/Matrices/MinorOnlyMatrix.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace TypistTech\PhpMatrix; +namespace TypistTech\PhpMatrix\Matrices; -readonly class MinorOnlyMatrix extends Matrix implements MatrixInterface +readonly class MinorOnlyMatrix extends Matrix { /** * @return string[] diff --git a/src/Releases/OfflineReleases.php b/src/Releases/OfflineReleases.php index 9a66b19..b8da6e4 100644 --- a/src/Releases/OfflineReleases.php +++ b/src/Releases/OfflineReleases.php @@ -5,7 +5,6 @@ namespace TypistTech\PhpMatrix\Releases; use TypistTech\PhpMatrix\Exceptions\RuntimeException; -use TypistTech\PhpMatrix\ReleasesInterface; class OfflineReleases implements ReleasesInterface { diff --git a/src/Releases/PhpNetReleases.php b/src/Releases/PhpNetReleases.php index f0f00a5..09cccde 100644 --- a/src/Releases/PhpNetReleases.php +++ b/src/Releases/PhpNetReleases.php @@ -8,7 +8,6 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\Promise\Utils; use Psr\Http\Message\ResponseInterface; -use TypistTech\PhpMatrix\ReleasesInterface; class PhpNetReleases implements ReleasesInterface { diff --git a/src/ReleasesInterface.php b/src/Releases/ReleasesInterface.php similarity index 77% rename from src/ReleasesInterface.php rename to src/Releases/ReleasesInterface.php index 49ac86d..a77bf10 100644 --- a/src/ReleasesInterface.php +++ b/src/Releases/ReleasesInterface.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace TypistTech\PhpMatrix; +namespace TypistTech\PhpMatrix\Releases; interface ReleasesInterface { diff --git a/tests/Unit/ComposerTest.php b/tests/Unit/ComposerTest.php index 828071e..2b00899 100644 --- a/tests/Unit/ComposerTest.php +++ b/tests/Unit/ComposerTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use TypistTech\PhpMatrix\Composer; use TypistTech\PhpMatrix\Exceptions\InvalidArgumentException; diff --git a/tests/Unit/MatrixTest.php b/tests/Unit/Matrices/MatrixTest.php similarity index 93% rename from tests/Unit/MatrixTest.php rename to tests/Unit/Matrices/MatrixTest.php index aae6c50..51cf2eb 100644 --- a/tests/Unit/MatrixTest.php +++ b/tests/Unit/Matrices/MatrixTest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use Mockery; use TypistTech\PhpMatrix\Exceptions\UnexpectedValueException; -use TypistTech\PhpMatrix\Matrix; -use TypistTech\PhpMatrix\MatrixInterface; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Matrices\Matrix; +use TypistTech\PhpMatrix\Matrices\MatrixInterface; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; covers(Matrix::class); diff --git a/tests/Unit/MinorOnlyMatrixTest.php b/tests/Unit/Matrices/MinorOnlyMatrixTest.php similarity index 91% rename from tests/Unit/MinorOnlyMatrixTest.php rename to tests/Unit/Matrices/MinorOnlyMatrixTest.php index ea2c76b..44b419b 100644 --- a/tests/Unit/MinorOnlyMatrixTest.php +++ b/tests/Unit/Matrices/MinorOnlyMatrixTest.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use Mockery; -use TypistTech\PhpMatrix\MatrixInterface; -use TypistTech\PhpMatrix\MinorOnlyMatrix; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Matrices\MatrixInterface; +use TypistTech\PhpMatrix\Matrices\MinorOnlyMatrix; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; covers(MinorOnlyMatrix::class); diff --git a/tests/Unit/Releases/OfflineReleasesTest.php b/tests/Unit/Releases/OfflineReleasesTest.php index 05eb4ef..7e1e994 100644 --- a/tests/Unit/Releases/OfflineReleasesTest.php +++ b/tests/Unit/Releases/OfflineReleasesTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use TypistTech\PhpMatrix\Releases\OfflineReleases; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; covers(OfflineReleases::class); diff --git a/tests/Unit/Releases/PhpNetReleasesTest.php b/tests/Unit/Releases/PhpNetReleasesTest.php index 6b9f01f..71d9f96 100644 --- a/tests/Unit/Releases/PhpNetReleasesTest.php +++ b/tests/Unit/Releases/PhpNetReleasesTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use TypistTech\PhpMatrix\Releases\PhpNetReleases; -use TypistTech\PhpMatrix\ReleasesInterface; +use TypistTech\PhpMatrix\Releases\ReleasesInterface; covers(PhpNetReleases::class); diff --git a/tests/Unit/VersionsTest.php b/tests/Unit/VersionsTest.php index cb18bcf..1fbc94d 100644 --- a/tests/Unit/VersionsTest.php +++ b/tests/Unit/VersionsTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Tests\Feature\Releases; +namespace Tests\Unit\Releases; use TypistTech\PhpMatrix\Versions; use UnexpectedValueException;