Skip to content

Commit e55c1ea

Browse files
authored
Remove return type for make() (#287)
1 parent 4f4847e commit e55c1ea

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Concerns/AsObject.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
trait AsObject
88
{
9-
public static function make(): static
9+
public static function make()
1010
{
1111
return app(static::class);
1212
}

tests/AsActionTest.php

+7
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ public function asCommand(Command $command): void
8585
expect(AsActionTest::$latestResult)->toBe(42);
8686
});
8787

88+
it('returns void when calling make()', function () {
89+
// Make sure that the static function ::make() returns not a type.
90+
$result = (new \ReflectionMethod(AsActionTest::class, 'make'))->getReturnType();
91+
92+
expect($result)->toBeEmpty();
93+
});
94+
8895
it('runs as a controller', function () {
8996
// Given we have a route registered for that action.
9097
Route::post('compute/{operation}', AsActionTest::class);

0 commit comments

Comments
 (0)