Skip to content
Merged
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
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"psr/http-server-handler": "^1",
"psr/http-server-middleware": "^1",
"psr/simple-cache": "^1.0.1 || ^2 || ^3",
"symfony/cache": "^4.3 || ^5 || ^6 || ^7",
"symfony/expression-language": "^4 || ^5 || ^6 || ^7",
"symfony/cache": "^4.3 || ^5 || ^6 || ^7 || ^8",
"symfony/expression-language": "^4 || ^5 || ^6 || ^7 || ^8",
"webonyx/graphql-php": "^v15.0",
"kcs/class-finder": "^0.6.0"
},
Expand All @@ -35,7 +35,7 @@
"php-coveralls/php-coveralls": "^2.7",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^10.5 || ^11.0",
"phpunit/phpunit": "^10.5 || ^11.0 || ^12.0",
"symfony/var-dumper": "^6.4"
},
"suggest": {
Expand Down
1 change: 1 addition & 0 deletions src/Utils/PropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static function setValue(object $instance, string $propertyName, mixed $v
throw AccessPropertyException::createForUnwritableProperty($class, $propertyName);
}

/** @param class-string $class */
private static function isPublicProperty(string $class, string $propertyName): bool
{
if (! property_exists($class, $propertyName)) {
Expand Down
13 changes: 7 additions & 6 deletions tests/Loggers/ExceptionLogger.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php

declare(strict_types=1);

namespace TheCodingMachine\GraphQLite\Loggers;


use Exception;
use Psr\Log\AbstractLogger;
use Psr\Log\LogLevel;
use Stringable;
use Throwable;

use function in_array;

/**
Expand All @@ -15,16 +18,14 @@
*/
class ExceptionLogger extends AbstractLogger
{
/**
* @inheritDoc
*/
public function log($level, $message, array $context = array())
/** @inheritDoc */
public function log($level, $message, array $context = []): void
{
if (in_array($level, [LogLevel::EMERGENCY, LogLevel::ALERT, LogLevel::CRITICAL, LogLevel::ERROR, LogLevel::WARNING])) {
if (isset($context['exception']) && $context['exception'] instanceof Throwable) {
throw $context['exception'];
}
throw new \Exception($message);
throw new Exception($message);
}
}
}
Loading