[PhpUnitBridge] fix internal annotation

This commit is contained in:
Nicolas Grekas 2019-08-04 08:59:43 +02:00
parent 37265de54d
commit f19b0abe0d
3 changed files with 2 additions and 8 deletions

View File

@ -17,7 +17,7 @@ use PHPUnit\Framework\Constraint\StringContains;
use PHPUnit\Framework\Constraint\TraversableContains; use PHPUnit\Framework\Constraint\TraversableContains;
/** /**
* @internal * This trait is @internal
*/ */
trait PolyfillAssertTrait trait PolyfillAssertTrait
{ {

View File

@ -15,7 +15,7 @@ use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
/** /**
* @internal * This trait is @internal
*/ */
trait PolyfillTestCaseTrait trait PolyfillTestCaseTrait
{ {

View File

@ -156,12 +156,6 @@ if (!file_exists("$PHPUNIT_DIR/$PHPUNIT_VERSION_DIR/phpunit") || $configurationH
$alteredCode = preg_replace('/abstract class (?:Assert|PHPUnit_Framework_Assert)[^\{]+\{/', '$0 '.PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillAssertTrait;", $alteredCode, 1); $alteredCode = preg_replace('/abstract class (?:Assert|PHPUnit_Framework_Assert)[^\{]+\{/', '$0 '.PHP_EOL." use \Symfony\Bridge\PhpUnit\Legacy\PolyfillAssertTrait;", $alteredCode, 1);
file_put_contents($alteredFile, $alteredCode); file_put_contents($alteredFile, $alteredCode);
// remove internal annotation from polyfill
foreach (array('PolyfillTestCaseTrait', 'PolyfillAssertTrait') as $polyfill) {
$traitFile = "./vendor/symfony/phpunit-bridge/Legacy/$polyfill.php";
file_put_contents($traitFile, str_replace(' * @internal', '', file_get_contents($traitFile)));
}
file_put_contents('phpunit', <<<'EOPHP' file_put_contents('phpunit', <<<'EOPHP'
<?php <?php