Skip to content

Commit 761f070

Browse files
committed
Remove LICENCE from CodeBlock
1 parent b7ce7f0 commit 761f070

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

ux.symfony.com/src/Util/SourceCleaner.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ class SourceCleaner
1717
{
1818
public static function cleanupPhpFile(string $contents, bool $removeClass = false): string
1919
{
20-
$contents = u($contents)
21-
->replace("<?php\n", '')
22-
->replaceMatches('/namespace[^\n]*/', '');
20+
$contents = u($contents)->replace("<?php\n", '');
21+
22+
// 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]*/', '');
2328

2429
if ($removeClass) {
2530
$contents = $contents->replaceMatches('/class[^\n]*\n{/', '')

0 commit comments

Comments
 (0)