Skip to content

Commit

Permalink
fix a condition, check the method type message
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed May 27, 2024
1 parent 3119b33 commit aaf8ad0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Configuration/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,13 @@ public function getConfigTreeBuilder(): Config\Definition\Builder\TreeBuilder
->thenInvalid('The reference_entity option should be used with the "referenceEntityAttributeOption" endpoint.')
->end()
->validate()
->ifTrue(fn ($data) => \array_key_exists('with_enriched_attributes', $data) && \array_key_exists('type', $data) && \in_array($data['type'], ['category'], true))
->ifTrue(fn ($data) => \array_key_exists('with_enriched_attributes', $data) && \array_key_exists('type', $data) && !\in_array($data['type'], ['category'], true))
->thenInvalid('The with_enriched_attributes option should only be used with the "category" endpoint.')
->end()
// ->validate()
// ->ifTrue(fn ($data) => \array_key_exists('with_enriched_attributes', $data) && \array_key_exists('method', $data) && 'all' !== $data['method'])
// ->thenInvalid('The with_enriched_attributes option should only be used with the "all" method.')
// ->end()
->validate()
->ifTrue(fn ($data) => \array_key_exists('with_enriched_attributes', $data) && \array_key_exists('method', $data) && 'all' !== $data['method'])
->thenInvalid('The with_enriched_attributes option should only be used with the "all" method.')
->end()
->children()
->scalarNode('type')
->isRequired()
Expand Down

0 comments on commit aaf8ad0

Please sign in to comment.