From d1291eaf38096636c365889d120ae10f93705488 Mon Sep 17 00:00:00 2001 From: StyleCI Bot <bot@styleci.io> Date: Wed, 25 May 2022 12:30:59 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Exceptions/FileConflictException.php | 10 +++---- src/Exceptions/FileNotFoundException.php | 2 +- src/Models/DateString.php | 6 +++-- tests/Unit/ValidatesExistenceTest.php | 34 +++++++++++++----------- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/Exceptions/FileConflictException.php b/src/Exceptions/FileConflictException.php index da20a9fa..f6a9e489 100644 --- a/src/Exceptions/FileConflictException.php +++ b/src/Exceptions/FileConflictException.php @@ -7,10 +7,10 @@ class FileConflictException extends Exception { protected $message = 'A file already exists at this path.'; - protected $code = 409; + protected $code = 409; - public function __construct(?string $path = null) - { - $this->message = $path ? "File already exists: {$path}" : $this->message; - } + public function __construct(?string $path = null) + { + $this->message = $path ? "File already exists: {$path}" : $this->message; + } } diff --git a/src/Exceptions/FileNotFoundException.php b/src/Exceptions/FileNotFoundException.php index 9cf2ef42..1304ce47 100644 --- a/src/Exceptions/FileNotFoundException.php +++ b/src/Exceptions/FileNotFoundException.php @@ -7,7 +7,7 @@ class FileNotFoundException extends Exception { protected $message = 'File not found.'; - protected $code = 404; + protected $code = 404; public function __construct(?string $path = null) { diff --git a/src/Models/DateString.php b/src/Models/DateString.php index b41692a8..c4bc0d2e 100644 --- a/src/Models/DateString.php +++ b/src/Models/DateString.php @@ -7,6 +7,7 @@ /** * Parse a date string and create normalized formats. + * * @see \Tests\Unit\DateStringTest */ class DateString @@ -27,8 +28,9 @@ class DateString public string $short; /** - * @param string $string - * @throws \Hyde\Framework\Exceptions\CouldNotParseDateStringException + * @param string $string + * + * @throws \Hyde\Framework\Exceptions\CouldNotParseDateStringException */ public function __construct(string $string) { diff --git a/tests/Unit/ValidatesExistenceTest.php b/tests/Unit/ValidatesExistenceTest.php index 568cd068..563f0822 100644 --- a/tests/Unit/ValidatesExistenceTest.php +++ b/tests/Unit/ValidatesExistenceTest.php @@ -12,25 +12,27 @@ */ class ValidatesExistenceTest extends TestCase { - public function test_validate_existence_does_nothing_if_file_exists() - { - $class = new class { - use ValidatesExistence; - }; + public function test_validate_existence_does_nothing_if_file_exists() + { + $class = new class + { + use ValidatesExistence; + }; - $class->validateExistence(BladePage::class, 'index'); + $class->validateExistence(BladePage::class, 'index'); - $this->assertTrue(true); - } + $this->assertTrue(true); + } - public function test_validate_existence_throws_file_not_found_exception_if_file_does_not_exist() - { - $this->expectException(FileNotFoundException::class); + public function test_validate_existence_throws_file_not_found_exception_if_file_does_not_exist() + { + $this->expectException(FileNotFoundException::class); - $class = new class { - use ValidatesExistence; - }; + $class = new class + { + use ValidatesExistence; + }; - $class->validateExistence(BladePage::class, 'not-found'); - } + $class->validateExistence(BladePage::class, 'not-found'); + } }