Skip to content

Commit

Permalink
fix: Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Nov 30, 2023
1 parent e5e280f commit c25ce8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"symfony/mime": "^5.3.0",
"symfony/translation": "^5.3.0",
"symfony/yaml": "^5.3.0",
"symfony/runtime": "^5.3.0",
"symfony/security-core": "^5.3.0",
"symfony/security-http": "^5.3.0",
"symfony/security-bundle": "^5.3.0",
Expand Down Expand Up @@ -70,7 +69,8 @@
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"symfony/phpunit-bridge": "^5.1",
"symfony/proxy-manager-bridge": "^5.3",
"phpstan/phpstan": "^1.2"
"phpstan/phpstan": "^1.2",
"symfony/runtime": "^5.3.0"
},
"conflict": {
"friendsofphp/php-cs-fixer": "3.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Core\MVC\Symfony\ErrorHandler;
declare(strict_types=1);

namespace Ibexa\Contracts\Core\MVC\Symfony\ErrorHandler;

use const PHP_VERSION_ID;
use Symfony\Component\Runtime\Internal\BasicErrorHandler;

final class Php82HideDeprecationsErrorHandler extends BasicErrorHandler
final class Php82HideDeprecationsErrorHandler
{
public static function register(bool $debug): void
{
parent::register($debug);
BasicErrorHandler::register($debug);

if (PHP_VERSION_ID > 80200) {
error_reporting(E_ALL & ~E_DEPRECATED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
declare(strict_types=1);

namespace Ibexa\Tests\Core\MVC\Symfony\ErrorHandler;

use Ibexa\Core\MVC\Symfony\ErrorHandler\Php82HideDeprecationsErrorHandler;
use const PHP_VERSION_ID;
use Ibexa\Contracts\Core\MVC\Symfony\ErrorHandler\Php82HideDeprecationsErrorHandler;
use PHPUnit\Framework\TestCase;

/**
* @requires PHP >= 8.2.0
*/
final class Php82HideDeprecationsErrorHandlerTest extends TestCase
{
/** @var int */
Expand All @@ -28,10 +32,6 @@ protected function tearDown(): void

public function testRegisterDebug(): void
{
if (PHP_VERSION_ID < 80200) {
$this->markTestSkipped('Does not affect versions below PHP 8.2.0');
}

Php82HideDeprecationsErrorHandler::register(true);
$errorReporting = error_reporting();

Expand All @@ -40,10 +40,6 @@ public function testRegisterDebug(): void

public function testRegisterNoDebug(): void
{
if (PHP_VERSION_ID < 80200) {
$this->markTestSkipped('Does not affect versions below PHP 8.2.0');
}

Php82HideDeprecationsErrorHandler::register(false);
$errorReporting = error_reporting();

Expand Down

0 comments on commit c25ce8e

Please sign in to comment.