diff --git a/.docker/command/test.sh b/.docker/command/test.sh index 7d45ae7..8dd34d8 100755 --- a/.docker/command/test.sh +++ b/.docker/command/test.sh @@ -1,3 +1,6 @@ +#!/bin/bash + sleep 5 + php vendor/bin/phpunit tests/Unit/ php vendor/bin/phpstan analyse -l 3 src/ diff --git a/.github/scripts/check_expire_date.sh b/.github/scripts/check_expire_date.sh index 0f49f3a..9640717 100644 --- a/.github/scripts/check_expire_date.sh +++ b/.github/scripts/check_expire_date.sh @@ -19,7 +19,7 @@ for file in $changed_files; do # 日付を抽出([Expire] Y-m-d の形式を想定) # \K はそこ以前の [Expire] を省略し、Y-m-d の部分のみを取得する - expire_date=$(echo $line_content | grep -oP '\[Expire\] \K\d{4}-\d{2}-\d{2}') + expire_date=$(echo $line_content | grep -oP "\[Expire\] \K\d{4}-\d{2}-\d{2}") # 日付が抽出できなかった場合、または日付が過去の場合にエラー if [[ -z $expire_date ]] || [[ $expire_date < $current_date ]]; then diff --git a/src/Exceptions/ImmutableException.php b/src/Exceptions/ImmutableException.php index 8c557e2..8655374 100644 --- a/src/Exceptions/ImmutableException.php +++ b/src/Exceptions/ImmutableException.php @@ -11,5 +11,8 @@ */ class ImmutableException extends Exception { + /** + * @var string + */ protected $message = 'merge() was called on an immutable request class.'; } diff --git a/src/Exceptions/UnsupportedOperandTypesException.php b/src/Exceptions/UnsupportedOperandTypesException.php index fae6bd3..2333df5 100644 --- a/src/Exceptions/UnsupportedOperandTypesException.php +++ b/src/Exceptions/UnsupportedOperandTypesException.php @@ -11,5 +11,8 @@ */ class UnsupportedOperandTypesException extends Exception { + /** + * @var string + */ protected $message = 'Unsupported operand types'; } diff --git a/src/Facades/AccessorName.php b/src/Facades/AccessorName.php index 90077ee..6d1ca11 100644 --- a/src/Facades/AccessorName.php +++ b/src/Facades/AccessorName.php @@ -19,7 +19,7 @@ class AccessorName public static function getProperty(string $method): string { preg_match('/(?<=get_).+(?=_attribute)/', Str::snake($method), $match); - if (empty($match[0])) { + if (empty($match[0]) === true) { return ''; } @@ -33,7 +33,7 @@ public static function getProperty(string $method): string */ public static function getMethod(string $property): string { - if (empty($property)) { + if (empty($property) === true) { return ''; } diff --git a/src/Facades/Route.php b/src/Facades/Route.php index b6b35a7..02ebd8c 100644 --- a/src/Facades/Route.php +++ b/src/Facades/Route.php @@ -20,7 +20,7 @@ class Route public static function getController(): string { $route = RouteFacade::currentRouteAction(); - if (empty($route) || strpos($route, '@') === false) { + if (empty($route) === true || strpos($route, '@') === false) { return ''; } @@ -40,7 +40,7 @@ public static function getAction(): string { // $route = RouteFacade::currentRouteAction(); - if (empty($route) || strpos($route, '@') === false) { + if (empty($route) === true || strpos($route, '@') === false) { return ''; } diff --git a/src/FormRequestAccessor.php b/src/FormRequestAccessor.php index 80d2989..ad0c2d3 100644 --- a/src/FormRequestAccessor.php +++ b/src/FormRequestAccessor.php @@ -59,7 +59,7 @@ trait FormRequestAccessor */ public function beforeAll(): array { - if (is_null($this->before())) { + if ($this->before() === null) { return []; } @@ -92,6 +92,8 @@ public function settings() } /** + * 全てのリクエストデータを配列で取得 + * * laravel\framework\src\Illuminate\Http\Concerns\InteractsWithInput.php * * @param array|mixed $keys @@ -221,7 +223,7 @@ public function validateResolved() */ public function before(): self { - if (is_null($this->beforeRequest)) { + if ($this->beforeRequest === null) { return new $this; }