Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Explicity mark nullable parameters for PHP 8.4 #614

Merged
merged 1 commit into from
Dec 2, 2024
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
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
Loading