Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #452

Merged
merged 1 commit into from
May 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Exceptions/FileConflictException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Models/DateString.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/**
* Parse a date string and create normalized formats.
*
* @see \Tests\Unit\DateStringTest
*/
class DateString
Expand All @@ -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)
{
Expand Down
34 changes: 18 additions & 16 deletions tests/Unit/ValidatesExistenceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}