Skip to content

Commit

Permalink
Adds support for Spiral Framework 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
butschster committed May 30, 2022
1 parent e7babb4 commit 1f4f5b1
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 25 deletions.
23 changes: 13 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@
}
],
"require": {
"php": "^8.0",
"spiral/boot": "^2.9",
"spiral/core": "^2.9",
"spiral/config": "^2.9",
"spiral/console": "^2.9",
"spiral/tokenizer": "^2.9",
"spiral/attributes": "^2.9",
"php": "^8.1",
"spiral/boot": "^3.0",
"spiral/core": "^3.0",
"spiral/config": "^3.0",
"spiral/console": "^3.0",
"spiral/tokenizer": "^3.0",
"spiral/attributes": "^3.0",
"symfony/messenger": "^6.0"
},
"require-dev": {
"spiral/framework": "^2.9",
"spiral/testing": "^1.0",
"spiral/framework": "^3.0",
"spiral/testing": "^2.0",
"vimeo/psalm": "^4.9"
},
"autoload": {
Expand All @@ -48,7 +48,10 @@
"psalm": "vendor/bin/psalm --config=psalm.xml ./src"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"spiral/composer-publish-plugin": true
}
},
"extra": {
"spiral": {
Expand Down
2 changes: 1 addition & 1 deletion src/Attribute/CommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
class CommandHandler
final class CommandHandler
{
}
2 changes: 1 addition & 1 deletion src/Attribute/QueryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
use Attribute;

#[Attribute(Attribute::TARGET_METHOD)]
class QueryHandler
final class QueryHandler
{
}
2 changes: 1 addition & 1 deletion src/CommandBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class CommandBus implements CommandBusInterface
use MessageBusExceptionTrait;

public function __construct(
private MessageBusInterface $bus
private readonly MessageBusInterface $bus
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/HandlersLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ final class HandlersLocator implements HandlersLocatorInterface
private bool $precessed = false;

public function __construct(
private Container $container,
private ClassesInterface $classes,
private ReaderInterface $reader,
private readonly Container $container,
private readonly ClassesInterface $classes,
private readonly ReaderInterface $reader,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/QueryBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class QueryBus implements QueryBusInterface
use MessageBusExceptionTrait;

public function __construct(
private MessageBusInterface $bus
private readonly MessageBusInterface $bus
) {
}

Expand Down
6 changes: 3 additions & 3 deletions tests/app/Command/StoreUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
final class StoreUser implements CommandInterface
{
public function __construct(
public string $uuid,
public string $username,
public string $password
public readonly string $uuid,
public readonly string $username,
public readonly string $password
) {
}
}
4 changes: 2 additions & 2 deletions tests/app/Command/UpdateUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
class UpdateUser implements CommandInterface
{
public function __construct(
public string $username,
public string $password
public readonly string $username,
public readonly string $password
) {
}
}
2 changes: 1 addition & 1 deletion tests/app/Handler/StoreUserHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
final class StoreUserHandler
{
public function __construct(
private EntityManagerInterface $entityManager
private readonly EntityManagerInterface $entityManager
) {

}
Expand Down
2 changes: 1 addition & 1 deletion tests/app/Handler/UsersQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
final class UsersQueries
{
public function __construct(
private UserRepositoryInterface $users
private readonly UserRepositoryInterface $users
) {
}

Expand Down
2 changes: 1 addition & 1 deletion tests/app/Query/FindUserById.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
final class FindUserById implements QueryInterface
{
public function __construct(
public int $id
public readonly int $id
) {
}
}

0 comments on commit 1f4f5b1

Please sign in to comment.