diff --git a/.horde.yml b/.horde.yml index 43b8d51..3501df4 100644 --- a/.horde.yml +++ b/.horde.yml @@ -43,4 +43,4 @@ keywords: vendor: horde quality: phpstan: - level: 5 + level: 3 \ No newline at end of file diff --git a/ci-tools/horde-components.phar b/ci-tools/horde-components.phar index 5424e7d..652d0cd 100755 Binary files a/ci-tools/horde-components.phar and b/ci-tools/horde-components.phar differ diff --git a/src/Author.php b/src/Author.php index 28efcd5..e7cf3fa 100644 --- a/src/Author.php +++ b/src/Author.php @@ -5,13 +5,14 @@ namespace Horde\Victim; use Stringable; +use InvalidArgumentException; class Author implements Stringable { public function __construct(public readonly string $name, public string $email = '', public string $homepage = '', public string $role = '') { if (empty($name)) { - throw new \InvalidArgumentException('Name cannot be empty'); + throw new InvalidArgumentException('Name cannot be empty'); } } diff --git a/src/ComposerRootProject.php b/src/ComposerRootProject.php index 762609b..4b4fe6b 100644 --- a/src/ComposerRootProject.php +++ b/src/ComposerRootProject.php @@ -11,7 +11,7 @@ class ComposerRootProject implements Stringable { public readonly DirectoryIterator $projectRoot; public function __construct( - string|stringable|DirectoryIterator $projectRoot + string|Stringable|DirectoryIterator $projectRoot ) { $this->projectRoot = new DirectoryIterator($projectRoot); } diff --git a/src/InvalidComposerJsonFileException.php b/src/InvalidComposerJsonFileException.php index 307dbda..a1a2de5 100644 --- a/src/InvalidComposerJsonFileException.php +++ b/src/InvalidComposerJsonFileException.php @@ -5,13 +5,14 @@ namespace Horde\Victim; use RuntimeException; +use Throwable; class InvalidComposerJsonFileException extends RuntimeException { public function __construct( string $message = 'Invalid composer.json file', int $code = 0, - ?\Throwable $previous = null + ?Throwable $previous = null ) { parent::__construct($message, $code, $previous); } diff --git a/test/unit/AuthorTest.php b/test/unit/AuthorTest.php index 5736e5f..5640552 100644 --- a/test/unit/AuthorTest.php +++ b/test/unit/AuthorTest.php @@ -7,6 +7,7 @@ use Horde\Victim\Author; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Attributes\CoversClass; +use InvalidArgumentException; #[CoversClass(Author::class)] class AuthorTest extends TestCase @@ -38,7 +39,7 @@ public function testConstructorWithAllParameters(): void public function testConstructorThrowsExceptionForEmptyName(): void { - $this->expectException(\InvalidArgumentException::class); + $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Name cannot be empty'); new Author('');