Skip to content

Commit

Permalink
API Explicity mark nullable paramters for PHP 8.4
Browse files Browse the repository at this point in the history
emteknetnz committed Nov 28, 2024
1 parent 7f5c6e4 commit fd4da56
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Dev/Benchmark.php
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public static function start(string $id): void
* @return string|null
* @throws \Exception
*/
public static function end(string $id, string $message = null, bool $return = true): ?string
public static function end(string $id, ?string $message = null, bool $return = true): ?string
{
$benchmark = Benchmark::$benchmarks[$id] ?? null;
if (!$benchmark) {
2 changes: 1 addition & 1 deletion src/Dev/SchemaBuild.php
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ protected function getHeading(): string
* @throws SchemaNotFoundException
* @throws SchemaBuilderException
*/
public function buildSchema(string $key = null, bool $clear = true): void
public function buildSchema(?string $key = null, bool $clear = true): void
{
/** @var LoggerInterface $logger */
$logger = Injector::inst()->get(LoggerInterface::class . '.graphql-build');
2 changes: 1 addition & 1 deletion src/Schema/DataObject/CreateCreator.php
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ public function createOperation(
public static function resolve(array $resolverContext = []): Closure
{
$dataClass = $resolverContext['dataClass'] ?? null;
return function ($obj, $args = [], $context = [], ResolveInfo $info = null) use ($dataClass) {
return function ($obj, $args = [], $context = [], ?ResolveInfo $info = null) use ($dataClass) {
if (!$dataClass) {
return null;
}
2 changes: 1 addition & 1 deletion src/Schema/Services/SchemaTranscriber.php
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ class SchemaTranscriber
* @param string $rootDir Storage path for the generated file.
* Caution: This location may be used by frontend assets relying on GraphQL, e.g. silverstripe/assets.
*/
public function __construct(GraphQLSchema $schema, string $name, string $rootDir = null)
public function __construct(GraphQLSchema $schema, string $name, ?string $rootDir = null)
{
$this->fs = new Filesystem();
$this->schema = $schema;
2 changes: 1 addition & 1 deletion tests/Schema/SchemaTest.php
Original file line number Diff line number Diff line change
@@ -285,7 +285,7 @@ public static function noop()
{
}

private function buildSchema(string $key = 'test', SchemaConfig $context = null): Schema
private function buildSchema(string $key = 'test', ?SchemaConfig $context = null): Schema
{
$schema = new Schema($key, $this->createSchemaContext());

0 comments on commit fd4da56

Please sign in to comment.