diff --git a/composer.json b/composer.json index 89afdc1b..9a58d588 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,7 @@ "illuminate/contracts": "^10.0|^11.0|^12.0", "illuminate/support": "^10.0|^11.0|^12.0", "laragraph/utils": "^2.0.1", - "thecodingmachine/safe": "^2.4", + "thecodingmachine/safe": "^3.0", "webonyx/graphql-php": "^15.0.3" }, "require-dev": { diff --git a/src/GraphQL.php b/src/GraphQL.php index 302f1625..3bf211e3 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -336,7 +336,7 @@ protected function buildObjectTypeFromClass($type, array $opts = []): Type if (!$type instanceof TypeConvertible) { throw new TypeNotFound( - \Safe\sprintf( + \sprintf( 'Unable to convert %s to a GraphQL type, please add/implement the interface %s', \get_class($type), TypeConvertible::class @@ -630,7 +630,7 @@ public static function getNormalizedSchemaConfiguration(string $schemaName): arr if (!\is_string($schemaConfig) && !\is_array($schemaConfig)) { throw new SchemaNotFound( - \Safe\sprintf( + \sprintf( "Configuration for schema '%s' must be either an array or a class implementing %s, found type %s", $schemaName, ConfigConvertible::class, diff --git a/src/Support/ExecutionMiddleware/UnusedVariablesMiddleware.php b/src/Support/ExecutionMiddleware/UnusedVariablesMiddleware.php index 581e4baf..b5beac62 100644 --- a/src/Support/ExecutionMiddleware/UnusedVariablesMiddleware.php +++ b/src/Support/ExecutionMiddleware/UnusedVariablesMiddleware.php @@ -31,7 +31,7 @@ public function handle(string $schemaName, Schema $schema, OperationParams $para } if ($unusedVariables) { - $msg = \Safe\sprintf( + $msg = \sprintf( 'The following variables were provided but not consumed: %s', implode(', ', array_keys($unusedVariables)) ); diff --git a/src/Support/SelectFields.php b/src/Support/SelectFields.php index 32cad3d0..481cc603 100644 --- a/src/Support/SelectFields.php +++ b/src/Support/SelectFields.php @@ -336,7 +336,7 @@ protected static function validateField(FieldDefinition $fieldObject, array $que default: throw new RuntimeException( - \Safe\sprintf( + \sprintf( "Unsupported use of 'privacy' configuration on field '%s'.", $fieldObject->name ) diff --git a/tests/Support/Traits/SqlAssertionTrait.php b/tests/Support/Traits/SqlAssertionTrait.php index 6ecfd6bf..209ea546 100644 --- a/tests/Support/Traits/SqlAssertionTrait.php +++ b/tests/Support/Traits/SqlAssertionTrait.php @@ -54,7 +54,7 @@ protected function assertSqlCount(int $expectedCount, string $msg = ''): void $msg .= "\n\n"; } - $msg .= \Safe\sprintf( + $msg .= \sprintf( "Expected number of SQL statements of %d does not match the actual value of %d\nQueries:\n\n%s\n", $expectedCount, $numSqlQueries, @@ -62,7 +62,7 @@ protected function assertSqlCount(int $expectedCount, string $msg = ''): void "\n", array_map( static function (QueryExecuted $query) { - return \Safe\sprintf( + return \sprintf( '[%s] %s', $query->connectionName, $query->sql diff --git a/tests/Unit/InstantiableTypesTest/FormattableDate.php b/tests/Unit/InstantiableTypesTest/FormattableDate.php index 0bc52612..920508da 100644 --- a/tests/Unit/InstantiableTypesTest/FormattableDate.php +++ b/tests/Unit/InstantiableTypesTest/FormattableDate.php @@ -28,7 +28,7 @@ public function args(): array 'format' => [ 'type' => Type::string(), 'defaultValue' => $this->defaultFormat, - 'description' => \Safe\sprintf('Defaults to %s', $this->defaultFormat), + 'description' => \sprintf('Defaults to %s', $this->defaultFormat), ], 'relative' => [ 'type' => Type::boolean(),