Skip to content

Commit 114ac67

Browse files
The $scene allowed to be NULL. (#4869)
Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent a623a66 commit 114ac67

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Annotation/Scene.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#[Attribute(Attribute::TARGET_METHOD | Attribute::IS_REPEATABLE)]
1818
class Scene extends AbstractMultipleAnnotation
1919
{
20-
public function __construct(public string $scene, public ?string $argument = null)
20+
public function __construct(public ?string $scene = null, public ?string $argument = null)
2121
{
2222
}
2323
}

src/Middleware/ValidationMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function handleSceneAnnotation(FormRequest $request, string $class, st
106106
/** @var Scene $annotation */
107107
foreach ($annotations as $annotation) {
108108
if ($annotation->argument === null || $annotation->argument === $argument) {
109-
$request->scene($annotation->scene);
109+
$request->scene($annotation->scene ?? $method);
110110
return;
111111
}
112112
}

0 commit comments

Comments
 (0)