Skip to content

Commit 9433165

Browse files
authored
Merge pull request #3 from 123inkt/PHP7.4-compatability-without-polyfill
Add PHP7.4 compatability without symfony8.0 polyfill
2 parents 9d5cd18 + d2e0a71 commit 9433165

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"require": {
1515
"php": ">=7.4",
1616
"composer-plugin-api": "^1.0 || ^2.0",
17-
"squizlabs/php_codesniffer": "^3.6",
18-
"symfony/polyfill-php80": "^1.15"
17+
"squizlabs/php_codesniffer": "^3.6"
1918
},
2019
"require-dev": {
2120
"composer/composer": "^2.0",

src/Plugin/BaselineHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static function getInstance(Config $config): self
2929
if (self::$instance === null) {
3030
$baseline = null;
3131
// only read baseline if phpcs is not writing one.
32-
if ($config->reportFile === null || str_contains($config->reportFile, 'phpcs.baseline.xml') === false) {
32+
if ($config->reportFile === null || strpos($config->reportFile, 'phpcs.baseline.xml') === false) {
3333
$baseline = BaselineSetFactory::fromFile(DirectoryUtil::getProjectRoot() . 'phpcs.baseline.xml');
3434
}
3535

src/Plugin/Plugin.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ public function onPostInstall(): void
7575
// @codeCoverageIgnoreEnd
7676
$this->stream->info('php-codesniffer-baseline: read: ' . $this->codeSnifferFilePath);
7777

78-
if (str_contains($source, BaselineHandler::class)) {
78+
if (strpos($source, BaselineHandler::class) !== false) {
7979
$this->stream->info('php-codesniffer-baseline: ignored. src/Files/File.php is already modified');
8080

8181
return;
8282
}
8383

8484
$search = '$messageCount++;';
85-
if (str_contains($source, $search) === false) {
85+
if (strpos($source, $search) === false) {
8686
$this->stream->error('php-codesniffer-baseline: unable to find `' . $search . '` in `squizlabs/php_codesniffer/src/Files/File.php`');
8787

8888
return;

0 commit comments

Comments
 (0)