Skip to content

Commit

Permalink
Fix after Rector processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Plakhotnikov Vladimir committed Jun 27, 2024
1 parent d4f5d07 commit cf6a544
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
9 changes: 7 additions & 2 deletions app/modules/Events/Integration/CycleOrm/EventRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,16 @@ public function deleteAll(array $scope = []): void
->where($this->buildScope($scope))
->fetchAll();

$batchSize = 100;

$batch = 0;
foreach ($events as $event) {
$this->em->delete($event);
$this->em->run();
$batch = 0;

if (++$batch % $batchSize === 0) {
$this->em->run();
$batch = 0;
}
}

$this->em->run();
Expand Down
2 changes: 1 addition & 1 deletion app/modules/VarDumper/Application/Dump/HtmlDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class HtmlDumper extends CliDumper

public function __construct(DumpIdGeneratorInterface $generator)
{
AbstractDumper::__construct(null, null, 0); // CliDumper? parent??
AbstractDumper::__construct(null, null, 0);
$this->dumpId = $generator->generate();
$this->displayOptions['fileLinkFormat'] = \ini_get('xdebug.file_link_format') ?: get_cfg_var(
'xdebug.file_link_format',
Expand Down
7 changes: 6 additions & 1 deletion app/src/Application/Service/HttpHandler/HandlerPipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace App\Application\Service\HttpHandler;

use Nyholm\Psr7\Response;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Spiral\Core\FactoryInterface;
Expand Down Expand Up @@ -54,9 +55,13 @@ public function handle(ServerRequestInterface $request): ResponseInterface
private function handlePipeline(ServerRequestInterface $request): ResponseInterface
{
$handler = $this->handlers[$this->position] ?? null;
\assert($handler instanceof HandlerInterface);

$this->position++;

if ($handler === null) {
return new Response(404);
}

return $handler->handle(
$request,
fn(ServerRequestInterface $request) => $this->handlePipeline($request),
Expand Down
3 changes: 2 additions & 1 deletion tests/App/Smtp/FakeStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ final class FakeStream extends AbstractStream
/**
* @var ResponseInterface[]
*/
public $response;
private array $response = [];

public function __construct(
private readonly SmtpService $service,
private readonly string $uuid,
Expand Down
6 changes: 4 additions & 2 deletions tests/Unit/Modules/Webhooks/WebhookRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

final class WebhookRegistryTest extends DatabaseTestCase
{
public $registry;
public $assert;
private $registry;

private $assert;

protected function setUp(): void
{
parent::setUp();
Expand Down

0 comments on commit cf6a544

Please sign in to comment.