We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b7ce7f0 commit 761f070Copy full SHA for 761f070
ux.symfony.com/src/Util/SourceCleaner.php
@@ -17,9 +17,14 @@ class SourceCleaner
17
{
18
public static function cleanupPhpFile(string $contents, bool $removeClass = false): string
19
20
- $contents = u($contents)
21
- ->replace("<?php\n", '')
22
- ->replaceMatches('/namespace[^\n]*/', '');
+ $contents = u($contents)->replace("<?php\n", '');
+
+ // Remove LICENCE header
23
+ if ($contents->indexOf('* This file is part of the Symfony package')) {
24
+ $contents = $contents->after(' */');
25
+ }
26
27
+ $contents = $contents->replaceMatches('/namespace[^\n]*/', '');
28
29
if ($removeClass) {
30
$contents = $contents->replaceMatches('/class[^\n]*\n{/', '')
0 commit comments