Skip to content

Commit 91bf06b

Browse files
authored
Refactor: Move ReleasesInterface under Releases namespace; Move matrices under Matrices namespace; Fix namespaces in tests/Unit (#51)
* Refactor: Move `ReleasesInterface` under `Releases` namespace * Refactor: Move matrices under `Matrices` namespace * Fix namespaces in `tests/Unit`
1 parent 177eaeb commit 91bf06b

15 files changed

+28
-28
lines changed

src/Console/MatrixFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace TypistTech\PhpMatrix\Console;
66

7-
use TypistTech\PhpMatrix\MatrixInterface;
7+
use TypistTech\PhpMatrix\Matrices\MatrixInterface;
88

99
class MatrixFactory
1010
{

src/Console/Mode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace TypistTech\PhpMatrix\Console;
66

7-
use TypistTech\PhpMatrix\Matrix;
8-
use TypistTech\PhpMatrix\MatrixInterface;
9-
use TypistTech\PhpMatrix\MinorOnlyMatrix;
10-
use TypistTech\PhpMatrix\ReleasesInterface;
7+
use TypistTech\PhpMatrix\Matrices\Matrix;
8+
use TypistTech\PhpMatrix\Matrices\MatrixInterface;
9+
use TypistTech\PhpMatrix\Matrices\MinorOnlyMatrix;
10+
use TypistTech\PhpMatrix\Releases\ReleasesInterface;
1111

1212
enum Mode: string
1313
{

src/Console/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use TypistTech\PhpMatrix\Releases\OfflineReleases;
88
use TypistTech\PhpMatrix\Releases\PhpNetReleases;
9-
use TypistTech\PhpMatrix\ReleasesInterface;
9+
use TypistTech\PhpMatrix\Releases\ReleasesInterface;
1010

1111
enum Source: string
1212
{

src/Matrix.php renamed to src/Matrices/Matrix.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
declare(strict_types=1);
44

5-
namespace TypistTech\PhpMatrix;
5+
namespace TypistTech\PhpMatrix\Matrices;
66

77
use Composer\Semver\Semver;
8+
use TypistTech\PhpMatrix\Exceptions\UnexpectedValueException as AppUnexpectedValueException;
9+
use TypistTech\PhpMatrix\Releases\ReleasesInterface;
810
use UnexpectedValueException;
911

1012
readonly class Matrix implements MatrixInterface
@@ -24,7 +26,7 @@ public function satisfiedBy(string $constraint): array
2426
$constraint
2527
);
2628
} catch (UnexpectedValueException $e) {
27-
throw new Exceptions\UnexpectedValueException(
29+
throw new AppUnexpectedValueException(
2830
$e->getMessage(),
2931
previous: $e
3032
);

src/MatrixInterface.php renamed to src/Matrices/MatrixInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TypistTech\PhpMatrix;
5+
namespace TypistTech\PhpMatrix\Matrices;
66

77
interface MatrixInterface
88
{

src/MinorOnlyMatrix.php renamed to src/Matrices/MinorOnlyMatrix.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace TypistTech\PhpMatrix;
5+
namespace TypistTech\PhpMatrix\Matrices;
66

7-
readonly class MinorOnlyMatrix extends Matrix implements MatrixInterface
7+
readonly class MinorOnlyMatrix extends Matrix
88
{
99
/**
1010
* @return string[]

src/Releases/OfflineReleases.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace TypistTech\PhpMatrix\Releases;
66

77
use TypistTech\PhpMatrix\Exceptions\RuntimeException;
8-
use TypistTech\PhpMatrix\ReleasesInterface;
98

109
class OfflineReleases implements ReleasesInterface
1110
{

src/Releases/PhpNetReleases.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use GuzzleHttp\ClientInterface;
99
use GuzzleHttp\Promise\Utils;
1010
use Psr\Http\Message\ResponseInterface;
11-
use TypistTech\PhpMatrix\ReleasesInterface;
1211

1312
class PhpNetReleases implements ReleasesInterface
1413
{

src/ReleasesInterface.php renamed to src/Releases/ReleasesInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace TypistTech\PhpMatrix;
5+
namespace TypistTech\PhpMatrix\Releases;
66

77
interface ReleasesInterface
88
{

tests/Unit/ComposerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace Tests\Feature\Releases;
5+
namespace Tests\Unit\Releases;
66

77
use TypistTech\PhpMatrix\Composer;
88
use TypistTech\PhpMatrix\Exceptions\InvalidArgumentException;

0 commit comments

Comments
 (0)