Skip to content
Merged
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
4 changes: 0 additions & 4 deletions src/http/StatelessApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,6 @@
{
$this->startEventTracking();

if ($this->has('errorHandler')) {
$this->errorHandler->unregister();
}

// parent constructor is called because StatelessApplication uses a custom initialization pattern
// @phpstan-ignore-next-line
parent::__construct($this->config);
Expand All @@ -425,12 +421,12 @@
$this->response->enableCookieValidation = $this->request->enableCookieValidation;

// reset the session to ensure a clean state
$this->session->close();

Check warning on line 424 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ // synchronize cookie validation settings between request and response $this->response->cookieValidationKey = $this->request->cookieValidationKey; $this->response->enableCookieValidation = $this->request->enableCookieValidation; - // reset the session to ensure a clean state - $this->session->close(); + $sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? ''; $this->session->setId($sessionId); // start the session with the correct 'ID'

Check warning on line 424 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ // synchronize cookie validation settings between request and response $this->response->cookieValidationKey = $this->request->cookieValidationKey; $this->response->enableCookieValidation = $this->request->enableCookieValidation; - // reset the session to ensure a clean state - $this->session->close(); + $sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? ''; $this->session->setId($sessionId); // start the session with the correct 'ID'
$sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? '';
$this->session->setId($sessionId);

// start the session with the correct 'ID'
$this->session->open();

Check warning on line 429 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $this->session->close(); $sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? ''; $this->session->setId($sessionId); - // start the session with the correct 'ID' - $this->session->open(); + $this->bootstrap(); $this->session->close(); }

Check warning on line 429 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $this->session->close(); $sessionId = $this->request->getCookies()->get($this->session->getName())->value ?? ''; $this->session->setId($sessionId); - // start the session with the correct 'ID' - $this->session->open(); + $this->bootstrap(); $this->session->close(); }

$this->bootstrap();

Expand All @@ -456,10 +452,10 @@
{
$this->cleanupEvents();

UploadedFile::reset();

Check warning on line 455 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ protected function terminate(Response $response): ResponseInterface { $this->cleanupEvents(); - UploadedFile::reset(); + if ($this->flushLogger) { $this->getLog()->getLogger()->flush(true); }

Check warning on line 455 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ protected function terminate(Response $response): ResponseInterface { $this->cleanupEvents(); - UploadedFile::reset(); + if ($this->flushLogger) { $this->getLog()->getLogger()->flush(true); }

if ($this->flushLogger) {
$this->getLog()->getLogger()->flush(true);

Check warning on line 458 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $this->cleanupEvents(); UploadedFile::reset(); if ($this->flushLogger) { - $this->getLog()->getLogger()->flush(true); + } return $response->getPsr7Response(); }

Check warning on line 458 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": @@ @@ $this->cleanupEvents(); UploadedFile::reset(); if ($this->flushLogger) { - $this->getLog()->getLogger()->flush(true); + $this->getLog()->getLogger()->flush(false); } return $response->getPsr7Response(); }

Check warning on line 458 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $this->cleanupEvents(); UploadedFile::reset(); if ($this->flushLogger) { - $this->getLog()->getLogger()->flush(true); + } return $response->getPsr7Response(); }

Check warning on line 458 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "TrueValue": @@ @@ $this->cleanupEvents(); UploadedFile::reset(); if ($this->flushLogger) { - $this->getLog()->getLogger()->flush(true); + $this->getLog()->getLogger()->flush(false); } return $response->getPsr7Response(); }
}

return $response->getPsr7Response();
Expand All @@ -481,17 +477,17 @@
*/
private function cleanupEvents(): void
{
Event::off('*', '*', $this->eventHandler);

Check warning on line 480 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ */ private function cleanupEvents(): void { - Event::off('*', '*', $this->eventHandler); + foreach (array_reverse($this->registeredEvents) as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { $event->sender->off($event->name);

Check warning on line 480 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ */ private function cleanupEvents(): void { - Event::off('*', '*', $this->eventHandler); + foreach (array_reverse($this->registeredEvents) as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { $event->sender->off($event->name);

foreach (array_reverse($this->registeredEvents) as $event) {

Check warning on line 482 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "UnwrapArrayReverse": @@ @@ private function cleanupEvents(): void { Event::off('*', '*', $this->eventHandler); - foreach (array_reverse($this->registeredEvents) as $event) { + foreach ($this->registeredEvents as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { $event->sender->off($event->name); }

Check warning on line 482 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "UnwrapArrayReverse": @@ @@ private function cleanupEvents(): void { Event::off('*', '*', $this->eventHandler); - foreach (array_reverse($this->registeredEvents) as $event) { + foreach ($this->registeredEvents as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { $event->sender->off($event->name); }
if ($event->sender !== null && method_exists($event->sender, 'off')) {
$event->sender->off($event->name);

Check warning on line 484 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ Event::off('*', '*', $this->eventHandler); foreach (array_reverse($this->registeredEvents) as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { - $event->sender->off($event->name); + } } $this->registeredEvents = [];

Check warning on line 484 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ Event::off('*', '*', $this->eventHandler); foreach (array_reverse($this->registeredEvents) as $event) { if ($event->sender !== null && method_exists($event->sender, 'off')) { - $event->sender->off($event->name); + } } $this->registeredEvents = [];
}
}

$this->registeredEvents = [];

Event::offAll();

Check warning on line 490 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ } } $this->registeredEvents = []; - Event::offAll(); + } /** * Handles application errors and returns a Yii2 Response instance.

Check warning on line 490 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ } } $this->registeredEvents = []; - Event::offAll(); + } /** * Handles application errors and returns a Yii2 Response instance.
}

/**
Expand All @@ -511,7 +507,7 @@
{
$response = $this->errorHandler->handleException($exception);

$this->trigger(self::EVENT_AFTER_REQUEST);

Check warning on line 510 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ private function handleError(Throwable $exception): Response { $response = $this->errorHandler->handleException($exception); - $this->trigger(self::EVENT_AFTER_REQUEST); + $this->state = self::STATE_END; return $response; }

Check warning on line 510 in src/http/StatelessApplication.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.3-ubuntu-latest

Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ private function handleError(Throwable $exception): Response { $response = $this->errorHandler->handleException($exception); - $this->trigger(self::EVENT_AFTER_REQUEST); + $this->state = self::STATE_END; return $response; }

$this->state = self::STATE_END;

Expand Down
Loading