forked from humbug/php-scoper
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Scope string literals used in expressions
Closes humbug#557.
- Loading branch information
Showing
7 changed files
with
957 additions
and
429 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.