From fbb691d07a5c81e8623abf3e021097ece3eb25a9 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 23 Apr 2024 10:38:04 +0200 Subject: [PATCH 1/5] Upgraded to PHP CS Fixer v3 (#854) * Upgraded to PHP CS Fixer v3 * Upgraded to PHP CS Fixer v3 * Update CONTRIBUTING.md * Update .gitignore * Set major version 3 --- .../{php-style.yml => php-cs-fixer.yaml} | 17 ++-- .gitignore | 2 +- .php-cs-fixer.dist.php | 85 +++++++++++++++++++ .php_cs.dist | 71 ---------------- CONTRIBUTING.md | 2 +- 5 files changed, 99 insertions(+), 78 deletions(-) rename .github/workflows/{php-style.yml => php-cs-fixer.yaml} (53%) create mode 100644 .php-cs-fixer.dist.php delete mode 100644 .php_cs.dist diff --git a/.github/workflows/php-style.yml b/.github/workflows/php-cs-fixer.yaml similarity index 53% rename from .github/workflows/php-style.yml rename to .github/workflows/php-cs-fixer.yaml index 81fdbc88..5ef0b585 100644 --- a/.github/workflows/php-style.yml +++ b/.github/workflows/php-cs-fixer.yaml @@ -1,9 +1,18 @@ -name: PHP Style +name: "PHP-CS-Fixer" -on: [push] +on: + push: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + +permissions: + contents: read jobs: php-cs-fixer: + permissions: + contents: write # for stefanzweifel/git-auto-commit-action to push code in repo runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -11,9 +20,7 @@ jobs: ref: ${{ github.head_ref }} - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:2.19.0 - with: - args: --config=.php_cs.dist --allow-risky yes + uses: docker://oskarstark/php-cs-fixer-ga:3 - uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/.gitignore b/.gitignore index 7a148f47..0560dc71 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ Thumbs.db # PHP-CS-Fixer /.php_cs -/.php_cs.cache +/.php-cs-fixer.cache # composer /composer.lock diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..b14b6d21 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,85 @@ +in([ + __DIR__ . '/bundles', + __DIR__ . '/config', + __DIR__ . '/lib', + __DIR__ . '/models', + __DIR__ . '/tests' + ]) + + ->exclude([ + __DIR__ . '/tests/_output', + __DIR__ . '/tests/Support/_generated', + ]) + + // do not fix views + ->notName('*.html.php') +; + +// do not enable self_accessor as it breaks pimcore models relying on get_called_class() +$config = new PhpCsFixer\Config(); +$config->setRules([ + '@PSR1' => true, + '@PSR2' => true, + 'array_syntax' => ['syntax' => 'short'], + 'list_syntax' => ['syntax' => 'short'], + + 'header_comment' => [ + 'comment_type' => 'PHPDoc', + 'header' => 'Pimcore' . PHP_EOL . PHP_EOL . + 'This source file is available under two different licenses:' . PHP_EOL . + '- GNU General Public License version 3 (GPLv3)' . PHP_EOL . + '- Pimcore Commercial License (PCL)' . PHP_EOL . + 'Full copyright and license information is available in' . PHP_EOL . + 'LICENSE.md which is distributed with this source code.' . PHP_EOL . + PHP_EOL . + ' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL . + ' @license http://www.pimcore.org/license GPLv3 and PCL' + ], + + 'blank_line_before_statement' => true, + 'encoding' => true, + 'function_typehint_space' => true, + 'single_line_comment_style' => true, + 'lowercase_cast' => true, + 'magic_constant_casing' => true, + 'method_argument_space' => ['on_multiline' => 'ignore'], + 'class_attributes_separation' => true, + 'native_function_casing' => true, + 'no_blank_lines_after_class_opening' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_empty_comment' => true, + 'no_empty_phpdoc' => true, + 'no_empty_statement' => true, + 'no_extra_blank_lines' => true, + 'no_leading_import_slash' => true, + 'no_leading_namespace_whitespace' => true, + 'no_short_bool_cast' => true, + 'no_spaces_around_offset' => true, + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], + 'no_unneeded_control_parentheses' => true, + 'no_unused_imports' => true, + 'no_whitespace_before_comma_in_array' => true, + 'no_whitespace_in_blank_line' => true, + 'object_operator_without_whitespace' => true, + 'ordered_imports' => true, + 'phpdoc_indent' => true, + 'phpdoc_no_useless_inheritdoc' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => true, + 'phpdoc_single_line_var_spacing' => true, + 'return_type_declaration' => true, + 'short_scalar_cast' => true, + 'single_blank_line_before_namespace' => true, + 'single_quote' => true, + 'space_after_semicolon' => true, + 'standardize_not_equals' => true, + 'ternary_operator_spaces' => true, + 'trailing_comma_in_multiline' => true, + 'whitespace_after_comma_in_array' => true, +]); + +$config->setFinder($finder); +return $config; diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index fd1e5dda..00000000 --- a/.php_cs.dist +++ /dev/null @@ -1,71 +0,0 @@ -in([__DIR__ . '/src']) - - // do not fix views - ->notName('*.html.php'); - -return PhpCsFixer\Config::create() - ->setRules([ - '@PSR1' => true, - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - - 'header_comment' => [ - 'commentType' => 'PHPDoc', - 'header' => 'Pimcore' . PHP_EOL . PHP_EOL . - 'This source file is available under two different licenses:' . PHP_EOL . - '- GNU General Public License version 3 (GPLv3)' . PHP_EOL . - '- Pimcore Commercial License (PCL)' . PHP_EOL . - 'Full copyright and license information is available in' . PHP_EOL . - 'LICENSE.md which is distributed with this source code.' . PHP_EOL . - PHP_EOL . - ' @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org)' . PHP_EOL . - ' @license http://www.pimcore.org/license GPLv3 and PCL' - ], - - // keep aligned = and => operators as they are: do not force aligning, but do not remove it - 'binary_operator_spaces' => ['align_double_arrow' => null, 'align_equals' => null], - - 'blank_line_before_return' => true, - 'encoding' => true, - 'function_typehint_space' => true, - 'hash_to_slash_comment' => true, - 'lowercase_cast' => true, - 'magic_constant_casing' => true, - 'method_argument_space' => ['ensure_fully_multiline' => false], - 'method_separation' => true, - 'native_function_casing' => true, - 'no_blank_lines_after_class_opening' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_empty_statement' => true, - 'no_extra_consecutive_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_short_bool_cast' => true, - 'no_spaces_around_offset' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unused_imports' => true, - 'no_whitespace_before_comma_in_array' => true, - 'no_whitespace_in_blank_line' => true, - 'object_operator_without_whitespace' => true, - 'ordered_imports' => true, - 'phpdoc_indent' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'return_type_declaration' => true, - 'self_accessor' => true, - 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, - 'single_quote' => true, - 'space_after_semicolon' => true, - 'standardize_not_equals' => true, - 'ternary_operator_spaces' => true, - 'whitespace_after_comma_in_array' => true, - ]) - ->setFinder($finder); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 53017eda..ad0baa2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,7 +18,7 @@ There are a few necessary steps before we can accept a pull request: * [Fork us!](https://help.github.com/articles/fork-a-repo/) * Select the right branch. main(e.g. 1.x) for features and improvements or latest maintenance branch for bug fixes (e.g. 1.0) -* Code! Follow the coding standards defined [here](https://github.com/pimcore/data-hub/blob/master/.php_cs.dist). +* Code! Follow the coding standards defined [here](https://github.com/pimcore/data-hub/blob/1.x/.php-cs-fixer.dist.php). * [Send a pull request](https://help.github.com/articles/using-pull-requests/) from your fork’s branch to our `master` branch. * [Sign the CLA](https://cla-assistant.io/pimcore/data-hub) - see also below. From 17c666ab5abcc41b6df92370bf82ab5442df80f1 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 23 Apr 2024 14:01:26 +0200 Subject: [PATCH 2/5] Use oskarstark/php-cs-fixer-ga:latest (#855) * Upgraded to PHP CS Fixer v3 * Upgraded to PHP CS Fixer v3 * Update CONTRIBUTING.md * Update .gitignore * Set major version 3 * Use latest --- .github/workflows/php-cs-fixer.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 5ef0b585..769f1fe3 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -20,7 +20,7 @@ jobs: ref: ${{ github.head_ref }} - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga:3 + uses: docker://oskarstark/php-cs-fixer-ga:latest - uses: stefanzweifel/git-auto-commit-action@v4 with: From 0317eb41d76884d9abb60248b7ecf60b6b35d290 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Tue, 23 Apr 2024 14:30:21 +0200 Subject: [PATCH 3/5] [PhpCsFixer] Fix paths (#856) * [PhpCsFixer] Fix paths * [PhpCsFixer] Fix paths * [PhpCsFixer] Fix paths --- .php-cs-fixer.dist.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index b14b6d21..d0e1b8d2 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,20 +2,14 @@ $finder = PhpCsFixer\Finder::create() ->in([ - __DIR__ . '/bundles', - __DIR__ . '/config', - __DIR__ . '/lib', - __DIR__ . '/models', - __DIR__ . '/tests' + __DIR__ . '/src', + __DIR__ . '/tests', ]) ->exclude([ __DIR__ . '/tests/_output', - __DIR__ . '/tests/Support/_generated', + __DIR__ . '/tests/_support/_generated', ]) - - // do not fix views - ->notName('*.html.php') ; // do not enable self_accessor as it breaks pimcore models relying on get_called_class() From 7652b48a906f466cba4c2aa1d6e44d5cf4d59e7b Mon Sep 17 00:00:00 2001 From: fashxp Date: Tue, 23 Apr 2024 12:30:43 +0000 Subject: [PATCH 4/5] Apply php-cs-fixer changes --- .../Configuration/MigrateLegacyConfig.php | 5 - .../RebuildWorkspacesCommand.php | 5 - .../GraphQL/RebuildDefinitionsCommand.php | 6 +- src/Configuration.php | 2 - src/Configuration/Dao.php | 3 - src/Configuration/DatahubConfigLocator.php | 1 - src/Controller/ConfigController.php | 49 +----- src/Controller/GraphQLExplorerController.php | 4 +- src/Controller/WebserviceController.php | 10 +- .../Compiler/ImportExportLocatorsPass.php | 17 -- .../PimcoreDataHubExtension.php | 5 +- src/Event/Config/SpecialEntitiesEvent.php | 1 + src/Event/GraphQL/Model/ExecutorEvent.php | 2 - src/Event/GraphQL/Model/ListingEvent.php | 2 - src/Event/GraphQL/Model/MutationTypeEvent.php | 1 - src/Event/GraphQL/Model/QueryTypeEvent.php | 1 - src/EventListener/AdminListener.php | 1 - src/EventListener/DataChangeListener.php | 9 - .../AssetType/AssetEmbeddedMetaInfoItem.php | 1 - src/GraphQL/AssetType/AssetFolderType.php | 11 +- src/GraphQL/AssetType/AssetInputType.php | 9 +- src/GraphQL/AssetType/AssetMetadataItem.php | 3 +- src/GraphQL/AssetType/AssetTreeType.php | 6 - src/GraphQL/AssetType/AssetType.php | 29 ++-- src/GraphQL/ClassTypeDefinitions.php | 1 - .../BooleanSelectType.php | 4 +- .../CheckboxType.php | 4 +- .../DateType.php | 8 +- .../ClassificationstoreFeatureType/Helper.php | 10 +- .../MultiselectType.php | 6 +- .../QuantityValueType.php | 8 +- .../StringType.php | 6 +- .../ClassificationstoreType/Feature.php | 6 - src/GraphQL/ClassificationstoreType/Group.php | 6 +- .../AdvancedManyToManyObjectRelation.php | 1 - .../AdvancedManyToManyRelation.php | 1 - src/GraphQL/DataObjectInputProcessor/Base.php | 2 - .../DataObjectInputProcessor/BaseOperator.php | 1 - src/GraphQL/DataObjectInputProcessor/Date.php | 1 - .../ExternalImage.php | 1 - .../Fieldcollections.php | 1 - .../DataObjectInputProcessor/Geopoint.php | 1 - .../IfEmptyOperator.php | 1 - .../DataObjectInputProcessor/Image.php | 1 - .../DataObjectInputProcessor/ImageGallery.php | 1 - .../InputQuantityValue.php | 1 - src/GraphQL/DataObjectInputProcessor/Link.php | 1 - .../LocaleCollectorOperator.php | 1 - .../LocaleSwitcherOperator.php | 1 - .../ManyToManyObjectRelation.php | 1 - .../ManyToManyRelation.php | 1 - .../ManyToOneRelation.php | 1 - .../QuantityValue.php | 1 - .../DataObjectInputProcessor/Table.php | 5 - .../AdvancedManyToManyObjectRelation.php | 3 +- .../AdvancedManyToManyRelation.php | 3 +- .../Base.php | 2 +- .../BooleanSelect.php | 2 +- .../Checkbox.php | 2 +- .../Date.php | 2 +- .../ExternalImage.php | 2 +- .../Fieldcollections.php | 21 ++- .../Geopoint.php | 2 +- .../Image.php | 2 +- .../ImageGallery.php | 14 +- .../InputQuantityValue.php | 2 +- .../Link.php | 2 +- .../ManyToManyObjectRelation.php | 2 +- .../ManyToManyRelation.php | 2 +- .../ManyToOneRelation.php | 2 +- .../Multiselect.php | 2 +- .../Numeric.php | 2 +- .../QuantityValue.php | 2 +- .../Table.php | 12 +- .../Base.php | 3 +- .../IfEmpty.php | 2 +- .../LocaleCollector.php | 2 +- .../LocaleSwitcher.php | 2 +- .../AbstractTable.php | 6 +- .../AssetBase.php | 4 +- .../Base.php | 6 +- .../Block.php | 2 - .../CalculatedValue.php | 3 +- .../Checkbox.php | 4 +- .../Classificationstore.php | 6 +- .../Geobounds.php | 4 +- .../Geopoint.php | 4 +- .../Geopolygon.php | 4 +- .../Helper/AssetBase.php | 2 - .../Helper/Base.php | 2 - .../Helper/Hotspotimage.php | 3 - .../Helper/Href.php | 2 - .../Helper/Image.php | 2 - .../Helper/ImageGallery.php | 3 - .../Helper/Multihref.php | 2 - .../Helper/MultihrefMetadata.php | 2 - .../Helper/Objects.php | 2 - .../Helper/ObjectsMetadata.php | 2 - .../Helper/ReverseManyToManyObjects.php | 2 - .../Hotspotimage.php | 4 +- .../Href.php | 4 +- .../ImageGallery.php | 4 +- .../InputQuantityValue.php | 4 - .../Link.php | 4 +- .../Multihref.php | 4 +- .../MultihrefMetadata.php | 4 +- .../Multiselect.php | 4 +- .../Numeric.php | 4 +- .../Objects.php | 4 +- .../ObjectsMetadata.php | 3 +- .../QuantityValue.php | 4 - .../ReverseManyToManyObjectRelation.php | 3 +- .../Slider.php | 4 +- .../StructuredTable.php | 2 + .../UrlSlug.php | 4 - .../Video.php | 4 +- ...jectQueryFieldConfigGeneratorInterface.php | 2 - .../Base.php | 4 +- .../Merge.php | 2 +- .../DataObjectType/AbstractRelationsType.php | 7 - src/GraphQL/DataObjectType/BlockEntryType.php | 9 +- src/GraphQL/DataObjectType/BlockType.php | 5 +- .../ElementDescriptorInputType.php | 14 +- .../DataObjectType/FieldcollectionType.php | 6 - src/GraphQL/DataObjectType/GeoboundsType.php | 4 +- .../DataObjectType/GeopointInputType.php | 1 - src/GraphQL/DataObjectType/GeopointType.php | 4 +- src/GraphQL/DataObjectType/HotspotType.php | 1 - .../InputQuantityValueInputType.php | 3 +- .../DataObjectType/InputQuantityValueType.php | 6 +- .../InputType/AbstractRelationInputType.php | 5 +- .../InputType/ImageInputType.php | 1 - src/GraphQL/DataObjectType/LinkInputType.php | 5 +- src/GraphQL/DataObjectType/LinkType.php | 22 +-- src/GraphQL/DataObjectType/LocalizedType.php | 2 +- src/GraphQL/DataObjectType/MergeType.php | 4 +- .../DataObjectType/MultihrefMetadataType.php | 6 +- .../DataObjectType/ObjectFolderType.php | 17 +- .../DataObjectType/ObjectMetadataType.php | 6 +- src/GraphQL/DataObjectType/ObjectTreeType.php | 6 - .../DataObjectType/PimcoreObjectType.php | 35 ++-- .../DataObjectType/QuantityValueInputType.php | 3 +- .../DataObjectType/QuantityValueType.php | 11 +- .../DataObjectType/QuantityValueUnitType.php | 2 +- src/GraphQL/DataObjectType/UrlSlugType.php | 9 +- src/GraphQL/DataObjectType/VideoType.php | 10 +- .../DataObjectType/VideoTypeDataType.php | 10 +- .../Areablock.php | 3 +- .../DocumentElementInputProcessor/Base.php | 1 - .../DocumentElementInputProcessor/Block.php | 1 - .../EditablesTrait.php | 1 - .../DocumentElementInputProcessor/Embed.php | 1 - .../DocumentElementInputProcessor/Image.php | 1 - .../Multiselect.php | 1 - .../Scheduledblock.php | 3 +- .../Areablock.php | 12 +- .../Block.php | 12 +- .../Embed.php | 4 +- .../Image.php | 6 +- .../Input.php | 4 +- .../Multiselect.php | 4 +- .../Scheduledblock.php | 12 +- .../Select.php | 4 +- .../Wysiwyg.php | 4 +- .../Video.php | 3 +- .../AreablockDataInputType.php | 3 +- .../DocumentElementType/AreablockDataType.php | 10 +- .../DocumentElementType/AreablockType.php | 7 +- src/GraphQL/DocumentElementType/BlockType.php | 8 +- .../DocumentElementType/CheckboxType.php | 8 +- src/GraphQL/DocumentElementType/DateType.php | 10 +- src/GraphQL/DocumentElementType/EmbedType.php | 8 +- src/GraphQL/DocumentElementType/ImageType.php | 19 +- .../DocumentElementType/LinkDataType.php | 37 ++-- src/GraphQL/DocumentElementType/LinkType.php | 7 +- .../DocumentElementType/MultiselectType.php | 8 +- .../DocumentElementType/NumericType.php | 8 +- src/GraphQL/DocumentElementType/PdfType.php | 9 +- .../DocumentElementType/RelationType.php | 17 +- .../DocumentElementType/RelationsType.php | 11 +- .../ScheduledblockDataInputType.php | 3 +- .../ScheduledblockDataType.php | 8 +- .../ScheduledblockType.php | 7 +- .../DocumentElementType/SimpleTextType.php | 6 +- src/GraphQL/DocumentElementType/VideoType.php | 18 +- src/GraphQL/DocumentResolver/Email.php | 1 - src/GraphQL/DocumentResolver/Hardlink.php | 1 - src/GraphQL/DocumentResolver/Link.php | 2 - src/GraphQL/DocumentResolver/PageSnippet.php | 1 - .../DocumentType/AbstractDocumentType.php | 15 +- .../DocumentType/DocumentElementType.php | 5 - .../DocumentType/DocumentFolderType.php | 5 +- .../DocumentType/DocumentLinkInputType.php | 1 - .../DocumentType/DocumentPageInputType.php | 5 +- src/GraphQL/DocumentType/DocumentTreeType.php | 6 +- src/GraphQL/DocumentType/DocumentType.php | 11 -- src/GraphQL/DocumentType/EmailType.php | 3 +- src/GraphQL/DocumentType/HardlinkType.php | 6 +- src/GraphQL/DocumentType/LinkType.php | 5 +- src/GraphQL/DocumentType/PageSnippetType.php | 24 ++- src/GraphQL/DocumentType/PageType.php | 2 - src/GraphQL/DocumentType/SnippetType.php | 2 - src/GraphQL/ElementDescriptor.php | 3 - src/GraphQL/ElementTag.php | 7 +- src/GraphQL/Exception/ClientSafeException.php | 3 - .../FieldHelper/AbstractFieldHelper.php | 6 +- src/GraphQL/FieldHelper/AssetFieldHelper.php | 1 - .../FieldHelper/DataObjectFieldHelper.php | 19 +- .../FieldHelper/DocumentFieldHelper.php | 1 - src/GraphQL/General/AnyDocumentTargetType.php | 6 - src/GraphQL/General/AnyTargetType.php | 6 - src/GraphQL/General/FolderType.php | 1 - src/GraphQL/General/UploadType.php | 9 - src/GraphQL/Helper.php | 44 ++--- src/GraphQL/Mutation/MutationType.php | 163 +++++++++--------- .../DefaultMutationOperatorFactoryBase.php | 1 - src/GraphQL/PropertyType/AssetFolderType.php | 7 +- src/GraphQL/PropertyType/AssetType.php | 11 +- src/GraphQL/PropertyType/CheckboxType.php | 10 +- src/GraphQL/PropertyType/DataObjectType.php | 10 +- .../PropertyType/DocumentFolderType.php | 7 +- src/GraphQL/PropertyType/DocumentType.php | 7 +- .../PropertyType/ElementPropertyType.php | 7 +- .../PropertyType/HotspotMetadataType.php | 5 - src/GraphQL/PropertyType/ObjectFolderType.php | 7 +- src/GraphQL/PropertyType/ObjectsType.php | 5 - src/GraphQL/PropertyType/SelectType.php | 10 +- src/GraphQL/PropertyType/TextType.php | 10 +- src/GraphQL/PropertyType/TextareaType.php | 10 +- src/GraphQL/Query/ConfigElementInterface.php | 1 - .../Query/Operator/AbstractOperator.php | 1 - src/GraphQL/Query/Operator/Alias.php | 1 - src/GraphQL/Query/Operator/Concatenator.php | 3 +- src/GraphQL/Query/Operator/DateFormatter.php | 2 - src/GraphQL/Query/Operator/ElementCounter.php | 2 - .../Factory/DefaultOperatorFactoryBase.php | 2 - .../Factory/OperatorFactoryInterface.php | 2 - src/GraphQL/Query/Operator/Merge.php | 3 +- src/GraphQL/Query/Operator/Substring.php | 2 - src/GraphQL/Query/Operator/Text.php | 2 - src/GraphQL/Query/Operator/Thumbnail.php | 2 - src/GraphQL/Query/Operator/ThumbnailHtml.php | 2 - src/GraphQL/Query/Operator/TranslateValue.php | 2 - src/GraphQL/Query/Operator/Trimmer.php | 7 +- src/GraphQL/Query/QueryType.php | 57 +++--- src/GraphQL/Query/Value/DefaultValue.php | 1 - src/GraphQL/RelationHelper.php | 3 - src/GraphQL/Resolver/AssetListing.php | 4 - src/GraphQL/Resolver/AssetType.php | 12 +- src/GraphQL/Resolver/Base.php | 3 - src/GraphQL/Resolver/DataObject.php | 3 - src/GraphQL/Resolver/Document.php | 8 +- src/GraphQL/Resolver/Element.php | 7 - src/GraphQL/Resolver/Geobounds.php | 2 - src/GraphQL/Resolver/Geopoint.php | 2 - src/GraphQL/Resolver/HotspotType.php | 5 - src/GraphQL/Resolver/Link.php | 40 ----- src/GraphQL/Resolver/Merge.php | 1 - src/GraphQL/Resolver/MultihrefMetadata.php | 2 - src/GraphQL/Resolver/ObjectMetadata.php | 2 - src/GraphQL/Resolver/QuantityValue.php | 3 - src/GraphQL/Resolver/QueryType.php | 13 +- src/GraphQL/Resolver/UrlSlug.php | 2 - src/GraphQL/Resolver/Video.php | 5 - src/GraphQL/Service.php | 26 +-- src/GraphQL/SharedType/HotspotHotspotType.php | 7 +- src/GraphQL/SharedType/HotspotMarkerType.php | 7 +- src/GraphQL/SharedType/KeyValueType.php | 3 +- .../Traits/ElementIdentificationTrait.php | 3 + src/GraphQL/Traits/ElementTagTrait.php | 5 - .../TranslationType/TranslationType.php | 2 +- src/GraphQL/TypeDefinitionInterface.php | 1 - src/GraphQL/TypeInterface/CsFeature.php | 12 +- src/GraphQL/TypeInterface/Element.php | 4 +- src/GraphQL/TypeInterface/Property.php | 8 +- src/Installer.php | 6 +- src/Model/SpecialEntitySetting.php | 6 + src/MySafeException.php | 4 - src/PimcoreDataHubBundle.php | 17 +- src/Service/FileUploadService.php | 3 - src/Service/OutputCacheService.php | 5 - src/WorkspaceHelper.php | 8 +- tests/GraphQL/ResolveTest.php | 45 +++-- .../Traits/ElementIdentificationTraitTest.php | 42 ++--- tests/Model/ImportingConfigTest.php | 14 +- tests/Model/_bootstrap.php | 12 ++ .../CheckConsumerPermissionsServiceTest.php | 66 ++++--- tests/Service/OutputCacheServiceTest.php | 47 +++-- tests/Service/_bootstrap.php | 12 ++ tests/_bootstrap.php | 15 +- tests/_support/GraphQLTester.php | 15 ++ tests/_support/Helper/Model.php | 22 ++- tests/_support/Helper/Service.php | 30 ++-- tests/_support/Helper/Unit.php | 10 +- tests/_support/ModelTester.php | 15 ++ tests/_support/Test/ModelTestCase.php | 8 +- tests/_support/Test/TestCase.php | 3 - 297 files changed, 826 insertions(+), 1338 deletions(-) diff --git a/src/Command/Configuration/MigrateLegacyConfig.php b/src/Command/Configuration/MigrateLegacyConfig.php index 33239ec5..4d4d18b8 100644 --- a/src/Command/Configuration/MigrateLegacyConfig.php +++ b/src/Command/Configuration/MigrateLegacyConfig.php @@ -23,9 +23,6 @@ class MigrateLegacyConfig extends AbstractCommand { - /** - * {@inheritDoc} - */ protected function configure() { $this @@ -67,8 +64,6 @@ private function migrateConfiguration(string $fileName, string $scope): void /** * - * @param InputInterface $input - * @param OutputInterface $output * * @return int|null * diff --git a/src/Command/Configuration/RebuildWorkspacesCommand.php b/src/Command/Configuration/RebuildWorkspacesCommand.php index 38572f2b..ac9e9487 100644 --- a/src/Command/Configuration/RebuildWorkspacesCommand.php +++ b/src/Command/Configuration/RebuildWorkspacesCommand.php @@ -25,9 +25,6 @@ class RebuildWorkspacesCommand extends AbstractCommand { - /** - * {@inheritDoc} - */ protected function configure() { $this @@ -43,8 +40,6 @@ protected function configure() /** * - * @param InputInterface $input - * @param OutputInterface $output * * @return int|null * diff --git a/src/Command/GraphQL/RebuildDefinitionsCommand.php b/src/Command/GraphQL/RebuildDefinitionsCommand.php index 53784c66..ab87af56 100644 --- a/src/Command/GraphQL/RebuildDefinitionsCommand.php +++ b/src/Command/GraphQL/RebuildDefinitionsCommand.php @@ -24,9 +24,6 @@ class RebuildDefinitionsCommand extends AbstractCommand { - /** - * {@inheritDoc} - */ protected function configure() { $this @@ -42,8 +39,6 @@ protected function configure() /** * - * @param InputInterface $input - * @param OutputInterface $output * * @return int * @@ -70,6 +65,7 @@ public function execute(InputInterface $input, OutputInterface $output) $config = Configuration::getByName($endpoint); if (!$config) { $this->output->writeln('Could not find config: ' . $endpoint . ''); + continue; } diff --git a/src/Configuration.php b/src/Configuration.php index a15b78ca..d13afa4b 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -316,7 +316,6 @@ public static function getList() /** * @param string $name * - * @return Configuration|null */ public static function getByName($name): ?self { @@ -425,7 +424,6 @@ public function __clone(): void /** * @internal * - * @param string $type * @param ?User $user * * @return bool diff --git a/src/Configuration/Dao.php b/src/Configuration/Dao.php index 250b87b9..85275df5 100644 --- a/src/Configuration/Dao.php +++ b/src/Configuration/Dao.php @@ -219,7 +219,6 @@ private function &getConfig() /** * get the list of configurations. * - * @return array */ public function loadList(): array { @@ -242,7 +241,6 @@ public function loadList(): array * * TODO: remove this static function and rename "loadList" to "getList" * - * @return array * */ public static function getList(): array @@ -253,7 +251,6 @@ public static function getList(): array } /** - * @param string $id * @param mixed $data * * @return array[][][] diff --git a/src/Configuration/DatahubConfigLocator.php b/src/Configuration/DatahubConfigLocator.php index de82b269..db74d4ff 100644 --- a/src/Configuration/DatahubConfigLocator.php +++ b/src/Configuration/DatahubConfigLocator.php @@ -28,7 +28,6 @@ class DatahubConfigLocator /** * Find config files for the given name (e.g. config) * - * @param string $name * @param array $params * * @return array diff --git a/src/Controller/ConfigController.php b/src/Controller/ConfigController.php index ef5827f1..9fd8e877 100644 --- a/src/Controller/ConfigController.php +++ b/src/Controller/ConfigController.php @@ -47,7 +47,6 @@ class ConfigController extends \Pimcore\Controller\UserAwareController /** * @param Configuration $configuration * - * @return array */ private function buildItem($configuration): array { @@ -65,17 +64,15 @@ private function buildItem($configuration): array 'writeable' => $configuration->isWriteable(), 'permissions' => [ 'delete' => $configuration->isAllowed('delete'), - 'update' => $configuration->isAllowed('update') - ] + 'update' => $configuration->isAllowed('update'), + ], ]; } /** * @Route("/list") * - * @param Request $request * - * @return JsonResponse */ public function listAction(Request $request): JsonResponse { @@ -105,7 +102,7 @@ public function listAction(Request $request): JsonResponse 'allowChildren' => true, 'iconCls' => 'pimcore_icon_folder', 'group' => $item->getGroup(), - 'children' => [] + 'children' => [], ]; } $groups[$item->getGroup()]['children'][] = $this->buildItem($item); @@ -133,10 +130,6 @@ public function listAction(Request $request): JsonResponse /** * @Route("/delete") * - * @param Request $request - * - * @return JsonResponse|null - * * @throws ConfigWriteException */ public function deleteAction(Request $request): ?JsonResponse @@ -174,10 +167,6 @@ public function deleteAction(Request $request): ?JsonResponse /** * @Route("/add") * - * @param Request $request - * - * @return JsonResponse|null - * * @throws ConfigWriteException */ public function addAction(Request $request): ?JsonResponse @@ -212,9 +201,7 @@ public function addAction(Request $request): ?JsonResponse /** * @Route("/clone") * - * @param Request $request * - * @return JsonResponse|null */ public function cloneAction(Request $request): ?JsonResponse { @@ -253,12 +240,6 @@ public function cloneAction(Request $request): ?JsonResponse /** * @Route("/get") * - * @param Request $request - * @param Service $graphQlService - * @param EventDispatcherInterface $eventDispatcher - * - * @return JsonResponse - * * @throws \Exception */ public function getAction(Request $request, Service $graphQlService, EventDispatcherInterface $eventDispatcher): JsonResponse @@ -372,7 +353,7 @@ public function getAction(Request $request, Service $graphQlService, EventDispat $config['schema']['specialEntities']['translation_listing']['create'] ?? false, $config['schema']['specialEntities']['translation_listing']['update'] ?? false, $config['schema']['specialEntities']['translation_listing']['delete'] ?? false - ) + ), ]; $specialSettingsEvent = new SpecialEntitiesEvent($coreSettings, $config); @@ -396,11 +377,11 @@ public function getAction(Request $request, Service $graphQlService, EventDispat 'configuration' => $config, 'userPermissions' => [ 'update' => $configuration->isAllowed('update'), - 'delete' => $configuration->isAllowed('delete') + 'delete' => $configuration->isAllowed('delete'), ], 'supportedGraphQLQueryDataTypes' => $supportedQueryDataTypes, 'supportedGraphQLMutationDataTypes' => $supportedMutationDataTypes, - 'modificationDate' => $config['general']['modificationDate'] + 'modificationDate' => $config['general']['modificationDate'], ] ); } @@ -408,9 +389,7 @@ public function getAction(Request $request, Service $graphQlService, EventDispat /** * @Route("/save") * - * @param Request $request * - * @return JsonResponse|null */ public function saveAction(Request $request): ?JsonResponse { @@ -491,11 +470,6 @@ public function saveAction(Request $request): ?JsonResponse /** * @Route("/get-explorer-url") * - * @param RouterInterface $routingService - * @param Request $request - * - * @return JsonResponse|null - * * @throws \Exception */ public function getExplorerUrlAction(RouterInterface $routingService, Request $request): ?JsonResponse @@ -513,8 +487,6 @@ public function getExplorerUrlAction(RouterInterface $routingService, Request $r /** * @Route("/thumbnail-tree") * - * @param Request $request - * * @return JsonResponse */ public function thumbnailTreeAction(Request $request) @@ -529,7 +501,7 @@ public function thumbnailTreeAction(Request $request) foreach ($items as $item) { $thumbnails[] = [ 'id' => $item->getName(), - 'text' => $item->getName() + 'text' => $item->getName(), ]; } @@ -539,8 +511,6 @@ public function thumbnailTreeAction(Request $request) /** * @Route("/permissions-users", methods={"GET"}) * - * @param Request $request - * * @return JsonResponse */ public function getPermissionUsersAction(Request $request) @@ -573,7 +543,6 @@ public function getPermissionUsersAction(Request $request) /** * @Route("/export", methods={"GET"}) * - * @param Request $request */ public function exportConfiguration(Request $request, ExportService $exportService): Response { @@ -604,8 +573,6 @@ public function exportConfiguration(Request $request, ExportService $exportServi /** * @Route("/import", methods={"POST"}) * - * @param Request $request - * @param ImportService $importService */ public function importConfiguration(Request $request, ImportService $importService): JsonResponse { @@ -616,7 +583,7 @@ public function importConfiguration(Request $request, ImportService $importServi $response = $this->jsonResponse([ 'success' => true, 'type' => $configuration->getType(), - 'name' => $configuration->getName() + 'name' => $configuration->getName(), ]); // set content-type to text/html, otherwise (when application/json is sent) chrome will complain in // Ext.form.Action.Submit and mark the submission as failed diff --git a/src/Controller/GraphQLExplorerController.php b/src/Controller/GraphQLExplorerController.php index ba32460a..3f299e28 100644 --- a/src/Controller/GraphQLExplorerController.php +++ b/src/Controller/GraphQLExplorerController.php @@ -23,8 +23,6 @@ class GraphQLExplorerController extends AbstractController { /** - * @param RouterInterface $routingService - * @param Request $request * * @return \Symfony\Component\HttpFoundation\Response * @@ -48,7 +46,7 @@ public function explorerAction(RouterInterface $routingService, Request $request $response = $this->render('@PimcoreDataHub/Feature/explorer.html.twig', [ 'graphQLUrl' => $url, - 'tokenHeader' => CheckConsumerPermissionsService::TOKEN_HEADER + 'tokenHeader' => CheckConsumerPermissionsService::TOKEN_HEADER, ]); $response->setPublic(); diff --git a/src/Controller/WebserviceController.php b/src/Controller/WebserviceController.php index a3087658..9e9694fe 100644 --- a/src/Controller/WebserviceController.php +++ b/src/Controller/WebserviceController.php @@ -80,11 +80,6 @@ public function __construct( } /** - * @param Service $service - * @param LocaleServiceInterface $localeService - * @param Factory $modelFactory - * @param Request $request - * @param LongRunningHelper $longRunningHelper * * @return JsonResponse * @@ -135,7 +130,7 @@ public function webonyxAction( try { $schemaConfig = [ - 'query' => $queryType + 'query' => $queryType, ]; if (!$mutationType->isEmpty()) { $schemaConfig['mutation'] = $mutationType; @@ -148,11 +143,12 @@ public function webonyxAction( $schema = new \GraphQL\Type\Schema( [ 'query' => $queryType, - 'mutation' => $mutationType + 'mutation' => $mutationType, ] ); $schema->assertValid(); Logger::error($e); + throw $e; } diff --git a/src/DependencyInjection/Compiler/ImportExportLocatorsPass.php b/src/DependencyInjection/Compiler/ImportExportLocatorsPass.php index a980a1a0..7b0a63db 100644 --- a/src/DependencyInjection/Compiler/ImportExportLocatorsPass.php +++ b/src/DependencyInjection/Compiler/ImportExportLocatorsPass.php @@ -146,10 +146,6 @@ private function createLocatorForTaggedServices( /** * @param string $operationType - * @param ContainerBuilder $container - * @param Definition $definition - * @param string $type - * @param string $tag */ private function buildSupportedGeneralTypes( $operationType, @@ -218,10 +214,6 @@ protected function processDataObjectQueryTypes(ContainerBuilder $container) /** * @param string $operationType - * @param ContainerBuilder $container - * @param Definition $definition - * @param string $type - * @param string $tag */ private function buildSupportedDataObjectDataTypes( $operationType, @@ -332,10 +324,6 @@ protected function processDocumentElementQueryTypes(ContainerBuilder $container) /** * @param string $operationType - * @param ContainerBuilder $container - * @param Definition $definition - * @param string $type - * @param string $tag */ private function buildSupportedDocumentElementDataTypes( $operationType, @@ -396,10 +384,6 @@ protected function processCsFeatureQueryTypes(ContainerBuilder $container) /** * @param string $operationType - * @param ContainerBuilder $container - * @param Definition $definition - * @param string $type - * @param string $tag */ private function buildSupportedCsFeatureDataTypes( $operationType, @@ -449,7 +433,6 @@ private function registerTranslationDataTypes(ContainerBuilder $container) } /** - * @param ContainerBuilder $container * @param string $tag * @param string $methodCall */ diff --git a/src/DependencyInjection/PimcoreDataHubExtension.php b/src/DependencyInjection/PimcoreDataHubExtension.php index f2bd4b42..cbb37591 100644 --- a/src/DependencyInjection/PimcoreDataHubExtension.php +++ b/src/DependencyInjection/PimcoreDataHubExtension.php @@ -25,9 +25,6 @@ class PimcoreDataHubExtension extends Extension implements PrependExtensionInterface { - /** - * {@inheritdoc} - */ public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -67,7 +64,7 @@ public function prepend(ContainerBuilder $container) [ ...ConfigurationHelper::getSymfonyConfigFiles($configDir), ...ConfigurationHelper::getSymfonyConfigFiles($_SERVER['PIMCORE_CONFIG_STORAGE_DIR_DATA_HUB'] ?? ''), - ...$configLocator->locate('config') + ...$configLocator->locate('config'), ]; foreach ($configs as $config) { diff --git a/src/Event/Config/SpecialEntitiesEvent.php b/src/Event/Config/SpecialEntitiesEvent.php index ac2b2565..d137a3e5 100644 --- a/src/Event/Config/SpecialEntitiesEvent.php +++ b/src/Event/Config/SpecialEntitiesEvent.php @@ -21,6 +21,7 @@ class SpecialEntitiesEvent extends Event { protected $specialSettings; + protected $config; public function __construct(array $specialSettings, array $config) diff --git a/src/Event/GraphQL/Model/ExecutorEvent.php b/src/Event/GraphQL/Model/ExecutorEvent.php index fe233e52..08390572 100644 --- a/src/Event/GraphQL/Model/ExecutorEvent.php +++ b/src/Event/GraphQL/Model/ExecutorEvent.php @@ -101,9 +101,7 @@ public function setQuery($query) } /** - * @param Request $request * @param string $query - * @param Schema $schema * @param array $context */ public function __construct(Request $request, $query, Schema $schema, $context) diff --git a/src/Event/GraphQL/Model/ListingEvent.php b/src/Event/GraphQL/Model/ListingEvent.php index dbf067a4..d8ba1679 100644 --- a/src/Event/GraphQL/Model/ListingEvent.php +++ b/src/Event/GraphQL/Model/ListingEvent.php @@ -82,10 +82,8 @@ public function setResolveInfo(ResolveInfo $resolveInfo): void } /** - * @param AbstractListing $listing * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo */ public function __construct(AbstractListing $listing, $args, $context = [], ResolveInfo $resolveInfo = null) { diff --git a/src/Event/GraphQL/Model/MutationTypeEvent.php b/src/Event/GraphQL/Model/MutationTypeEvent.php index a021430e..92b49cc0 100644 --- a/src/Event/GraphQL/Model/MutationTypeEvent.php +++ b/src/Event/GraphQL/Model/MutationTypeEvent.php @@ -74,7 +74,6 @@ public function setContext(array $context): void protected $context; /** - * @param MutationType $mutationType * @param array $config * @param array $context */ diff --git a/src/Event/GraphQL/Model/QueryTypeEvent.php b/src/Event/GraphQL/Model/QueryTypeEvent.php index b019c255..f1a837b9 100644 --- a/src/Event/GraphQL/Model/QueryTypeEvent.php +++ b/src/Event/GraphQL/Model/QueryTypeEvent.php @@ -74,7 +74,6 @@ public function setContext(array $context): void } /** - * @param QueryType $queryType * @param array $config * @param array $context */ diff --git a/src/EventListener/AdminListener.php b/src/EventListener/AdminListener.php index 603cb19a..969512d3 100644 --- a/src/EventListener/AdminListener.php +++ b/src/EventListener/AdminListener.php @@ -29,7 +29,6 @@ public function __construct(array $config) /** * Handles INDEX_ACTION_SETTINGS event and adds custom admin UI settings * - * @param IndexActionSettingsEvent $event */ public function addIndexSettings(IndexActionSettingsEvent $event) { diff --git a/src/EventListener/DataChangeListener.php b/src/EventListener/DataChangeListener.php index a1277ea0..14455cee 100644 --- a/src/EventListener/DataChangeListener.php +++ b/src/EventListener/DataChangeListener.php @@ -28,9 +28,6 @@ class DataChangeListener implements EventSubscriberInterface { - /** - * {@inheritdoc} - */ public static function getSubscribedEvents() { return [ @@ -44,7 +41,6 @@ public static function getSubscribedEvents() } /** - * @param DataObjectEvent $e * * @throws ValidationException */ @@ -61,7 +57,6 @@ public function onObjectUpdate(DataObjectEvent $e) } /** - * @param DataObjectEvent $e * * @throws ValidationException */ @@ -73,7 +68,6 @@ public function onObjectDelete(DataObjectEvent $e) } /** - * @param DocumentEvent $e * * @throws ValidationException */ @@ -90,7 +84,6 @@ public function onDocumentUpdate(DocumentEvent $e) } /** - * @param DocumentEvent $e * * @throws ValidationException */ @@ -102,7 +95,6 @@ public function onDocumentDelete(DocumentEvent $e) } /** - * @param AssetEvent $e * * @throws ValidationException */ @@ -119,7 +111,6 @@ public function onAssetUpdate(AssetEvent $e) } /** - * @param AssetEvent $e * * @throws ValidationException */ diff --git a/src/GraphQL/AssetType/AssetEmbeddedMetaInfoItem.php b/src/GraphQL/AssetType/AssetEmbeddedMetaInfoItem.php index 5cdf1dd1..e689ea2a 100644 --- a/src/GraphQL/AssetType/AssetEmbeddedMetaInfoItem.php +++ b/src/GraphQL/AssetType/AssetEmbeddedMetaInfoItem.php @@ -25,7 +25,6 @@ class AssetEmbeddedMetaInfoItem extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) diff --git a/src/GraphQL/AssetType/AssetFolderType.php b/src/GraphQL/AssetType/AssetFolderType.php index 480329ea..6bebb431 100644 --- a/src/GraphQL/AssetType/AssetFolderType.php +++ b/src/GraphQL/AssetType/AssetFolderType.php @@ -22,7 +22,6 @@ class AssetFolderType extends FolderType { /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -48,9 +47,9 @@ public function build(&$config) 'fullpath' => [ 'type' => Type::string(), 'args' => [ - 'thumbnail' => ['type' => Type::string()] + 'thumbnail' => ['type' => Type::string()], - ] + ], ], 'creationDate' => Type::int(), 'modificationDate' => Type::int(), @@ -59,10 +58,10 @@ public function build(&$config) 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma seperated list of key names' - ] + 'description' => 'comma seperated list of key names', + ], ], - 'resolve' => [$elementResolver, 'resolveProperties'] + 'resolve' => [$elementResolver, 'resolveProperties'], ], 'parent' => [ 'type' => $this, diff --git a/src/GraphQL/AssetType/AssetInputType.php b/src/GraphQL/AssetType/AssetInputType.php index 24e2ad34..13988b1e 100644 --- a/src/GraphQL/AssetType/AssetInputType.php +++ b/src/GraphQL/AssetType/AssetInputType.php @@ -26,7 +26,6 @@ class AssetInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -56,10 +55,10 @@ public function build(&$config) 'name' => Type::nonNull(Type::string()), 'type' => Type::nonNull(Type::string()), 'data' => Type::string(), - 'language' => Type::string() - ] - ])) - ] + 'language' => Type::string(), + ], + ])), + ], ]; } } diff --git a/src/GraphQL/AssetType/AssetMetadataItem.php b/src/GraphQL/AssetType/AssetMetadataItem.php index f23ac3d3..103e4d7d 100644 --- a/src/GraphQL/AssetType/AssetMetadataItem.php +++ b/src/GraphQL/AssetType/AssetMetadataItem.php @@ -25,7 +25,6 @@ class AssetMetadataItem extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -45,7 +44,7 @@ public function build(&$config) 'name' => Type::string(), 'type' => Type::string(), 'data' => Type::string(), - 'language' => Type::string() + 'language' => Type::string(), ]; } } diff --git a/src/GraphQL/AssetType/AssetTreeType.php b/src/GraphQL/AssetType/AssetTreeType.php index cb218b6e..7a42b548 100644 --- a/src/GraphQL/AssetType/AssetTreeType.php +++ b/src/GraphQL/AssetType/AssetTreeType.php @@ -27,11 +27,9 @@ class AssetTreeType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'asset_tree']) @@ -41,7 +39,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'asset } /** - * @return array * * @throws \Exception */ @@ -54,9 +51,6 @@ public function getTypes(): array return $types; } - /** - * @inheritDoc - */ public function resolveType($element, $context, ResolveInfo $info) { if (!$element) { diff --git a/src/GraphQL/AssetType/AssetType.php b/src/GraphQL/AssetType/AssetType.php index cd53fd47..3a69d2dd 100644 --- a/src/GraphQL/AssetType/AssetType.php +++ b/src/GraphQL/AssetType/AssetType.php @@ -32,7 +32,6 @@ class AssetType extends ObjectType protected $fieldname; /** - * @param Service $graphQlService * @param array $config * @param array $context * @@ -84,7 +83,7 @@ public function build(&$config) $resolutionsArgumentsType = [ 'type' => Type::listOf(Type::float()), 'description' => 'List of resolution types [2, 5, ...]', - 'defaultValue' => [2] + 'defaultValue' => [2], ]; $config['fields'] = [ @@ -98,7 +97,7 @@ public function build(&$config) 'type' => Type::string(), 'args' => [ 'thumbnail' => ['type' => Type::string()], - 'format' => ['type' => Type::string()] + 'format' => ['type' => Type::string()], ], 'resolve' => [$resolver, 'resolvePath'], ], @@ -107,7 +106,7 @@ public function build(&$config) 'args' => [ 'thumbnail' => ['type' => Type::nonNull(Type::string())], 'format' => ['type' => Type::string()], - 'types' => $resolutionsArgumentsType + 'types' => $resolutionsArgumentsType, ], 'resolve' => [$resolver, 'resolveResolutions'], ], @@ -115,7 +114,7 @@ public function build(&$config) 'type' => $dimensionsType, 'args' => [ 'thumbnail' => ['type' => Type::string()], - 'format' => ['type' => Type::string()] + 'format' => ['type' => Type::string()], ], 'resolve' => [$resolver, 'resolveDimensions'], ], @@ -136,11 +135,11 @@ public function build(&$config) ], 'resolve' => [$resolver, 'resolveResolutions'], ], - ] + ], ])), 'args' => [ 'thumbnail' => ['type' => Type::nonNull(Type::string())], - 'format' => ['type' => Type::string()] + 'format' => ['type' => Type::string()], ], 'resolve' => [$resolver, 'resolveSrcSet'], ], @@ -152,7 +151,7 @@ public function build(&$config) 'type' => Type::string(), 'args' => [ 'thumbnail' => ['type' => Type::string()], - 'format' => ['type' => Type::string()] + 'format' => ['type' => Type::string()], ], 'resolve' => [$resolver, 'resolveData'], ], @@ -161,29 +160,29 @@ public function build(&$config) 'args' => [ 'name' => ['type' => Type::string()], ], - 'resolve' => [$resolver, 'resolveTag'] + 'resolve' => [$resolver, 'resolveTag'], ], 'metadata' => [ 'type' => Type::listOf($assetMetadataItemType), 'args' => [ 'language' => ['type' => Type::string()], - 'ignore_language' => ['type' => Type::boolean()] + 'ignore_language' => ['type' => Type::boolean()], ], - 'resolve' => [$resolver, 'resolveMetadata'] + 'resolve' => [$resolver, 'resolveMetadata'], ], 'embeddedMetaInfo' => [ 'type' => Type::listOf($assetEmbeddedMetaInfoItemType), - 'resolve' => [$resolver, 'resolveEmbeddedMetaInfo'] + 'resolve' => [$resolver, 'resolveEmbeddedMetaInfo'], ], 'properties' => [ 'type' => Type::listOf($propertyType), 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma separated list of key names' - ] + 'description' => 'comma separated list of key names', + ], ], - 'resolve' => [$elementResolver, 'resolveProperties'] + 'resolve' => [$elementResolver, 'resolveProperties'], ], 'parent' => [ 'type' => $assetTree, diff --git a/src/GraphQL/ClassTypeDefinitions.php b/src/GraphQL/ClassTypeDefinitions.php index ea93c8b5..3cbc3776 100644 --- a/src/GraphQL/ClassTypeDefinitions.php +++ b/src/GraphQL/ClassTypeDefinitions.php @@ -30,7 +30,6 @@ class ClassTypeDefinitions public static $definitions = []; /** - * @param Service $graphQlService * @param array $context */ public static function build(Service $graphQlService, $context = []) diff --git a/src/GraphQL/ClassificationstoreFeatureType/BooleanSelectType.php b/src/GraphQL/ClassificationstoreFeatureType/BooleanSelectType.php index d02b58b1..05a31c9b 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/BooleanSelectType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/BooleanSelectType.php @@ -38,14 +38,14 @@ public static function getInstance() if ($value instanceof FeatureDescriptor) { return $value->getValue(); } - } + }, ]; $config = [ 'name' => 'csFeatureBooleanSelect', 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance = new static($config); diff --git a/src/GraphQL/ClassificationstoreFeatureType/CheckboxType.php b/src/GraphQL/ClassificationstoreFeatureType/CheckboxType.php index 0b90b8e3..b83e6af1 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/CheckboxType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/CheckboxType.php @@ -38,14 +38,14 @@ public static function getInstance() if ($value instanceof FeatureDescriptor) { return $value->getValue(); } - } + }, ]; $config = [ 'name' => 'csFeatureCheckbox', 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance = new static($config); diff --git a/src/GraphQL/ClassificationstoreFeatureType/DateType.php b/src/GraphQL/ClassificationstoreFeatureType/DateType.php index f8dc9f02..06df90be 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/DateType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/DateType.php @@ -39,8 +39,8 @@ public static function getInstance() 'args' => [ ['name' => 'format', 'type' => Type::string(), - 'description' => 'see Carbon::format' - ] + 'description' => 'see Carbon::format', + ], ], 'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) { if ($value instanceof FeatureDescriptor) { @@ -56,14 +56,14 @@ public static function getInstance() return $formattedValue; } } - } + }, ]; $config = [ 'name' => 'csFeatureDate', 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance = new static($config); diff --git a/src/GraphQL/ClassificationstoreFeatureType/Helper.php b/src/GraphQL/ClassificationstoreFeatureType/Helper.php index 201e6eeb..42549f99 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/Helper.php +++ b/src/GraphQL/ClassificationstoreFeatureType/Helper.php @@ -35,7 +35,7 @@ public static function getCommonFields() if ($value instanceof FeatureDescriptor) { return $value->getId(); } - } + }, ], 'name' => [ 'type' => Type::string(), @@ -46,7 +46,7 @@ public static function getCommonFields() return $keyConfig->getName(); } } - } + }, ], 'description' => [ 'type' => Type::string(), @@ -57,7 +57,7 @@ public static function getCommonFields() return $keyConfig->getDescription(); } } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -65,8 +65,8 @@ public static function getCommonFields() if ($value instanceof FeatureDescriptor) { return $value->getType(); } - } - ] + }, + ], ]; return $fields; diff --git a/src/GraphQL/ClassificationstoreFeatureType/MultiselectType.php b/src/GraphQL/ClassificationstoreFeatureType/MultiselectType.php index 5e7301b8..c5327e47 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/MultiselectType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/MultiselectType.php @@ -27,8 +27,6 @@ class MultiselectType extends ObjectType protected static $instance = []; /** - * @param Service $service - * @param string $name * @param string $fieldname * * @return MultiselectType @@ -44,14 +42,14 @@ public static function getInstance(Service $service, string $name, $fieldname = if ($value instanceof FeatureDescriptor) { return $value->getValue(); } - } + }, ]; $config = [ 'name' => $name, 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance[$name] = new static($config); } diff --git a/src/GraphQL/ClassificationstoreFeatureType/QuantityValueType.php b/src/GraphQL/ClassificationstoreFeatureType/QuantityValueType.php index 82828642..0c995a12 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/QuantityValueType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/QuantityValueType.php @@ -26,10 +26,6 @@ class QuantityValueType extends ObjectType protected static $instance = []; /** - * @param Service $service - * @param string $name - * @param string $innerType - * @param string $fieldname * * @return mixed * @@ -47,14 +43,14 @@ public static function getInstance(Service $service, string $name, string $inner if ($value instanceof FeatureDescriptor) { return $value->getValue(); } - } + }, ]; $config = [ 'name' => $name, 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance[$name] = new static($config); } diff --git a/src/GraphQL/ClassificationstoreFeatureType/StringType.php b/src/GraphQL/ClassificationstoreFeatureType/StringType.php index ffca7909..c8bf7f91 100644 --- a/src/GraphQL/ClassificationstoreFeatureType/StringType.php +++ b/src/GraphQL/ClassificationstoreFeatureType/StringType.php @@ -26,8 +26,6 @@ class StringType extends ObjectType protected static $instance = []; /** - * @param string $name - * @param string $valueField * * @return StringType */ @@ -41,14 +39,14 @@ public static function getInstance(string $name, string $valueField) if ($value instanceof FeatureDescriptor) { return $value->getValue(); } - } + }, ]; $config = [ 'name' => $name, 'interfaces' => [CsFeature::getInstance()], - 'fields' => $fields + 'fields' => $fields, ]; self::$instance[$name] = new static($config); diff --git a/src/GraphQL/ClassificationstoreType/Feature.php b/src/GraphQL/ClassificationstoreType/Feature.php index a3ee6ab1..a64a6198 100644 --- a/src/GraphQL/ClassificationstoreType/Feature.php +++ b/src/GraphQL/ClassificationstoreType/Feature.php @@ -27,11 +27,9 @@ class Feature extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'csFeature']) @@ -42,7 +40,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'csFea } /** - * @return array * * @throws \Exception */ @@ -60,9 +57,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if (!$element instanceof FeatureDescriptor) { diff --git a/src/GraphQL/ClassificationstoreType/Group.php b/src/GraphQL/ClassificationstoreType/Group.php index 7abf94a3..53584b9c 100644 --- a/src/GraphQL/ClassificationstoreType/Group.php +++ b/src/GraphQL/ClassificationstoreType/Group.php @@ -31,8 +31,6 @@ class Group extends ObjectType protected $featureType; /** - * @param Service $graphQlService - * @param Feature $featuresType * @param array $config * @param array $context */ @@ -97,8 +95,8 @@ public function build(&$config) } return $result; - } - ] + }, + ], ]; } } diff --git a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php index b64091e4..8c535f0f 100644 --- a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyObjectRelation.php @@ -32,7 +32,6 @@ class AdvancedManyToManyObjectRelation extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyRelation.php b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyRelation.php index ee0752ea..2627cd6e 100644 --- a/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/AdvancedManyToManyRelation.php @@ -32,7 +32,6 @@ class AdvancedManyToManyRelation extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/Base.php b/src/GraphQL/DataObjectInputProcessor/Base.php index fe77125b..cf2ec64d 100644 --- a/src/GraphQL/DataObjectInputProcessor/Base.php +++ b/src/GraphQL/DataObjectInputProcessor/Base.php @@ -49,7 +49,6 @@ public function getAttribute() * @param mixed $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ @@ -64,7 +63,6 @@ public function process($object, $newValue, $args, $context, ResolveInfo $info) /** * @param array $nodeDef - * @param ClassDefinition $class * * @return mixed */ diff --git a/src/GraphQL/DataObjectInputProcessor/BaseOperator.php b/src/GraphQL/DataObjectInputProcessor/BaseOperator.php index bb19b6a7..318455cf 100644 --- a/src/GraphQL/DataObjectInputProcessor/BaseOperator.php +++ b/src/GraphQL/DataObjectInputProcessor/BaseOperator.php @@ -34,7 +34,6 @@ public function __construct($nodeDef) * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info */ public function process($object, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DataObjectInputProcessor/Date.php b/src/GraphQL/DataObjectInputProcessor/Date.php index e86d2426..c4a296df 100644 --- a/src/GraphQL/DataObjectInputProcessor/Date.php +++ b/src/GraphQL/DataObjectInputProcessor/Date.php @@ -28,7 +28,6 @@ class Date extends Base * @param int|string $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/ExternalImage.php b/src/GraphQL/DataObjectInputProcessor/ExternalImage.php index 4676017e..c194618c 100644 --- a/src/GraphQL/DataObjectInputProcessor/ExternalImage.php +++ b/src/GraphQL/DataObjectInputProcessor/ExternalImage.php @@ -27,7 +27,6 @@ class ExternalImage extends Base * @param string $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/Fieldcollections.php b/src/GraphQL/DataObjectInputProcessor/Fieldcollections.php index cf12bc43..9e61d78d 100644 --- a/src/GraphQL/DataObjectInputProcessor/Fieldcollections.php +++ b/src/GraphQL/DataObjectInputProcessor/Fieldcollections.php @@ -38,7 +38,6 @@ public function __construct(array $nodeDef, array $processors) * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/Geopoint.php b/src/GraphQL/DataObjectInputProcessor/Geopoint.php index ea2ed847..1917e4c8 100644 --- a/src/GraphQL/DataObjectInputProcessor/Geopoint.php +++ b/src/GraphQL/DataObjectInputProcessor/Geopoint.php @@ -27,7 +27,6 @@ class Geopoint extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php b/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php index 54fb524b..12e9c8a9 100644 --- a/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php +++ b/src/GraphQL/DataObjectInputProcessor/IfEmptyOperator.php @@ -35,7 +35,6 @@ public function __construct($nodeDef) * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @return void|null * diff --git a/src/GraphQL/DataObjectInputProcessor/Image.php b/src/GraphQL/DataObjectInputProcessor/Image.php index 1426e9a4..5aaa539a 100644 --- a/src/GraphQL/DataObjectInputProcessor/Image.php +++ b/src/GraphQL/DataObjectInputProcessor/Image.php @@ -30,7 +30,6 @@ class Image extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @return void|null * diff --git a/src/GraphQL/DataObjectInputProcessor/ImageGallery.php b/src/GraphQL/DataObjectInputProcessor/ImageGallery.php index 4a8b4e26..b06ae760 100644 --- a/src/GraphQL/DataObjectInputProcessor/ImageGallery.php +++ b/src/GraphQL/DataObjectInputProcessor/ImageGallery.php @@ -28,7 +28,6 @@ class ImageGallery extends Base * @param mixed $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/InputQuantityValue.php b/src/GraphQL/DataObjectInputProcessor/InputQuantityValue.php index 3a86426e..e3b6a8b2 100644 --- a/src/GraphQL/DataObjectInputProcessor/InputQuantityValue.php +++ b/src/GraphQL/DataObjectInputProcessor/InputQuantityValue.php @@ -27,7 +27,6 @@ class InputQuantityValue extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/Link.php b/src/GraphQL/DataObjectInputProcessor/Link.php index 59f6e3f3..d9bd4c0f 100644 --- a/src/GraphQL/DataObjectInputProcessor/Link.php +++ b/src/GraphQL/DataObjectInputProcessor/Link.php @@ -27,7 +27,6 @@ class Link extends Base * @param mixed $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/LocaleCollectorOperator.php b/src/GraphQL/DataObjectInputProcessor/LocaleCollectorOperator.php index 5c45b6fb..c3cea652 100644 --- a/src/GraphQL/DataObjectInputProcessor/LocaleCollectorOperator.php +++ b/src/GraphQL/DataObjectInputProcessor/LocaleCollectorOperator.php @@ -26,7 +26,6 @@ class LocaleCollectorOperator extends BaseOperator * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info */ public function process($object, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DataObjectInputProcessor/LocaleSwitcherOperator.php b/src/GraphQL/DataObjectInputProcessor/LocaleSwitcherOperator.php index 8b986d23..68a1b45d 100644 --- a/src/GraphQL/DataObjectInputProcessor/LocaleSwitcherOperator.php +++ b/src/GraphQL/DataObjectInputProcessor/LocaleSwitcherOperator.php @@ -37,7 +37,6 @@ public function __construct($nodeDef) * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info */ public function process($object, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DataObjectInputProcessor/ManyToManyObjectRelation.php b/src/GraphQL/DataObjectInputProcessor/ManyToManyObjectRelation.php index a441bda6..64f9078b 100644 --- a/src/GraphQL/DataObjectInputProcessor/ManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/ManyToManyObjectRelation.php @@ -32,7 +32,6 @@ class ManyToManyObjectRelation extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php b/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php index 0f5e39f6..22c53ab1 100644 --- a/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/ManyToManyRelation.php @@ -31,7 +31,6 @@ class ManyToManyRelation extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php b/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php index aba68702..bc3ff426 100644 --- a/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php +++ b/src/GraphQL/DataObjectInputProcessor/ManyToOneRelation.php @@ -31,7 +31,6 @@ class ManyToOneRelation extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/QuantityValue.php b/src/GraphQL/DataObjectInputProcessor/QuantityValue.php index e4f14889..2b9831c7 100644 --- a/src/GraphQL/DataObjectInputProcessor/QuantityValue.php +++ b/src/GraphQL/DataObjectInputProcessor/QuantityValue.php @@ -27,7 +27,6 @@ class QuantityValue extends Base * @param array $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectInputProcessor/Table.php b/src/GraphQL/DataObjectInputProcessor/Table.php index 8c16ce75..78bf8ea0 100644 --- a/src/GraphQL/DataObjectInputProcessor/Table.php +++ b/src/GraphQL/DataObjectInputProcessor/Table.php @@ -27,10 +27,6 @@ class Table extends Base */ protected $processors; - /** - * @param array $nodeDef - * @param array $processors - */ public function __construct(array $nodeDef, array $processors) { parent::__construct($nodeDef); @@ -42,7 +38,6 @@ public function __construct(array $nodeDef, array $processors) * @param mixed $newValue * @param array $args * @param array $context - * @param ResolveInfo $info * * @throws \Exception */ diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyObjectRelation.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyObjectRelation.php index b0d1cb09..68753cc1 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyObjectRelation.php @@ -22,6 +22,7 @@ class AdvancedManyToManyObjectRelation extends Base { protected $elementInputType; + protected $fieldDefinition; public function __construct(Service $graphQlService, ElementDescriptorInputType $elementInputType) @@ -40,7 +41,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => ['type' => Type::listOf($inputType)], - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyRelation.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyRelation.php index ab34f458..0bd3c96d 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyRelation.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/AdvancedManyToManyRelation.php @@ -22,6 +22,7 @@ class AdvancedManyToManyRelation extends Base { protected $elementInputType; + protected $fieldDefinition; public function __construct(Service $graphQlService, ElementDescriptorInputType $elementInputType) @@ -40,7 +41,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => ['type' => Type::listOf($inputType)], - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Base.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Base.php index e2fe9d40..5d9a5cd4 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Base.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Base.php @@ -45,7 +45,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::string(), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/BooleanSelect.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/BooleanSelect.php index 20c25811..e95ad3a9 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/BooleanSelect.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/BooleanSelect.php @@ -27,7 +27,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::boolean(), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Checkbox.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Checkbox.php index 074378a8..e0ad0415 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Checkbox.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Checkbox.php @@ -27,7 +27,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::boolean(), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php index c32b63eb..37103763 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Date.php @@ -28,7 +28,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::string(), 'processor' => [$processor, 'process'], - 'description' => 'Either as unix timestamp (as string) or date string' + 'description' => 'Either as unix timestamp (as string) or date string', ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ExternalImage.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ExternalImage.php index 03bd496e..098a32c7 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ExternalImage.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ExternalImage.php @@ -28,7 +28,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::string(), 'processor' => [$processor, 'process'], - 'description' => 'External Image URL' + 'description' => 'External Image URL', ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Fieldcollections.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Fieldcollections.php index e1c45170..cd817ca5 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Fieldcollections.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Fieldcollections.php @@ -64,7 +64,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul // groups $listItemType = new InputObjectType([ 'name' => $listInputTypeName, - 'fields' => $inputFields + 'fields' => $inputFields, ]); $groupsInputFields[$allowedFcType] = Type::listOf($listItemType); $fieldProcessors[$allowedFcType] = $processors; @@ -72,7 +72,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul $groupsInputType = new InputObjectType([ 'name' => $groupsInputTypeName, - 'fields' => $groupsInputFields + 'fields' => $groupsInputFields, ]); $inputTypeName = 'fieldcollections_' . $fieldName . '_input'; @@ -85,10 +85,10 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul 'fields' => [ 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true then the entire item list will be overwritten' + 'description' => 'if true then the entire item list will be overwritten', ], - 'items' => $groupsInputType - ] + 'items' => $groupsInputType, + ], ]); self::$typeCache[$inputTypeName] = $inputType; } @@ -98,14 +98,13 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $inputType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } /** * @param array $inputFields * @param array $processors - * @param Definition $fcDef */ public function generateInputFieldsAndProcessors(&$inputFields, &$processors, Definition $fcDef) { @@ -121,8 +120,8 @@ public function generateInputFieldsAndProcessors(&$inputFields, &$processors, De 'attribute' => $localizedDef->getName(), 'label' => $localizedDef->getTitle() ?? $localizedDef->getName(), 'dataType' => $localizedDef->getFieldtype(), - 'layout' => $localizedDef - ] + 'layout' => $localizedDef, + ], ]; $result = $fieldHelper->getMutationFieldConfigFromConfig($nodeDef, $fcDef); if ($result) { @@ -137,8 +136,8 @@ public function generateInputFieldsAndProcessors(&$inputFields, &$processors, De 'attribute' => $fcFieldDef->getName(), 'label' => $fcFieldDef->getTitle() ?? $fcFieldDef->getName(), 'dataType' => $fcFieldDef->getFieldtype(), - 'layout' => $fcFieldDef - ] + 'layout' => $fcFieldDef, + ], ]; $result = $fieldHelper->getMutationFieldConfigFromConfig($nodeDef, $fcDef); diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php index 8ccdc2e8..309652e4 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Geopoint.php @@ -25,7 +25,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('geopoint_input'), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Image.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Image.php index 17fc505a..683ceaa4 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Image.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Image.php @@ -26,7 +26,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('image_input'), 'processor' => [$processor, 'process'], - 'description' => 'Asset ID' + 'description' => 'Asset ID', ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ImageGallery.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ImageGallery.php index 91cf7ec4..53896285 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ImageGallery.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ImageGallery.php @@ -29,8 +29,8 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul $imageInput = new InputObjectType([ 'name' => 'GalleryImageInput', 'fields' => [ - 'id' => Type::int() - ] + 'id' => Type::int(), + ], ]); $inputType = new InputObjectType([ @@ -38,17 +38,17 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul 'fields' => [ 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true then the entire gallery list will be overwritten' + 'description' => 'if true then the entire gallery list will be overwritten', ], 'images' => [ - 'type' => Type::listOf($imageInput) - ] - ] + 'type' => Type::listOf($imageInput), + ], + ], ]); return [ 'arg' => $inputType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/InputQuantityValue.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/InputQuantityValue.php index 8d9b1841..3ebe6e01 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/InputQuantityValue.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/InputQuantityValue.php @@ -25,7 +25,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('input_quantity_value_input'), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Link.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Link.php index d4ab61bb..41ef7eab 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Link.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Link.php @@ -25,7 +25,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('link_input'), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyObjectRelation.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyObjectRelation.php index 7437ba47..27da9d65 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyObjectRelation.php @@ -39,7 +39,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => ['type' => Type::listOf($inputType)], - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyRelation.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyRelation.php index b8cc6c4d..c61b5160 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyRelation.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToManyRelation.php @@ -39,7 +39,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => ['type' => Type::listOf($inputType)], - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToOneRelation.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToOneRelation.php index 00b8bf5b..5df7756f 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToOneRelation.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/ManyToOneRelation.php @@ -25,7 +25,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('elementdescriptor_input'), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Multiselect.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Multiselect.php index 3a142167..4f0caef6 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Multiselect.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Multiselect.php @@ -27,7 +27,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => Type::listOf(Type::string()), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Numeric.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Numeric.php index 7636fad3..35fcd220 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Numeric.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Numeric.php @@ -38,7 +38,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $type, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/QuantityValue.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/QuantityValue.php index bf3466d3..0373ab3f 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/QuantityValue.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/QuantityValue.php @@ -25,7 +25,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul return [ 'arg' => $this->getGraphQlService()->getDataObjectTypeDefinition('quantity_value_input'), - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Table.php b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Table.php index 47cf8a68..bf7f7725 100644 --- a/src/GraphQL/DataObjectMutationFieldConfigGenerator/Table.php +++ b/src/GraphQL/DataObjectMutationFieldConfigGenerator/Table.php @@ -44,7 +44,7 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul $rowInput = new InputObjectType([ 'name' => 'RowInput', - 'fields' => $inputItems + 'fields' => $inputItems, ]); $inputType = new InputObjectType([ @@ -52,17 +52,17 @@ public function getGraphQlMutationFieldConfig($nodeDef, $class, $container = nul 'fields' => [ 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true then the entire table will be overwritten' + 'description' => 'if true then the entire table will be overwritten', ], 'rows' => [ - 'type' => Type::listOf($rowInput) - ] - ] + 'type' => Type::listOf($rowInput), + ], + ], ]); return [ 'arg' => $inputType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } diff --git a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/Base.php b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/Base.php index df33aa5b..96f4e0b8 100644 --- a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/Base.php +++ b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/Base.php @@ -30,7 +30,6 @@ public function __construct(Service $graphQlService) /** * @param array $nodeDef - * @param ClassDefinition $class * * @return mixed */ @@ -82,7 +81,7 @@ public function getGraphQlMutationOperatorConfig($nodeDef, $class = null, $conta return [ 'arg' => $determinedType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php index 853fa17e..cd9360d1 100644 --- a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php +++ b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/IfEmpty.php @@ -39,7 +39,7 @@ public function getGraphQlMutationOperatorConfig($nodeDef, $class = null, $conta return [ 'arg' => $determinedType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleCollector.php b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleCollector.php index aac0e05c..7c9803e2 100644 --- a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleCollector.php +++ b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleCollector.php @@ -43,7 +43,7 @@ public function getGraphQlMutationOperatorConfig($nodeDef, $class = null, $conta return [ 'arg' => $determinedType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleSwitcher.php b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleSwitcher.php index b96a0337..2a93a67a 100644 --- a/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleSwitcher.php +++ b/src/GraphQL/DataObjectMutationOperatorConfigGenerator/LocaleSwitcher.php @@ -39,7 +39,7 @@ public function getGraphQlMutationOperatorConfig($nodeDef, $class = null, $conta return [ 'arg' => $determinedType, - 'processor' => [$processor, 'process'] + 'processor' => [$processor, 'process'], ]; } } diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/AbstractTable.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/AbstractTable.php index 597287dc..3e716bbc 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/AbstractTable.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/AbstractTable.php @@ -29,7 +29,6 @@ abstract class AbstractTable extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -69,12 +68,11 @@ function ($k) { } return $rows; - } + }, ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|FieldcollectionDefinition|null $class * @param object|null $container * @@ -98,7 +96,7 @@ public function getFieldType(Data $fieldDefinition, $class = null, $container = $type = new ObjectType( [ 'name' => $name, - 'fields' => $columns + 'fields' => $columns, ] ); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/AssetBase.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/AssetBase.php index e47c3d8c..3b0145bb 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/AssetBase.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/AssetBase.php @@ -22,7 +22,6 @@ class AssetBase extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -39,14 +38,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Base.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Base.php index 1eedef2c..df408c39 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Base.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Base.php @@ -34,7 +34,6 @@ public function __construct(Service $graphQlService) /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -44,7 +43,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } @@ -62,7 +61,7 @@ public function enrichConfig($fieldDefinition, $class, $attribute, $graphQLConfi if ($container instanceof Data\Localizedfields) { $graphQLConfig['args'] = $graphQLConfig['args'] ?? []; $graphQLConfig['args'] = array_merge($graphQLConfig['args'], - ['language' => ['type' => Type::string()] + ['language' => ['type' => Type::string()], ]); } @@ -76,7 +75,6 @@ public function enrichConfig($fieldDefinition, $class, $attribute, $graphQLConfi } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Block.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Block.php index 8b3db209..5f36b28a 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Block.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Block.php @@ -31,7 +31,6 @@ class Block extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -47,7 +46,6 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/CalculatedValue.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/CalculatedValue.php index 67c33ace..4082dc31 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/CalculatedValue.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/CalculatedValue.php @@ -27,7 +27,6 @@ class CalculatedValue extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -42,7 +41,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'description' => $fieldDefinition->getTooltip() + 'description' => $fieldDefinition->getTooltip(), ], $container ); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Checkbox.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Checkbox.php index c8f3c555..9429d7f2 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Checkbox.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Checkbox.php @@ -23,7 +23,6 @@ class Checkbox extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Classificationstore.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Classificationstore.php index 05c45011..b14ab3b1 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Classificationstore.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Classificationstore.php @@ -26,7 +26,6 @@ class Classificationstore extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -62,18 +61,17 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class 'name' => $groupConfig->getName(), 'description' => $groupConfig->getDescription(), '_csValue' => $csField, - '_language' => $language + '_language' => $language, ]; } } return $result; - } + }, ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geobounds.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geobounds.php index e80312aa..03a469d8 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geobounds.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geobounds.php @@ -23,7 +23,6 @@ class Geobounds extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopoint.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopoint.php index 726a51b6..df06215a 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopoint.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopoint.php @@ -23,7 +23,6 @@ class Geopoint extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolygon.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolygon.php index d2b774c5..82792ba9 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolygon.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Geopolygon.php @@ -25,7 +25,6 @@ class Geopolygon extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -35,12 +34,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/AssetBase.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/AssetBase.php index 07f85fa3..9a0c6059 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/AssetBase.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/AssetBase.php @@ -44,7 +44,6 @@ class AssetBase public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -61,7 +60,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Base.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Base.php index ffaf51dc..7984cb4a 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Base.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Base.php @@ -42,7 +42,6 @@ class Base public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -59,7 +58,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return mixed * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Hotspotimage.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Hotspotimage.php index c788e478..2b42edc8 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Hotspotimage.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Hotspotimage.php @@ -51,9 +51,7 @@ class Hotspotimage public $attribute; /** - * @param Service $graphQlService * @param string $attribute - * @param ClassDefinition\Data\Hotspotimage $fieldDefinition * @param ClassDefinition|Fieldcollection\Definition $class */ public function __construct( @@ -72,7 +70,6 @@ public function __construct( * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Href.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Href.php index 30015a41..86e23cc0 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Href.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Href.php @@ -44,7 +44,6 @@ class Href public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -62,7 +61,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Image.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Image.php index 409e3ee3..d4a7e187 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Image.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Image.php @@ -44,7 +44,6 @@ class Image public $attribute; /** - * @param \Pimcore\Bundle\DataHubBundle\GraphQL\Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -62,7 +61,6 @@ public function __construct(\Pimcore\Bundle\DataHubBundle\GraphQL\Service $graph * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ImageGallery.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ImageGallery.php index faf63dec..7f4315bc 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ImageGallery.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ImageGallery.php @@ -53,9 +53,7 @@ class ImageGallery public $attribute; /** - * @param GraphQlService $graphQlService * @param string $attribute - * @param ClassDefinition\Data\ImageGallery $fieldDefinition * @param ClassDefinition|Fieldcollection\Definition $class */ public function __construct( @@ -74,7 +72,6 @@ public function __construct( * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor[]|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Multihref.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Multihref.php index 32aec412..b88e197a 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Multihref.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Multihref.php @@ -44,7 +44,6 @@ class Multihref public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param ClassDefinition\Data $fieldDefinition * @param ClassDefinition $class @@ -61,7 +60,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor[]|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/MultihrefMetadata.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/MultihrefMetadata.php index 590a0a54..b3cae69a 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/MultihrefMetadata.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/MultihrefMetadata.php @@ -45,7 +45,6 @@ class MultihrefMetadata public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -62,7 +61,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Objects.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Objects.php index 45b273d2..dd0374a3 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Objects.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/Objects.php @@ -44,7 +44,6 @@ class Objects public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -61,7 +60,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ObjectsMetadata.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ObjectsMetadata.php index 1ac5b36b..88a80738 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ObjectsMetadata.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ObjectsMetadata.php @@ -44,7 +44,6 @@ class ObjectsMetadata public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param ClassDefinition\Data $fieldDefinition * @param ClassDefinition $class @@ -61,7 +60,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ReverseManyToManyObjects.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ReverseManyToManyObjects.php index 139ddb06..4f2bf780 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ReverseManyToManyObjects.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Helper/ReverseManyToManyObjects.php @@ -45,7 +45,6 @@ class ReverseManyToManyObjects public $attribute; /** - * @param Service $graphQlService * @param string $attribute * @param Data $fieldDefinition * @param ClassDefinition $class @@ -62,7 +61,6 @@ public function __construct(Service $graphQlService, $attribute, $fieldDefinitio * @param BaseDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Hotspotimage.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Hotspotimage.php index 9e54063e..c17a9e9d 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Hotspotimage.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Hotspotimage.php @@ -30,7 +30,6 @@ class Hotspotimage extends Base /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -45,14 +44,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Href.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Href.php index 6fef5154..0e0e58b2 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Href.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Href.php @@ -23,7 +23,6 @@ class Href extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -34,12 +33,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ImageGallery.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ImageGallery.php index eaa300f4..f131b3e8 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ImageGallery.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ImageGallery.php @@ -31,7 +31,6 @@ class ImageGallery extends Base /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -49,14 +48,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/InputQuantityValue.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/InputQuantityValue.php index 76d5b901..71797e0e 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/InputQuantityValue.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/InputQuantityValue.php @@ -19,10 +19,6 @@ class InputQuantityValue extends Base { - /** - * @inheritdoc - * - */ public function getFieldType(Data $fieldDefinition, $class = null, $container = null) { return $this->getGraphQlService()->getDataObjectTypeDefinition('input_quantity_value'); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php index ece938bb..b7918936 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Link.php @@ -23,7 +23,6 @@ class Link extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -34,12 +33,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'columnConfig' => $attribute, 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multihref.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multihref.php index 6cf5993c..c7063c15 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multihref.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multihref.php @@ -30,7 +30,6 @@ class Multihref extends Base implements TypeDefinitionInterface { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -42,14 +41,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/MultihrefMetadata.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/MultihrefMetadata.php index 5aba5cea..25665558 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/MultihrefMetadata.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/MultihrefMetadata.php @@ -24,7 +24,6 @@ class MultihrefMetadata extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -36,14 +35,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multiselect.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multiselect.php index 321512ed..b90c52c5 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multiselect.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Multiselect.php @@ -23,7 +23,6 @@ class Multiselect extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Numeric.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Numeric.php index a3ac4fc1..60b4af8b 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Numeric.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Numeric.php @@ -23,7 +23,6 @@ class Numeric extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Objects.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Objects.php index e5a9517a..dad1f8e1 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Objects.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Objects.php @@ -30,7 +30,6 @@ class Objects extends Base implements TypeDefinitionInterface { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -45,14 +44,13 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ObjectsMetadata.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ObjectsMetadata.php index 321d9e4e..b199105f 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ObjectsMetadata.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ObjectsMetadata.php @@ -25,7 +25,6 @@ class ObjectsMetadata extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -38,7 +37,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/QuantityValue.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/QuantityValue.php index 3b0a09e5..f200de8b 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/QuantityValue.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/QuantityValue.php @@ -19,10 +19,6 @@ class QuantityValue extends Base { - /** - * @inheritdoc - * - */ public function getFieldType(Data $fieldDefinition, $class = null, $container = null) { return $this->getGraphQlService()->getDataObjectTypeDefinition('quantity_value'); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ReverseManyToManyObjectRelation.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ReverseManyToManyObjectRelation.php index e9eab66e..6a3a43c2 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/ReverseManyToManyObjectRelation.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/ReverseManyToManyObjectRelation.php @@ -24,7 +24,6 @@ class ReverseManyToManyObjectRelation extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -40,7 +39,7 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class [ 'name' => $fieldDefinition->getName(), 'type' => $this->getFieldType($fieldDefinition, $class, $container), - 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class) + 'resolve' => $this->getResolver($attribute, $fieldDefinition, $class), ], $container ); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Slider.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Slider.php index f5b62182..8a6ca09c 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Slider.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Slider.php @@ -23,7 +23,6 @@ class Slider extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -33,12 +32,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/StructuredTable.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/StructuredTable.php index a47d45a9..74d9f4e9 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/StructuredTable.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/StructuredTable.php @@ -30,9 +30,11 @@ protected function getTableColumns(Data $fieldDefinition): array switch ($columnConfig['type']) { case 'number': $type = Type::float(); + break; case 'bool': $type = Type::boolean(); + break; case 'text': default: diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/UrlSlug.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/UrlSlug.php index fdc87ba9..e530287b 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/UrlSlug.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/UrlSlug.php @@ -20,10 +20,6 @@ class UrlSlug extends Base { - /** - * @inheritdoc - * - */ public function getFieldType(Data $fieldDefinition, $class = null, $container = null) { return Type::listOf($this->getGraphQlService()->getDataObjectTypeDefinition('url_slug')); diff --git a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Video.php b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Video.php index 670a0faa..54f426dc 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGenerator/Video.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGenerator/Video.php @@ -22,7 +22,6 @@ class Video extends Base { /** * @param string $attribute - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * @@ -32,12 +31,11 @@ public function getGraphQlFieldConfig($attribute, Data $fieldDefinition, $class { return $this->enrichConfig($fieldDefinition, $class, $attribute, [ 'name' => $fieldDefinition->getName(), - 'type' => $this->getFieldType($fieldDefinition, $class, $container) + 'type' => $this->getFieldType($fieldDefinition, $class, $container), ], $container); } /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryFieldConfigGeneratorInterface.php b/src/GraphQL/DataObjectQueryFieldConfigGeneratorInterface.php index 9fec6faf..ad4465f1 100644 --- a/src/GraphQL/DataObjectQueryFieldConfigGeneratorInterface.php +++ b/src/GraphQL/DataObjectQueryFieldConfigGeneratorInterface.php @@ -22,7 +22,6 @@ interface DataObjectQueryFieldConfigGeneratorInterface { /** * @param string $columnConfig - * @param Data $fieldDefinition * @param ClassDefinition $class * @param object $container * @@ -31,7 +30,6 @@ interface DataObjectQueryFieldConfigGeneratorInterface public function getGraphQlFieldConfig($columnConfig, Data $fieldDefinition, $class, $container); /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Base.php b/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Base.php index 6b2aafe1..9dc91347 100644 --- a/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Base.php +++ b/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Base.php @@ -71,7 +71,7 @@ public function getGraphQlQueryOperatorConfig($typeName, $nodeDef, $class = null return $this->enrichConfig([ 'name' => $fieldname, 'type' => $type, - 'resolve' => [$resolver, 'resolve'] + 'resolve' => [$resolver, 'resolve'], ], $container); } @@ -87,7 +87,7 @@ public function enrichConfig($config, $container = null) if ($container instanceof Data\Localizedfields) { $config['args'] = $config['args'] ? $config['args'] : []; $config['args'] = array_merge($config['args'], - ['language' => ['type' => Type::string()] + ['language' => ['type' => Type::string()], ]); } diff --git a/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Merge.php b/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Merge.php index 8a30190c..f0b4151e 100644 --- a/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Merge.php +++ b/src/GraphQL/DataObjectQueryOperatorConfigGenerator/Merge.php @@ -62,7 +62,7 @@ public function getGraphQlQueryOperatorConfig($typeName, $nodeConfig, $class = n [ 'name' => $fieldname, 'type' => $type, - 'resolve' => [$resolver, 'resolve'] + 'resolve' => [$resolver, 'resolve'], ], $container ); diff --git a/src/GraphQL/DataObjectType/AbstractRelationsType.php b/src/GraphQL/DataObjectType/AbstractRelationsType.php index df138076..298756ed 100644 --- a/src/GraphQL/DataObjectType/AbstractRelationsType.php +++ b/src/GraphQL/DataObjectType/AbstractRelationsType.php @@ -31,7 +31,6 @@ abstract class AbstractRelationsType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** @var ClassDefinition */ @@ -41,8 +40,6 @@ abstract class AbstractRelationsType extends UnionType implements ContainerAware protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param ClassDefinition|Definition|null $class * @param array $config */ @@ -85,7 +82,6 @@ public function setClass($class): void } /** - * @return array * * @throws \Exception */ @@ -131,9 +127,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element) { diff --git a/src/GraphQL/DataObjectType/BlockEntryType.php b/src/GraphQL/DataObjectType/BlockEntryType.php index 5dd997e5..99dc0cce 100644 --- a/src/GraphQL/DataObjectType/BlockEntryType.php +++ b/src/GraphQL/DataObjectType/BlockEntryType.php @@ -35,7 +35,6 @@ class BlockEntryType extends ObjectType implements ContainerAwareInterface protected static $instance; use ContainerAwareTrait; - use ServiceTrait; /** @var ClassDefinition */ @@ -45,8 +44,6 @@ class BlockEntryType extends ObjectType implements ContainerAwareInterface protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param array $config */ @@ -63,8 +60,6 @@ public function __construct(Service $graphQlService, Data $fieldDefinition, $cla /** * @param string $type - * @param Service $graphQlService - * @param Data $fieldDefinition * @param ClassDefinition|null $class * * @return static|null @@ -73,7 +68,7 @@ public static function getInstance($type, Service $graphQlService, Data $fieldDe { if (!isset(self::$instance[$type])) { $config = [ - 'name' => $type + 'name' => $type, ]; self::$instance = new static($graphQlService, $fieldDefinition, $class, $config); } @@ -117,8 +112,6 @@ public function build(&$config) } /** - * @param Data $fieldDef - * @param bool $localized * * @return mixed */ diff --git a/src/GraphQL/DataObjectType/BlockType.php b/src/GraphQL/DataObjectType/BlockType.php index cfdca99e..ca7200ec 100644 --- a/src/GraphQL/DataObjectType/BlockType.php +++ b/src/GraphQL/DataObjectType/BlockType.php @@ -27,7 +27,6 @@ class BlockType extends ObjectType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** @var ClassDefinition */ @@ -37,8 +36,6 @@ class BlockType extends ObjectType implements ContainerAwareInterface protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param array $config */ @@ -63,7 +60,7 @@ public function build(&$config) $config['name'] = 'block_'.$this->class->getName().'_'.$this->fieldDefinition->getName(); $config['fields'] = [ - 'entries' => Type::listOf($type) + 'entries' => Type::listOf($type), ]; } } diff --git a/src/GraphQL/DataObjectType/ElementDescriptorInputType.php b/src/GraphQL/DataObjectType/ElementDescriptorInputType.php index a71193b4..e7357e0f 100644 --- a/src/GraphQL/DataObjectType/ElementDescriptorInputType.php +++ b/src/GraphQL/DataObjectType/ElementDescriptorInputType.php @@ -35,17 +35,15 @@ class ElementDescriptorInputType extends InputObjectType protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param null $class * @param array $config * @param array $context */ public function __construct(Service $graphQlService, - Data $fieldDefinition = null, - $class = null, - $config = ['name' => 'ElementDescriptorInput'], - $context = []) + Data $fieldDefinition = null, + $class = null, + $config = ['name' => 'ElementDescriptorInput'], + $context = []) { $this->class = $class; $this->fieldDefinition = $fieldDefinition; @@ -68,8 +66,8 @@ public function build(&$config) 'fullpath' => Type::string(), 'metadata' => [ 'type' => Type::listOf(new ElementMetadataKeyValuePairInputType()), - 'resolve' => [$resolver, 'resolveMetadata'] - ] + 'resolve' => [$resolver, 'resolveMetadata'], + ], ]; $config['description'] = 'type can be omitted for mutations only allowing one type, e.g. many-to-many-objects.'; } diff --git a/src/GraphQL/DataObjectType/FieldcollectionType.php b/src/GraphQL/DataObjectType/FieldcollectionType.php index fd637090..19d08563 100644 --- a/src/GraphQL/DataObjectType/FieldcollectionType.php +++ b/src/GraphQL/DataObjectType/FieldcollectionType.php @@ -27,13 +27,11 @@ class FieldcollectionType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; protected $types; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -45,7 +43,6 @@ public function __construct(Service $graphQlService, $config = []) } /** - * @return array * * @throws \Exception */ @@ -54,9 +51,6 @@ public function getTypes(): array return $this->types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element instanceof FieldcollectionDescriptor) { diff --git a/src/GraphQL/DataObjectType/GeoboundsType.php b/src/GraphQL/DataObjectType/GeoboundsType.php index c4819abe..ea6ffcca 100644 --- a/src/GraphQL/DataObjectType/GeoboundsType.php +++ b/src/GraphQL/DataObjectType/GeoboundsType.php @@ -33,11 +33,11 @@ public static function getInstance() 'fields' => [ 'northEast' => [ 'type' => GeopointType::getInstance(), - 'resolve' => [$resolver, 'resolveNorthEast'] + 'resolve' => [$resolver, 'resolveNorthEast'], ], 'southWest' => [ 'type' => GeopointType::getInstance(), - 'resolve' => [$resolver, 'resolveSouthWest'] + 'resolve' => [$resolver, 'resolveSouthWest'], ], ], diff --git a/src/GraphQL/DataObjectType/GeopointInputType.php b/src/GraphQL/DataObjectType/GeopointInputType.php index 179b95e0..59ec230b 100644 --- a/src/GraphQL/DataObjectType/GeopointInputType.php +++ b/src/GraphQL/DataObjectType/GeopointInputType.php @@ -25,7 +25,6 @@ class GeopointInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ diff --git a/src/GraphQL/DataObjectType/GeopointType.php b/src/GraphQL/DataObjectType/GeopointType.php index c0ac2131..03c8fe81 100644 --- a/src/GraphQL/DataObjectType/GeopointType.php +++ b/src/GraphQL/DataObjectType/GeopointType.php @@ -34,11 +34,11 @@ public static function getInstance() 'fields' => [ 'longitude' => [ 'type' => Type::float(), - 'resolve' => [$resolver, 'resolveLongitude'] + 'resolve' => [$resolver, 'resolveLongitude'], ], 'latitude' => [ 'type' => Type::float(), - 'resolve' => [$resolver, 'resolveLatitude'] + 'resolve' => [$resolver, 'resolveLatitude'], ], ], diff --git a/src/GraphQL/DataObjectType/HotspotType.php b/src/GraphQL/DataObjectType/HotspotType.php index b4e92168..f29a211d 100644 --- a/src/GraphQL/DataObjectType/HotspotType.php +++ b/src/GraphQL/DataObjectType/HotspotType.php @@ -32,7 +32,6 @@ class HotspotType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ diff --git a/src/GraphQL/DataObjectType/InputQuantityValueInputType.php b/src/GraphQL/DataObjectType/InputQuantityValueInputType.php index da8fe964..35caf760 100644 --- a/src/GraphQL/DataObjectType/InputQuantityValueInputType.php +++ b/src/GraphQL/DataObjectType/InputQuantityValueInputType.php @@ -25,7 +25,6 @@ class InputQuantityValueInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'InputQuantityValueInput']) @@ -46,7 +45,7 @@ public function build(&$config) $config['fields'] = [ 'value' => Type::string(), 'unit' => Type::string(), - 'unitId' => Type::string() + 'unitId' => Type::string(), ]; } } diff --git a/src/GraphQL/DataObjectType/InputQuantityValueType.php b/src/GraphQL/DataObjectType/InputQuantityValueType.php index 6f05dae1..387c82be 100644 --- a/src/GraphQL/DataObjectType/InputQuantityValueType.php +++ b/src/GraphQL/DataObjectType/InputQuantityValueType.php @@ -22,8 +22,6 @@ class InputQuantityValueType extends QuantityValueType { /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param array $config * @param array $context */ @@ -31,8 +29,8 @@ public function __construct(Service $graphQlService, Data $fieldDefinition = nul { $config['fields'] = [ 'value' => [ - 'type' => Type::string() - ] + 'type' => Type::string(), + ], ]; parent::__construct($graphQlService, $fieldDefinition, $config, $context); } diff --git a/src/GraphQL/DataObjectType/InputType/AbstractRelationInputType.php b/src/GraphQL/DataObjectType/InputType/AbstractRelationInputType.php index 530d8c1d..2b27bffc 100644 --- a/src/GraphQL/DataObjectType/InputType/AbstractRelationInputType.php +++ b/src/GraphQL/DataObjectType/InputType/AbstractRelationInputType.php @@ -25,7 +25,6 @@ abstract class AbstractRelationInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -43,8 +42,8 @@ public function build(&$config) { $config['fields'] = [ 'id' => [ - 'type' => Type::int() - ] + 'type' => Type::int(), + ], ]; } } diff --git a/src/GraphQL/DataObjectType/InputType/ImageInputType.php b/src/GraphQL/DataObjectType/InputType/ImageInputType.php index 2c3e9247..71444695 100644 --- a/src/GraphQL/DataObjectType/InputType/ImageInputType.php +++ b/src/GraphQL/DataObjectType/InputType/ImageInputType.php @@ -20,7 +20,6 @@ class ImageInputType extends AbstractRelationInputType { /** - * @param Service $graphQlService * @param array $config * @param array $context */ diff --git a/src/GraphQL/DataObjectType/LinkInputType.php b/src/GraphQL/DataObjectType/LinkInputType.php index d77ffe86..f4a51864 100644 --- a/src/GraphQL/DataObjectType/LinkInputType.php +++ b/src/GraphQL/DataObjectType/LinkInputType.php @@ -26,7 +26,6 @@ class LinkInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'LinkInput']) @@ -55,8 +54,8 @@ public function build(&$config) '_blank', '_self', '_top', - '_parent' - ] + '_parent', + ], ]), 'anchor' => Type::string(), 'title' => Type::string(), diff --git a/src/GraphQL/DataObjectType/LinkType.php b/src/GraphQL/DataObjectType/LinkType.php index 34ea745f..7c9d1c7c 100644 --- a/src/GraphQL/DataObjectType/LinkType.php +++ b/src/GraphQL/DataObjectType/LinkType.php @@ -34,47 +34,47 @@ public static function getInstance() 'fields' => [ 'text' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveText'] + 'resolve' => [$resolver, 'resolveText'], ], 'path' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolvePath'] + 'resolve' => [$resolver, 'resolvePath'], ], 'target' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveTarget'] + 'resolve' => [$resolver, 'resolveTarget'], ], 'anchor' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveAnchor'] + 'resolve' => [$resolver, 'resolveAnchor'], ], 'title' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveTitle'] + 'resolve' => [$resolver, 'resolveTitle'], ], 'accesskey' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveAccesskey'] + 'resolve' => [$resolver, 'resolveAccesskey'], ], 'rel' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveRel'] + 'resolve' => [$resolver, 'resolveRel'], ], 'class' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveClass'] + 'resolve' => [$resolver, 'resolveClass'], ], 'attributes' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveAttributes'] + 'resolve' => [$resolver, 'resolveAttributes'], ], 'tabindex' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveTabindex'] + 'resolve' => [$resolver, 'resolveTabindex'], ], 'parameters' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveParameters'] + 'resolve' => [$resolver, 'resolveParameters'], ], ], ]; diff --git a/src/GraphQL/DataObjectType/LocalizedType.php b/src/GraphQL/DataObjectType/LocalizedType.php index d677e0cf..bf66492f 100644 --- a/src/GraphQL/DataObjectType/LocalizedType.php +++ b/src/GraphQL/DataObjectType/LocalizedType.php @@ -48,7 +48,7 @@ public static function getInstance($determinedType) foreach (Tool::getValidLanguages() as $language) { $config['fields'][$language] = [ - 'type' => $determinedType + 'type' => $determinedType, ]; } diff --git a/src/GraphQL/DataObjectType/MergeType.php b/src/GraphQL/DataObjectType/MergeType.php index f4051f8b..22444645 100644 --- a/src/GraphQL/DataObjectType/MergeType.php +++ b/src/GraphQL/DataObjectType/MergeType.php @@ -34,7 +34,6 @@ class MergeType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** @var array */ @@ -47,7 +46,6 @@ class MergeType extends UnionType implements ContainerAwareInterface protected $container; /** - * @param Service $graphQlService * @param array $nodeDef * @param ClassDefinition|null $class * @param object|null $container @@ -99,7 +97,7 @@ public function getTypes(): array } /** - * @inheritdoc + * * * @throws Exception */ diff --git a/src/GraphQL/DataObjectType/MultihrefMetadataType.php b/src/GraphQL/DataObjectType/MultihrefMetadataType.php index d5e2e6c0..f076ccbb 100644 --- a/src/GraphQL/DataObjectType/MultihrefMetadataType.php +++ b/src/GraphQL/DataObjectType/MultihrefMetadataType.php @@ -37,8 +37,6 @@ class MultihrefMetadataType extends ObjectType protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param ClassDefinition|Definition|null $class * @param array $config */ @@ -65,11 +63,11 @@ public function build(&$config) $fields = ['element' => [ 'type' => new HrefType($this->getGraphQlService(), $this->fieldDefinition, $this->class), - 'resolve' => [$resolver, 'resolveElement'] + 'resolve' => [$resolver, 'resolveElement'], ], 'metadata' => [ 'type' => Type::listOf(new ElementMetadataKeyValuePairType()), - 'resolve' => [$resolver, 'resolveMetadata'] + 'resolve' => [$resolver, 'resolveMetadata'], ]]; $config['fields'] = $fields; diff --git a/src/GraphQL/DataObjectType/ObjectFolderType.php b/src/GraphQL/DataObjectType/ObjectFolderType.php index 1207a2d2..eddbdd4e 100644 --- a/src/GraphQL/DataObjectType/ObjectFolderType.php +++ b/src/GraphQL/DataObjectType/ObjectFolderType.php @@ -22,7 +22,6 @@ class ObjectFolderType extends FolderType { /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -48,7 +47,7 @@ public function build(&$config) ], 'key' => Type::string(), 'fullpath' => [ - 'type' => Type::string() + 'type' => Type::string(), ], 'creationDate' => Type::int(), 'modificationDate' => Type::int(), @@ -58,18 +57,18 @@ public function build(&$config) ], 'index' => [ 'type' => Type::int(), - 'resolve' => [$resolver, 'resolveIndex'] + 'resolve' => [$resolver, 'resolveIndex'], ], 'childrenSortBy' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveChildrenSortBy'] + 'resolve' => [$resolver, 'resolveChildrenSortBy'], ], 'children' => [ 'type' => Type::listOf($objectTreeType), 'args' => [ 'objectTypes' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'list of object types (object, variant, folder)' + 'description' => 'list of object types (object, variant, folder)', ], ], 'resolve' => [$resolver, 'resolveChildren'], @@ -79,17 +78,17 @@ public function build(&$config) 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma separated list of key names' - ] + 'description' => 'comma separated list of key names', + ], ], - 'resolve' => [$resolver, 'resolveProperties'] + 'resolve' => [$resolver, 'resolveProperties'], ], '_siblings' => [ 'type' => Type::listOf($objectTreeType), 'args' => [ 'objectTypes' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'list of object types (object, variant, folder)' + 'description' => 'list of object types (object, variant, folder)', ], ], 'resolve' => [$resolver, 'resolveSiblings'], diff --git a/src/GraphQL/DataObjectType/ObjectMetadataType.php b/src/GraphQL/DataObjectType/ObjectMetadataType.php index a1fee61b..80dc6615 100644 --- a/src/GraphQL/DataObjectType/ObjectMetadataType.php +++ b/src/GraphQL/DataObjectType/ObjectMetadataType.php @@ -36,8 +36,6 @@ class ObjectMetadataType extends ObjectType protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param ClassDefinition|null $class * @param array $config */ @@ -75,11 +73,11 @@ public function build(&$config) $fields = ['element' => [ 'type' => $elementTypeDefinition, - 'resolve' => [$resolver, 'resolveElement'] + 'resolve' => [$resolver, 'resolveElement'], ], 'metadata' => [ 'type' => Type::listOf(new ElementMetadataKeyValuePairType()), - 'resolve' => [$resolver, 'resolveMetadata'] + 'resolve' => [$resolver, 'resolveMetadata'], ]]; diff --git a/src/GraphQL/DataObjectType/ObjectTreeType.php b/src/GraphQL/DataObjectType/ObjectTreeType.php index 6af3ad7f..55607fd4 100644 --- a/src/GraphQL/DataObjectType/ObjectTreeType.php +++ b/src/GraphQL/DataObjectType/ObjectTreeType.php @@ -30,11 +30,9 @@ class ObjectTreeType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'object_tree']) @@ -44,7 +42,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'objec } /** - * @return array * * @throws \Exception */ @@ -62,9 +59,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if (!$element) { diff --git a/src/GraphQL/DataObjectType/PimcoreObjectType.php b/src/GraphQL/DataObjectType/PimcoreObjectType.php index 3fdd8656..b266676c 100644 --- a/src/GraphQL/DataObjectType/PimcoreObjectType.php +++ b/src/GraphQL/DataObjectType/PimcoreObjectType.php @@ -50,8 +50,6 @@ class PimcoreObjectType extends ObjectType protected $fields; /** - * @param Service $graphQlService - * @param string $className * @param string $classId * @param array $config * @param array $context @@ -97,15 +95,15 @@ public function build($context = []) } return null; - } + }, ], 'index' => [ 'type' => Type::int(), - 'resolve' => [$resolver, 'resolveIndex'] + 'resolve' => [$resolver, 'resolveIndex'], ], 'childrenSortBy' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveChildrenSortBy'] + 'resolve' => [$resolver, 'resolveChildrenSortBy'], ], 'classname' => [ 'type' => Type::string(), @@ -115,17 +113,17 @@ public function build($context = []) 'args' => [ 'name' => ['type' => Type::string()], ], - 'resolve' => [$resolver, 'resolveTag'] + 'resolve' => [$resolver, 'resolveTag'], ], 'properties' => [ 'type' => Type::listOf($propertyType), 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma separated list of key names' - ] + 'description' => 'comma separated list of key names', + ], ], - 'resolve' => [$resolver, 'resolveProperties'] + 'resolve' => [$resolver, 'resolveProperties'], ], 'parent' => [ 'type' => $objectTreeType, @@ -136,7 +134,7 @@ public function build($context = []) 'args' => [ 'objectTypes' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'list of object types (object, variant, folder)' + 'description' => 'list of object types (object, variant, folder)', ], ], 'resolve' => [$resolver, 'resolveChildren'], @@ -146,7 +144,7 @@ public function build($context = []) 'args' => [ 'objectTypes' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'list of object types (object, variant, folder)' + 'description' => 'list of object types (object, variant, folder)', ], ], 'resolve' => [$resolver, 'resolveSiblings'], @@ -188,7 +186,6 @@ public function build($context = []) /** * @param array $column - * @param ClassDefinition $class * @param array $fields * * @return void @@ -222,8 +219,8 @@ public function addFieldCollectionDefs($column, ClassDefinition $class, &$fields 'attributes' => [ 'attribute' => $attrName, 'label' => $fieldDef->getName(), - 'dataType' => $fieldDef->getFieldtype() - ] + 'dataType' => $fieldDef->getFieldtype(), + ], ]; $fcResult = $fieldHelper->getQueryFieldConfigFromConfig($columnDesc, $fcDef); if ($fcResult) { @@ -244,8 +241,8 @@ public function addFieldCollectionDefs($column, ClassDefinition $class, &$fields 'attributes' => [ 'attribute' => $attrName, 'label' => $fieldDef->getName(), - 'dataType' => $fieldDef->getFieldtype() - ] + 'dataType' => $fieldDef->getFieldtype(), + ], ]; $fcResult = $fieldHelper->getQueryFieldConfigFromConfig($columnDesc, $fcDef, $fcLocalizedFields); if ($fcResult) { @@ -258,7 +255,7 @@ public function addFieldCollectionDefs($column, ClassDefinition $class, &$fields $itemFcType = new ObjectType([ 'name' => $typename, - 'fields' => $fcFields + 'fields' => $fcFields, ]); RuntimeCache::save($itemFcType, $fcKey); @@ -271,7 +268,7 @@ public function addFieldCollectionDefs($column, ClassDefinition $class, &$fields $unionTypesConfig = [ 'name' => $unionname, - 'types' => $unionTypes + 'types' => $unionTypes, ]; $union = new FieldcollectionType($this->getGraphQlService(), $unionTypesConfig); @@ -308,7 +305,7 @@ public function addFieldCollectionDefs($column, ClassDefinition $class, &$fields } return null; - } + }, ]; } diff --git a/src/GraphQL/DataObjectType/QuantityValueInputType.php b/src/GraphQL/DataObjectType/QuantityValueInputType.php index f86e3d91..b8d06922 100644 --- a/src/GraphQL/DataObjectType/QuantityValueInputType.php +++ b/src/GraphQL/DataObjectType/QuantityValueInputType.php @@ -25,7 +25,6 @@ class QuantityValueInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'QuantityValueInput']) @@ -46,7 +45,7 @@ public function build(&$config) $config['fields'] = [ 'value' => Type::float(), 'unit' => Type::string(), - 'unitId' => Type::string() + 'unitId' => Type::string(), ]; } } diff --git a/src/GraphQL/DataObjectType/QuantityValueType.php b/src/GraphQL/DataObjectType/QuantityValueType.php index cb05ddcc..3b07ec94 100644 --- a/src/GraphQL/DataObjectType/QuantityValueType.php +++ b/src/GraphQL/DataObjectType/QuantityValueType.php @@ -29,8 +29,6 @@ class QuantityValueType extends ObjectType protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param array $config * @param array $context */ @@ -56,7 +54,6 @@ public function build(&$config) } /** - * @param Service $graphQlService * @param string $valueType * * @return array[] @@ -68,17 +65,17 @@ public static function getFieldConfig(Service $graphQlService, $valueType) $fields = [ 'unit' => [ 'type' => QuantityValueUnitType::getInstance(), - 'resolve' => [$resolver, 'resolveUnit'] + 'resolve' => [$resolver, 'resolveUnit'], ], 'value' => [ 'type' => $valueType, - 'resolve' => [$resolver, 'resolveValue'] + 'resolve' => [$resolver, 'resolveValue'], ], 'toString' => [ 'type' => Type::string(), 'resolve' => [$resolver, 'resolveToString'], - 'args' => ['language' => ['type' => Type::string()]] - ] + 'args' => ['language' => ['type' => Type::string()]], + ], ]; return $fields; diff --git a/src/GraphQL/DataObjectType/QuantityValueUnitType.php b/src/GraphQL/DataObjectType/QuantityValueUnitType.php index 1303d39f..613dcc9f 100644 --- a/src/GraphQL/DataObjectType/QuantityValueUnitType.php +++ b/src/GraphQL/DataObjectType/QuantityValueUnitType.php @@ -34,7 +34,7 @@ public static function getInstance() 'id' => Type::id(), 'abbreviation' => Type::string(), 'longname' => Type::string(), - ] + ], ]; self::$instance = new static($config); } diff --git a/src/GraphQL/DataObjectType/UrlSlugType.php b/src/GraphQL/DataObjectType/UrlSlugType.php index 50eed46f..99d62939 100644 --- a/src/GraphQL/DataObjectType/UrlSlugType.php +++ b/src/GraphQL/DataObjectType/UrlSlugType.php @@ -29,8 +29,6 @@ class UrlSlugType extends ObjectType protected $fieldDefinition; /** - * @param Service $graphQlService - * @param Data|null $fieldDefinition * @param array $config * @param array $context */ @@ -51,7 +49,6 @@ public function build(&$config) } /** - * @param Service $graphQlService * * @return array[] */ @@ -62,12 +59,12 @@ public static function getFieldConfig(Service $graphQlService) $fields = [ 'slug' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveSlug'] + 'resolve' => [$resolver, 'resolveSlug'], ], 'siteId' => [ 'type' => Type::int(), - 'resolve' => [$resolver, 'resolveSiteId'] - ] + 'resolve' => [$resolver, 'resolveSiteId'], + ], ]; return $fields; diff --git a/src/GraphQL/DataObjectType/VideoType.php b/src/GraphQL/DataObjectType/VideoType.php index d68339a8..a44951d9 100644 --- a/src/GraphQL/DataObjectType/VideoType.php +++ b/src/GraphQL/DataObjectType/VideoType.php @@ -51,23 +51,23 @@ public function build(&$config) [ 'type' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveType'] + 'resolve' => [$resolver, 'resolveType'], ], 'data' => [ 'type' => $this->videoDataType, - 'resolve' => [$resolver, 'resolveData'] + 'resolve' => [$resolver, 'resolveData'], ], 'poster' => [ 'type' => $assetType, - 'resolve' => [$resolver, 'resolvePoster'] + 'resolve' => [$resolver, 'resolvePoster'], ], 'title' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveTitle'] + 'resolve' => [$resolver, 'resolveTitle'], ], 'description' => [ 'type' => Type::string(), - 'resolve' => [$resolver, 'resolveDescription'] + 'resolve' => [$resolver, 'resolveDescription'], ], ]; diff --git a/src/GraphQL/DataObjectType/VideoTypeDataType.php b/src/GraphQL/DataObjectType/VideoTypeDataType.php index dffe9453..baf0e234 100644 --- a/src/GraphQL/DataObjectType/VideoTypeDataType.php +++ b/src/GraphQL/DataObjectType/VideoTypeDataType.php @@ -40,7 +40,6 @@ public function __construct(Service $graphQlService) } /** - * @return array * * @throws \Exception */ @@ -55,17 +54,14 @@ public function getTypes(): array new ObjectType([ 'name' => 'VideoDataDescriptor', 'fields' => [ - 'id' => ['type' => Type::string(), 'description' => 'external ID'] - ] + 'id' => ['type' => Type::string(), 'description' => 'external ID'], + ], ] ), - $this->assetType + $this->assetType, ]; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element instanceof ElementDescriptor) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Areablock.php b/src/GraphQL/DocumentElementInputProcessor/Areablock.php index 8098756d..f8e2d5c4 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Areablock.php +++ b/src/GraphQL/DocumentElementInputProcessor/Areablock.php @@ -28,7 +28,6 @@ class Areablock extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { @@ -62,7 +61,7 @@ public function process($document, $newValue, $args, $context, ResolveInfo $info $indices[$idx] = [ 'key' => $idx + 1, 'type' => $blockType, - 'hidden' => $hidden + 'hidden' => $hidden, ]; foreach ($editables as $editableType => $listByType) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Base.php b/src/GraphQL/DocumentElementInputProcessor/Base.php index d1ca0536..19f8040b 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Base.php +++ b/src/GraphQL/DocumentElementInputProcessor/Base.php @@ -41,7 +41,6 @@ public function __construct(EditableLoaderInterface $editableLoader, Service $gr * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Block.php b/src/GraphQL/DocumentElementInputProcessor/Block.php index c239d4c0..2fb1d831 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Block.php +++ b/src/GraphQL/DocumentElementInputProcessor/Block.php @@ -28,7 +28,6 @@ class Block extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DocumentElementInputProcessor/EditablesTrait.php b/src/GraphQL/DocumentElementInputProcessor/EditablesTrait.php index 8445b554..f5d5e7ed 100644 --- a/src/GraphQL/DocumentElementInputProcessor/EditablesTrait.php +++ b/src/GraphQL/DocumentElementInputProcessor/EditablesTrait.php @@ -20,7 +20,6 @@ trait EditablesTrait { /** - * @param PageSnippet $document * @param string $editableName * * @return void diff --git a/src/GraphQL/DocumentElementInputProcessor/Embed.php b/src/GraphQL/DocumentElementInputProcessor/Embed.php index c2f901c3..032a028a 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Embed.php +++ b/src/GraphQL/DocumentElementInputProcessor/Embed.php @@ -25,7 +25,6 @@ class Embed extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Image.php b/src/GraphQL/DocumentElementInputProcessor/Image.php index 8e9218d0..9526910e 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Image.php +++ b/src/GraphQL/DocumentElementInputProcessor/Image.php @@ -27,7 +27,6 @@ class Image extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Multiselect.php b/src/GraphQL/DocumentElementInputProcessor/Multiselect.php index b0992157..f1c22c41 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Multiselect.php +++ b/src/GraphQL/DocumentElementInputProcessor/Multiselect.php @@ -25,7 +25,6 @@ class Multiselect extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { diff --git a/src/GraphQL/DocumentElementInputProcessor/Scheduledblock.php b/src/GraphQL/DocumentElementInputProcessor/Scheduledblock.php index cee75b21..377383cb 100644 --- a/src/GraphQL/DocumentElementInputProcessor/Scheduledblock.php +++ b/src/GraphQL/DocumentElementInputProcessor/Scheduledblock.php @@ -28,7 +28,6 @@ class Scheduledblock extends Base * @param mixed $newValue * @param array $args * @param mixed $context - * @param ResolveInfo $info */ public function process($document, $newValue, $args, $context, ResolveInfo $info) { @@ -60,7 +59,7 @@ public function process($document, $newValue, $args, $context, ResolveInfo $info $indices[$idx] = [ 'key' => $idx, - 'date' => $date + 'date' => $date, ]; foreach ($editables as $editableType => $listByType) { diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Areablock.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Areablock.php index 39cf12b1..23555a7d 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Areablock.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Areablock.php @@ -54,11 +54,11 @@ public function getDocumentElementMutationFieldConfig() 'hidden' => Type::boolean(), 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true (default), all elements inside the block will be replaced' + 'description' => 'if true (default), all elements inside the block will be replaced', ], - 'editables' => MutationType::$documentElementTypes + 'editables' => MutationType::$documentElementTypes, ]; - } + }, ] ); } @@ -73,13 +73,13 @@ public function getDocumentElementMutationFieldConfig() 'indices' => Type::listOf($this->areablockDataInputType), 'items' => [ 'type' => Type::listOf(self::$itemType), - ] + ], ]; - } + }, ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Block.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Block.php index 2fd38197..4a488507 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Block.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Block.php @@ -47,11 +47,11 @@ public function getDocumentElementMutationFieldConfig() return [ 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true (default), all elements inside the block will be replaced' + 'description' => 'if true (default), all elements inside the block will be replaced', ], - 'editables' => MutationType::$documentElementTypes + 'editables' => MutationType::$documentElementTypes, ]; - } + }, ] ); } @@ -66,12 +66,12 @@ public function getDocumentElementMutationFieldConfig() 'indices' => Type::listOf(Type::int()), 'items' => [ 'type' => Type::listOf(self::$itemType), - ] + ], ]; - } + }, ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Embed.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Embed.php index d0d470ab..9e42758d 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Embed.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Embed.php @@ -44,10 +44,10 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'url' => Type::string(), - ] + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Image.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Image.php index e58b94d7..06f5a051 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Image.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Image.php @@ -44,11 +44,11 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'id' => Type::int(), // the target asset - 'alt' => Type::string() - ] + 'alt' => Type::string(), + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Input.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Input.php index 2dfcd6a0..7dc1ff7a 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Input.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Input.php @@ -44,10 +44,10 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'text' => Type::string(), - ] + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Multiselect.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Multiselect.php index 517be7ea..a4764385 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Multiselect.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Multiselect.php @@ -42,10 +42,10 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'selections' => Type::listOf(Type::string()), - ] + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Scheduledblock.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Scheduledblock.php index ead1d799..7cc3ba78 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Scheduledblock.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Scheduledblock.php @@ -53,11 +53,11 @@ public function getDocumentElementMutationFieldConfig() 'date' => Type::int(), 'replace' => [ 'type' => Type::boolean(), - 'description' => 'if true (default), all elements inside the block will be replaced' + 'description' => 'if true (default), all elements inside the block will be replaced', ], - 'editables' => MutationType::$documentElementTypes + 'editables' => MutationType::$documentElementTypes, ]; - } + }, ] ); } @@ -72,13 +72,13 @@ public function getDocumentElementMutationFieldConfig() 'indices' => Type::listOf($this->scheduledblockDataInputType), 'items' => [ 'type' => Type::listOf(self::$itemType), - ] + ], ]; - } + }, ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Select.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Select.php index 49bbbb59..b556079f 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Select.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Select.php @@ -42,10 +42,10 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'text' => Type::string(), - ] + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Wysiwyg.php b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Wysiwyg.php index f3873222..40b70407 100644 --- a/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Wysiwyg.php +++ b/src/GraphQL/DocumentElementMutationFieldConfigGenerator/Wysiwyg.php @@ -42,10 +42,10 @@ public function getDocumentElementMutationFieldConfig() 'fields' => [ '_editableName' => Type::nonNull(Type::string()), 'text' => Type::string(), - ] + ], ] ), - 'processor' => [$this->processor, 'process'] + 'processor' => [$this->processor, 'process'], ]; } } diff --git a/src/GraphQL/DocumentElementQueryFieldConfigGenerator/Video.php b/src/GraphQL/DocumentElementQueryFieldConfigGenerator/Video.php index 3880db87..81bd0b26 100644 --- a/src/GraphQL/DocumentElementQueryFieldConfigGenerator/Video.php +++ b/src/GraphQL/DocumentElementQueryFieldConfigGenerator/Video.php @@ -21,14 +21,13 @@ class Video extends Base { /** - * @param Service $graphQlService * * @throws \Exception */ public function __construct(Service $graphQlService) { -// $this->assetType = $assetType; + // $this->assetType = $assetType; parent::__construct($graphQlService); } diff --git a/src/GraphQL/DocumentElementType/AreablockDataInputType.php b/src/GraphQL/DocumentElementType/AreablockDataInputType.php index a1e13bbe..a8d91c95 100644 --- a/src/GraphQL/DocumentElementType/AreablockDataInputType.php +++ b/src/GraphQL/DocumentElementType/AreablockDataInputType.php @@ -25,7 +25,6 @@ class AreablockDataInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -44,7 +43,7 @@ public function build(&$config) $config['fields'] = [ 'key' => Type::string(), 'type' => Type::string(), - 'hidden' => Type::boolean() + 'hidden' => Type::boolean(), ]; } } diff --git a/src/GraphQL/DocumentElementType/AreablockDataType.php b/src/GraphQL/DocumentElementType/AreablockDataType.php index 491fd4e5..0aaefc5d 100644 --- a/src/GraphQL/DocumentElementType/AreablockDataType.php +++ b/src/GraphQL/DocumentElementType/AreablockDataType.php @@ -39,7 +39,7 @@ public function __construct(Service $graphQlService) if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -47,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value) { return $value->getName(); } - } + }, ], 'key' => [ 'type' => Type::string(), @@ -57,7 +57,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ], 'type' => [ 'type' => Type::string(), @@ -67,7 +67,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ], 'hidden' => [ 'type' => Type::boolean(), @@ -75,7 +75,7 @@ public function __construct(Service $graphQlService) if (is_array($value)) { return $value['hidden']; } - } + }, ], ], ]; diff --git a/src/GraphQL/DocumentElementType/AreablockType.php b/src/GraphQL/DocumentElementType/AreablockType.php index 87408a1a..b5a2b673 100644 --- a/src/GraphQL/DocumentElementType/AreablockType.php +++ b/src/GraphQL/DocumentElementType/AreablockType.php @@ -25,7 +25,6 @@ class AreablockType extends ObjectType protected static $instance; /** - * @param AreablockDataType $areablockDataType * * @return static */ @@ -42,7 +41,7 @@ public static function getInstance(AreablockDataType $areablockDataType) if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -50,7 +49,7 @@ public static function getInstance(AreablockDataType $areablockDataType) if ($value) { return $value->getName(); } - } + }, ], 'data' => [ 'type' => Type::listOf($areablockDataType), @@ -58,7 +57,7 @@ public static function getInstance(AreablockDataType $areablockDataType) if ($value instanceof Areablock) { return $value->getData(); } - } + }, ], ], diff --git a/src/GraphQL/DocumentElementType/BlockType.php b/src/GraphQL/DocumentElementType/BlockType.php index a1e1b26a..6d65de3a 100644 --- a/src/GraphQL/DocumentElementType/BlockType.php +++ b/src/GraphQL/DocumentElementType/BlockType.php @@ -40,7 +40,7 @@ public static function getInstance() if ($value instanceof Block) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public static function getInstance() if ($value instanceof Block) { return $value->getType(); } - } + }, ], 'indices' => [ 'type' => Type::listOf(Type::int()), @@ -56,8 +56,8 @@ public static function getInstance() if ($value instanceof Block) { return $value->getData(); } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/CheckboxType.php b/src/GraphQL/DocumentElementType/CheckboxType.php index a51d5a0b..183ba5e5 100644 --- a/src/GraphQL/DocumentElementType/CheckboxType.php +++ b/src/GraphQL/DocumentElementType/CheckboxType.php @@ -40,7 +40,7 @@ public static function getInstance() if ($value instanceof Checkbox) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public static function getInstance() if ($value instanceof Checkbox) { return $value->getType(); } - } + }, ], 'checked' => [ 'type' => Type::boolean(), @@ -56,8 +56,8 @@ public static function getInstance() if ($value instanceof Checkbox) { return $value->getData(); } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/DateType.php b/src/GraphQL/DocumentElementType/DateType.php index fdd2a409..b81a886e 100644 --- a/src/GraphQL/DocumentElementType/DateType.php +++ b/src/GraphQL/DocumentElementType/DateType.php @@ -41,7 +41,7 @@ public static function getInstance() if ($value instanceof Date) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -49,7 +49,7 @@ public static function getInstance() if ($value instanceof Date) { return $value->getType(); } - } + }, ], 'timestamp' => [ 'type' => Type::int(), @@ -60,7 +60,7 @@ public static function getInstance() return $data->getTimestamp(); } } - } + }, ], 'formatted' => [ 'type' => Type::string(), @@ -75,8 +75,8 @@ public static function getInstance() return $formattedValue; } } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/EmbedType.php b/src/GraphQL/DocumentElementType/EmbedType.php index ce83ce53..f03bd590 100644 --- a/src/GraphQL/DocumentElementType/EmbedType.php +++ b/src/GraphQL/DocumentElementType/EmbedType.php @@ -41,7 +41,7 @@ public static function getInstance() if ($value instanceof Date) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -49,7 +49,7 @@ public static function getInstance() if ($value instanceof Date) { return $value->getType(); } - } + }, ], 'url' => [ 'type' => Type::string(), @@ -57,8 +57,8 @@ public static function getInstance() if ($value instanceof Embed) { return $value->getUrl(); } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/ImageType.php b/src/GraphQL/DocumentElementType/ImageType.php index 6cc0bd91..d6773d1b 100644 --- a/src/GraphQL/DocumentElementType/ImageType.php +++ b/src/GraphQL/DocumentElementType/ImageType.php @@ -29,7 +29,6 @@ class ImageType extends ObjectType protected static $instance; /** - * @param Service $graphQlService * * @return ImageType * @@ -57,7 +56,7 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -67,7 +66,7 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], 'image' => [ 'type' => $assetType, @@ -83,7 +82,7 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], 'alt' => [ 'type' => Type::string(), @@ -93,7 +92,7 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], 'crop' => [ 'type' => HotspotCropType::getInstance(), @@ -104,12 +103,12 @@ public static function getInstance(Service $graphQlService) 'cropLeft' => $value->getCropLeft(), 'cropHeight' => $value->getCropHeight(), 'cropWidth' => $value->getCropWidth(), - 'cropPercent' => $value->getCropPercent() + 'cropPercent' => $value->getCropPercent(), ]; } return null; - } + }, ], 'hotspots' => [ 'type' => Type::listOf($hotspotHotspotType), @@ -119,7 +118,7 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], 'marker' => [ 'type' => Type::listOf($hotspotMarkerType), @@ -129,9 +128,9 @@ public static function getInstance(Service $graphQlService) } return null; - } + }, ], - ] + ], ]; self::$instance = new static($config); } diff --git a/src/GraphQL/DocumentElementType/LinkDataType.php b/src/GraphQL/DocumentElementType/LinkDataType.php index 1830c792..9442f338 100644 --- a/src/GraphQL/DocumentElementType/LinkDataType.php +++ b/src/GraphQL/DocumentElementType/LinkDataType.php @@ -27,7 +27,6 @@ class LinkDataType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -47,7 +46,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -55,7 +54,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getName(); } - } + }, ], 'internal' => [ 'type' => Type::boolean(), @@ -63,7 +62,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['internal'] ?? null; } - } + }, ], 'internalType' => [ 'type' => Type::string(), @@ -71,7 +70,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['internalType'] ?? null; } - } + }, ], 'internalId' => [ 'type' => Type::int(), @@ -79,7 +78,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['internalId'] ?? null; } - } + }, ], 'path' => [ 'type' => Type::string(), @@ -87,7 +86,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['path'] ?? null; } - } + }, ], 'text' => [ 'type' => Type::string(), @@ -95,11 +94,11 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['text'] ?? null; } - } + }, ], 'target' => [ 'type' => $anyTargetType, - 'resolve' => [new Link($this->getGraphQlService()), 'resolveTarget'] + 'resolve' => [new Link($this->getGraphQlService()), 'resolveTarget'], ], 'windowTarget' => [ // Target is already in use. 'type' => Type::string(), @@ -107,7 +106,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['target'] ?? null; } - } + }, ], 'parameters' => [ 'type' => Type::string(), @@ -115,7 +114,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['parameters'] ?? null; } - } + }, ], 'anchor' => [ 'type' => Type::string(), @@ -123,7 +122,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['anchor'] ?? null; } - } + }, ], 'title' => [ 'type' => Type::string(), @@ -131,7 +130,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['title'] ?? null; } - } + }, ], 'accesskey' => [ 'type' => Type::string(), @@ -139,7 +138,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['accesskey'] ?? null; } - } + }, ], 'relation' => [ 'type' => Type::string(), @@ -147,7 +146,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['rel'] ?? null; } - } + }, ], 'tabindex' => [ 'type' => Type::string(), @@ -155,7 +154,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['tabindex'] ?? null; } - } + }, ], 'class' => [ 'type' => Type::string(), @@ -163,7 +162,7 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['class'] ?? null; } - } + }, ], 'attributes' => [ 'type' => Type::string(), @@ -171,9 +170,9 @@ public function __construct(Service $graphQlService) if ($value instanceof \Pimcore\Model\Document\Editable\Link) { return $value->getData()['attributes'] ?? null; } - } + }, ], - ] + ], ]; parent::__construct($config); } diff --git a/src/GraphQL/DocumentElementType/LinkType.php b/src/GraphQL/DocumentElementType/LinkType.php index 1ebc0c79..e8034657 100644 --- a/src/GraphQL/DocumentElementType/LinkType.php +++ b/src/GraphQL/DocumentElementType/LinkType.php @@ -24,7 +24,6 @@ class LinkType extends ObjectType protected static $instance; /** - * @param LinkDataType $linkDataType * * @return static */ @@ -41,7 +40,7 @@ public static function getInstance(LinkDataType $linkDataType) if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -49,13 +48,13 @@ public static function getInstance(LinkDataType $linkDataType) if ($value) { return $value->getName(); } - } + }, ], 'data' => [ 'type' => $linkDataType, 'resolve' => static function ($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) { return $value; - } + }, ], ], ]; diff --git a/src/GraphQL/DocumentElementType/MultiselectType.php b/src/GraphQL/DocumentElementType/MultiselectType.php index 668a1690..a6422178 100644 --- a/src/GraphQL/DocumentElementType/MultiselectType.php +++ b/src/GraphQL/DocumentElementType/MultiselectType.php @@ -39,7 +39,7 @@ public static function getInstance() if ($value) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -47,7 +47,7 @@ public static function getInstance() if ($value instanceof \Pimcore\Model\Document\Editable\Numeric) { return $value->getType(); } - } + }, ], 'selections' => [ 'type' => Type::listOf(Type::string()), @@ -55,8 +55,8 @@ public static function getInstance() if ($value instanceof \Pimcore\Model\Document\Editable\Multiselect) { return $value->getData(); } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/NumericType.php b/src/GraphQL/DocumentElementType/NumericType.php index 0ebd2e7d..a8d283d3 100644 --- a/src/GraphQL/DocumentElementType/NumericType.php +++ b/src/GraphQL/DocumentElementType/NumericType.php @@ -40,7 +40,7 @@ public static function getInstance() if ($value) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public static function getInstance() if ($value instanceof Numeric) { return $value->getType(); } - } + }, ], 'number' => [ 'type' => Type::string(), @@ -56,8 +56,8 @@ public static function getInstance() if ($value instanceof Numeric) { return $value->getData(); } - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/PdfType.php b/src/GraphQL/DocumentElementType/PdfType.php index cfcd721b..23738def 100644 --- a/src/GraphQL/DocumentElementType/PdfType.php +++ b/src/GraphQL/DocumentElementType/PdfType.php @@ -27,7 +27,6 @@ class PdfType extends ObjectType protected static $instance; /** - * @param Service $service * * @return PdfType * @@ -48,7 +47,7 @@ public static function getInstance(Service $service) if ($value) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public static function getInstance(Service $service) if ($value instanceof \Pimcore\Model\Document\Editable\Numeric) { return $value->getType(); } - } + }, ], 'pdf' => [ 'type' => $assetType, @@ -72,8 +71,8 @@ public static function getInstance(Service $service) } return null; - } - ] + }, + ], ], ]; self::$instance = new static($config); diff --git a/src/GraphQL/DocumentElementType/RelationType.php b/src/GraphQL/DocumentElementType/RelationType.php index 77c60543..338c0ebe 100644 --- a/src/GraphQL/DocumentElementType/RelationType.php +++ b/src/GraphQL/DocumentElementType/RelationType.php @@ -27,7 +27,6 @@ class RelationType extends ObjectType protected static $instance; /** - * @param Service $graphQlService * * @return RelationType * @@ -48,7 +47,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relation) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relation) { return $value->getName(); } - } + }, ], 'id' => [ 'type' => Type::int(), @@ -64,7 +63,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relation) { return $value->getId(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -72,7 +71,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relation) { return $value->getType(); } - } + }, ], 'subtype' => [ 'type' => Type::string(), @@ -80,7 +79,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relation) { return $value->getSubtype(); } - } + }, ], 'relation' => [ 'type' => $anyTargetType, @@ -94,9 +93,9 @@ public static function getInstance(Service $graphQlService) return $desc; } } - } - ] - ] + }, + ], + ], ]; self::$instance = new static($config); } diff --git a/src/GraphQL/DocumentElementType/RelationsType.php b/src/GraphQL/DocumentElementType/RelationsType.php index 513d5021..ceb2c60b 100644 --- a/src/GraphQL/DocumentElementType/RelationsType.php +++ b/src/GraphQL/DocumentElementType/RelationsType.php @@ -28,7 +28,6 @@ class RelationsType extends ObjectType protected static $instance; /** - * @param Service $graphQlService * * @return static * @@ -49,7 +48,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relations) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -57,7 +56,7 @@ public static function getInstance(Service $graphQlService) if ($value instanceof Relations) { return $value->getName(); } - } + }, ], 'relations' => [ 'type' => Type::listOf($anyTargetType), @@ -75,9 +74,9 @@ public static function getInstance(Service $graphQlService) return $result; } } - } - ] - ] + }, + ], + ], ]; self::$instance = new static($config); } diff --git a/src/GraphQL/DocumentElementType/ScheduledblockDataInputType.php b/src/GraphQL/DocumentElementType/ScheduledblockDataInputType.php index 353ac48e..dad23dce 100644 --- a/src/GraphQL/DocumentElementType/ScheduledblockDataInputType.php +++ b/src/GraphQL/DocumentElementType/ScheduledblockDataInputType.php @@ -25,7 +25,6 @@ class ScheduledblockDataInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -43,7 +42,7 @@ public function build(&$config) { $config['fields'] = [ 'key' => Type::string(), - 'date' => Type::int() + 'date' => Type::int(), ]; } } diff --git a/src/GraphQL/DocumentElementType/ScheduledblockDataType.php b/src/GraphQL/DocumentElementType/ScheduledblockDataType.php index 8ab6d2a5..4092aec3 100644 --- a/src/GraphQL/DocumentElementType/ScheduledblockDataType.php +++ b/src/GraphQL/DocumentElementType/ScheduledblockDataType.php @@ -39,7 +39,7 @@ public function __construct(Service $graphQlService) if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -47,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value) { return $value->getName(); } - } + }, ], 'key' => [ 'type' => Type::string(), @@ -57,7 +57,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ], 'date' => [ 'type' => Type::int(), @@ -67,7 +67,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ], ], ]; diff --git a/src/GraphQL/DocumentElementType/ScheduledblockType.php b/src/GraphQL/DocumentElementType/ScheduledblockType.php index 90f03419..fc4d76ae 100644 --- a/src/GraphQL/DocumentElementType/ScheduledblockType.php +++ b/src/GraphQL/DocumentElementType/ScheduledblockType.php @@ -25,7 +25,6 @@ class ScheduledblockType extends ObjectType protected static $instance; /** - * @param ScheduledblockDataType $scheduledblockDataType * * @return static */ @@ -42,7 +41,7 @@ public static function getInstance(ScheduledblockDataType $scheduledblockDataTyp if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -50,7 +49,7 @@ public static function getInstance(ScheduledblockDataType $scheduledblockDataTyp if ($value) { return $value->getName(); } - } + }, ], 'data' => [ 'type' => Type::listOf($scheduledblockDataType), @@ -58,7 +57,7 @@ public static function getInstance(ScheduledblockDataType $scheduledblockDataTyp if ($value instanceof Scheduledblock) { return $value->getData(); } - } + }, ], ], diff --git a/src/GraphQL/DocumentElementType/SimpleTextType.php b/src/GraphQL/DocumentElementType/SimpleTextType.php index 0f19e491..fa7fcc47 100644 --- a/src/GraphQL/DocumentElementType/SimpleTextType.php +++ b/src/GraphQL/DocumentElementType/SimpleTextType.php @@ -40,7 +40,7 @@ public static function getStandardConfig($name) if ($value) { return $value->getName(); } - } + }, ], '_editableType' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public static function getStandardConfig($name) if ($value) { return $value->getType(); } - } + }, ], 'text' => [ 'type' => Type::string(), @@ -62,7 +62,7 @@ public static function getStandardConfig($name) return $value->getData(); } } - } + }, ], ], ]; diff --git a/src/GraphQL/DocumentElementType/VideoType.php b/src/GraphQL/DocumentElementType/VideoType.php index 1db46e67..92e0f37d 100644 --- a/src/GraphQL/DocumentElementType/VideoType.php +++ b/src/GraphQL/DocumentElementType/VideoType.php @@ -29,8 +29,6 @@ class VideoType extends ObjectType protected static $instance; /** - * @param Service $graphQlService - * @param AssetType $assetType * * @return static */ @@ -47,7 +45,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value) { return $value->getType(); } - } + }, ], '_editableName' => [ 'type' => Type::string(), @@ -55,7 +53,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value) { return $value->getName(); } - } + }, ], 'id' => [ 'type' => Type::string(), @@ -63,7 +61,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value instanceof Video) { return $value->getId(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -71,7 +69,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value) { return $value->getVideoType(); } - } + }, ], 'title' => [ 'type' => Type::string(), @@ -79,7 +77,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value instanceof Video) { return $value->getTitle(); } - } + }, ], 'description' => [ 'type' => Type::string(), @@ -87,7 +85,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType if ($value instanceof Video) { return $value->getDescription(); } - } + }, ], 'posterAsset' => [ 'type' => $assetType, @@ -103,7 +101,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType } return null; - } + }, ], 'videoAsset' => [ 'type' => $assetType, @@ -118,7 +116,7 @@ public static function getInstance(Service $graphQlService, AssetType $assetType } return null; - } + }, ], ], ]; diff --git a/src/GraphQL/DocumentResolver/Email.php b/src/GraphQL/DocumentResolver/Email.php index 7f4640eb..c14b23d8 100644 --- a/src/GraphQL/DocumentResolver/Email.php +++ b/src/GraphQL/DocumentResolver/Email.php @@ -29,7 +29,6 @@ class Email * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DocumentResolver/Hardlink.php b/src/GraphQL/DocumentResolver/Hardlink.php index 70d90deb..607f078c 100644 --- a/src/GraphQL/DocumentResolver/Hardlink.php +++ b/src/GraphQL/DocumentResolver/Hardlink.php @@ -33,7 +33,6 @@ public function __construct() * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DocumentResolver/Link.php b/src/GraphQL/DocumentResolver/Link.php index a0bf8bd6..2c5b5031 100644 --- a/src/GraphQL/DocumentResolver/Link.php +++ b/src/GraphQL/DocumentResolver/Link.php @@ -36,7 +36,6 @@ public function __construct(GraphQLService $graphQlService) * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * @@ -61,7 +60,6 @@ public function resolveObject($value = null, $args = [], $context = [], ResolveI * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * diff --git a/src/GraphQL/DocumentResolver/PageSnippet.php b/src/GraphQL/DocumentResolver/PageSnippet.php index 76903800..2c1b3b3f 100644 --- a/src/GraphQL/DocumentResolver/PageSnippet.php +++ b/src/GraphQL/DocumentResolver/PageSnippet.php @@ -30,7 +30,6 @@ class PageSnippet * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/DocumentType/AbstractDocumentType.php b/src/GraphQL/DocumentType/AbstractDocumentType.php index 83b3da39..de637439 100644 --- a/src/GraphQL/DocumentType/AbstractDocumentType.php +++ b/src/GraphQL/DocumentType/AbstractDocumentType.php @@ -26,7 +26,6 @@ abstract class AbstractDocumentType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -57,13 +56,13 @@ public function buildBaseFields(&$config) $config['fields'] = [ 'creationDate' => Type::int(), 'id' => ['name' => 'id', - 'type' => Type::id() + 'type' => Type::id(), ], 'fullpath' => [ 'type' => Type::string()], 'modificationDate' => Type::int(), 'published' => ['name' => 'published', - 'type' => Type::boolean() + 'type' => Type::boolean(), ], 'type' => Type::string(), 'controller' => Type::string(), @@ -74,17 +73,17 @@ public function buildBaseFields(&$config) 'args' => [ 'name' => ['type' => Type::string()], ], - 'resolve' => [$resolver, 'resolveTag'] + 'resolve' => [$resolver, 'resolveTag'], ], 'properties' => [ 'type' => Type::listOf($propertyType), 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma seperated list of key names' - ] + 'description' => 'comma seperated list of key names', + ], ], - 'resolve' => [$resolver, 'resolveProperties'] + 'resolve' => [$resolver, 'resolveProperties'], ], 'parent' => [ 'type' => $documentTree, @@ -102,7 +101,7 @@ public function buildBaseFields(&$config) 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => Type::listOf($documentTranslation), 'resolve' => [$documentResolver, 'resolveTranslations'], - ] + ], ]; } } diff --git a/src/GraphQL/DocumentType/DocumentElementType.php b/src/GraphQL/DocumentType/DocumentElementType.php index 72965eca..a2113615 100644 --- a/src/GraphQL/DocumentType/DocumentElementType.php +++ b/src/GraphQL/DocumentType/DocumentElementType.php @@ -25,13 +25,11 @@ class DocumentElementType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; protected $container; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -53,9 +51,6 @@ public function getTypes(): array return $supportedTypes; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { $type = $element->getType(); diff --git a/src/GraphQL/DocumentType/DocumentFolderType.php b/src/GraphQL/DocumentType/DocumentFolderType.php index 13b35add..8e76e2ba 100644 --- a/src/GraphQL/DocumentType/DocumentFolderType.php +++ b/src/GraphQL/DocumentType/DocumentFolderType.php @@ -22,7 +22,6 @@ class DocumentFolderType extends FolderType { /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -49,7 +48,7 @@ public function build(&$config) ], 'filename' => Type::string(), 'fullpath' => [ - 'type' => Type::string() + 'type' => Type::string(), ], 'creationDate' => Type::int(), 'modificationDate' => Type::int(), @@ -69,7 +68,7 @@ public function build(&$config) 'args' => ['defaultLanguage' => ['type' => Type::string()]], 'type' => Type::listOf($documentTranslation), 'resolve' => [$documentResolver, 'resolveTranslations'], - ] + ], ]; } } diff --git a/src/GraphQL/DocumentType/DocumentLinkInputType.php b/src/GraphQL/DocumentType/DocumentLinkInputType.php index 4b884515..c5663ed9 100644 --- a/src/GraphQL/DocumentType/DocumentLinkInputType.php +++ b/src/GraphQL/DocumentType/DocumentLinkInputType.php @@ -26,7 +26,6 @@ class DocumentLinkInputType extends InputObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ diff --git a/src/GraphQL/DocumentType/DocumentPageInputType.php b/src/GraphQL/DocumentType/DocumentPageInputType.php index 9f939e4b..cab39fde 100644 --- a/src/GraphQL/DocumentType/DocumentPageInputType.php +++ b/src/GraphQL/DocumentType/DocumentPageInputType.php @@ -27,7 +27,6 @@ class DocumentPageInputType extends InputObjectType protected $processors = []; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -58,7 +57,7 @@ public function build(&$config) $elementInputTypeList = new InputObjectType([ //TODO this is document_page specific 'name' => 'document_pagemutationelements', - 'fields' => $elementFields + 'fields' => $elementFields, ]); $config['fields'] = [ @@ -66,7 +65,7 @@ public function build(&$config) 'controller' => Type::string(), 'action' => Type::string(), 'template' => Type::string(), - 'elements' => $elementInputTypeList + 'elements' => $elementInputTypeList, ]; } diff --git a/src/GraphQL/DocumentType/DocumentTreeType.php b/src/GraphQL/DocumentType/DocumentTreeType.php index 6101b1e7..53222dbe 100644 --- a/src/GraphQL/DocumentType/DocumentTreeType.php +++ b/src/GraphQL/DocumentType/DocumentTreeType.php @@ -29,7 +29,6 @@ class DocumentTreeType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; private $types; @@ -37,7 +36,6 @@ class DocumentTreeType extends UnionType implements ContainerAwareInterface private $customTypes = []; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'document_tree']) @@ -47,7 +45,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'docum } /** - * @return array * * @throws \Exception */ @@ -63,7 +60,7 @@ public function getTypes(): array 'document_hardlink', 'document_link', 'document_page', - 'document_snippet' + 'document_snippet', ]; foreach ($supportedTypes as $supportedType) { $this->types[$supportedType] = $this->getGraphQlService()->getDocumentTypeDefinition($supportedType); @@ -84,7 +81,6 @@ public function getTypes(): array /** * @param ElementInterface $element * @param array $context - * @param ResolveInfo $info * * @return mixed */ diff --git a/src/GraphQL/DocumentType/DocumentType.php b/src/GraphQL/DocumentType/DocumentType.php index 0348f0db..71d01bee 100644 --- a/src/GraphQL/DocumentType/DocumentType.php +++ b/src/GraphQL/DocumentType/DocumentType.php @@ -26,7 +26,6 @@ class DocumentType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; protected $types; @@ -62,12 +61,6 @@ class DocumentType extends UnionType implements ContainerAwareInterface protected $customTypes; /** - * @param Service $graphQlService - * @param PageType $pageType - * @param LinkType $linkType - * @param EmailType $emailType - * @param HardlinkType $hardlinkType - * @param SnippetType $snippetType * @param array $config */ public function __construct(Service $graphQlService, PageType $pageType, LinkType $linkType, EmailType $emailType, HardlinkType $hardlinkType, SnippetType $snippetType, $config = []) @@ -85,7 +78,6 @@ public function __construct(Service $graphQlService, PageType $pageType, LinkTyp } /** - * @return array * * @throws \Exception */ @@ -110,9 +102,6 @@ public function getCustomDataTypes() return $this->customTypes; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { $element = Document::getById($element['id']); diff --git a/src/GraphQL/DocumentType/EmailType.php b/src/GraphQL/DocumentType/EmailType.php index 4cb04fdd..010ceb6b 100644 --- a/src/GraphQL/DocumentType/EmailType.php +++ b/src/GraphQL/DocumentType/EmailType.php @@ -24,7 +24,6 @@ class EmailType extends AbstractDocumentType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -48,7 +47,7 @@ public function build(&$config) 'replyTo' => Type::string(), 'to' => Type::string(), 'cc' => Type::string(), - 'bcc' => Type::string() + 'bcc' => Type::string(), ] ); } diff --git a/src/GraphQL/DocumentType/HardlinkType.php b/src/GraphQL/DocumentType/HardlinkType.php index bd4ff7d4..fe65e81d 100644 --- a/src/GraphQL/DocumentType/HardlinkType.php +++ b/src/GraphQL/DocumentType/HardlinkType.php @@ -27,8 +27,6 @@ class HardlinkType extends AbstractDocumentType protected $anyDocumentTargetType; /** - * @param Service $graphQlService - * @param AnyDocumentTargetType $anyDocumentTargetType * @param array $config * @param array $context */ @@ -53,8 +51,8 @@ public function build(&$config) 'childrenFromSource' => Type::boolean(), 'target' => [ 'type' => $this->anyDocumentTargetType, - 'resolve' => [$resolver, 'resolveTarget'] - ] + 'resolve' => [$resolver, 'resolveTarget'], + ], ] ); } diff --git a/src/GraphQL/DocumentType/LinkType.php b/src/GraphQL/DocumentType/LinkType.php index 6ec7232e..8fb1d824 100644 --- a/src/GraphQL/DocumentType/LinkType.php +++ b/src/GraphQL/DocumentType/LinkType.php @@ -24,7 +24,6 @@ class LinkType extends AbstractDocumentType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ @@ -50,11 +49,11 @@ public function build(&$config) 'internalType' => Type::string(), 'object' => [ 'type' => $anyTargetType, - 'resolve' => [$resolver, 'resolveObject'] + 'resolve' => [$resolver, 'resolveObject'], ], 'direct' => Type::string(), 'linktype' => Type::string(), - 'href' => Type::string() + 'href' => Type::string(), ] ); } diff --git a/src/GraphQL/DocumentType/PageSnippetType.php b/src/GraphQL/DocumentType/PageSnippetType.php index 403f3996..3a8652b0 100644 --- a/src/GraphQL/DocumentType/PageSnippetType.php +++ b/src/GraphQL/DocumentType/PageSnippetType.php @@ -26,8 +26,6 @@ class PageSnippetType extends AbstractDocumentType protected $documentElementType; /** - * @param Service $graphQlService - * @param DocumentElementType $documentElementType * @param array $config * @param array $context */ @@ -48,7 +46,7 @@ public function build(&$config) $this->buildBaseFields($config); $config['fields']['elements'] = [ 'type' => Type::listOf($this->documentElementType), - 'resolve' => [$resolver, 'resolveElements'] + 'resolve' => [$resolver, 'resolveElements'], ]; $config['fields']['editables'] = [ @@ -57,18 +55,18 @@ public function build(&$config) 'getInheritedValues' => [ 'type' => Type::boolean(), 'description' => 'Whether inherited editables should be fetched or not.', - 'defaultValue' => false + 'defaultValue' => false, ], ], - 'resolve' => [$resolver, 'resolveElements'] + 'resolve' => [$resolver, 'resolveElements'], ]; $config['fields']['title'] = [ - 'type' => Type::string() + 'type' => Type::string(), ]; $config['fields']['description'] = [ - 'type' => Type::string() + 'type' => Type::string(), ]; $keyValue = new ListOfType(KeyValueType::getInstance()); @@ -79,22 +77,22 @@ public function build(&$config) 'attributes' => [ 'type' => $keyValue, 'description' => 'Attributes passed into the controller/action', - 'defaultValue' => [] + 'defaultValue' => [], ], 'query' => [ 'type' => $keyValue, 'description' => 'Query Params passed into the controller/action', - 'defaultValue' => [] + 'defaultValue' => [], ], 'options' => [ 'type' => $keyValue, 'description' => 'Options passed into the controller/action', - 'defaultValue' => [] + 'defaultValue' => [], ], 'use_layout' => [ 'type' => Type::boolean(), - 'description' => 'Disable Layout Rendering' - ] + 'description' => 'Disable Layout Rendering', + ], ], 'resolve' => static function ($value, $args) { $documentId = $value['id']; @@ -115,7 +113,7 @@ public function build(&$config) } return null; - } + }, ]; } } diff --git a/src/GraphQL/DocumentType/PageType.php b/src/GraphQL/DocumentType/PageType.php index 6d2a2c8c..aa2c20ba 100644 --- a/src/GraphQL/DocumentType/PageType.php +++ b/src/GraphQL/DocumentType/PageType.php @@ -20,8 +20,6 @@ class PageType extends PageSnippetType { /** - * @param Service $graphQlService - * @param DocumentElementType $documentElementType * @param array $config * @param array $context */ diff --git a/src/GraphQL/DocumentType/SnippetType.php b/src/GraphQL/DocumentType/SnippetType.php index adceb2bd..68e9a331 100644 --- a/src/GraphQL/DocumentType/SnippetType.php +++ b/src/GraphQL/DocumentType/SnippetType.php @@ -20,8 +20,6 @@ class SnippetType extends PageSnippetType { /** - * @param Service $graphQlService - * @param DocumentElementType $documentElementType * @param array $config * @param array $context */ diff --git a/src/GraphQL/ElementDescriptor.php b/src/GraphQL/ElementDescriptor.php index 4e95f678..6d5c9e1a 100644 --- a/src/GraphQL/ElementDescriptor.php +++ b/src/GraphQL/ElementDescriptor.php @@ -22,9 +22,6 @@ class ElementDescriptor extends BaseDescriptor { - /** - * @param ElementInterface|null $element - */ public function __construct(ElementInterface $element = null) { parent::__construct(); diff --git a/src/GraphQL/ElementTag.php b/src/GraphQL/ElementTag.php index 2105b512..9a524404 100644 --- a/src/GraphQL/ElementTag.php +++ b/src/GraphQL/ElementTag.php @@ -40,8 +40,8 @@ public static function getElementTagInputTypeDefinition() 'fields' => [ 'id' => Type::id(), 'path' => Type::string(), - ] - ])) + ], + ])), ]; } @@ -49,7 +49,6 @@ public static function getElementTagInputTypeDefinition() } /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -68,7 +67,7 @@ public function build(&$config) $config['fields'] = [ 'id' => Type::id(), 'name' => Type::string(), - 'path' => Type::string() + 'path' => Type::string(), ]; } } diff --git a/src/GraphQL/Exception/ClientSafeException.php b/src/GraphQL/Exception/ClientSafeException.php index 0025a47c..f6be6ab8 100644 --- a/src/GraphQL/Exception/ClientSafeException.php +++ b/src/GraphQL/Exception/ClientSafeException.php @@ -19,9 +19,6 @@ class ClientSafeException extends \Exception implements ClientAware { - /** - * @return bool - */ public function isClientSafe(): bool { return true; diff --git a/src/GraphQL/FieldHelper/AbstractFieldHelper.php b/src/GraphQL/FieldHelper/AbstractFieldHelper.php index 450e8c9d..aaf086ac 100644 --- a/src/GraphQL/FieldHelper/AbstractFieldHelper.php +++ b/src/GraphQL/FieldHelper/AbstractFieldHelper.php @@ -45,7 +45,6 @@ public function skipField($container, $astName) } /** - * @param FieldNode $ast * @param array $data * @param object $container * @param array $args @@ -62,7 +61,7 @@ public function doExtractData(FieldNode $ast, &$data, $container, $args, $contex } // example for http://webonyx.github.io/graphql-php/error-handling/ -// throw new MySafeException("fieldhelper", "TBD customized error message"); + // throw new MySafeException("fieldhelper", "TBD customized error message"); $getter = 'get' . ucfirst($astName); $arguments = $this->getArguments($ast); @@ -88,7 +87,6 @@ public function doExtractData(FieldNode $ast, &$data, $container, $args, $contex } /** - * @param FieldNode $ast * * @return array */ @@ -112,7 +110,6 @@ public function getArguments(FieldNode $ast) * @param object $container * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array */ @@ -147,7 +144,6 @@ public function extractData(&$data, $container, $args, $context = [], ResolveInf * @param object $container * @param array $args * @param array $context - * @param ResolveInfo $resolveInfo */ public function processSelections(&$data, $selections, $container, $args, $context, ResolveInfo $resolveInfo) { diff --git a/src/GraphQL/FieldHelper/AssetFieldHelper.php b/src/GraphQL/FieldHelper/AssetFieldHelper.php index f30d599b..020c734f 100644 --- a/src/GraphQL/FieldHelper/AssetFieldHelper.php +++ b/src/GraphQL/FieldHelper/AssetFieldHelper.php @@ -67,7 +67,6 @@ public function getAssetThumbnail(Asset $asset, string | Image\Thumbnail\Config } /** - * @param FieldNode $ast * @param array $data * @param Asset $container * @param array $args diff --git a/src/GraphQL/FieldHelper/DataObjectFieldHelper.php b/src/GraphQL/FieldHelper/DataObjectFieldHelper.php index bb31d3cf..f5c033f2 100644 --- a/src/GraphQL/FieldHelper/DataObjectFieldHelper.php +++ b/src/GraphQL/FieldHelper/DataObjectFieldHelper.php @@ -69,8 +69,8 @@ public function getQueryFieldConfigFromConfig($nodeDef, $class, $container = nul 'key' => $key, 'config' => [ 'name' => $key, - 'type' => Type::int() - ] + 'type' => Type::int(), + ], ]; case 'filename': case 'fullpath': @@ -79,8 +79,8 @@ public function getQueryFieldConfigFromConfig($nodeDef, $class, $container = nul 'key' => $key, 'config' => [ 'name' => $key, - 'type' => Type::string() - ] + 'type' => Type::string(), + ], ]; case 'published': return [ @@ -88,7 +88,7 @@ public function getQueryFieldConfigFromConfig($nodeDef, $class, $container = nul 'config' => [ 'name' => $key, 'type' => Type::boolean(), - ] + ], ]; default: return null; @@ -193,8 +193,6 @@ public function getFieldDefinitionFromKey($class, $key, &$container = null) } /** - * @param Data $fieldDefinition - * @param string $operationType * * @return bool * @@ -268,7 +266,7 @@ public function getMutationFieldConfigFromConfig($nodeDef, $class) 'arg' => ['type' => Type::string()], 'processor' => function ($object, $newValue, $args) { $object->setKey($newValue); - } + }, ]; case 'published': @@ -277,7 +275,7 @@ public function getMutationFieldConfigFromConfig($nodeDef, $class) 'arg' => ['type' => Type::boolean()], 'processor' => function ($object, $newValue, $args) { $object->setPublished($newValue); - } + }, ]; default: return null; @@ -345,7 +343,6 @@ public function getGraphQlTypeFromNodeConf($nodeConf, $class, $container = null) } /** - * @param FieldNode $ast * @param array $data * @param object $container * @param array $args @@ -362,7 +359,7 @@ public function doExtractData(FieldNode $ast, &$data, $container, $args, $contex } // example for http://webonyx.github.io/graphql-php/error-handling/ -// throw new MySafeException("fieldhelper", "TBD customized error message"); + // throw new MySafeException("fieldhelper", "TBD customized error message"); $getter = 'get' . ucfirst($astName); diff --git a/src/GraphQL/FieldHelper/DocumentFieldHelper.php b/src/GraphQL/FieldHelper/DocumentFieldHelper.php index 51c8d903..99a6fd06 100644 --- a/src/GraphQL/FieldHelper/DocumentFieldHelper.php +++ b/src/GraphQL/FieldHelper/DocumentFieldHelper.php @@ -23,7 +23,6 @@ class DocumentFieldHelper extends AbstractFieldHelper { /** - * @param FieldNode $ast * @param array $data * @param Asset $container * @param array $args diff --git a/src/GraphQL/General/AnyDocumentTargetType.php b/src/GraphQL/General/AnyDocumentTargetType.php index 1ae689cf..bdec515a 100644 --- a/src/GraphQL/General/AnyDocumentTargetType.php +++ b/src/GraphQL/General/AnyDocumentTargetType.php @@ -26,11 +26,9 @@ class AnyDocumentTargetType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'AnyDocumentTarget']) @@ -41,7 +39,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'AnyDo } /** - * @return array * * @throws \Exception */ @@ -60,9 +57,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element) { diff --git a/src/GraphQL/General/AnyTargetType.php b/src/GraphQL/General/AnyTargetType.php index 7941a7b1..aed56501 100644 --- a/src/GraphQL/General/AnyTargetType.php +++ b/src/GraphQL/General/AnyTargetType.php @@ -27,11 +27,9 @@ class AnyTargetType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = ['name' => 'AnyTarget']) @@ -42,7 +40,6 @@ public function __construct(Service $graphQlService, $config = ['name' => 'AnyTa } /** - * @return array * * @throws \Exception */ @@ -86,9 +83,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element) { diff --git a/src/GraphQL/General/FolderType.php b/src/GraphQL/General/FolderType.php index 0c298a2f..2e3a33fd 100644 --- a/src/GraphQL/General/FolderType.php +++ b/src/GraphQL/General/FolderType.php @@ -24,7 +24,6 @@ abstract class FolderType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config * @param array $context */ diff --git a/src/GraphQL/General/UploadType.php b/src/GraphQL/General/UploadType.php index 47407d0d..71459a9a 100644 --- a/src/GraphQL/General/UploadType.php +++ b/src/GraphQL/General/UploadType.php @@ -31,17 +31,11 @@ class UploadType extends ScalarType 'The `Upload` special type represents a file to be uploaded in the same HTTP request as specified by [graphql-multipart-request-spec](https://github.com/jaydenseric/graphql-multipart-request-spec).'; - /** - * @inheritDoc - */ public function serialize($value) { throw new InvariantViolation('`Upload` cannot be serialized'); } - /** - * @inheritDoc - */ public function parseValue($value) { if (!$value instanceof UploadedFile) { @@ -55,9 +49,6 @@ public function parseValue($value) return $value; } - /** - * @inheritDoc - */ public function parseLiteral(Node $valueNode, ?array $variables = null) { throw new Error( diff --git a/src/GraphQL/Helper.php b/src/GraphQL/Helper.php index de89e5dd..79d2c9b3 100644 --- a/src/GraphQL/Helper.php +++ b/src/GraphQL/Helper.php @@ -101,7 +101,7 @@ public static function buildSqlCondition($defaultTable, $q, $op = null, $subject '$like' => 'LIKE', '$notlike' => 'NOT LIKE', '$notnull' => 'IS NOT NULL', - '$not' => 'NOT' + '$not' => 'NOT', ]; $ops = array_keys($mappingTable); @@ -151,15 +151,15 @@ public static function buildSqlCondition($defaultTable, $q, $op = null, $subject $parts[] = '( NOT ' . $db->quoteIdentifier($key) . $valuePart . ')'; } else { $parts[] = '( NOT ' . self::quoteAbsoluteColumnName( - $defaultTable, - $key - ) . $valuePart . ')'; + $defaultTable, + $key + ) . $valuePart . ')'; } } else { $parts[] = '(' . self::quoteAbsoluteColumnName( - $defaultTable, - $key - ) . ' ' . $innerOp . ' ' . $db->quote($objectValue) . ')'; + $defaultTable, + $key + ) . ' ' . $innerOp . ' ' . $db->quote($objectValue) . ')'; } } else { if ($objectValue instanceof \stdClass) { @@ -167,14 +167,14 @@ public static function buildSqlCondition($defaultTable, $q, $op = null, $subject } else { if (is_null($objectValue)) { $parts[] = '(' . self::quoteAbsoluteColumnName( - $defaultTable, - $objectVar - ) . ' IS NULL)'; + $defaultTable, + $objectVar + ) . ' IS NULL)'; } else { $parts[] = '(' . self::quoteAbsoluteColumnName( - $defaultTable, - $objectVar - ) . ' = ' . $db->quote($objectValue) . ')'; + $defaultTable, + $objectVar + ) . ' = ' . $db->quote($objectValue) . ')'; } } } @@ -186,14 +186,14 @@ public static function buildSqlCondition($defaultTable, $q, $op = null, $subject $innerOp = $mappingTable[strtolower($key)]; if ($innerOp == 'NOT') { $parts[] = '(NOT' . self::quoteAbsoluteColumnName( - $defaultTable, - $subject - ) . ' = ' . $db->quote($value) . ')'; + $defaultTable, + $subject + ) . ' = ' . $db->quote($value) . ')'; } else { $parts[] = '(' . self::quoteAbsoluteColumnName( - $defaultTable, - $subject - ) . ' ' . $innerOp . ' ' . $db->quote($value) . ')'; + $defaultTable, + $subject + ) . ' ' . $innerOp . ' ' . $db->quote($value) . ')'; } } else { if (isset($fieldMappingTable[$key])) { @@ -207,9 +207,9 @@ public static function buildSqlCondition($defaultTable, $q, $op = null, $subject $parts[] = '(' . self::quoteAbsoluteColumnName($defaultTable, $key) . ' IS NULL)'; } else { $parts[] = '(' . self::quoteAbsoluteColumnName( - $defaultTable, - $key - ) . ' = ' . $db->quote($value) . ')'; + $defaultTable, + $key + ) . ' = ' . $db->quote($value) . ')'; } } } diff --git a/src/GraphQL/Mutation/MutationType.php b/src/GraphQL/Mutation/MutationType.php index bd919d0a..8aaff3bf 100644 --- a/src/GraphQL/Mutation/MutationType.php +++ b/src/GraphQL/Mutation/MutationType.php @@ -50,7 +50,6 @@ class MutationType extends ObjectType { use ServiceTrait; - use PermissionInfoTrait; use ElementIdentificationTrait; use ElementTagTrait; @@ -62,22 +61,20 @@ class MutationType extends ObjectType * @var LocaleServiceInterface */ protected $localeService; + /** * @var Factory */ protected $modelFactory; public static $typeCache = []; + /** * @var EventDispatcherInterface */ private $eventDispatcher; /** - * @param Service $graphQlService - * @param LocaleServiceInterface $localeService - * @param Factory $modelFactory - * @param EventDispatcherInterface $eventDispatcher * @param array $config * @param array $context * @@ -189,8 +186,8 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ } return $value; - } - ] + }, + ], ], ]); @@ -200,14 +197,14 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ 'path' => ['type' => Type::string()], 'parentId' => ['type' => Type::int()], 'published' => ['type' => Type::boolean(), 'description' => 'Default is true!'], - 'userId' => ['type' => Type::int()] + 'userId' => ['type' => Type::int()], ]; } else { $args = [ 'id' => ['type' => Type::int()], 'fullpath' => ['type' => Type::string()], 'omitVersionCreate' => ['type' => Type::boolean()], - 'userId' => ['type' => Type::int()] + 'userId' => ['type' => Type::int()], ]; } @@ -221,7 +218,7 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ self::$typeCache[$inputTypeName] = $inputType; $args = array_merge($args, [ - 'input' => $inputType + 'input' => $inputType, ]); $me = $this; @@ -235,7 +232,7 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ if (!WorkspaceHelper::checkPermission($element, 'update')) { return [ 'success' => false, - 'message' => 'not allowed to update document' + 'message' => 'not allowed to update document', ]; } } else { @@ -250,14 +247,14 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ if (!$parent) { return [ 'success' => false, - 'message' => 'unable to resolve parent' + 'message' => 'unable to resolve parent', ]; } if (!WorkspaceHelper::checkPermission($parent, 'create')) { return [ 'success' => false, - 'message' => 'not allowed to create document' + 'message' => 'not allowed to create document', ]; } @@ -294,9 +291,9 @@ public function buildUpdateDocumentMutation(&$config, $context, $mutationType, $ return [ 'success' => true, 'message' => 'document updated: ' . $element->getId(), - 'id' => $element->getId() + 'id' => $element->getId(), ]; - } + }, ]; $config['fields'][$opName] = $updateField; @@ -325,7 +322,7 @@ public function getDocumentEmailMutationInputType($context, &$processors = []) $elementInputTypeList = new InputObjectType([ 'name' => 'document_emailmutationelements', - 'fields' => $elementFields + 'fields' => $elementFields, ]); $inputTypeName = 'document_email_input'; @@ -347,7 +344,7 @@ public function getDocumentEmailMutationInputType($context, &$processors = []) 'cc' => Type::string(), 'bcc' => Type::string(), 'tags' => ElementTag::getElementTagInputTypeDefinition(), - ] + ], ]); return $inputType; @@ -370,7 +367,6 @@ public function getDocumentLinkMutationInputType($context, &$processors = []) * @param ElementDescriptor|null $value * @param array $args * @param mixed $context - * @param ResolveInfo $info * @param Document\Link $element * @param array $processors */ @@ -402,7 +398,6 @@ public static function processDocumentLinkMutationInput($value, $args, $context, * @param ElementDescriptor|null $value * @param array $args * @param mixed $context - * @param ResolveInfo $info * @param Document\Page|Document\Email $element * @param array $processors * @@ -417,7 +412,6 @@ public function processDocumentEmailMutationInput($value, $args, $context, Resol * @param ElementDescriptor|null $value * @param array $args * @param mixed $context - * @param ResolveInfo $info * @param Document\Page|Document\Email $element * @param array $processors */ @@ -486,8 +480,8 @@ public function getDocumentPageMutationInputType($context, &$processors = []) 'name' => 'overwrite_strategy', 'values' => [ 'overwrite', - 'update' - ] + 'update', + ], ]); } @@ -505,7 +499,7 @@ public function getDocumentPageMutationInputType($context, &$processors = []) 'editableUpdateStrategy' => self::$typeCache['overwrite_strategy'], 'editables' => $elementInputTypeList, 'tags' => ElementTag::getElementTagInputTypeDefinition(), - ] + ], ]); return $inputType; @@ -527,6 +521,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) $class = ClassDefinition::getByName($entity); if (!$class) { Logger::error('class ' . $entity . ' not found'); + continue; } $entityConfig = $configuration->getMutationEntityConfig($entity); @@ -554,8 +549,8 @@ public function buildDataObjectMutations(&$config = [], $context = []) } return $value; - } - ] + }, + ], ], ]); @@ -568,7 +563,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) $inputTypeName = 'Update' . ucfirst($entity) . 'Input'; $inputType = self::$typeCache[$inputTypeName] ?? new InputObjectType([ 'name' => $inputTypeName, - 'fields' => $inputFields + 'fields' => $inputFields, ]); self::$typeCache[$inputTypeName] = $inputType; @@ -600,7 +595,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) if (!$parent) { return [ 'success' => false, - 'message' => 'unable to resolve parent' + 'message' => 'unable to resolve parent', ]; } @@ -609,7 +604,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) if (!$me->omitPermissionCheck && !WorkspaceHelper::checkPermission($parent, 'create')) { return [ 'success' => false, - 'message' => 'not allowed to create object ' . $entity + 'message' => 'not allowed to create object ' . $entity, ]; } @@ -671,9 +666,9 @@ public function buildDataObjectMutations(&$config = [], $context = []) return [ 'success' => true, 'message' => 'object created: ' . $newInstance->getId(), - 'id' => $newInstance->getId() + 'id' => $newInstance->getId(), ]; - } + }, ]; $config['fields'][$opName] = $createField; @@ -699,8 +694,8 @@ public function buildDataObjectMutations(&$config = [], $context = []) } return $value; - } - ] + }, + ], ], ]); @@ -711,7 +706,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) $inputTypeName = 'Update' . ucfirst($entity) . 'Input'; $inputType = isset(self::$typeCache[$inputTypeName]) ? self::$typeCache[$inputTypeName] : new InputObjectType([ 'name' => $inputTypeName, - 'fields' => $inputFields + 'fields' => $inputFields, ]); self::$typeCache[$inputTypeName] = $inputType; @@ -726,7 +721,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'omitVersionCreate' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], 'input' => ['type' => $inputType], - ], 'resolve' => $this->getUpdateObjectResolver($processors, $localeService, null, $this->omitPermissionCheck) + ], 'resolve' => $this->getUpdateObjectResolver($processors, $localeService, null, $this->omitPermissionCheck), ]; $config['fields'][$opName] = $updateField; @@ -739,7 +734,7 @@ public function buildDataObjectMutations(&$config = [], $context = []) 'name' => 'Delete' . ucfirst($entity) . 'Result', 'fields' => [ 'success' => ['type' => Type::boolean()], - 'message' => ['type' => Type::string()] + 'message' => ['type' => Type::string()], ], ]); @@ -759,29 +754,29 @@ public function buildDataObjectMutations(&$config = [], $context = []) if (!$object) { return [ 'success' => false, - 'message' => 'unable to delete object. Unknown id or fullpath' + 'message' => 'unable to delete object. Unknown id or fullpath', ]; } if (!$me->omitPermissionCheck && !WorkspaceHelper::checkPermission($object, 'delete')) { return [ 'success' => false, - 'message' => 'permission denied.' + 'message' => 'permission denied.', ]; } $object->delete(); return [ 'success' => true, - 'message' => '' + 'message' => '', ]; } catch (\Exception $e) { return [ 'success' => false, - 'message' => $e->getMessage() + 'message' => $e->getMessage(), ]; } - } + }, ]; $config['fields'][$opName] = $deleteField; @@ -856,14 +851,14 @@ public function getUpdateObjectResolver($processors, $localeService, $object = n if (!$object) { return [ 'success' => false, - 'message' => 'unable to update object. Unknown id or fullpath' + 'message' => 'unable to update object. Unknown id or fullpath', ]; } if (!$omitPermissionCheck && !WorkspaceHelper::checkPermission($object, 'update')) { return [ 'success' => false, - 'message' => 'permission denied.' + 'message' => 'permission denied.', ]; } @@ -904,14 +899,14 @@ public function getUpdateObjectResolver($processors, $localeService, $object = n } catch (\Exception $e) { return [ 'success' => false, - 'message' => $e->getMessage() + 'message' => $e->getMessage(), ]; } return [ 'success' => true, 'message' => 'object ' . $object->getId() . ' updated', - 'id' => $object->getId() + 'id' => $object->getId(), ]; }; } @@ -947,8 +942,8 @@ public function buildCreateAssetMutation(&$config, $context) } return $value; - } - ] + }, + ], ], ]); @@ -978,14 +973,14 @@ public function buildCreateAssetMutation(&$config, $context) if (!$parent) { return [ 'success' => false, - 'message' => 'unable to resolve parent' + 'message' => 'unable to resolve parent', ]; } if (!$omitPermissionCheck && !WorkspaceHelper::checkPermission($parent, 'create')) { return [ 'success' => false, - 'message' => 'not allowed to create asset' + 'message' => 'not allowed to create asset', ]; } @@ -1026,12 +1021,12 @@ public function buildCreateAssetMutation(&$config, $context) } catch (DuplicateFullPathException $e) { return [ 'success' => false, - 'message' => 'saving failed: Duplicate path' + 'message' => 'saving failed: Duplicate path', ]; } catch (\Exception $e) { return [ 'success' => false, - 'message' => 'saving failed: ' . $e->getMessage() + 'message' => 'saving failed: ' . $e->getMessage(), ]; } @@ -1042,9 +1037,9 @@ public function buildCreateAssetMutation(&$config, $context) return [ 'success' => true, 'message' => 'asset created: ' . $newInstance->getId(), - 'id' => $newInstance->getId() + 'id' => $newInstance->getId(), ]; - } + }, ]; $config['fields'][$opName] = $createField; @@ -1085,8 +1080,8 @@ public function buildUpdateAssetMutation(&$config, $context) } return $value; - } - ] + }, + ], ], ]); @@ -1100,7 +1095,7 @@ public function buildUpdateAssetMutation(&$config, $context) 'fullpath' => ['type' => Type::string()], 'omitVersionCreate' => ['type' => Type::boolean()], 'userId' => ['type' => Type::int()], - 'input' => $this->getGraphQlService()->getAssetTypeDefinition('asset_input') + 'input' => $this->getGraphQlService()->getAssetTypeDefinition('asset_input'), ], 'resolve' => static function ($value, $args, $context, ResolveInfo $info) use ($me) { /** @var Asset $element */ $element = $me->getElementByTypeAndIdOrPath($args, 'asset'); @@ -1137,9 +1132,9 @@ public function buildUpdateAssetMutation(&$config, $context) return [ 'success' => true, 'message' => 'asset updated: ' . $element->getId(), - 'id' => $element->getId() + 'id' => $element->getId(), ]; - } + }, ]; $config['fields'][$opName] = $updateField; @@ -1164,14 +1159,14 @@ public function buildCreateFolderMutation($type, &$config, $context) 'fields' => [ 'success' => ['type' => Type::boolean()], 'message' => ['type' => Type::string()], - 'id' => ['type' => Type::int()] + 'id' => ['type' => Type::int()], ], ]); $args = [ 'path' => ['type' => Type::string()], 'parentId' => ['type' => Type::int()], - 'userId' => ['type' => Type::int()] + 'userId' => ['type' => Type::int()], ]; if ($type === 'asset') { @@ -1184,7 +1179,7 @@ public function buildCreateFolderMutation($type, &$config, $context) $createField = [ 'type' => $createResultType, 'args' => $args, - 'resolve' => $resolverFn + 'resolve' => $resolverFn, ]; $config['fields'][$opName] = $createField; @@ -1212,14 +1207,14 @@ public function getCreateFolderResolver($elementType) if (!$parent) { return [ 'success' => false, - 'message' => 'unable to resolve parent' + 'message' => 'unable to resolve parent', ]; } if (!$me->omitPermissionCheck && !WorkspaceHelper::checkPermission($parent, 'create')) { return [ 'success' => false, - 'message' => 'not allowed to create ' . $elementType . 'folder ' + 'message' => 'not allowed to create ' . $elementType . 'folder ', ]; } @@ -1248,7 +1243,7 @@ public function getCreateFolderResolver($elementType) return [ 'success' => true, 'message' => 'folder created: ' . $newInstance->getId(), - 'id' => $newInstance->getId() + 'id' => $newInstance->getId(), ]; }; } @@ -1269,7 +1264,7 @@ public function buildUpdateFolderMutation($type, &$config, $context) $opName = 'update' . ucfirst($type) . 'Folder'; $inputFields = [ - 'parentId' => ['type' => Type::int()] + 'parentId' => ['type' => Type::int()], ]; if ($type === 'asset') { $inputFields['filename'] = ['type' => Type::string()]; @@ -1278,14 +1273,14 @@ public function buildUpdateFolderMutation($type, &$config, $context) } $inputType = new InputObjectType([ 'name' => 'Update' . ucfirst($type) . 'FolderInput', - 'fields' => $inputFields + 'fields' => $inputFields, ]); $updateResultType = new ObjectType([ 'name' => 'Update' . ucfirst($type) . 'FolderResult', 'fields' => [ 'success' => ['type' => Type::boolean()], - 'message' => ['type' => Type::string()] + 'message' => ['type' => Type::string()], ], ]); @@ -1298,7 +1293,7 @@ public function buildUpdateFolderMutation($type, &$config, $context) 'id' => ['type' => Type::int()], 'fullpath' => ['type' => Type::string()], 'userId' => ['type' => Type::int()], - 'input' => ['type' => $inputType] + 'input' => ['type' => $inputType], ], 'resolve' => static function ($value, $args, $context, ResolveInfo $info) use ($type, $omitPermissionCheck, $me) { try { /** @var Configuration $configuration */ @@ -1308,7 +1303,7 @@ public function buildUpdateFolderMutation($type, &$config, $context) if (!$omitPermissionCheck && !WorkspaceHelper::checkPermission($element, 'update')) { return [ 'success' => false, - 'message' => 'permission denied.' + 'message' => 'permission denied.', ]; } @@ -1327,16 +1322,16 @@ public function buildUpdateFolderMutation($type, &$config, $context) } catch (\Exception $e) { return [ 'success' => false, - 'message' => $e->getMessage() + 'message' => $e->getMessage(), ]; } return [ 'success' => true, 'message' => 'hurray', - 'id' => $element->getId() + 'id' => $element->getId(), ]; - } + }, ]; $config['fields'][$opName] = $updateField; @@ -1370,7 +1365,7 @@ public function buildDeleteElementMutation(&$config, $context, $type) 'name' => 'Delete' . ucfirst($type) . 'Result', 'fields' => [ 'success' => ['type' => Type::boolean()], - 'message' => ['type' => Type::string()] + 'message' => ['type' => Type::string()], ], ]); @@ -1389,7 +1384,7 @@ public function buildDeleteElementMutation(&$config, $context, $type) if (!$idOrPath) { return [ 'success' => false, - 'message' => 'Missing required field id or fullpath to delete the asset.' + 'message' => 'Missing required field id or fullpath to delete the asset.', ]; } @@ -1398,7 +1393,7 @@ public function buildDeleteElementMutation(&$config, $context, $type) if (!$omitPermissionCheck && !WorkspaceHelper::checkPermission($element, 'delete')) { return [ 'success' => false, - 'message' => 'delete ' . $type . ' permission denied.' + 'message' => 'delete ' . $type . ' permission denied.', ]; } $result = ['success' => false]; @@ -1406,14 +1401,14 @@ public function buildDeleteElementMutation(&$config, $context, $type) $result = [ 'success' => true, - 'message' => $type . ' ' . $idOrPath . ' deleted' + 'message' => $type . ' ' . $idOrPath . ' deleted', ]; } catch (\Exception $e) { $result['message'] = $e->getMessage(); } return $result; - } + }, ]; $config['fields'][$opName] = $deleteField; @@ -1447,7 +1442,7 @@ public function buildDeleteFolderMutation($type, &$config, $context) 'name' => 'Delete' . ucfirst($type) . 'FolderResult', 'fields' => [ 'success' => ['type' => Type::boolean()], - 'message' => ['type' => Type::string()] + 'message' => ['type' => Type::string()], ], ]); @@ -1469,22 +1464,22 @@ public function buildDeleteFolderMutation($type, &$config, $context) if (!$omitPermissionCheck && !WorkspaceHelper::checkPermission($element, 'delete')) { return [ 'success' => false, - 'message' => 'delete ' . $type . ' permission denied.' + 'message' => 'delete ' . $type . ' permission denied.', ]; } $element->delete(); return [ 'success' => true, - 'message' => '' + 'message' => '', ]; } catch (\Exception $e) { return [ 'success' => false, - 'message' => $e->getMessage() + 'message' => $e->getMessage(), ]; } - } + }, ]; $config['fields'][$opName] = $deleteField; @@ -1512,14 +1507,14 @@ public function getUpdateFolderResolver($elementType) if (!$parent) { return [ 'success' => false, - 'message' => 'unable to resolve parent' + 'message' => 'unable to resolve parent', ]; } if (!$me->omitPermissionCheck && !WorkspaceHelper::checkPermission($parent, 'update')) { return [ 'success' => false, - 'message' => 'not allowed to create ' . $elementType . 'folder ' + 'message' => 'not allowed to create ' . $elementType . 'folder ', ]; } @@ -1537,7 +1532,7 @@ public function getUpdateFolderResolver($elementType) return [ 'success' => true, 'message' => 'folder created: ' . $newInstance->getId(), - 'id' => $newInstance->getId() + 'id' => $newInstance->getId(), ]; }; } diff --git a/src/GraphQL/Mutation/Operator/Factory/DefaultMutationOperatorFactoryBase.php b/src/GraphQL/Mutation/Operator/Factory/DefaultMutationOperatorFactoryBase.php index ea7ffdb0..f2382739 100644 --- a/src/GraphQL/Mutation/Operator/Factory/DefaultMutationOperatorFactoryBase.php +++ b/src/GraphQL/Mutation/Operator/Factory/DefaultMutationOperatorFactoryBase.php @@ -37,7 +37,6 @@ public function __construct(Service $graphQlService, string $className) } /** - * @param array $configElement * @param array|null $context * * @return OperatorInterface diff --git a/src/GraphQL/PropertyType/AssetFolderType.php b/src/GraphQL/PropertyType/AssetFolderType.php index 989fc3d5..1baeed84 100644 --- a/src/GraphQL/PropertyType/AssetFolderType.php +++ b/src/GraphQL/PropertyType/AssetFolderType.php @@ -30,7 +30,6 @@ class AssetFolderType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -48,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'asset' => [ 'type' => $assetFolderType, @@ -78,7 +77,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ]]]; diff --git a/src/GraphQL/PropertyType/AssetType.php b/src/GraphQL/PropertyType/AssetType.php index 7b10d100..2cae25d7 100644 --- a/src/GraphQL/PropertyType/AssetType.php +++ b/src/GraphQL/PropertyType/AssetType.php @@ -30,7 +30,6 @@ class AssetType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -48,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'asset' => [ 'type' => $assetType, @@ -81,9 +80,9 @@ public function __construct(Service $graphQlService) } return null; - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/PropertyType/CheckboxType.php b/src/GraphQL/PropertyType/CheckboxType.php index 5440adde..924e03fd 100644 --- a/src/GraphQL/PropertyType/CheckboxType.php +++ b/src/GraphQL/PropertyType/CheckboxType.php @@ -40,7 +40,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'checked' => [ 'type' => Type::boolean(), @@ -58,9 +58,9 @@ public function __construct(Service $graphQlService) } elseif ($value instanceof Property) { return $value->getData(); } - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/PropertyType/DataObjectType.php b/src/GraphQL/PropertyType/DataObjectType.php index 9922438d..8b6c6577 100644 --- a/src/GraphQL/PropertyType/DataObjectType.php +++ b/src/GraphQL/PropertyType/DataObjectType.php @@ -42,7 +42,7 @@ public function __construct(Service $graphQlService, ObjectsType $objectUnionTyp if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -50,7 +50,7 @@ public function __construct(Service $graphQlService, ObjectsType $objectUnionTyp if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'object' => [ 'type' => $objectUnionType, @@ -75,9 +75,9 @@ public function __construct(Service $graphQlService, ObjectsType $objectUnionTyp } return null; - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/PropertyType/DocumentFolderType.php b/src/GraphQL/PropertyType/DocumentFolderType.php index 0a29c3c8..c3b13be2 100644 --- a/src/GraphQL/PropertyType/DocumentFolderType.php +++ b/src/GraphQL/PropertyType/DocumentFolderType.php @@ -30,7 +30,6 @@ class DocumentFolderType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -48,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'document' => [ 'type' => $documentFolderType, @@ -79,7 +78,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ]]]; diff --git a/src/GraphQL/PropertyType/DocumentType.php b/src/GraphQL/PropertyType/DocumentType.php index ac52ec60..eb69ec59 100644 --- a/src/GraphQL/PropertyType/DocumentType.php +++ b/src/GraphQL/PropertyType/DocumentType.php @@ -30,7 +30,6 @@ class DocumentType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -48,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'document' => [ 'type' => $documentUnionType, @@ -79,7 +78,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ]]]; diff --git a/src/GraphQL/PropertyType/ElementPropertyType.php b/src/GraphQL/PropertyType/ElementPropertyType.php index d11ce62e..59bff4c4 100644 --- a/src/GraphQL/PropertyType/ElementPropertyType.php +++ b/src/GraphQL/PropertyType/ElementPropertyType.php @@ -57,7 +57,6 @@ class ElementPropertyType extends UnionType protected $selectType; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -68,7 +67,6 @@ public function __construct(Service $graphQlService, $config = []) } /** - * @return array * * @throws \Exception */ @@ -83,7 +81,7 @@ public function getTypes(): array $supportedTypes = [ $this->checkboxType, $this->textType, - $this->selectType + $this->selectType, ]; if ($this->getGraphQlService()->querySchemaEnabled('asset')) { @@ -119,9 +117,6 @@ public function getTypes(): array return $supportedTypes; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element instanceof \Pimcore\Model\Property) { diff --git a/src/GraphQL/PropertyType/HotspotMetadataType.php b/src/GraphQL/PropertyType/HotspotMetadataType.php index edb78c89..a4683094 100644 --- a/src/GraphQL/PropertyType/HotspotMetadataType.php +++ b/src/GraphQL/PropertyType/HotspotMetadataType.php @@ -46,7 +46,6 @@ class HotspotMetadataType extends UnionType protected $textType; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -57,7 +56,6 @@ public function __construct(Service $graphQlService, $config = []) } /** - * @return array * * @throws \Exception */ @@ -77,9 +75,6 @@ public function getTypes(): array return $supportedTypes; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element instanceof MarkerHotspotItem) { diff --git a/src/GraphQL/PropertyType/ObjectFolderType.php b/src/GraphQL/PropertyType/ObjectFolderType.php index 486da8da..4c8c2ad7 100644 --- a/src/GraphQL/PropertyType/ObjectFolderType.php +++ b/src/GraphQL/PropertyType/ObjectFolderType.php @@ -30,7 +30,6 @@ class ObjectFolderType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * * @throws \Exception */ @@ -48,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -56,7 +55,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'object' => [ 'type' => $objectFolderType, @@ -79,7 +78,7 @@ public function __construct(Service $graphQlService) } return null; - } + }, ]]]; diff --git a/src/GraphQL/PropertyType/ObjectsType.php b/src/GraphQL/PropertyType/ObjectsType.php index 6eba9d3d..cc8b9912 100644 --- a/src/GraphQL/PropertyType/ObjectsType.php +++ b/src/GraphQL/PropertyType/ObjectsType.php @@ -27,7 +27,6 @@ class ObjectsType extends UnionType implements ContainerAwareInterface { use ContainerAwareTrait; - use ServiceTrait; public function __construct(Service $graphQlService) @@ -39,7 +38,6 @@ public function __construct(Service $graphQlService) } /** - * @return array * * @throws \Exception */ @@ -71,9 +69,6 @@ public function getTypes(): array return $types; } - /** - * @inheritdoc - */ public function resolveType($element, $context, ResolveInfo $info) { if ($element) { diff --git a/src/GraphQL/PropertyType/SelectType.php b/src/GraphQL/PropertyType/SelectType.php index f88aa8da..2a775d4a 100644 --- a/src/GraphQL/PropertyType/SelectType.php +++ b/src/GraphQL/PropertyType/SelectType.php @@ -39,7 +39,7 @@ public function __construct(Service $graphQlService) if ($value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -47,7 +47,7 @@ public function __construct(Service $graphQlService) if ($value instanceof Property) { return $value->getType(); } - } + }, ], 'text' => [ 'type' => Type::string(), @@ -55,9 +55,9 @@ public function __construct(Service $graphQlService) if ($value instanceof Property) { return $value->getData(); } - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/PropertyType/TextType.php b/src/GraphQL/PropertyType/TextType.php index 8e32894c..23a27532 100644 --- a/src/GraphQL/PropertyType/TextType.php +++ b/src/GraphQL/PropertyType/TextType.php @@ -40,7 +40,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'text' => [ 'type' => Type::string(), @@ -58,9 +58,9 @@ public function __construct(Service $graphQlService) } elseif ($value instanceof Property) { return $value->getData(); } - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/PropertyType/TextareaType.php b/src/GraphQL/PropertyType/TextareaType.php index 74578a3a..b4d5d0cf 100644 --- a/src/GraphQL/PropertyType/TextareaType.php +++ b/src/GraphQL/PropertyType/TextareaType.php @@ -40,7 +40,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getName(); } - } + }, ], 'type' => [ 'type' => Type::string(), @@ -48,7 +48,7 @@ public function __construct(Service $graphQlService) if ($value instanceof MarkerHotspotItem || $value instanceof Property) { return $value->getType(); } - } + }, ], 'text' => [ 'type' => Type::string(), @@ -58,9 +58,9 @@ public function __construct(Service $graphQlService) } elseif ($value instanceof Property) { return $value->getData(); } - } - ] - ] + }, + ], + ], ]; parent::__construct($config); diff --git a/src/GraphQL/Query/ConfigElementInterface.php b/src/GraphQL/Query/ConfigElementInterface.php index 258b7b3a..48e65346 100644 --- a/src/GraphQL/Query/ConfigElementInterface.php +++ b/src/GraphQL/Query/ConfigElementInterface.php @@ -27,7 +27,6 @@ public function getLabel(); /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass|null */ diff --git a/src/GraphQL/Query/Operator/AbstractOperator.php b/src/GraphQL/Query/Operator/AbstractOperator.php index 05525e29..0c4c9fcf 100644 --- a/src/GraphQL/Query/Operator/AbstractOperator.php +++ b/src/GraphQL/Query/Operator/AbstractOperator.php @@ -38,7 +38,6 @@ abstract class AbstractOperator implements OperatorInterface protected $children; /** - * @param array $config * @param array|null $context */ public function __construct(array $config = [], $context = null) diff --git a/src/GraphQL/Query/Operator/Alias.php b/src/GraphQL/Query/Operator/Alias.php index 6f2cea77..49c23e55 100644 --- a/src/GraphQL/Query/Operator/Alias.php +++ b/src/GraphQL/Query/Operator/Alias.php @@ -22,7 +22,6 @@ class Alias extends AbstractOperator { /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/Concatenator.php b/src/GraphQL/Query/Operator/Concatenator.php index 584dcd48..a8d476aa 100644 --- a/src/GraphQL/Query/Operator/Concatenator.php +++ b/src/GraphQL/Query/Operator/Concatenator.php @@ -21,10 +21,10 @@ class Concatenator extends AbstractOperator { private $glue; + private $forceValue; /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -37,7 +37,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/DateFormatter.php b/src/GraphQL/Query/Operator/DateFormatter.php index 625f345e..f6453cf1 100644 --- a/src/GraphQL/Query/Operator/DateFormatter.php +++ b/src/GraphQL/Query/Operator/DateFormatter.php @@ -27,7 +27,6 @@ class DateFormatter extends AbstractOperator private $format; /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -39,7 +38,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/ElementCounter.php b/src/GraphQL/Query/Operator/ElementCounter.php index 910385b3..da54a592 100644 --- a/src/GraphQL/Query/Operator/ElementCounter.php +++ b/src/GraphQL/Query/Operator/ElementCounter.php @@ -23,7 +23,6 @@ class ElementCounter extends AbstractOperator private $countEmpty; /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -35,7 +34,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/Factory/DefaultOperatorFactoryBase.php b/src/GraphQL/Query/Operator/Factory/DefaultOperatorFactoryBase.php index ada63228..e71b7f06 100644 --- a/src/GraphQL/Query/Operator/Factory/DefaultOperatorFactoryBase.php +++ b/src/GraphQL/Query/Operator/Factory/DefaultOperatorFactoryBase.php @@ -37,10 +37,8 @@ public function __construct(Service $graphQlService, string $className) } /** - * @param array $configElement * @param array|null $context * - * @return OperatorInterface */ public function build(array $configElement = [], $context = null): OperatorInterface { diff --git a/src/GraphQL/Query/Operator/Factory/OperatorFactoryInterface.php b/src/GraphQL/Query/Operator/Factory/OperatorFactoryInterface.php index b4ff8fc1..f64598c2 100644 --- a/src/GraphQL/Query/Operator/Factory/OperatorFactoryInterface.php +++ b/src/GraphQL/Query/Operator/Factory/OperatorFactoryInterface.php @@ -22,10 +22,8 @@ interface OperatorFactoryInterface { /** - * @param array $configElement * @param array|null $context * - * @return OperatorInterface */ public function build(array $configElement, $context = null): OperatorInterface; } diff --git a/src/GraphQL/Query/Operator/Merge.php b/src/GraphQL/Query/Operator/Merge.php index 76e41991..ad01d764 100644 --- a/src/GraphQL/Query/Operator/Merge.php +++ b/src/GraphQL/Query/Operator/Merge.php @@ -24,10 +24,10 @@ class Merge extends AbstractOperator { private $flatten = true; + private $unique; /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -39,7 +39,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/Substring.php b/src/GraphQL/Query/Operator/Substring.php index 9b09c700..34a4c2c2 100644 --- a/src/GraphQL/Query/Operator/Substring.php +++ b/src/GraphQL/Query/Operator/Substring.php @@ -27,7 +27,6 @@ class Substring extends AbstractOperator private $ellipses; /** - * @param array $config * @param array|null $context */ public function __construct(array $config = [], $context = null) @@ -41,7 +40,6 @@ public function __construct(array $config = [], $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * diff --git a/src/GraphQL/Query/Operator/Text.php b/src/GraphQL/Query/Operator/Text.php index ee67edec..0e3cc0b5 100644 --- a/src/GraphQL/Query/Operator/Text.php +++ b/src/GraphQL/Query/Operator/Text.php @@ -21,7 +21,6 @@ class Text extends AbstractOperator { /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -31,7 +30,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass */ diff --git a/src/GraphQL/Query/Operator/Thumbnail.php b/src/GraphQL/Query/Operator/Thumbnail.php index 8a5d9d0e..be59f5ab 100644 --- a/src/GraphQL/Query/Operator/Thumbnail.php +++ b/src/GraphQL/Query/Operator/Thumbnail.php @@ -24,7 +24,6 @@ class Thumbnail extends AbstractOperator private $thumbnailConfig; /** - * @param array $config * @param array|null $context */ public function __construct(array $config = [], $context = null) @@ -36,7 +35,6 @@ public function __construct(array $config = [], $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass|null */ diff --git a/src/GraphQL/Query/Operator/ThumbnailHtml.php b/src/GraphQL/Query/Operator/ThumbnailHtml.php index d540b809..b5344f5f 100644 --- a/src/GraphQL/Query/Operator/ThumbnailHtml.php +++ b/src/GraphQL/Query/Operator/ThumbnailHtml.php @@ -33,7 +33,6 @@ class ThumbnailHtml extends AbstractOperator private $thumbnailHtmlConfig; /** - * @param array $config * @param array|null $context */ public function __construct(array $config = [], $context = null) @@ -45,7 +44,6 @@ public function __construct(array $config = [], $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass|null */ diff --git a/src/GraphQL/Query/Operator/TranslateValue.php b/src/GraphQL/Query/Operator/TranslateValue.php index 8b2a34fa..11981628 100644 --- a/src/GraphQL/Query/Operator/TranslateValue.php +++ b/src/GraphQL/Query/Operator/TranslateValue.php @@ -23,7 +23,6 @@ class TranslateValue extends AbstractOperator private $prefix; /** - * @param array $config * @param array|null $context */ public function __construct(array $config = [], $context = null) @@ -36,7 +35,6 @@ public function __construct(array $config = [], $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass|null * diff --git a/src/GraphQL/Query/Operator/Trimmer.php b/src/GraphQL/Query/Operator/Trimmer.php index 92790266..537b3164 100644 --- a/src/GraphQL/Query/Operator/Trimmer.php +++ b/src/GraphQL/Query/Operator/Trimmer.php @@ -21,13 +21,14 @@ class Trimmer extends AbstractOperator { const LEFT = 1; + const RIGHT = 2; + const BOTH = 3; private $trim; /** - * @param array $config * @param array|null $context */ public function __construct(array $config, $context = null) @@ -39,7 +40,6 @@ public function __construct(array $config, $context = null) /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass * @@ -69,12 +69,15 @@ public function getLabeledValue($element, ResolveInfo $resolveInfo = null) switch ($this->trim) { case self::LEFT: $childValue = ltrim($childValue); + break; case self::RIGHT: $childValue = rtrim($childValue); + break; case self::BOTH: $childValue = trim($childValue); + break; } } diff --git a/src/GraphQL/Query/QueryType.php b/src/GraphQL/Query/QueryType.php index 00a904f5..dc5266f8 100644 --- a/src/GraphQL/Query/QueryType.php +++ b/src/GraphQL/Query/QueryType.php @@ -54,10 +54,6 @@ class QueryType extends ObjectType protected $modelFactory; /** - * @param Service $graphQlService - * @param LocaleServiceInterface $localeService - * @param Factory $modelFactory - * @param EventDispatcherInterface $eventDispatcher * @param array $config * @param array $context * @@ -107,7 +103,7 @@ public function buildFolderQueries($type, &$config = [], $context = []) 'defaultLanguage' => ['type' => Type::string()], ], 'type' => $graphQlType, - 'resolve' => [$resolver, 'resolve' . ucfirst($type) . 'FolderGetter'] + 'resolve' => [$resolver, 'resolve' . ucfirst($type) . 'FolderGetter'], ]; $config['fields']['get' . ucfirst($type) . 'Folder'] = $defGet; @@ -138,7 +134,7 @@ public function buildAssetQueries(&$config = [], $context = []) 'defaultLanguage' => ['type' => Type::string()], ], 'type' => $assetType, - 'resolve' => [$resolver, 'resolveAssetGetter'] + 'resolve' => [$resolver, 'resolveAssetGetter'], ]; $config['fields']['getAsset'] = $defGet; @@ -168,7 +164,7 @@ public function buildDocumentQueries(&$config = [], $context = []) 'defaultLanguage' => ['type' => Type::string()], ], 'type' => $this->getGraphQlService()->getDocumentTypeDefinition('document'), - 'resolve' => [$resolver, 'resolveDocumentGetter'] + 'resolve' => [$resolver, 'resolveDocumentGetter'], ]; $config['fields']['getDocument'] = $defGet; @@ -205,6 +201,7 @@ public function buildDataObjectQueries(&$config = [], $context = []): void $class = ClassDefinition::getByName($entity); if (!$class) { Logger::error('class ' . $entity . ' not found'); + continue; } @@ -231,7 +228,7 @@ public function buildDataObjectQueries(&$config = [], $context = []): void 'cursor' => Type::string(), 'node' => [ 'type' => ClassTypeDefinitions::get($class), - 'resolve' => [$resolver, 'resolveEdge'] + 'resolve' => [$resolver, 'resolveEdge'], ], ], ] @@ -244,14 +241,14 @@ public function buildDataObjectQueries(&$config = [], $context = []): void 'edges' => [ 'type' => Type::listOf($edgeType), - 'resolve' => [$resolver, 'resolveEdges'] + 'resolve' => [$resolver, 'resolveEdges'], ], 'totalCount' => [ 'description' => 'The total count of all queryable objects for this schema listing', 'resolve' => [$resolver, 'resolveListingTotalCount'], - 'type' => Type::int() - ] - ] + 'type' => Type::int(), + ], + ], ] ); @@ -261,7 +258,7 @@ public function buildDataObjectQueries(&$config = [], $context = []): void 'ids' => ['type' => Type::string()], 'fullpaths' => [ 'type' => Type::string(), - 'description' => 'Comma separated list of fullpath' + 'description' => 'Comma separated list of fullpath', ], 'tags' => ['type' => Type::string(), 'description' => 'Comma separated list of tag names'], 'defaultLanguage' => ['type' => Type::string()], @@ -313,7 +310,7 @@ public function buildAssetListingQueries(&$config = [], $context = []): void 'cursor' => Type::string(), 'node' => [ 'type' => $assetTree, - 'resolve' => [$listResolver, 'resolveEdge'] + 'resolve' => [$listResolver, 'resolveEdge'], ], ], ] @@ -325,14 +322,14 @@ public function buildAssetListingQueries(&$config = [], $context = []): void 'fields' => [ 'edges' => [ 'type' => Type::listOf($edgeType), - 'resolve' => [$listResolver, 'resolveEdges'] + 'resolve' => [$listResolver, 'resolveEdges'], ], 'totalCount' => [ 'description' => 'The total count of all queryable assets for this schema listing', 'resolve' => [$listResolver, 'resolveListingTotalCount'], - 'type' => Type::int() - ] - ] + 'type' => Type::int(), + ], + ], ] ); @@ -342,7 +339,7 @@ public function buildAssetListingQueries(&$config = [], $context = []): void 'ids' => ['type' => Type::string()], 'fullpaths' => [ 'type' => Type::string(), - 'description' => 'Comma separated list of fullpath' + 'description' => 'Comma separated list of fullpath', ], 'defaultLanguage' => ['type' => Type::string()], 'first' => ['type' => Type::int()], @@ -380,15 +377,15 @@ public function buildTranslationQueries(array &$config = [], array $context = [] 'key' => ['type' => Type::string()], 'languages' => [ 'type' => Type::string(), - 'description' => 'e.g.: "en,de,fr ..."' + 'description' => 'e.g.: "en,de,fr ..."', ], 'domain' => [ 'type' => Type::string(), - 'description' => 'default value: messages' + 'description' => 'default value: messages', ], ], 'type' => $translationType, - 'resolve' => [$resolver, 'resolveTranslationGetter'] + 'resolve' => [$resolver, 'resolveTranslationGetter'], ]; $config['fields']['getTranslation'] = $defGet; @@ -414,7 +411,7 @@ public function buildTranslationListingQueries(array &$config, array $context) 'cursor' => Type::string(), 'node' => [ 'type' => $translation, - 'resolve' => [$listResolver, 'resolveEdge'] + 'resolve' => [$listResolver, 'resolveEdge'], ], ], ] @@ -426,14 +423,14 @@ public function buildTranslationListingQueries(array &$config, array $context) 'fields' => [ 'edges' => [ 'type' => Type::listOf($edgeType), - 'resolve' => [$listResolver, 'resolveEdges'] + 'resolve' => [$listResolver, 'resolveEdges'], ], 'totalCount' => [ 'description' => 'The total count of all queryable translations for this schema listing', 'resolve' => [$listResolver, 'resolveListingTotalCount'], - 'type' => Type::int() - ] - ] + 'type' => Type::int(), + ], + ], ] ); @@ -442,11 +439,11 @@ public function buildTranslationListingQueries(array &$config, array $context) 'args' => [ 'keys' => [ 'type' => Type::string(), - 'description' => 'e.g.: "key-1,key 2,key_3"' + 'description' => 'e.g.: "key-1,key 2,key_3"', ], 'languages' => [ 'type' => Type::string(), - 'description' => 'e.g.: "en,de,fr ..."' + 'description' => 'e.g.: "en,de,fr ..."', ], 'first' => ['type' => Type::int()], 'after' => ['type' => Type::int()], @@ -457,7 +454,7 @@ public function buildTranslationListingQueries(array &$config, array $context) ], 'domain' => [ 'type' => Type::string(), - 'description' => 'default value: messages' + 'description' => 'default value: messages', ], ], 'type' => $listingType, diff --git a/src/GraphQL/Query/Value/DefaultValue.php b/src/GraphQL/Query/Value/DefaultValue.php index 31f54098..fab08e13 100644 --- a/src/GraphQL/Query/Value/DefaultValue.php +++ b/src/GraphQL/Query/Value/DefaultValue.php @@ -24,7 +24,6 @@ class DefaultValue extends AbstractValue { /** * @param ElementInterface|null $element - * @param ResolveInfo|null $resolveInfo * * @return \stdClass|null */ diff --git a/src/GraphQL/RelationHelper.php b/src/GraphQL/RelationHelper.php index 9c724ad9..5eed52e2 100644 --- a/src/GraphQL/RelationHelper.php +++ b/src/GraphQL/RelationHelper.php @@ -21,11 +21,8 @@ class RelationHelper { /** - * @param ElementInterface $relation - * @param Service $graphQlService * @param array $args * @param array $context - * @param ResolveInfo $resolveInfo * * @return ElementDescriptor */ diff --git a/src/GraphQL/Resolver/AssetListing.php b/src/GraphQL/Resolver/AssetListing.php index cd395601..61d7f37d 100644 --- a/src/GraphQL/Resolver/AssetListing.php +++ b/src/GraphQL/Resolver/AssetListing.php @@ -48,7 +48,6 @@ public function __construct(Service $graphQlService, EventDispatcherInterface $e * @param ElementDescriptor $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return mixed */ @@ -61,7 +60,6 @@ public function resolveEdges($value = null, $args = [], $context = [], ResolveIn * @param ElementDescriptor $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null */ @@ -80,7 +78,6 @@ public function resolveEdge($value = null, $args = [], $context = [], ResolveInf * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -208,7 +205,6 @@ static function ($fullpath) use ($db) { * @param ElementDescriptor $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return mixed */ diff --git a/src/GraphQL/Resolver/AssetType.php b/src/GraphQL/Resolver/AssetType.php index 7bb3b982..3a69bbab 100644 --- a/src/GraphQL/Resolver/AssetType.php +++ b/src/GraphQL/Resolver/AssetType.php @@ -34,7 +34,6 @@ class AssetType * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -58,7 +57,6 @@ public function resolveTag($value = null, $args = [], $context = [], ResolveInfo * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -75,7 +73,7 @@ public function resolveMetadata($value = null, $args = [], $context = [], Resolv //Relational data would return as a comma separated list. each element type and id by `_`, eg. "object_154,asset_489" $event = new AssetEvent($asset, [ 'metadata' => $metadata, - 'context' => $context + 'context' => $context, ]); /** @var EventDispatcher $eventDispatcher */ $eventDispatcher = \Pimcore::getContainer()->get('event_dispatcher'); @@ -116,7 +114,6 @@ public function resolveMetadata($value = null, $args = [], $context = [], Resolv * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -140,7 +137,6 @@ public function resolveEmbeddedMetaInfo($value = null, $args = [], $context = [] * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -164,7 +160,6 @@ public function resolvePath($value = null, $args = [], $context = [], ResolveInf * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -189,7 +184,6 @@ public function resolveData($value = null, $args = [], $context = [], ResolveInf * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -225,7 +219,6 @@ public function resolveSrcSet($value = null, $args = [], $context = [], ResolveI * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -291,7 +284,6 @@ public function resolveResolutions($value = null, $args = [], $context = [], Res * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -337,7 +329,7 @@ public function resolveDimensions($value = null, $args = [], $context = [], Reso return [ 'width' => $width, - 'height' => $height + 'height' => $height, ]; } diff --git a/src/GraphQL/Resolver/Base.php b/src/GraphQL/Resolver/Base.php index a7aebe21..cace1d3a 100644 --- a/src/GraphQL/Resolver/Base.php +++ b/src/GraphQL/Resolver/Base.php @@ -54,7 +54,6 @@ public function __construct($typeName, $attributes, $class, $container) * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return \stdClass */ @@ -74,9 +73,7 @@ public function resolve($value = null, $args = [], $context = [], ResolveInfo $r /** * Helper method that allows dynamic inspection into the resolver attributes. * - * @param string $type * - * @return string|null */ public function getResolverAttribute(string $type): ?string { diff --git a/src/GraphQL/Resolver/DataObject.php b/src/GraphQL/Resolver/DataObject.php index d009a78f..a062d3a6 100644 --- a/src/GraphQL/Resolver/DataObject.php +++ b/src/GraphQL/Resolver/DataObject.php @@ -34,7 +34,6 @@ public function __construct(Service $graphQlService) * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -58,7 +57,6 @@ public function resolveTag($value = null, $args = [], $context = [], ResolveInfo * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return int|null */ @@ -81,7 +79,6 @@ public function resolveIndex($value = null, $args = [], $context = [], ResolveIn * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null */ diff --git a/src/GraphQL/Resolver/Document.php b/src/GraphQL/Resolver/Document.php index f4fb09ee..a0b2fae5 100644 --- a/src/GraphQL/Resolver/Document.php +++ b/src/GraphQL/Resolver/Document.php @@ -42,9 +42,6 @@ public function __construct(DocumentService $documentService, Service $graphQlSe * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo - * - * @return array * * @throws \Exception */ @@ -65,7 +62,7 @@ public function resolveTranslations($value = null, $args = [], $context = [], Re $result[] = [ 'id' => $transId, 'language' => $transLanguage, - 'target' => $this->resolveTranslationTarget($value, $args, $context, $resolveInfo) + 'target' => $this->resolveTranslationTarget($value, $args, $context, $resolveInfo), ]; } } @@ -77,9 +74,6 @@ public function resolveTranslations($value = null, $args = [], $context = [], Re * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo - * - * @return ElementDescriptor|null * * @throws \Exception */ diff --git a/src/GraphQL/Resolver/Element.php b/src/GraphQL/Resolver/Element.php index e8335a08..fb15338b 100644 --- a/src/GraphQL/Resolver/Element.php +++ b/src/GraphQL/Resolver/Element.php @@ -49,7 +49,6 @@ public function __construct(string $elementType, Service $graphQlService) * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -71,9 +70,6 @@ public function resolveTag($value = null, $args = [], $context = [], ResolveInfo /** * @param array $value - * @param array $args - * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|Property[]|null * @@ -108,7 +104,6 @@ public function resolveProperties($value = null, array $args = [], array $contex * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * @@ -131,7 +126,6 @@ public function resolveParent($value = null, $args = [], $context = [], ResolveI * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -153,7 +147,6 @@ public function resolveChildren($value = null, $args = [], $context = [], Resolv * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * diff --git a/src/GraphQL/Resolver/Geobounds.php b/src/GraphQL/Resolver/Geobounds.php index 14e47d38..f042ca6a 100644 --- a/src/GraphQL/Resolver/Geobounds.php +++ b/src/GraphQL/Resolver/Geobounds.php @@ -27,7 +27,6 @@ class Geobounds * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return GeoCoordinates|null * @@ -46,7 +45,6 @@ public function resolveNorthEast($value = null, $args = [], $context = [], Resol * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return GeoCoordinates|null * diff --git a/src/GraphQL/Resolver/Geopoint.php b/src/GraphQL/Resolver/Geopoint.php index 9a4c0d29..046cc584 100644 --- a/src/GraphQL/Resolver/Geopoint.php +++ b/src/GraphQL/Resolver/Geopoint.php @@ -27,7 +27,6 @@ class Geopoint * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return float|null * @@ -46,7 +45,6 @@ public function resolveLongitude($value = null, $args = [], $context = [], Resol * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return float|null * diff --git a/src/GraphQL/Resolver/HotspotType.php b/src/GraphQL/Resolver/HotspotType.php index 721654b8..5543d987 100644 --- a/src/GraphQL/Resolver/HotspotType.php +++ b/src/GraphQL/Resolver/HotspotType.php @@ -36,7 +36,6 @@ class HotspotType * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * @@ -64,7 +63,6 @@ public function resolveImage($value = null, $args = [], $context = [], ResolveIn * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -79,7 +77,6 @@ public function resolveCrop($value = null, $args = [], $context = [], ResolveInf * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -94,7 +91,6 @@ public function resolveHotspots($value = null, $args = [], $context = [], Resolv * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -109,7 +105,6 @@ public function resolveMarker($value = null, $args = [], $context = [], ResolveI * @param array $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo */ public function resolveMetadata($value = null, $args = [], $context = [], ResolveInfo $resolveInfo = null) { diff --git a/src/GraphQL/Resolver/Link.php b/src/GraphQL/Resolver/Link.php index a207bd18..e48350ef 100644 --- a/src/GraphQL/Resolver/Link.php +++ b/src/GraphQL/Resolver/Link.php @@ -26,7 +26,6 @@ class Link * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -41,7 +40,6 @@ public function resolveText($value = null, $args = [], $context = [], ResolveInf * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -53,10 +51,6 @@ public function resolvePath($value = null, $args = [], $context = [], ResolveInf } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -66,10 +60,6 @@ public function resolveTarget($value = null, $args = [], $context = [], ResolveI } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -79,10 +69,6 @@ public function resolveAnchor($value = null, $args = [], $context = [], ResolveI } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -92,10 +78,6 @@ public function resolveTitle($value = null, $args = [], $context = [], ResolveIn } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -105,10 +87,6 @@ public function resolveAccesskey($value = null, $args = [], $context = [], Resol } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -118,10 +96,6 @@ public function resolveRel($value = null, $args = [], $context = [], ResolveInfo } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -131,10 +105,6 @@ public function resolveClass($value = null, $args = [], $context = [], ResolveIn } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -144,10 +114,6 @@ public function resolveAttributes($value = null, $args = [], $context = [], Reso } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -157,10 +123,6 @@ public function resolveTabindex($value = null, $args = [], $context = [], Resolv } /** - * @param $value - * @param $args - * @param $context - * @param ResolveInfo|null $resolveInfo * * @return null */ @@ -170,8 +132,6 @@ public function resolveParameters($value = null, $args = [], $context = [], Reso } /** - * @param \Pimcore\Model\DataObject\Data\Link|null $value - * @param string $property * * @return null */ diff --git a/src/GraphQL/Resolver/Merge.php b/src/GraphQL/Resolver/Merge.php index 7fd530e9..ae92bc33 100644 --- a/src/GraphQL/Resolver/Merge.php +++ b/src/GraphQL/Resolver/Merge.php @@ -57,7 +57,6 @@ public function __construct($typeName = null, $attributes = null, $class = null, * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/Resolver/MultihrefMetadata.php b/src/GraphQL/Resolver/MultihrefMetadata.php index fdccf56f..e0b8b26a 100644 --- a/src/GraphQL/Resolver/MultihrefMetadata.php +++ b/src/GraphQL/Resolver/MultihrefMetadata.php @@ -51,7 +51,6 @@ public function __construct($fieldDefinition = null, $class = null, $fieldHelper * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -89,7 +88,6 @@ public function resolveElement($value = null, $args = [], $context = [], Resolve * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/Resolver/ObjectMetadata.php b/src/GraphQL/Resolver/ObjectMetadata.php index 3cc82fb2..03002f05 100644 --- a/src/GraphQL/Resolver/ObjectMetadata.php +++ b/src/GraphQL/Resolver/ObjectMetadata.php @@ -52,7 +52,6 @@ public function __construct($fieldDefinition = null, $class = null, $fieldHelper * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -88,7 +87,6 @@ public function resolveElement($value = null, $args = [], $context = [], Resolve * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * diff --git a/src/GraphQL/Resolver/QuantityValue.php b/src/GraphQL/Resolver/QuantityValue.php index 13e2e864..61366be1 100644 --- a/src/GraphQL/Resolver/QuantityValue.php +++ b/src/GraphQL/Resolver/QuantityValue.php @@ -27,7 +27,6 @@ class QuantityValue * @param AbstractQuantityValue|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -46,7 +45,6 @@ public function resolveUnit($value = null, $args = [], $context = [], ResolveInf * @param AbstractQuantityValue|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return float|string|null * @@ -65,7 +63,6 @@ public function resolveValue($value = null, $args = [], $context = [], ResolveIn * @param AbstractQuantityValue|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * diff --git a/src/GraphQL/Resolver/QueryType.php b/src/GraphQL/Resolver/QueryType.php index 9fa330ad..e5b3eb29 100644 --- a/src/GraphQL/Resolver/QueryType.php +++ b/src/GraphQL/Resolver/QueryType.php @@ -58,7 +58,6 @@ class QueryType protected $configuration; /** - * @param EventDispatcherInterface $eventDispatcher * @param ClassDefinition|null $class * @param object $configuration * @param bool $omitPermissionCheck @@ -75,7 +74,6 @@ public function __construct(EventDispatcherInterface $eventDispatcher, $class = * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * @param string|null $elementType * * @return array|null @@ -111,7 +109,6 @@ public function resolveFolderGetter($value = null, $args = [], $context = [], Re * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -126,7 +123,6 @@ public function resolveAssetFolderGetter($value = null, $args = [], $context = [ * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -141,7 +137,6 @@ public function resolveDocumentFolderGetter($value = null, $args = [], $context * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -156,7 +151,6 @@ public function resolveObjectFolderGetter($value = null, $args = [], $context = * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array|null * @@ -200,7 +194,6 @@ public function resolveDocumentGetter($value = null, $args = [], $context = [], * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null * @@ -263,7 +256,6 @@ public function resolveTranslationGetter(mixed $value = null, array $args = [], * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor * @@ -321,6 +313,7 @@ public function resolveObjectGetter($value = null, $args = [], $context = [], Re $objectList = $objectList->load(); if (!$objectList) { $errorMessage = $this->createArgumentErrorMessage($isFullpathSet, $isIdSet, $args); + throw new ClientSafeException($errorMessage); } $object = $objectList[0]; @@ -342,7 +335,6 @@ public function resolveObjectGetter($value = null, $args = [], $context = [], Re * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array */ @@ -364,7 +356,6 @@ public function resolveEdge($value = null, $args = [], $context = [], ResolveInf * @param array|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array */ @@ -391,7 +382,6 @@ public function resolveEdges($value = null, $args = [], $context = [], ResolveIn * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return array * @@ -546,7 +536,6 @@ static function ($fullpath) use ($db) { * @param ElementDescriptor|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return mixed */ diff --git a/src/GraphQL/Resolver/UrlSlug.php b/src/GraphQL/Resolver/UrlSlug.php index ae098f98..4232fd7d 100644 --- a/src/GraphQL/Resolver/UrlSlug.php +++ b/src/GraphQL/Resolver/UrlSlug.php @@ -26,7 +26,6 @@ class UrlSlug * @param \Pimcore\Model\DataObject\Data\UrlSlug|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -45,7 +44,6 @@ public function resolveSlug($value = null, $args = [], $context = [], ResolveInf * @param \Pimcore\Model\DataObject\Data\UrlSlug|null $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return int|null * diff --git a/src/GraphQL/Resolver/Video.php b/src/GraphQL/Resolver/Video.php index 935eaeb3..c4af1cfd 100644 --- a/src/GraphQL/Resolver/Video.php +++ b/src/GraphQL/Resolver/Video.php @@ -29,7 +29,6 @@ class Video * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null */ @@ -46,7 +45,6 @@ public function resolveType($value = null, $args = [], $context = [], ResolveInf * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null * @@ -65,7 +63,6 @@ public function resolveTitle($value = null, $args = [], $context = [], ResolveIn * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return string|null */ @@ -82,7 +79,6 @@ public function resolveDescription($value = null, $args = [], $context = [], Res * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|null */ @@ -113,7 +109,6 @@ public function resolvePoster($value = null, $args = [], $context = [], ResolveI * @param mixed $value * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo * * @return ElementDescriptor|array|null */ diff --git a/src/GraphQL/Service.php b/src/GraphQL/Service.php index c822efe0..c4ecd800 100644 --- a/src/GraphQL/Service.php +++ b/src/GraphQL/Service.php @@ -56,14 +56,10 @@ class Service { - /*** - * @var ContainerInterface - */ + // @var ContainerInterface protected $dataObjectQueryTypeGeneratorFactories; - /*** - * @var ContainerInterface - */ + // @var ContainerInterface protected $dataObjectMutationTypeGeneratorFactories; /** @@ -268,8 +264,6 @@ public function buildDataObjectMutationDataConfig($nodeDef, $class = null, $cont /** * @param string $attribute - * @param Data|null $fieldDefinition - * @param ClassDefinition|null $class * * @return callable(mixed $value, array $args, array $context, \GraphQL\Type\Definition\ResolveInfo $info): mixed */ @@ -284,8 +278,6 @@ public function buildDataObjectDataQueryResolver($attribute, Data $fieldDefiniti } /** - * @param Data|null $fieldDefinition - * @param ClassDefinition|null $class * @param object|null $container * * @return mixed @@ -362,7 +354,6 @@ public function supportsDataObjectMutationDataType($typeName) /** * @param string $typeName * @param array $nodeDef - * @param ClassDefinition|null $class * @param object|null $container * @param array $params * @@ -381,7 +372,6 @@ public function buildDataObjectQueryOperatorConfig($typeName, $nodeDef, ClassDef /** * @param string $typeName * @param array $nodeDef - * @param ClassDefinition|null $class * @param object|null $container * @param array $params * @@ -406,7 +396,6 @@ public function buildDataObjectMutationOperatorConfig($typeName, $nodeDef, Class * @param string $mode * @param string $typeName * @param array $nodeDef - * @param ClassDefinition|null $class * @param object|null $container * @param array $params * @@ -466,7 +455,6 @@ public function buildTranslationType(string $typeName): mixed /** * @param string $typeName * @param array|null $attributes - * @param ClassDefinition|null $class * @param object|null $container * * @return Query\Operator\OperatorInterface @@ -715,6 +703,7 @@ public function getAssetTypeDefinition($typeName) if (isset($this->assetDataTypes[$typeName])) { return $this->assetDataTypes[$typeName]; } + throw new ClientSafeException('unknown asset type: ' . $typeName); } @@ -730,6 +719,7 @@ public function getClassificationStoreTypeDefinition($typeName) if (isset($this->classificationStoreDataTypes[$typeName])) { return $this->classificationStoreDataTypes[$typeName]; } + throw new ClientSafeException('unknown classificationstore type: ' . $typeName); } @@ -745,6 +735,7 @@ public function getDataObjectTypeDefinition($typeName) if (isset($this->dataObjectDataTypes[$typeName])) { return $this->dataObjectDataTypes[$typeName]; } + throw new ClientSafeException('unknown dataobject type: ' . $typeName); } @@ -760,6 +751,7 @@ public function getDocumentTypeDefinition($typeName) if (isset($this->documentDataTypes[$typeName])) { return $this->documentDataTypes[$typeName]; } + throw new ClientSafeException('unknown document type: ' . $typeName); } @@ -775,6 +767,7 @@ public function getPropertyTypeDefinition($typeName) if (isset($this->propertyDataTypes[$typeName])) { return $this->propertyDataTypes[$typeName]; } + throw new ClientSafeException('unknown property type: ' . $typeName); } @@ -933,8 +926,6 @@ public static function setValue($object, $attribute, $callback) } /** - * @param BaseDescriptor $descriptor - * @param Data $fieldDefinition * @param string $attribute * @param array $args * @@ -1091,7 +1082,6 @@ public static function resolveValue(BaseDescriptor $descriptor, Data $fieldDefin * @param object $container * @param string $fieldName * - * @return bool */ private static function isLocalizedField($container, $fieldName): bool { @@ -1144,7 +1134,6 @@ public function getDataObjectDataTypes(): array * @param ElementInterface $target * @param array $args * @param array $context - * @param ResolveInfo|null $resolveInfo */ public function extractData($data, $target, $args = [], $context = [], ResolveInfo $resolveInfo = null) { @@ -1163,7 +1152,6 @@ public function extractData($data, $target, $args = [], $context = [], ResolveIn } /** - * @param string $type * * @return bool */ diff --git a/src/GraphQL/SharedType/HotspotHotspotType.php b/src/GraphQL/SharedType/HotspotHotspotType.php index 1957e936..26f3d5b6 100644 --- a/src/GraphQL/SharedType/HotspotHotspotType.php +++ b/src/GraphQL/SharedType/HotspotHotspotType.php @@ -31,7 +31,6 @@ class HotspotHotspotType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -59,10 +58,10 @@ public function build(&$config) 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma seperated list of key names' - ] + 'description' => 'comma seperated list of key names', + ], ], - 'resolve' => [$resolver, 'resolveMetadata'] + 'resolve' => [$resolver, 'resolveMetadata'], ], 'name' => Type::string(), ]; diff --git a/src/GraphQL/SharedType/HotspotMarkerType.php b/src/GraphQL/SharedType/HotspotMarkerType.php index bd0d5236..ee56d996 100644 --- a/src/GraphQL/SharedType/HotspotMarkerType.php +++ b/src/GraphQL/SharedType/HotspotMarkerType.php @@ -31,7 +31,6 @@ class HotspotMarkerType extends ObjectType use ServiceTrait; /** - * @param Service $graphQlService * @param array $config */ public function __construct(Service $graphQlService, $config = []) @@ -58,10 +57,10 @@ public function build(&$config) 'args' => [ 'keys' => [ 'type' => Type::listOf(Type::string()), - 'description' => 'comma seperated list of key names' - ] + 'description' => 'comma seperated list of key names', + ], ], - 'resolve' => [$resolver, 'resolveMetadata'] + 'resolve' => [$resolver, 'resolveMetadata'], ], 'name' => Type::string(), ]; diff --git a/src/GraphQL/SharedType/KeyValueType.php b/src/GraphQL/SharedType/KeyValueType.php index da294049..aee916c4 100644 --- a/src/GraphQL/SharedType/KeyValueType.php +++ b/src/GraphQL/SharedType/KeyValueType.php @@ -36,7 +36,7 @@ public static function getInstance() 'name' => 'KeyValue', 'fields' => [ 'key' => Type::string(), - 'value' => Type::string() + 'value' => Type::string(), ], ]; self::$instance = new static($config); @@ -46,7 +46,6 @@ public static function getInstance() } /** - * @param array|null $value * * @return array */ diff --git a/src/GraphQL/Traits/ElementIdentificationTrait.php b/src/GraphQL/Traits/ElementIdentificationTrait.php index 084a82f3..6e58c550 100644 --- a/src/GraphQL/Traits/ElementIdentificationTrait.php +++ b/src/GraphQL/Traits/ElementIdentificationTrait.php @@ -22,8 +22,11 @@ trait ElementIdentificationTrait { private $typeKey = 'type'; + private $idKey = 'id'; + private $fullpathKey = 'fullpath'; + private $supportedTypes = ['object', 'asset', 'document']; /** diff --git a/src/GraphQL/Traits/ElementTagTrait.php b/src/GraphQL/Traits/ElementTagTrait.php index 2995fa59..76916152 100644 --- a/src/GraphQL/Traits/ElementTagTrait.php +++ b/src/GraphQL/Traits/ElementTagTrait.php @@ -22,8 +22,6 @@ trait ElementTagTrait { /** - * @param string $element_type - * @param int $id * * @return array */ @@ -46,8 +44,6 @@ protected function getTags(string $element_type, int $id) } /** - * @param string $element_type - * @param int $id * @param array $tags * * @return bool @@ -61,7 +57,6 @@ protected function setTags(string $element_type, int $id, $tags) } /** - * @param array $input * * @return array|bool */ diff --git a/src/GraphQL/TranslationType/TranslationType.php b/src/GraphQL/TranslationType/TranslationType.php index 7d2b8c07..10c2d826 100644 --- a/src/GraphQL/TranslationType/TranslationType.php +++ b/src/GraphQL/TranslationType/TranslationType.php @@ -50,7 +50,7 @@ public function build(array &$config) 'type' => Type::string(), 'translations' => [ 'type' => new JsonType(), - ] + ], ]; } } diff --git a/src/GraphQL/TypeDefinitionInterface.php b/src/GraphQL/TypeDefinitionInterface.php index 06aaa82e..f33aeed1 100644 --- a/src/GraphQL/TypeDefinitionInterface.php +++ b/src/GraphQL/TypeDefinitionInterface.php @@ -22,7 +22,6 @@ interface TypeDefinitionInterface { /** - * @param Data $fieldDefinition * @param ClassDefinition|null $class * @param object|null $container * diff --git a/src/GraphQL/TypeInterface/CsFeature.php b/src/GraphQL/TypeInterface/CsFeature.php index d5252916..de9887bb 100644 --- a/src/GraphQL/TypeInterface/CsFeature.php +++ b/src/GraphQL/TypeInterface/CsFeature.php @@ -36,18 +36,18 @@ public static function getInstance() 'name' => 'csFeatureInterface', 'fields' => [ 'id' => [ - 'type' => Type::int() + 'type' => Type::int(), ], 'name' => [ - 'type' => Type::string() + 'type' => Type::string(), ], 'type' => [ - 'type' => Type::string() + 'type' => Type::string(), ], 'description' => [ - 'type' => Type::string() - ] - ] + 'type' => Type::string(), + ], + ], ] ); diff --git a/src/GraphQL/TypeInterface/Element.php b/src/GraphQL/TypeInterface/Element.php index 8c4b53cf..ced2c536 100644 --- a/src/GraphQL/TypeInterface/Element.php +++ b/src/GraphQL/TypeInterface/Element.php @@ -37,8 +37,8 @@ public static function getInstance() 'fields' => [ 'id' => [ 'type' => Type::id(), - ] - ] + ], + ], ] ); } diff --git a/src/GraphQL/TypeInterface/Property.php b/src/GraphQL/TypeInterface/Property.php index 7b684fa0..80996f4f 100644 --- a/src/GraphQL/TypeInterface/Property.php +++ b/src/GraphQL/TypeInterface/Property.php @@ -34,12 +34,12 @@ public static function getInstance() 'name' => 'property', 'fields' => [ 'name' => [ - 'type' => Type::string() // name of property + 'type' => Type::string(), // name of property ], 'type' => [ - 'type' => Type::string() // property type - ] - ] + 'type' => Type::string(), // property type + ], + ], ] ); diff --git a/src/Installer.php b/src/Installer.php index d1bcda69..fe314017 100644 --- a/src/Installer.php +++ b/src/Installer.php @@ -27,7 +27,9 @@ class Installer extends SettingsStoreAwareInstaller { const DATAHUB_PERMISSION_CATEGORY = 'Datahub'; + const DATAHUB_ADAPTER_PERMISSION = 'plugin_datahub_adapter_graphql'; + const DATAHUB_ADMIN_PERMISSION = 'plugin_datahub_admin'; public function needsReloadAfterInstall(): bool @@ -35,9 +37,6 @@ public function needsReloadAfterInstall(): bool return true; } - /** - * {@inheritdoc} - */ public function install(): void { try { @@ -68,6 +67,7 @@ public function install(): void } } catch (\Exception $e) { Logger::warn($e); + throw new InstallationException($e->getMessage()); } diff --git a/src/Model/SpecialEntitySetting.php b/src/Model/SpecialEntitySetting.php index a83ea0c4..0ba50505 100644 --- a/src/Model/SpecialEntitySetting.php +++ b/src/Model/SpecialEntitySetting.php @@ -20,13 +20,19 @@ class SpecialEntitySetting implements \JsonSerializable protected $name; protected $readPossible = false; + protected $createPossible = false; + protected $updatePossible = false; + protected $deletePossible = false; protected $readAllowed = false; + protected $createAllowed = false; + protected $updateAllowed = false; + protected $deleteAllowed = false; public function __construct( diff --git a/src/MySafeException.php b/src/MySafeException.php index dc2d1ec6..dc65d17f 100644 --- a/src/MySafeException.php +++ b/src/MySafeException.php @@ -28,7 +28,6 @@ class MySafeException extends \Exception implements ClientAware * @param string|null $category * @param string $message * @param int $code - * @param \Throwable|null $previous */ public function __construct($category = null, $message = '', $code = 0, \Throwable $previous = null) { @@ -36,9 +35,6 @@ public function __construct($category = null, $message = '', $code = 0, \Throwab parent::__construct($message, $code, $previous); } - /** - * @return bool - */ public function isClientSafe(): bool { return true; diff --git a/src/PimcoreDataHubBundle.php b/src/PimcoreDataHubBundle.php index 6a7021a3..a0f1e730 100644 --- a/src/PimcoreDataHubBundle.php +++ b/src/PimcoreDataHubBundle.php @@ -41,9 +41,6 @@ class PimcoreDataHubBundle extends AbstractPimcoreBundle implements PimcoreBundl //TODO decide whether we want to return null here or throw an exception (maybe make this configurable?) public static $notAllowedPolicy = self::NOT_ALLOWED_POLICY_NULL; - /** - * @inheritDoc - */ public function build(ContainerBuilder $container) { $container->addCompilerPass(new ImportExportLocatorsPass()); @@ -55,28 +52,19 @@ public static function registerDependentBundles(BundleCollection $collection): v $collection->addBundle(new PimcoreAdminBundle(), 60); } - /** - * {@inheritdoc} - */ protected function getComposerPackageName(): string { return 'pimcore/data-hub'; } - /** - * @return array - */ public function getCssPaths(): array { return [ '/bundles/pimcoredatahub/css/icons.css', - '/bundles/pimcoredatahub/css/style.css' + '/bundles/pimcoredatahub/css/style.css', ]; } - /** - * @return array - */ public function getJsPaths(): array { return [ @@ -107,14 +95,13 @@ public function getJsPaths(): array '/bundles/pimcoredatahub/js/workspace/abstract.js', '/bundles/pimcoredatahub/js/workspace/document.js', '/bundles/pimcoredatahub/js/workspace/asset.js', - '/bundles/pimcoredatahub/js/workspace/object.js' + '/bundles/pimcoredatahub/js/workspace/object.js', ]; } /** * If the bundle has an installation routine, an installer is responsible of handling installation related tasks * - * @return InstallerInterface|null */ public function getInstaller(): ?InstallerInterface { diff --git a/src/Service/FileUploadService.php b/src/Service/FileUploadService.php index a0b29bff..deb7dc30 100644 --- a/src/Service/FileUploadService.php +++ b/src/Service/FileUploadService.php @@ -22,9 +22,7 @@ class FileUploadService { /** - * @param \Symfony\Component\HttpFoundation\Request $request * - * @return array * * @throws RequestError */ @@ -63,7 +61,6 @@ public function parseUploadedFiles(Request $request): array /** * Validates that the request meet our expectations * - * @param \Symfony\Component\HttpFoundation\Request $request * */ protected function validateParsedBody(Request $request): void diff --git a/src/Service/OutputCacheService.php b/src/Service/OutputCacheService.php index 5d508edf..623aacd4 100644 --- a/src/Service/OutputCacheService.php +++ b/src/Service/OutputCacheService.php @@ -60,7 +60,6 @@ public function __construct(ContainerBagInterface $container, EventDispatcherInt } /** - * @param Request $request * * @return mixed */ @@ -76,11 +75,8 @@ public function load(Request $request) } /** - * @param Request $request - * @param JsonResponse $response * @param array $extraTags * - * @return void */ public function save(Request $request, JsonResponse $response, $extraTags = []): void { @@ -111,7 +107,6 @@ protected function loadFromCache($key) * @param mixed $item * @param array $tags * - * @return void */ protected function saveToCache($key, $item, $tags = []): void { diff --git a/src/WorkspaceHelper.php b/src/WorkspaceHelper.php index 501c150a..d6a04bb6 100644 --- a/src/WorkspaceHelper.php +++ b/src/WorkspaceHelper.php @@ -41,7 +41,6 @@ class WorkspaceHelper const MODIFY_TYPE_DELETE = 'delete'; /** - * @param array $workspaces * * @return array */ @@ -68,7 +67,6 @@ public static function cleanupWorkspaces(array $workspaces) } /** - * @param Configuration $configurationEntity * @param string $spaceType * @param string $modificationType * @param string $searchValue @@ -143,7 +141,6 @@ public static function modifyWorkspaceRowByType(Configuration $configurationEnti } /** - * @param Configuration $config * @param array $workspaces * * @throws \Exception @@ -176,7 +173,6 @@ public static function saveWorkspaces(Configuration $config, $workspaces) } /** - * @param Configuration $configuration * * @return array * @@ -204,7 +200,6 @@ public static function loadWorkspaces(Configuration $configuration) } /** - * @param Configuration $config * * @throws \Exception */ @@ -246,6 +241,7 @@ public static function checkPermission($element, $type) $isAllowed = self::isAllowed($element, $configuration, $type); if (!$isAllowed && PimcoreDataHubBundle::getNotAllowedPolicy() === PimcoreDataHubBundle::NOT_ALLOWED_POLICY_EXCEPTION) { $elementType = Service::getElementType($element); + throw new ClientSafeException($type . ' access for ' . $elementType . ' ' . $element->getFullPath() . ' denied'); } @@ -256,8 +252,6 @@ public static function checkPermission($element, $type) * @internal * * @param ElementInterface|OwnerAwareFieldInterface|null $element - * @param Configuration $configuration - * @param string $type * * @return bool */ diff --git a/tests/GraphQL/ResolveTest.php b/tests/GraphQL/ResolveTest.php index d841b93d..fe6c7d8d 100644 --- a/tests/GraphQL/ResolveTest.php +++ b/tests/GraphQL/ResolveTest.php @@ -15,14 +15,13 @@ namespace Pimcore\Bundle\DataHubBundle\Tests\GraphQL; +use Codeception\Test\Unit; use Pimcore\Bundle\DataHubBundle\GraphQL\Resolver\QueryType; use Pimcore\Bundle\DataHubBundle\GraphQL\Resolver\TranslationListing; use Pimcore\Bundle\DataHubBundle\GraphQL\Service; use Pimcore\Model\Translation; use Pimcore\Tool; use Symfony\Component\EventDispatcher\EventDispatcher; -use Codeception\Test\Unit; - class ResolveTest extends Unit { @@ -52,7 +51,7 @@ public function testGraphQLTranslationListingResolveListing() public function testGraphQLTranslationListingResolveListingWithDomain() { $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["domain" => "admin"]); + $listRes = $translationListing->resolveListing([], ['domain' => 'admin']); for($i = 0; $i < 2; $i++) { $this->assertEquals('translation-ka' .$i, $listRes['edges'][$i]['cursor']); @@ -66,10 +65,10 @@ public function testGraphQLTranslationListingResolveListingWithDomain() public function testGraphQLTranslationListingResolveListingWithKey() { - $key = "k2"; + $key = 'k2'; $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["keys" => $key]); + $listRes = $translationListing->resolveListing([], ['keys' => $key]); $this->assertEquals('translation-' . $key, $listRes['edges'][0]['cursor']); @@ -81,11 +80,10 @@ public function testGraphQLTranslationListingResolveListingWithKey() public function testGraphQLTranslationListingResolveListingWithKeys() { - $keys = "k1,k2,k3"; + $keys = 'k1,k2,k3'; $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["keys" => $keys]); - + $listRes = $translationListing->resolveListing([], ['keys' => $keys]); for($i = 0; $i < 2; $i++) { $this->assertEquals('translation-k' .$i + 1, $listRes['edges'][$i]['cursor']); @@ -99,36 +97,36 @@ public function testGraphQLTranslationListingResolveListingWithKeys() public function testGraphQLTranslationListingResolveListingWithLanguage() { - $languages = "en"; + $languages = 'en'; $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["languages" => $languages]); + $listRes = $translationListing->resolveListing([], ['languages' => $languages]); $translations = $listRes['edges'][0]['node']->getTranslations(); $this->assertCount(1, $translations); - $this->assertArrayHasKey("en", $translations); + $this->assertArrayHasKey('en', $translations); } public function testGraphQLTranslationListingResolveListingWithLanguages() { - $languages = "en, de"; + $languages = 'en, de'; $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["languages" => $languages]); + $listRes = $translationListing->resolveListing([], ['languages' => $languages]); $translations = $listRes['edges'][0]['node']->getTranslations(); $this->assertCount(2, $translations); - $this->assertArrayHasKey("en", $translations); - $this->assertArrayHasKey("de", $translations); + $this->assertArrayHasKey('en', $translations); + $this->assertArrayHasKey('de', $translations); } public function testGraphQLTranslationListingResolveListingWithLanguagesAndKeys() { - $languages = "en, de"; - $keys = "k1,k2,k3"; + $languages = 'en, de'; + $keys = 'k1,k2,k3'; $translationListing = new TranslationListing($this->service, new EventDispatcher()); - $listRes = $translationListing->resolveListing([], ["languages" => $languages, "keys" => $keys]); + $listRes = $translationListing->resolveListing([], ['languages' => $languages, 'keys' => $keys]); for($i = 0; $i < 2; $i++) { $translation = $listRes['edges'][$i]['node']; @@ -137,8 +135,8 @@ public function testGraphQLTranslationListingResolveListingWithLanguagesAndKeys( $this->assertEquals('k' . $i + 1, $translation->getKey()); $this->assertCount(2, $translations); - $this->assertArrayHasKey("en", $translations); - $this->assertArrayHasKey("de", $translations); + $this->assertArrayHasKey('en', $translations); + $this->assertArrayHasKey('de', $translations); } } @@ -149,7 +147,8 @@ public function testGraphQLResolveTranslationGetter() $queryTypeResolver->resolveTranslationGetter(); } - private function addTranslations(): void { + private function addTranslations(): void + { for($i = 0; $i < 4; $i++) { $this->addTranslation('k' . $i); } @@ -159,7 +158,8 @@ private function addTranslations(): void { } } - private function addTranslation(string $key, string $domain = "messages"): void { + private function addTranslation(string $key, string $domain = 'messages'): void + { $t = new Translation(); $t->setDomain($domain); $t->setKey($key); @@ -173,4 +173,3 @@ private function addTranslation(string $key, string $domain = "messages"): void } } - diff --git a/tests/GraphQL/Traits/ElementIdentificationTraitTest.php b/tests/GraphQL/Traits/ElementIdentificationTraitTest.php index b6bc298c..13d38375 100644 --- a/tests/GraphQL/Traits/ElementIdentificationTraitTest.php +++ b/tests/GraphQL/Traits/ElementIdentificationTraitTest.php @@ -16,19 +16,19 @@ namespace Pimcore\Bundle\DataHubBundle\Tests\GraphQL\Traits; use Codeception\Test\Unit; -use \Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait; - -use Pimcore\Bundle\DataHubBundle\GraphQL\Exception\ClientSafeException; +use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait; class TestTrait { use ElementIdentificationTrait; - const BY_ID = "ById"; - const BY_PATH = "ByPath"; + const BY_ID = 'ById'; + + const BY_PATH = 'ByPath'; /** * @param string $elementType + * * @return string */ protected function getElementById($elementType) @@ -38,6 +38,7 @@ protected function getElementById($elementType) /** * @param string $elementType + * * @return string */ protected function getElementByPath($elementType) @@ -49,13 +50,14 @@ protected function getElementByPath($elementType) class ElementIdentificationTraitTest extends Unit { const TRAIT_TO_TEST = '\Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ElementIdentificationTrait'; + const TEST_TYPE = 'object'; public function testThrowingClientSafeExceptionIfTypeIsMissing() { // Arrange $this->expectExceptionMessageMatches('/type expected/'); - $newValueItemValue = array(); + $newValueItemValue = []; // System under Test $sut = $this->getMockForTrait(self::TRAIT_TO_TEST); // Act + Assert @@ -66,7 +68,7 @@ public function testThrowingClientSafeExceptionIfTypeIsNotSupported() { // Arrange $this->expectExceptionMessageMatches('/The type .* is not supported/'); - $newValueItemValue = array("type" => "wrong"); + $newValueItemValue = ['type' => 'wrong']; // System under Test $sut = $this->getMockForTrait(self::TRAIT_TO_TEST); // Act + Assert @@ -77,7 +79,7 @@ public function testThrowingClientSafeExceptionIfBothIdAndFullpathAreMissing() { // Arrange $this->expectExceptionMessageMatches('/either .* or .* expected/'); - $newValueItemValue = array("type" => self::TEST_TYPE); + $newValueItemValue = ['type' => self::TEST_TYPE]; // System under Test $sut = $this->getMockForTrait(self::TRAIT_TO_TEST); // Act + Assert @@ -88,11 +90,11 @@ public function testThrowingClientSafeExceptionIfBothIdAndFullpathArePassed() { // Arrange $this->expectExceptionMessage('either id or fullpath expected but not both'); - $newValueItemValue = array( - "type" => self::TEST_TYPE, - "id" => 4, - "fullpath" => "/some/path/withKey" - ); + $newValueItemValue = [ + 'type' => self::TEST_TYPE, + 'id' => 4, + 'fullpath' => '/some/path/withKey', + ]; // System under Test $sut = new TestTrait(); // Act & Assert @@ -102,10 +104,10 @@ public function testThrowingClientSafeExceptionIfBothIdAndFullpathArePassed() public function testElementIdentificationGetElementByFullPath() { // Arrange - $newValueItemValue = array( - "type" => self::TEST_TYPE, - "fullpath" => "/some/path/withKey" - ); + $newValueItemValue = [ + 'type' => self::TEST_TYPE, + 'fullpath' => '/some/path/withKey', + ]; // System under Test $sut = new TestTrait(); // Act @@ -117,9 +119,9 @@ public function testElementIdentificationGetElementByFullPath() public function testElementIdentificationIfTypeCanBePassedAsSeparateArgument() { // Arrange - $newValueItemValue = array( - "fullpath" => "/some/path/withKey" - ); + $newValueItemValue = [ + 'fullpath' => '/some/path/withKey', + ]; // System under Test $sut = new TestTrait(); // Act diff --git a/tests/Model/ImportingConfigTest.php b/tests/Model/ImportingConfigTest.php index 49169028..2879ed66 100644 --- a/tests/Model/ImportingConfigTest.php +++ b/tests/Model/ImportingConfigTest.php @@ -9,8 +9,8 @@ * Full copyright and license information is available in * LICENSE.md which is distributed with this source code. * - * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) - * @license http://www.pimcore.org/license GPLv3 and PCL + * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) + * @license http://www.pimcore.org/license GPLv3 and PCL */ namespace Pimcore\Tests\Model\DataObject; @@ -18,12 +18,12 @@ use Pimcore\Bundle\DataHubBundle\Configuration; use Pimcore\Tests\Support\Helper\DataType\TestDataHelper; use Pimcore\Tests\Support\Test\ModelTestCase; -use Pimcore\Model\DataObject\DataHubTestEntity; /** * Class ListingTest * * @package Pimcore\Tests\Model\DataObject + * * @group model.dataobject.listing */ class ImportingConfigTest extends ModelTestCase @@ -33,7 +33,8 @@ class ImportingConfigTest extends ModelTestCase */ protected $testDataHelper; - const CORRECT_API_KEY = "correct_key"; + const CORRECT_API_KEY = 'correct_key'; + const CONFNAME = 'newone'; public function setUp(): void @@ -46,11 +47,9 @@ public function setUp(): void public function tearDown(): void { //TestHelper::cleanUp(); -// parent::tearDown(); + // parent::tearDown(); } - - public function testConfiguration() { @@ -59,7 +58,6 @@ public function testConfiguration() $config = new Configuration('graphql', '/124', self::CONFNAME); - $configurationData = file_get_contents(__DIR__ . '/../_support/Resources/configuration_query_mutation_allowed.json'); $decodedConfigurationData = json_decode($configurationData, true); $config->setConfiguration($decodedConfigurationData); diff --git a/tests/Model/_bootstrap.php b/tests/Model/_bootstrap.php index 5367b35f..47598fcc 100644 --- a/tests/Model/_bootstrap.php +++ b/tests/Model/_bootstrap.php @@ -1,4 +1,16 @@ createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); $request = new Request(); - // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); // Act @@ -47,12 +47,11 @@ public function testSecurityCheckFailsWhenInvalidApiKeyInRequest() // Arrange $configuration = $this->createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); - $request = new Request(array("apikey" => "wrong_key")); - + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); + $request = new Request(['apikey' => 'wrong_key']); // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); @@ -67,12 +66,11 @@ public function testSecurityCheckPassesWhenCorrectApiKeyInQuery() // Arrange $configuration = $this->createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); - $request = new Request(array("apikey" => self::CORRECT_API_KEY)); - + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); + $request = new Request(['apikey' => self::CORRECT_API_KEY]); // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); @@ -87,12 +85,12 @@ public function testSecurityCheckPassesWhenCorrectApiKeyInApikeyHeader() // Arrange $configuration = $this->createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); $request = new Request(); - $request->headers->set("apikey", self::CORRECT_API_KEY); + $request->headers->set('apikey', self::CORRECT_API_KEY); // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); @@ -107,12 +105,12 @@ public function testSecurityCheckPassesWhenCorrectXApiKeyInApikeyHeader() // Arrange $configuration = $this->createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); $request = new Request(); - $request->headers->set("X-API-Key", self::CORRECT_API_KEY); + $request->headers->set('X-API-Key', self::CORRECT_API_KEY); // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); // Act @@ -126,12 +124,12 @@ public function testSecurityCheckPrioritizesHeaderOverQueryParam() // Arrange $configuration = $this->createMock(Configuration::class); $configuration->method('getSecurityConfig') - ->willReturn(array( - "method" => Configuration::SECURITYCONFIG_AUTH_APIKEY, - "apikey" => self::CORRECT_API_KEY - )); - $request = new Request(array("apikey", "wrong_key")); - $request->headers->set("apikey", self::CORRECT_API_KEY); + ->willReturn([ + 'method' => Configuration::SECURITYCONFIG_AUTH_APIKEY, + 'apikey' => self::CORRECT_API_KEY, + ]); + $request = new Request(['apikey', 'wrong_key']); + $request->headers->set('apikey', self::CORRECT_API_KEY); // System under Test $sut = new \Pimcore\Bundle\DataHubBundle\Service\CheckConsumerPermissionsService(); // Act diff --git a/tests/Service/OutputCacheServiceTest.php b/tests/Service/OutputCacheServiceTest.php index 16aea770..99f6c7d5 100644 --- a/tests/Service/OutputCacheServiceTest.php +++ b/tests/Service/OutputCacheServiceTest.php @@ -12,32 +12,35 @@ * @copyright Copyright (c) Pimcore GmbH (http://www.pimcore.org) * @license http://www.pimcore.org/license GPLv3 and PCL */ + namespace Pimcore\Bundle\DataHubBundle\Service; use Codeception\Test\Unit; use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\JsonResponse; +use Symfony\Component\HttpFoundation\Request; class OutputCacheServiceTest extends Unit { - protected $container; + protected $eventDispatcher; + protected $request; + protected $sut; protected function setUp(): void { $this->container = $this->createMock(ContainerBagInterface::class); $this->container->method('get') - ->willReturn(array( - 'graphql' => array( + ->willReturn([ + 'graphql' => [ 'output_cache_enabled' => true, - 'output_cache_lifetime' => 25 - ) - )); + 'output_cache_lifetime' => 25, + ], + ]); $this->eventDispatcher = $this->createMock(EventDispatcherInterface::class); $this->eventDispatcher->method('dispatch') @@ -49,12 +52,11 @@ protected function setUp(): void ->getMock(); $payload = '{"query":"{\n getProductCategoryListing {\n edges {\n node {\n fullpath\n }\n }\n }\n}","variables":null,"operationName":null}'; - $this->request = Request::create('/api', 'POST', array("apikey" => "super_secret_api_key"), [], [], [], $payload); - $this->request->headers->set("Content-Type", "application/json"); + $this->request = Request::create('/api', 'POST', ['apikey' => 'super_secret_api_key'], [], [], [], $payload); + $this->request->headers->set('Content-Type', 'application/json'); $this->request->request->set('clientname', 'test-datahub-config'); } - public function testReturnNullWhenItemIsNotCached() { // Arrange @@ -67,7 +69,6 @@ public function testReturnNullWhenItemIsNotCached() $this->assertEquals(null, $cacheItem); } - public function testReturnItemWhenItIsCached() { // Arrange @@ -81,7 +82,6 @@ public function testReturnItemWhenItIsCached() $this->assertEquals($response, $cacheItem); } - public function testSaveItemWhenCacheIsEnabled() { // Arrange @@ -95,17 +95,16 @@ public function testSaveItemWhenCacheIsEnabled() $this->sut->save($this->request, $response); } - public function testIgnoreSaveWhenCacheIsDisabled() { // Arrange $this->container = $this->createMock(ContainerBagInterface::class); $this->container->method('get') - ->willReturn(array( - 'graphql' => array( - 'output_cache_enabled' => false - ) - )); + ->willReturn([ + 'graphql' => [ + 'output_cache_enabled' => false, + ], + ]); $this->sut = $this->getMockBuilder(OutputCacheService::class) ->setConstructorArgs([$this->container, $this->eventDispatcher]) @@ -122,17 +121,16 @@ public function testIgnoreSaveWhenCacheIsDisabled() $this->sut->save($this->request, $response); } - public function testIgnoreLoadWhenCacheIsDisabled() { // Arrange $this->container = $this->createMock(ContainerBagInterface::class); $this->container->method('get') - ->willReturn(array( - 'graphql' => array( - 'output_cache_enabled' => false - ) - )); + ->willReturn([ + 'graphql' => [ + 'output_cache_enabled' => false, + ], + ]); $this->sut = $this->getMockBuilder(OutputCacheService::class) ->setConstructorArgs([$this->container, $this->eventDispatcher]) @@ -149,7 +147,6 @@ public function testIgnoreLoadWhenCacheIsDisabled() $this->sut->save($this->request, $response); } - public function testIgnoreCacheWhenRequestParameterIsPassed() { // Arrange diff --git a/tests/Service/_bootstrap.php b/tests/Service/_bootstrap.php index 5367b35f..47598fcc 100644 --- a/tests/Service/_bootstrap.php +++ b/tests/Service/_bootstrap.php @@ -1,4 +1,16 @@ debug('[DataHub] Running datahub installer'); - //create migrations table in order to allow installation - needed for SettingsStoreAware Installer \Pimcore\Db::get()->exec(' create table migration_versions @@ -59,6 +69,7 @@ public function initializeDefinitions(): void /** * @param \stdClass $class + * * @return void */ public function prepareData($class) @@ -75,5 +86,4 @@ public function prepareData($class) $object->save(); } } - } diff --git a/tests/_support/Helper/Service.php b/tests/_support/Helper/Service.php index d54f3f5c..d8449e8a 100644 --- a/tests/_support/Helper/Service.php +++ b/tests/_support/Helper/Service.php @@ -1,40 +1,50 @@ has('test.service_container') ? $container->get('test.service_container') : $container; } + return self::$container->get($serviceId); } public function initializeDefinitions() { -// $this->setupFieldcollection_Unittestfieldcollection(); -// $this->setupPimcoreClass_Unittest(); -// $this->setupObjectbrick_UnittestBrick(); + // $this->setupFieldcollection_Unittestfieldcollection(); + // $this->setupPimcoreClass_Unittest(); + // $this->setupObjectbrick_UnittestBrick(); } - } diff --git a/tests/_support/Helper/Unit.php b/tests/_support/Helper/Unit.php index 6c362eeb..549f5aa4 100644 --- a/tests/_support/Helper/Unit.php +++ b/tests/_support/Helper/Unit.php @@ -1,12 +1,16 @@ Date: Thu, 2 May 2024 10:34:38 +0200 Subject: [PATCH 5/5] Update SECURITY.md --- SECURITY.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 6b6917f5..cd3189e3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,20 +2,21 @@ ## Reporting a Vulnerability -If you think that you have found a security issue, -don’t use the bug tracker and don’t publish it publicly. -Instead, all security issues must be reported via 📫 to [security-issue@pimcore.com](mailto:security-issue@pimcore.com). +If you think that you have found a security issue, +don’t use the bug tracker and don’t publish it publicly. +Instead, all security issues must be reported via a private vulnerability report. + +Please follow the [instructions](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability#privately-reporting-a-security-vulnerability) to submit a private report. ## Resolving Process -Every submitted security issue is handled with top priority by following these steps: +Every submitted security issue is handled with top priority by following these steps: 1. Confirm the vulnerability 2. Determine the severity 3. Contact reporter 4. Work on a patch 5. Get a CVE identification number (may be done by the reporter or a security service provider) -6. Patch reviewing +6. Patch reviewing 7. Tagging a new release for supported versions 8. Publish security announcement -