Skip to content

Commit

Permalink
Update to use PHP 8.1 syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
  • Loading branch information
samsonasik committed Nov 3, 2024
1 parent 1694254 commit 08f01b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
13 changes: 3 additions & 10 deletions src/PhpSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@

class PhpSession implements AuthenticationInterface
{
private UserRepositoryInterface $repository;

private array $config;

private ResponseFactoryInterface $responseFactory;
private readonly ResponseFactoryInterface $responseFactory;

/** @var callable */
private $userFactory;
Expand All @@ -36,14 +32,11 @@ class PhpSession implements AuthenticationInterface
* @param callable(string, array, array): UserInterface $userFactory
*/
public function __construct(
UserRepositoryInterface $repository,
array $config,
private readonly UserRepositoryInterface $repository,
private array $config,
$responseFactory,
callable $userFactory
) {
$this->repository = $repository;
$this->config = $config;

if (is_callable($responseFactory)) {
// Ensures type safety of the composed factory
$responseFactory = new CallableResponseFactoryDecorator(
Expand Down
5 changes: 3 additions & 2 deletions test/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use mezziotest\authentication\session\testasset\inmemorycontainer;
use MezzioTest\Authentication\Session\TestAsset\InMemoryContainerPSR11V1;
use MezzioTest\Authentication\Session\TestAsset\InMemoryContainerPSR11V2;
use Psr\Container\ContainerInterface;
Expand All @@ -12,7 +13,7 @@
$id = array_shift($params);
// phpcs:disable WebimpressCodingStandard.Formatting.StringClassReference.Found
$id->hasType()
? class_alias(InMemoryContainerPSR11V2::class, 'MezzioTest\Authentication\Session\TestAsset\InMemoryContainer')
: class_alias(InMemoryContainerPSR11V1::class, 'MezzioTest\Authentication\Session\TestAsset\InMemoryContainer');
? class_alias(InMemoryContainerPSR11V2::class, inmemorycontainer::class)
: class_alias(InMemoryContainerPSR11V1::class, inmemorycontainer::class);
// phpcs:enable WebimpressCodingStandard.Formatting.StringClassReference.Found
})();

0 comments on commit 08f01b8

Please sign in to comment.