Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take shortcut when exporting a string #60

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Jun 17, 2024

No description provided.

@@ -96,7 +96,7 @@ public function shortenedRecursiveExport(array &$data, ?RecursionContext $proces
public function shortenedExport(mixed $value): string
{
if (is_string($value)) {
$string = str_replace("\n", '', $this->export($value));
$string = str_replace("\n", '', $this->exportString($value));
Copy link
Contributor Author

@staabm staabm Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this means we take a shortcut from

export -> recursiveExport -> exportString to just a single exportString, similar to how it is done in recursiveExport() itself.

we save 2 method calls per string beeing exported.

@sebastianbergmann sebastianbergmann merged commit 208c14f into sebastianbergmann:main Jun 18, 2024
5 checks passed
@staabm staabm deleted the stringshort branch June 18, 2024 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants