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

More consistent formatting for generated files #633

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generated/8.1/array.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/8.1/image.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/8.2/array.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/8.2/image.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/8.3/array.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/8.3/image.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/8.4/array.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/8.4/image.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions generated/8.5/array.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generated/8.5/image.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions generator/src/Generator/FileCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public function generateVersionSplitters(string $module, string $path, array $ve
\fwrite($stream, "\n}");
}
}
\fwrite($stream, "\n");
\fclose($stream);
}

Expand Down Expand Up @@ -145,8 +146,9 @@ public function generateRectorFile(array $functions, string $path): void

// This file configures rector/rector to replace all PHP functions with their equivalent "safe" functions.
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(
RenameFunctionRector::class,[
$rectorConfig->ruleWithConfiguration(
RenameFunctionRector::class,
[
TXT;

fwrite($stream, $header);
Expand All @@ -155,7 +157,7 @@ public function generateRectorFile(array $functions, string $path): void
fwrite($stream, " '$functionName' => 'Safe\\$functionName',\n");
}

fwrite($stream, " ]);\n};\n");
fwrite($stream, " ]\n );\n};\n");
fclose($stream);
}

Expand Down
2 changes: 1 addition & 1 deletion generator/src/Generator/WritePhpFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private function displayParamsWithType(array $params): string

$paramName = $param->getParameterName();
if ($param->isVariadic()) {
$paramAsString .= ' ...$'.$paramName;
$paramAsString .= '...$'.$paramName;
} else {
if ($param->isByReference()) {
$paramAsString .= '&';
Expand Down
Loading