Skip to content
Open
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
894 changes: 894 additions & 0 deletions specs/misc/composer.php

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions specs/string-literal/expr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

declare(strict_types=1);

/*
* This file is part of the humbug/php-scoper package.
*
* Copyright (c) 2017 Théo FIDRY <[email protected]>,
* Pádraic Brady <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

use Humbug\PhpScoper\SpecFramework\Config\Meta;

return [
'meta' => new Meta(
title: 'Scalar literal used in an expression',
),

'String value used in a comparison expression' => <<<'PHP'
<?php
namespace Composer\Package\Loader;
if ($class !== 'Composer\Package\CompletePackage' && $class !== 'Composer\Package\RootPackage') {
trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', E_USER_DEPRECATED);
}
----
<?php
namespace Humbug\Composer\Package\Loader;
if ($class !== 'Humbug\Composer\Package\CompletePackage' && $class !== 'Humbug\Composer\Package\RootPackage') {
trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', \E_USER_DEPRECATED);
}

PHP,

'Non valid class name string value used in a comparison expression' => <<<'PHP'
<?php
namespace Composer\Package\Loader;
if ($class !== '1Composer\Package\CompletePackage' && $class !== '0Composer\Package\RootPackage') {
trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', E_USER_DEPRECATED);
}
----
<?php
namespace Humbug\Composer\Package\Loader;
if ($class !== '1Composer\Package\CompletePackage' && $class !== '0Composer\Package\RootPackage') {
trigger_error('The $class arg is deprecated, please reach out to Composer maintainers ASAP if you still need this.', \E_USER_DEPRECATED);
}

PHP,
];
2 changes: 0 additions & 2 deletions src/Configuration/ConfigurationFactory.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@

namespace Humbug\PhpScoper\Configuration;

use Humbug\PhpScoper\Patcher\ComposerPatcher;
use Humbug\PhpScoper\Patcher\Patcher;
use Humbug\PhpScoper\Patcher\PatcherChain;
use Humbug\PhpScoper\Patcher\SymfonyParentTraitPatcher;
@@ -89,7 +88,6 @@ public function create(?string $path = null, array $paths = []): Configuration

array_unshift($patchers, new SymfonyPatcher());
array_unshift($patchers, new SymfonyParentTraitPatcher());
array_unshift($patchers, new ComposerPatcher());

$symbolsConfiguration = $this->symbolsConfigurationFactory->createSymbolsConfiguration($config);

66 changes: 0 additions & 66 deletions src/Patcher/ComposerPatcher.php

This file was deleted.

2 changes: 2 additions & 0 deletions src/PhpParser/NodeVisitor/StringScalarPrefixer.php
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@
use PhpParser\Node\Arg;
use PhpParser\Node\ArrayItem;
use PhpParser\Node\Const_;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\FuncCall;
@@ -174,6 +175,7 @@ private function prefixStringScalar(String_ $string): String_
$parentNode instanceof Assign
|| $parentNode instanceof Param
|| $parentNode instanceof Const_
|| $parentNode instanceof Expr
|| $parentNode instanceof PropertyProperty
|| $parentNode instanceof Return_
)) {
3 changes: 0 additions & 3 deletions tests/Configuration/ConfigurationFactoryTest.php
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@
use Fidry\FileSystem\FS;
use Humbug\PhpScoper\Container;
use Humbug\PhpScoper\FileSystemTestCase;
use Humbug\PhpScoper\Patcher\ComposerPatcher;
use Humbug\PhpScoper\Patcher\PatcherChain;
use Humbug\PhpScoper\Patcher\SymfonyParentTraitPatcher;
use Humbug\PhpScoper\Patcher\SymfonyPatcher;
@@ -60,7 +59,6 @@ public function test_it_can_be_created_without_a_file(): void
self::assertSame([], $configuration->getFilesWithContents());
self::assertEquals(
new PatcherChain([
new ComposerPatcher(),
new SymfonyParentTraitPatcher(),
new SymfonyPatcher(),
]),
@@ -141,7 +139,6 @@ public function test_it_can_create_a_complete_configuration(): void
);
self::assertEquals(
new PatcherChain([
new ComposerPatcher(),
new SymfonyParentTraitPatcher(),
new SymfonyPatcher(),
]),
358 changes: 0 additions & 358 deletions tests/Patcher/ComposerPatcherTest.php

This file was deleted.