Skip to content

Commit a67e6e3

Browse files
authored
Merge pull request #700 from murtukov/enhancement/use-strict-access
Treat `useStrictAccess` option as true by default
2 parents d1aa2b4 + b1af6c0 commit a67e6e3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/Definition/ConfigProcessor/AclConfigProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static function acl(array $fields, AccessResolver $accessResolver, callab
3838
$field['resolve'] = function ($value, $args, $context, ResolveInfo $info) use ($field, $accessChecker, $accessResolver, $defaultResolver) {
3939
$resolverCallback = self::findFieldResolver($field, $info, $defaultResolver);
4040

41-
return $accessResolver->resolve($accessChecker, $resolverCallback, [$value, $args, $context, $info], $field['useStrictAccess']);
41+
return $accessResolver->resolve($accessChecker, $resolverCallback, [$value, $args, $context, $info], $field['useStrictAccess'] ?? true);
4242
};
4343
}
4444
}

src/Generator/TypeBuilder.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
* TODO (murtukov):
6262
* 1. Add <code> docblocks for every method
6363
* 2. Replace hard-coded string types with constants ('object', 'input-object' etc.).
64-
* 3. Change formatting of generated arguments.
6564
*/
6665
class TypeBuilder
6766
{
@@ -94,9 +93,6 @@ public function __construct(ExpressionConverter $expressionConverter, string $na
9493
Config::registerConverter($expressionConverter, ConverterInterface::TYPE_STRING);
9594
}
9695

97-
/**
98-
* TODO (murtukov). Implement file prototype to increase performance.
99-
*/
10096
public function build(array $config, string $type): PhpFile
10197
{
10298
$this->config = $config;
@@ -179,7 +175,7 @@ protected function buildConfigLoader(array $config): ArrowFunction
179175
* @var string|null $description
180176
* @var array|null $interfaces
181177
* @var string|null $resolveType
182-
* @var string|null $validation - only by InputType
178+
* @var array|null $validation - only by InputType
183179
* @var array|null $types - only by UnionType
184180
* @var array|null $values - only by EnumType
185181
* @var callback|null $serialize - only by CustomScalarType
@@ -566,8 +562,6 @@ public function buildField(array $fieldConfig /*, $fieldname */)
566562

567563
if (!empty($access) && is_string($access) && ExpressionLanguage::expressionContainsVar('object', $access)) {
568564
$field->addItem('useStrictAccess', false);
569-
} else {
570-
$field->addItem('useStrictAccess', true);
571565
}
572566

573567
if ('input-object' === $this->type && isset($validation)) {

0 commit comments

Comments
 (0)