Skip to content

Commit c531be9

Browse files
committed
MC-36456: union implementation
1 parent 19ba821 commit c531be9

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

lib/internal/Magento/Framework/GraphQl/Config/Element/UnionInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ interface UnionInterface extends ConfigElementInterface
1919
*
2020
* @return Type[]
2121
*/
22-
public function getTypes() : array;
22+
public function getTypes(): array;
2323
}

lib/internal/Magento/Framework/GraphQl/Config/Element/UnionType.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(
5555
*
5656
* @return string
5757
*/
58-
public function getName() : string
58+
public function getName(): string
5959
{
6060
return $this->name;
6161
}
@@ -65,7 +65,7 @@ public function getName() : string
6565
*
6666
* @return string[]
6767
*/
68-
public function getTypes() : array
68+
public function getTypes(): array
6969
{
7070
return $this->types;
7171
}
@@ -75,7 +75,7 @@ public function getTypes() : array
7575
*
7676
* @return string
7777
*/
78-
public function getTypeResolver()
78+
public function getTypeResolver(): string
7979
{
8080
return $this->typeResolver;
8181
}
@@ -85,7 +85,7 @@ public function getTypeResolver()
8585
*
8686
* @return string
8787
*/
88-
public function getDescription() : string
88+
public function getDescription(): string
8989
{
9090
return $this->description;
9191
}

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/Formatter/Unions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(OutputMapper $outputMapper)
3434
/**
3535
* @inheritDoc
3636
*/
37-
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
37+
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType): array
3838
{
3939
$config = [];
4040
if ($configElement instanceof UnionType && !empty($configElement->getTypes())) {

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/FormatterComposite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function __construct(array $formatters)
3131
/**
3232
* @inheritDoc
3333
*/
34-
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array
34+
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType): array
3535
{
3636
$defaultConfig = [
3737
'name' => $configElement->getName(),
@@ -42,6 +42,6 @@ public function format(ConfigElementInterface $configElement, OutputTypeInterfac
4242
$formattedConfig[] = $formatter->format($configElement, $outputType);
4343
}
4444

45-
return array_merge($defaultConfig,...$formattedConfig);
45+
return array_merge($defaultConfig, ...$formattedConfig);
4646
}
4747
}

lib/internal/Magento/Framework/GraphQl/Schema/Type/Output/ElementMapper/FormatterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ interface FormatterInterface
2222
* @param OutputTypeInterface $outputType
2323
* @return array
2424
*/
25-
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType) : array;
25+
public function format(ConfigElementInterface $configElement, OutputTypeInterface $outputType): array;
2626
}

lib/internal/Magento/Framework/GraphQlSchemaStitching/GraphQlReader/Reader/UnionType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct(
5353
/**
5454
* @inheritDoc
5555
*/
56-
public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
56+
public function read(\GraphQL\Type\Definition\Type $typeMeta): array
5757
{
5858
if ($typeMeta instanceof \GraphQL\Type\Definition\UnionType) {
5959
$typeName = $typeMeta->name;
@@ -85,7 +85,7 @@ public function read(\GraphQL\Type\Definition\Type $typeMeta) : array
8585
* @param \GraphQL\Type\Definition\UnionType $unionTypeMeta
8686
* @return string
8787
*/
88-
private function getUnionTypeResolver(\GraphQL\Type\Definition\UnionType $unionTypeMeta) : string
88+
private function getUnionTypeResolver(\GraphQL\Type\Definition\UnionType $unionTypeMeta): string
8989
{
9090
/** @var \GraphQL\Language\AST\NodeList $directives */
9191
$directives = $unionTypeMeta->astNode->directives;

0 commit comments

Comments
 (0)