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
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ interface EventFactory
*/
public function make(
$eventName,
UseCaseRequest $useCaseRequest = null,
UseCaseResponse $useCaseResponse = null,
\Exception $exception = null
?UseCaseRequest $useCaseRequest = null,
?UseCaseResponse $useCaseResponse = null,
?\Exception $exception = null
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function postExecute(ProxyStrategyRequest $proxyStrategyRequest)
return new ProxyStrategyResponseDTO($item->get(), false);
}

private function fetchWithNamespace(string $id, string $namespace = null): CacheItemInterface
private function fetchWithNamespace(string $id, ?string $namespace = null): CacheItemInterface
{
if ($namespace !== null) {
$namespaceId = $this->cache->getItem($namespace);
Expand All @@ -78,7 +78,7 @@ private function fetchWithNamespace(string $id, string $namespace = null): Cache
return $this->cache->getItem($id);
}

private function saveWithNamespace(string $id, mixed $data, string $namespace = null, int $lifetime = null): CacheItemInterface
private function saveWithNamespace(string $id, mixed $data, ?string $namespace = null, ?int $lifetime = null): CacheItemInterface
{
if ($namespace !== null) {
$namespaceId = $this->cache->getItem($namespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function withUseCaseRequest(UseCaseRequest $useCaseRequest)
/**
* @return EventProxyStrategyRequestBuilder
*/
public function withUseCaseResponse(UseCaseResponse $useCaseResponse = null)
public function withUseCaseResponse(?UseCaseResponse $useCaseResponse = null)
{
$this->request->useCaseResponse = $useCaseResponse;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function createPostExecuteRequest(
$annotation,
UseCase $useCase,
UseCaseRequest $useCaseRequest,
UseCaseResponse $useCaseResponse = null
?UseCaseResponse $useCaseResponse = null
) {
$request = new ProxyStrategyRequestDTO();
switch ($annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private function sortPreStrategies()
usort(
$this->strategies,
function (ProxyStrategyBag $s1, ProxyStrategyBag $s2) {
return array_search($s1->getType(), UseCaseProxy::$strategyPreOrder) >
return array_search($s1->getType(), UseCaseProxy::$strategyPreOrder) <=>
array_search($s2->getType(), UseCaseProxy::$strategyPreOrder);
}
);
Expand Down Expand Up @@ -215,7 +215,7 @@ private function sortPostStrategies()
usort(
$this->strategies,
function (ProxyStrategyBag $s1, ProxyStrategyBag $s2) {
return array_search($s1->getType(), UseCaseProxy::$strategyPostOrder) >
return array_search($s1->getType(), UseCaseProxy::$strategyPostOrder) <=>
array_search($s2->getType(), UseCaseProxy::$strategyPostOrder);
}
);
Expand All @@ -242,7 +242,7 @@ private function sortOnExceptionStrategies()
usort(
$this->strategies,
function (ProxyStrategyBag $s1, ProxyStrategyBag $s2) {
return array_search($s1->getType(), UseCaseProxy::$strategyOnExceptionOrder) >
return array_search($s1->getType(), UseCaseProxy::$strategyOnExceptionOrder) <=>
array_search($s2->getType(), UseCaseProxy::$strategyOnExceptionOrder);
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ abstract public function create(UseCase $useCase);
/**
* @return UseCaseProxyBuilder
*/
public function withCache(CacheItemPoolInterface $cache = null)
public function withCache(?CacheItemPoolInterface $cache = null)
{
$this->cache = $cache;

Expand All @@ -95,7 +95,7 @@ public function withCache(CacheItemPoolInterface $cache = null)
/**
* @return UseCaseProxyBuilder
*/
public function withEventSender(EventSender $event = null)
public function withEventSender(?EventSender $event = null)
{
$this->event = $event;

Expand All @@ -105,7 +105,7 @@ public function withEventSender(EventSender $event = null)
/**
* @return UseCaseProxyBuilder
*/
public function withEventFactory(EventFactory $eventFactory = null)
public function withEventFactory(?EventFactory $eventFactory = null)
{
$this->eventFactory = $eventFactory;

Expand All @@ -132,7 +132,7 @@ public function withReader(Reader $reader)
/**
* @return UseCaseProxyBuilder
*/
public function withSecurity(Security $security = null)
public function withSecurity(?Security $security = null)
{
$this->security = $security;

Expand All @@ -142,7 +142,7 @@ public function withSecurity(Security $security = null)
/**
* @return UseCaseProxyBuilder
*/
public function withTransaction(Transaction $transaction = null)
public function withTransaction(?Transaction $transaction = null)
{
$this->transaction = $transaction;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,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
) {
$this->useCaseRequest = $useCaseRequest;
$this->useCaseResponse = $useCaseResponse;
Expand Down
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Composer\Autoload\ClassLoader;

error_reporting(E_ALL | E_STRICT);
error_reporting(E_ALL);

/** @var ClassLoader $loader */
require __DIR__.'/../vendor/autoload.php';