Skip to content

Commit 679a406

Browse files
authored
Merge pull request #23 from samsonasik/apply-php74
Apply PHP 7.4 syntax and typed property
2 parents a39c72f + b081350 commit 679a406

4 files changed

+4
-11
lines changed

src/BasicAccess.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ public function __construct(
4545
if (is_callable($responseFactory)) {
4646
// Ensures type safety of the composed factory
4747
$responseFactory = new CallableResponseFactoryDecorator(
48-
static function () use ($responseFactory): ResponseInterface {
49-
return $responseFactory();
50-
}
48+
static fn(): ResponseInterface => $responseFactory()
5149
);
5250
}
5351

test/BasicAccessFactoryTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ protected function setUp(): void
3131
{
3232
$this->userRegister = $this->createMock(UserRepositoryInterface::class);
3333
$this->responsePrototype = $this->createMock(ResponseInterface::class);
34-
$this->responseFactory = function (): ResponseInterface {
35-
return $this->responsePrototype;
36-
};
34+
$this->responseFactory = fn(): ResponseInterface => $this->responsePrototype;
3735
}
3836

3937
public function testInvokeWithEmptyContainer(): void

test/BasicAccessTest.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ protected function setUp(): void
3838
$this->userRepository = $this->createMock(UserRepositoryInterface::class);
3939
$this->authenticatedUser = $this->createMock(UserInterface::class);
4040
$this->responsePrototype = $this->createMock(ResponseInterface::class);
41-
$this->responseFactory = function (): ResponseInterface {
42-
return $this->responsePrototype;
43-
};
41+
$this->responseFactory = fn(): ResponseInterface => $this->responsePrototype;
4442
}
4543

4644
public function testConstructor(): void

test/ConfigProviderTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
class ConfigProviderTest extends TestCase
1111
{
12-
/** @var ConfigProvider */
13-
private $provider;
12+
private ConfigProvider $provider;
1413

1514
public function setUp(): void
1615
{

0 commit comments

Comments
 (0)