|
12 | 12 |
|
13 | 13 | // see https://github.com/humbug/php-scoper |
14 | 14 | return [ |
15 | | - 'prefix' => 'SwissKnife' . $timestamp, |
| 15 | + 'prefix' => 'Jack' . $timestamp, |
16 | 16 | 'expose-constants' => ['#^SYMFONY\_[\p{L}_]+$#'], |
17 | 17 | 'exclude-namespaces' => [ |
18 | | - '#^Rector\\\\SwissKnife#', |
| 18 | + '#^Rector\\\\Jack#', |
19 | 19 | '#^Symfony\\\\Polyfill#', |
20 | 20 | '#^PHPUnit\\\\', |
21 | | - '#^Symfony\\\\Component\\\\Config#', |
22 | | - '#^Symfony\\\\Component\\\\DependencyInjection#', |
23 | 21 | ], |
24 | 22 | 'exclude-files' => [ |
25 | 23 | // do not prefix "trigger_deprecation" from symfony - https://github.com/symfony/symfony/commit/0032b2a2893d3be592d4312b7b098fb9d71aca03 |
26 | 24 | // these paths are relative to this file location, so it should be in the root directory |
27 | 25 | 'vendor/symfony/deprecation-contracts/function.php', |
28 | | - 'stubs/PHPUnit/PHPUnit_Framework_TestCase.php', |
29 | | - |
30 | | - // keep class references |
31 | | - 'src/Enum/SymfonyExtensionClass.php', |
32 | | - |
33 | | - // uses native PHPUnit TestCase class in the project |
34 | | - 'src/Testing/PHPUnitMocker.php', |
35 | | - 'src/Testing/MockWire.php', |
36 | | - ], |
37 | | - 'patchers' => [ |
38 | | - // unprefix test case class names |
39 | | - function (string $filePath, string $prefix, string $content): string { |
40 | | - if (! str_ends_with($filePath, 'packages/Testing/UnitTestFilter.php') |
41 | | - && |
42 | | - ! str_ends_with($filePath, 'src/Testing/MockWire.php') |
43 | | - ) { |
44 | | - return $content; |
45 | | - } |
46 | | - |
47 | | - $content = Strings::replace( |
48 | | - $content, |
49 | | - '#' . $prefix . '\\\\PHPUnit\\\\Framework\\\\TestCase#', |
50 | | - 'PHPUnit\Framework\TestCase' |
51 | | - ); |
52 | | - |
53 | | - return Strings::replace( |
54 | | - $content, |
55 | | - '#' . $prefix . '\\\\PHPUnit_Framework_TestCase#', |
56 | | - 'PHPUnit_Framework_TestCase' |
57 | | - ); |
58 | | - }, |
59 | | - |
60 | | - // unprefix kernerl test case class names |
61 | | - function (string $filePath, string $prefix, string $content): string { |
62 | | - if (! str_ends_with($filePath, 'packages/Testing/UnitTestFilter.php')) { |
63 | | - return $content; |
64 | | - } |
65 | | - |
66 | | - $content = Strings::replace( |
67 | | - $content, |
68 | | - '#' . $prefix . '\\\\Symfony\\\\Bundle\\\\FrameworkBundle\\\\Test\\\\KernelTestCase#', |
69 | | - 'Symfony\Bundle\FrameworkBundle\Test\KernelTestCase' |
70 | | - ); |
71 | | - |
72 | | - return Strings::replace( |
73 | | - $content, |
74 | | - '#' . $prefix . '\\\\Symfony\\\\Component\\\\Form\\\\Test\\\\TypeTestCase', |
75 | | - 'Symfony\Component\Form\Test\TypeTestCase' |
76 | | - ); |
77 | | - }, |
78 | 26 | ], |
79 | 27 | ]; |
0 commit comments