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
  • Loading branch information
emteknetnz committed Nov 28, 2024
1 parent 7f5c6e4 commit c9a0b5d
Show file tree
Hide file tree
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
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/Dev/SchemaBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/DataObject/CreateCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Services/SchemaTranscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/Schema/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit c9a0b5d

Please sign in to comment.