Skip to content

Commit a617540

Browse files
committed
[TASK] Rename AbstractNode WithKeepExistingOptions
1 parent 052b401 commit a617540

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

packages/guides-restructured-text/src/RestructuredText/Directives/BaseDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function process(
6060
): Node|null {
6161
return $this->processNode($blockContext, $directive)
6262
// Ensure options are always available
63-
->withDefaultOptions($this->optionsToArray($directive->getOptions()));
63+
->withKeepExistingOptions($this->optionsToArray($directive->getOptions()));
6464
}
6565

6666
/**

packages/guides-restructured-text/src/RestructuredText/Directives/SubDirective.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final public function process(
4444
return null;
4545
}
4646

47-
return $node->withDefaultOptions($this->optionsToArray($directive->getOptions()));
47+
return $node->withKeepExistingOptions($this->optionsToArray($directive->getOptions()));
4848
}
4949

5050
/** @return Rule<CollectionNode> */

packages/guides-restructured-text/tests/unit/Parser/DummyNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function withOptions(array $options): Node
3737
}
3838

3939
/** {@inheritDoc} */
40-
public function withDefaultOptions(array $options): Node
40+
public function withKeepExistingOptions(array $options): Node
4141
{
4242
return $this;
4343
}

packages/guides/src/Nodes/AbstractNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function withOptions(array $options): Node
9696
*
9797
* @return static
9898
*/
99-
public function withDefaultOptions(array $options): Node
99+
public function withKeepExistingOptions(array $options): Node
100100
{
101101
$result = clone $this;
102102
$result->options = [...$options, ...$result->options];

packages/guides/src/Nodes/Node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function getOptions(): array;
2222
public function withOptions(array $options): Node;
2323

2424
/** @param array<string, scalar|null> $options */
25-
public function withDefaultOptions(array $options): Node;
25+
public function withKeepExistingOptions(array $options): Node;
2626

2727
public function hasOption(string $name): bool;
2828

0 commit comments

Comments
 (0)