Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ jobs:
strategy:
matrix:
php-versions: [ '8.2', '8.3', '8.4' ]
symfony-version: ['5.4.*', '6.4.*', '7.2.*']
symfony-version: ['6.4.*', '7.2.*']
dependencies-version: ['--prefer-lowest', '--prefer-stable']
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -33,7 +34,7 @@ jobs:
run: composer config extra.symfony.require "${{ matrix.symfony-version }}"

- name: Update project dependencies
run: composer update --no-progress --ansi --prefer-stable
run: composer update --no-progress --ansi ${{ matrix.dependencies-version }}

- name: Composer install
run: composer install --no-scripts --no-interaction --prefer-dist -oa
Expand Down
6 changes: 3 additions & 3 deletions Services/Event/Impl/EventFactoryImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class EventFactoryImpl implements EventFactory
*/
public function make(
$eventName,
UseCaseRequest $useCaseRequest = null,
UseCaseResponse $useCaseResponse = null,
\Exception $exception = null
?UseCaseRequest $useCaseRequest = null,
?UseCaseResponse $useCaseResponse = null,
?\Exception $exception = null
) {
return $this->useCaseEventBuilder
->create()
Expand Down
6 changes: 3 additions & 3 deletions Services/Event/Impl/UseCaseEventBuilderImpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function named($name)
/**
* @return UseCaseEventBuilder
*/
public function withUseCaseRequest(UseCaseRequest $useCaseRequest = null)
public function withUseCaseRequest(?UseCaseRequest $useCaseRequest = null)
{
if (null !== $useCaseRequest) {
$this->event->setUseCaseRequest($useCaseRequest);
Expand All @@ -51,7 +51,7 @@ public function withUseCaseRequest(UseCaseRequest $useCaseRequest = null)
/**
* @return UseCaseEventBuilder
*/
public function withUseCaseResponse(UseCaseResponse $useCaseResponse = null)
public function withUseCaseResponse(?UseCaseResponse $useCaseResponse = null)
{
if (null !== $useCaseResponse) {
$this->event->setUseCaseResponse($useCaseResponse);
Expand All @@ -63,7 +63,7 @@ public function withUseCaseResponse(UseCaseResponse $useCaseResponse = null)
/**
* @return UseCaseEventBuilder
*/
public function withUseCaseException(\Exception $exception = null)
public function withUseCaseException(?\Exception $exception = null)
{
if (null !== $exception) {
$this->event->setUseCaseException($exception);
Expand Down
6 changes: 3 additions & 3 deletions Services/Event/UseCaseEventBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ abstract public function named($name);
* @return UseCaseEventBuilder
* @codeCoverageIgnore
*/
abstract public function withUseCaseRequest(UseCaseRequest $useCaseRequest = null);
abstract public function withUseCaseRequest(?UseCaseRequest $useCaseRequest = null);

/**
* @return UseCaseEventBuilder
* @codeCoverageIgnore
*/
abstract public function withUseCaseResponse(UseCaseResponse $useCaseResponse = null);
abstract public function withUseCaseResponse(?UseCaseResponse $useCaseResponse = null);

/**
* @return UseCaseEventBuilder
* @codeCoverageIgnore
*/
abstract public function withUseCaseException(\Exception $exception = null);
abstract public function withUseCaseException(?\Exception $exception = null);

/**
* @return UseCaseEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function getToken()
*
* @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored
*/
public function setToken(TokenInterface $token = null)
public function setToken(?TokenInterface $token = null)
{
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct()
self::$sent = false;
}

public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
self::$eventName = $eventName;
self::$sent = true;
Expand Down
6 changes: 3 additions & 3 deletions Tests/DependencyInjection/Fixtures/Util/EventFactorySpy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class EventFactorySpy implements EventFactory
*/
public function make(
$eventName,
UseCaseRequest $useCaseRequest = null,
UseCaseResponse $useCaseResponse = null,
\Exception $exception = null
?UseCaseRequest $useCaseRequest = null,
?UseCaseResponse $useCaseResponse = null,
?\Exception $exception = null
) {
if (EventUseCaseStub::EVENT_NAME === $eventName) {
return new Event();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getToken()
*
* @param TokenInterface $token A TokenInterface token, or null if no further authentication information should be stored
*/
public function setToken(TokenInterface $token = null)
public function setToken(?TokenInterface $token = null)
{
return;
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

use Composer\Autoload\ClassLoader;

error_reporting(E_ALL | E_STRICT);
/** @var ClassLoader $loader */
require __DIR__.'/../vendor/autoload.php';
error_reporting(E_ALL);

require __DIR__ . "/../vendor/autoload.php";
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
},
"require": {
"php": ">=8.2",
"openclassrooms/use-case": "^2.0",
"symfony/cache": "~5.4 || ~6.4 || ~7.1",
"symfony/dependency-injection": "~5.4 || ~6.4 || ~7.1",
"symfony/config": "~5.0 || ~6.4 || ~7.1",
"symfony/http-kernel": "~5.0 || ~6.4 || ~7.1 || ~7.1",
"symfony/security-core": "~5.0 || ~6.4 || ~7.1",
"openclassrooms/use-case": "dev-php8.4@dev",
"symfony/cache": "~6.4 || ~7.1",
"symfony/dependency-injection": "~6.4 || ~7.1",
"symfony/config": "~6.4 || ~7.1",
"symfony/http-kernel": "~6.4 || ~7.1 || ~7.1",
"symfony/security-core": "~6.4 || ~7.1",
"doctrine/orm": "~2.3 || ~3.2",
"doctrine/dbal": "~3.2",
"symfony/event-dispatcher": "~5.0 || ~6.4 || ~7.1"
"doctrine/dbal": "~3.2 || ~4.0",
"symfony/event-dispatcher": "~6.4 || ~7.1"
},
"require-dev": {
"phpunit/phpunit": "^10"
"phpunit/phpunit": "^10.5"
},
"extra": {
"branch-alias": {
Expand Down