Skip to content
Open
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
3 changes: 3 additions & 0 deletions .docker/command/test.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/bash

sleep 5

php vendor/bin/phpunit tests/Unit/
php vendor/bin/phpstan analyse -l 3 src/
2 changes: 1 addition & 1 deletion .github/scripts/check_expire_date.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/Exceptions/ImmutableException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
*/
class ImmutableException extends Exception
{
/**
* @var string
*/
protected $message = 'merge() was called on an immutable request class.';
}
3 changes: 3 additions & 0 deletions src/Exceptions/UnsupportedOperandTypesException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
*/
class UnsupportedOperandTypesException extends Exception
{
/**
* @var string
*/
protected $message = 'Unsupported operand types';
}
4 changes: 2 additions & 2 deletions src/Facades/AccessorName.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}

Expand All @@ -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 '';
}

Expand Down
4 changes: 2 additions & 2 deletions src/Facades/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}

Expand All @@ -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 '';
}

Expand Down
6 changes: 4 additions & 2 deletions src/FormRequestAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ trait FormRequestAccessor
*/
public function beforeAll(): array
{
if (is_null($this->before())) {
if ($this->before() === null) {
return [];
}

Expand Down Expand Up @@ -92,6 +92,8 @@ public function settings()
}

/**
* 全てのリクエストデータを配列で取得
*
* laravel\framework\src\Illuminate\Http\Concerns\InteractsWithInput.php
*
* @param array|mixed $keys
Expand Down Expand Up @@ -221,7 +223,7 @@ public function validateResolved()
*/
public function before(): self
{
if (is_null($this->beforeRequest)) {
if ($this->beforeRequest === null) {
return new $this;
}

Expand Down