Skip to content

Commit 40b7eac

Browse files
author
Jeremiah VALERIE
committed
Merge branch '0.14'
2 parents bee2e36 + 5b10c26 commit 40b7eac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+224
-339
lines changed

.php_cs.dist

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ return PhpCsFixer\Config::create()
1010
->setRules(
1111
[
1212
'@Symfony' => true,
13+
'@PHP71Migration' => true,
14+
'@PHP74Migration:risky' => true,
1315
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
1416
'general_phpdoc_annotation_remove' => ['author', 'category', 'copyright', 'created', 'license', 'package', 'since', 'subpackage', 'version'],
1517
'fully_qualified_strict_types' => true,
@@ -19,7 +21,9 @@ return PhpCsFixer\Config::create()
1921
'global_namespace_import' => ['import_functions' => true, 'import_classes' => true, 'import_constants' => true],
2022
'phpdoc_summary' => false,
2123
'hash_to_slash_comment' => false,
22-
'single_line_comment_style' => false
24+
'single_line_comment_style' => false,
25+
'phpdoc_no_alias_tag' => ['type' => 'var'],
26+
'no_mixed_echo_print' => ['use' => 'echo'],
2327
]
2428
)
2529
->setFinder($finder)

UPGRADE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ UPGRADE FROM 0.13 to 0.14
1212
- [Replace `overblog_graphql.global_variable` tag](#replace-overblog_graphqlglobal_variable-tag)
1313
- [Replace `resolver` expression function](#replace-resolver-expression-function)
1414
- [Rename `ResolverInterface` to `QueryInterface`](#rename-resolverinterface-to-queryinterface)
15+
- [Remove Argument deprecated method](#remove-argument-deprecated-method)
16+
- [Remove ConnectionBuilder deprecated class](#remove-connectionbuilder-deprecated-class)
1517

1618
### Customize the cursor encoder of the edges of a connection
1719

@@ -199,6 +201,15 @@ Example:
199201
}
200202
```
201203

204+
### Remove Argument deprecated method
205+
206+
Method `Overblog\GraphQLBundle\Definition\Argument::getRawArguments` is replaced by
207+
`Overblog\GraphQLBundle\Definition\Argument::getArrayCopy`.
208+
209+
### Remove ConnectionBuilder deprecated class
210+
211+
Class `Overblog\GraphQLBundle\Relay\Connection\Output\ConnectionBuilder` is replaced by
212+
`Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder`.
202213

203214
UPGRADE FROM 0.12 to 0.13
204215
=======================

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"test -f phpbench.phar || wget https://github.com/phpbench/phpbench/releases/download/1.0.0-alpha7/phpbench.phar -O phpbench.phar",
8181
"@php phpbench.phar run -l dots --ansi -vvv --report='generator: \"table\", cols: [\"benchmark\", \"subject\", \"params\", \"best\", \"mean\", \"mode\", \"worst\", \"diff\"], break: [\"benchmark\"], sort: {mean: \"asc\"}'"
8282
],
83-
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.4/php-cs-fixer.phar -O php-cs-fixer.phar",
83+
"install-cs": "test -f php-cs-fixer.phar || wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.18.7/php-cs-fixer.phar -O php-cs-fixer.phar",
8484
"fix-cs": [
8585
"@install-cs",
8686
"@php php-cs-fixer.phar fix --diff -v --allow-risky=yes --ansi"

src/Config/ObjectTypeDefinition.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public function getDefinition(): ArrayNodeDefinition
5050
private function treatFieldsDefaultAccess(ArrayNodeDefinition $node): void
5151
{
5252
$node->validate()
53-
->ifTrue(function ($v) {
54-
return array_key_exists('fieldsDefaultAccess', $v) && null !== $v['fieldsDefaultAccess'];
55-
})
53+
->ifTrue(fn ($v) => array_key_exists('fieldsDefaultAccess', $v) && null !== $v['fieldsDefaultAccess'])
5654
->then(function ($v) {
5755
foreach ($v['fields'] as &$field) {
5856
if (array_key_exists('access', $field) && null !== $field['access']) {

src/Config/Parser/AnnotationParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class AnnotationParser extends MetadataParser
1717
{
18-
const METADATA_FORMAT = '@%s';
18+
public const METADATA_FORMAT = '@%s';
1919

2020
protected static ?AnnotationReader $annotationReader = null;
2121

src/Config/Parser/AttributeParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
class AttributeParser extends MetadataParser
1616
{
17-
const METADATA_FORMAT = '#[%s]';
17+
public const METADATA_FORMAT = '#[%s]';
1818

1919
public static function getMetadatas(Reflector $reflector): array
2020
{

src/Config/Parser/MetadataParser/MetadataParser.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545
abstract class MetadataParser implements PreParserInterface
4646
{
47-
const ANNOTATION_NAMESPACE = 'Overblog\GraphQLBundle\Annotation\\';
48-
const METADATA_FORMAT = '%s';
47+
public const ANNOTATION_NAMESPACE = 'Overblog\GraphQLBundle\Annotation\\';
48+
public const METADATA_FORMAT = '%s';
4949

5050
private static ClassesTypesMap $map;
5151
private static array $typeGuessers = [];
@@ -233,7 +233,7 @@ private static function classMetadatasToGQLConfiguration(
233233

234234
if (null !== $gqlType) {
235235
if (!$gqlName) {
236-
$gqlName = isset($classMetadata->name) ? $classMetadata->name : $reflectionClass->getShortName();
236+
$gqlName = !empty($classMetadata->name) ? $classMetadata->name : $reflectionClass->getShortName();
237237
}
238238

239239
if ($preProcess) {
@@ -346,9 +346,7 @@ private static function graphQLTypeConfigFromAnnotation(ReflectionClass $reflect
346346

347347
$buildersAnnotations = array_merge(self::getMetadataMatching($metadatas, Metadata\FieldsBuilder::class), $typeAnnotation->builders);
348348
if (!empty($buildersAnnotations)) {
349-
$typeConfiguration['builders'] = array_map(function ($fieldsBuilderAnnotation) {
350-
return ['builder' => $fieldsBuilderAnnotation->name, 'builderConfig' => $fieldsBuilderAnnotation->config];
351-
}, $buildersAnnotations);
349+
$typeConfiguration['builders'] = array_map(fn ($fieldsBuilderAnnotation) => ['builder' => $fieldsBuilderAnnotation->name, 'builderConfig' => $fieldsBuilderAnnotation->config], $buildersAnnotations);
352350
}
353351

354352
if (isset($typeAnnotation->isTypeOf)) {
@@ -593,7 +591,7 @@ private static function getTypeFieldConfigurationFromReflector(ReflectionClass $
593591
if (is_string($fieldMetadata->argsBuilder)) {
594592
$fieldConfiguration['argsBuilder'] = ['builder' => $fieldMetadata->argsBuilder, 'config' => []];
595593
} elseif (is_array($fieldMetadata->argsBuilder)) {
596-
list($builder, $builderConfig) = $fieldMetadata->argsBuilder;
594+
[$builder, $builderConfig] = $fieldMetadata->argsBuilder;
597595
$fieldConfiguration['argsBuilder'] = ['builder' => $builder, 'config' => $builderConfig];
598596
} else {
599597
throw new InvalidArgumentException(sprintf('The attribute "argsBuilder" on metadata %s defined on "%s" must be a string or an array where first index is the builder name and the second is the config.', static::formatMetadata($fieldMetadataName), $reflector->getName()));
@@ -608,7 +606,7 @@ private static function getTypeFieldConfigurationFromReflector(ReflectionClass $
608606
$fieldConfiguration['builder'] = $fieldMetadata->fieldBuilder;
609607
$fieldConfiguration['builderConfig'] = [];
610608
} elseif (is_array($fieldMetadata->fieldBuilder)) {
611-
list($builder, $builderConfig) = $fieldMetadata->fieldBuilder;
609+
[$builder, $builderConfig] = $fieldMetadata->fieldBuilder;
612610
$fieldConfiguration['builder'] = $builder;
613611
$fieldConfiguration['builderConfig'] = $builderConfig ?: [];
614612
} else {
@@ -929,7 +927,7 @@ private static function guessType(ReflectionClass $reflectionClass, Reflector $r
929927
}
930928
}
931929

932-
throw new TypeGuessingException(join("\n", $errors));
930+
throw new TypeGuessingException(implode("\n", $errors));
933931
}
934932

935933
/**

src/Config/Processor/InheritanceProcessor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ public static function process(array $configs): array
3939

4040
private static function removedDecorators(array $configs): array
4141
{
42-
return array_filter($configs, function ($config) {
43-
return !isset($config['decorator']) || true !== $config['decorator'];
44-
});
42+
return array_filter($configs, fn ($config) => !isset($config['decorator']) || true !== $config['decorator']);
4543
}
4644

4745
private static function processConfigsHeirs(array $configs): array

src/Definition/Argument.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
use function array_key_exists;
88
use function count;
9-
use function sprintf;
10-
use function trigger_error;
11-
use const E_USER_DEPRECATED;
129

1310
class Argument implements ArgumentInterface
1411
{
@@ -32,23 +29,6 @@ public function getArrayCopy(): array
3229
return $this->rawArguments;
3330
}
3431

35-
/**
36-
* @deprecated This method is deprecated since 0.12 and will be removed in 0.13. You should use getArrayCopy method instead.
37-
*/
38-
public function getRawArguments(): array
39-
{
40-
@trigger_error(
41-
sprintf(
42-
'This "%s" method is deprecated since 0.12 and will be removed in 0.13. You should use "%s::getArrayCopy" instead.',
43-
__METHOD__,
44-
__CLASS__
45-
),
46-
E_USER_DEPRECATED
47-
);
48-
49-
return $this->getArrayCopy();
50-
}
51-
5232
/**
5333
* @param int|string $offset
5434
*/

src/Definition/Type/CustomScalarType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function __construct(array $config = [])
1919
$config['name'] = $config['name'] ?? uniqid('CustomScalar');
2020
parent::__construct($config);
2121

22-
$this->config['scalarType'] = isset($this->config['scalarType']) ? $this->config['scalarType'] : null;
22+
$this->config['scalarType'] = $this->config['scalarType'] ?? null;
2323
}
2424

2525
/**

0 commit comments

Comments
 (0)