Skip to content

Commit

Permalink
feat(graphql-printer)!: Settings::isNormalizeSchema() renamed to `S…
Browse files Browse the repository at this point in the history
…ettings::isNormalizeDefinitions()`.
  • Loading branch information
LastDragon-ru committed Aug 29, 2023
1 parent 4a8b916 commit cacf098
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/graphql-printer/src/Blocks/Document/DocumentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function testStatistics(): void {
public static function dataProviderSerialize(): array {
$settings = (new TestSettings())
->setPrintDirectives(false)
->setNormalizeSchema(false)
->setNormalizeDefinitions(false)
->setNormalizeInterfaces(false)
->setNormalizeFields(false)
->setNormalizeEnums(false)
Expand Down Expand Up @@ -267,7 +267,7 @@ interface B {
GRAPHQL,
$settings
->setPrintDirectives(true)
->setNormalizeSchema(true)
->setNormalizeDefinitions(true)
->setNormalizeInterfaces(true)
->setNormalizeFields(true)
->setNormalizeEnums(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function isWrapped(): bool {
}

protected function isNormalized(): bool {
return $this->getSettings()->isNormalizeSchema();
return $this->getSettings()->isNormalizeDefinitions();
}

protected function isAlwaysMultiline(): bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function isWrapped(): bool {
}

protected function isNormalized(): bool {
return $this->getSettings()->isNormalizeSchema();
return $this->getSettings()->isNormalizeDefinitions();
}

protected function isAlwaysMultiline(): bool {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/src/Contracts/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function isPrintUnusedDefinitions(): bool;
* If `false` types and directives in the schema will be printed in the
* original order if `true` they will be sorted by name.
*/
public function isNormalizeSchema(): bool;
public function isNormalizeDefinitions(): bool;

/**
* If `false` members will be printed in the original order if `true` they
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/src/PrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public static function dataProviderPrintSchema(): array {
'@directive',
]),
(new TestSettings())
->setNormalizeSchema(false)
->setNormalizeDefinitions(false)
->setNormalizeUnions(false)
->setNormalizeEnums(false)
->setNormalizeInterfaces(false)
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/src/Settings/GraphQLSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class GraphQLSettings extends ImmutableSettings {
protected bool $printDirectives = true;
protected bool $printDirectiveDefinitions = false;
protected bool $printUnusedDefinitions = true;
protected bool $normalizeSchema = true;
protected bool $normalizeDefinitions = true;
protected bool $normalizeUnions = false;
protected bool $normalizeEnums = false;
protected bool $normalizeInterfaces = false;
Expand Down
12 changes: 6 additions & 6 deletions packages/graphql-printer/src/Settings/ImmutableSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class ImmutableSettings implements Settings {
protected bool $printDirectives = true;
protected bool $printDirectiveDefinitions = true;
protected bool $printUnusedDefinitions = false;
protected bool $normalizeSchema = true;
protected bool $normalizeDefinitions = true;
protected bool $normalizeUnions = true;
protected bool $normalizeEnums = true;
protected bool $normalizeInterfaces = true;
Expand Down Expand Up @@ -118,13 +118,13 @@ public function setPrintDirectiveDefinitions(bool $value): static {
});
}

public function isNormalizeSchema(): bool {
return $this->normalizeSchema;
public function isNormalizeDefinitions(): bool {
return $this->normalizeDefinitions;
}

public function setNormalizeSchema(bool $value): static {
public function setNormalizeDefinitions(bool $value): static {
return $this->set(static function (self $settings) use ($value): void {
$settings->normalizeSchema = $value;
$settings->normalizeDefinitions = $value;
});
}

Expand Down Expand Up @@ -311,7 +311,7 @@ public static function createFrom(Settings $settings): self {
->setPrintDirectives($settings->isPrintDirectives())
->setPrintDirectiveDefinitions($settings->isPrintDirectiveDefinitions())
->setPrintUnusedDefinitions($settings->isPrintUnusedDefinitions())
->setNormalizeSchema($settings->isNormalizeSchema())
->setNormalizeDefinitions($settings->isNormalizeDefinitions())
->setNormalizeUnions($settings->isNormalizeUnions())
->setNormalizeEnums($settings->isNormalizeEnums())
->setNormalizeInterfaces($settings->isNormalizeInterfaces())
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-printer/src/Testing/TestSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TestSettings extends ImmutableSettings {
protected bool $printDirectives = true;
protected bool $printDirectiveDefinitions = true;
protected bool $printUnusedDefinitions = false;
protected bool $normalizeSchema = true;
protected bool $normalizeDefinitions = true;
protected bool $normalizeUnions = true;
protected bool $normalizeEnums = true;
protected bool $normalizeInterfaces = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/Printer/PrinterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ public static function dataProviderPrintSchema(): array {
'@mock',
]),
(new TestSettings())
->setNormalizeSchema(false)
->setNormalizeDefinitions(false)
->setNormalizeUnions(false)
->setNormalizeEnums(false)
->setNormalizeInterfaces(false)
Expand Down

0 comments on commit cacf098

Please sign in to comment.