Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: drop support of very old deps #5524

Merged
merged 1 commit into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 19 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,38 @@
}
],
"require": {
"php": "^7.1 || ^8.0",
"php": "^7.1.3 || ^8.0",
"ext-json": "*",
"ext-tokenizer": "*",
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^1.2",
"doctrine/annotations": "^1.2",
"composer/semver": "^3.2",
"composer/xdebug-handler": "^1.4",
"doctrine/annotations": "^1.12",
"php-cs-fixer/diff": "^2.0",
"symfony/console": "^3.4.43 || ^4.4.11 || ^5.1.3",
"symfony/event-dispatcher": "^3.0 || ^4.0 || ^5.0",
"symfony/filesystem": "^3.0 || ^4.0 || ^5.0",
"symfony/finder": "^3.0 || ^4.0 || ^5.0",
"symfony/options-resolver": "^3.0 || ^4.0 || ^5.0",
"symfony/polyfill-php70": "^1.0",
"symfony/polyfill-php72": "^1.4",
"symfony/process": "^3.0 || ^4.0 || ^5.0",
"symfony/stopwatch": "^3.0 || ^4.0 || ^5.0"
"symfony/console": "^4.4.20 || ^5.1.3",
"symfony/event-dispatcher": "^4.4.20 || ^5.0",
"symfony/filesystem": "^4.4.20 || ^5.0",
"symfony/finder": "^4.4.20 || ^5.0",
"symfony/options-resolver": "^4.4.20 || ^5.0",
"symfony/polyfill-php72": "^1.22",
"symfony/process": "^4.4.20 || ^5.0",
"symfony/stopwatch": "^4.4.20 || ^5.0"
},
"require-dev": {
"justinrainbow/json-schema": "^5.0",
"justinrainbow/json-schema": "^5.2",
"keradus/cli-executor": "^1.4",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.4.2",
"php-cs-fixer/accessible-object": "^1.0",
"mikey179/vfsstream": "^1.6.8",
"php-coveralls/php-coveralls": "^2.4.3",
"php-cs-fixer/accessible-object": "^1.1",
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2",
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1",
"phpspec/prophecy": "^1.10.3",
"phpspec/prophecy-phpunit": "^1.1 || ^2.0",
"phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5",
"phpunitgoodpractices/polyfill": "^1.5",
"phpunitgoodpractices/traits": "^1.9.1",
"sanmai/phpunit-legacy-adapter": "^6.4 || ^8.2.1",
"symfony/phpunit-bridge": "^5.2.3",
"symfony/yaml": "^3.0 || ^4.0 || ^5.0"
"symfony/phpunit-bridge": "^5.2.4",
"symfony/yaml": "^4.4.20 || ^5.0"
},
"suggest": {
"ext-dom": "For handling output formats in XML",
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

# ensure that deps will work on lowest supported PHP version
composer config platform.php 2> /dev/null || composer config platform.php 7.1.0
composer config platform.php 2> /dev/null || composer config platform.php 7.1.3

# require suggested packages
composer require --no-update symfony/polyfill-mbstring
Expand Down
4 changes: 2 additions & 2 deletions php-cs-fixer
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ if (defined('HHVM_VERSION_ID')) {
} elseif (
!defined('PHP_VERSION_ID')
|| \PHP_VERSION_ID === 80000
|| \PHP_VERSION_ID < 70100
|| \PHP_VERSION_ID < 70103
|| \PHP_VERSION_ID >= 80100
) {
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.1.0 and maximum version of PHP 8.0.*.\n");
fwrite(STDERR, "PHP needs to be a minimum version of PHP 7.1.3 and maximum version of PHP 8.0.*.\n");
fwrite(STDERR, 'Current PHP version: '.PHP_VERSION.".\n");

if (defined('PHP_VERSION_ID') && \PHP_VERSION_ID === 80000) {
Expand Down
4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ parameters:
excludes_analyse:
- tests/Fixtures
ignoreErrors:
- '/^Class (Symfony\\Contracts\\EventDispatcher\\Event|Symfony\\Component\\EventDispatcher\\Event) not found.$/'
- '/^Constant T_NAME_(RELATIVE|FULLY_QUALIFIED|QUALIFIED) not found\.$/'
- '/assertInstanceOf\(\) expects class-string.*, string given/'
-
message: '/^Else branch is unreachable because previous condition is always true\.$/'
path: src/Event/Event.php
-
message: '/^Strict comparison using !== between ''@git-commit@'' and ''@git-commit@'' will always evaluate to false\.$/'
path: src/Console/Application.php
Expand Down
31 changes: 0 additions & 31 deletions src/Event/Event.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/FixerFileProcessedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace PhpCsFixer;

use PhpCsFixer\Event\Event;
use Symfony\Contracts\EventDispatcher\Event;

/**
* Event that is fired when file was processed by Fixer.
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/FileFilterIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
namespace PhpCsFixer\Runner;

use PhpCsFixer\Cache\CacheManagerInterface;
use PhpCsFixer\Event\Event;
use PhpCsFixer\FileReader;
use PhpCsFixer\FixerFileProcessedEvent;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
Expand Down
2 changes: 1 addition & 1 deletion src/Runner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
use PhpCsFixer\Differ\DifferInterface;
use PhpCsFixer\Error\Error;
use PhpCsFixer\Error\ErrorsManager;
use PhpCsFixer\Event\Event;
use PhpCsFixer\FileReader;
use PhpCsFixer\Fixer\FixerInterface;
use PhpCsFixer\FixerFileProcessedEvent;
Expand All @@ -29,6 +28,7 @@
use PhpCsFixer\Tokenizer\Tokens;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Contracts\EventDispatcher\Event;

/**
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
Expand Down
18 changes: 3 additions & 15 deletions tests/AutoReview/ProjectCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace PhpCsFixer\Tests\AutoReview;

use PhpCsFixer\DocBlock\DocBlock;
use PhpCsFixer\Event\Event;
use PhpCsFixer\FixerFactory;
use PhpCsFixer\Preg;
use PhpCsFixer\Tests\TestCase;
Expand Down Expand Up @@ -107,18 +106,12 @@ function (\ReflectionClass $interface) {
'setWhitespacesConfig', // due to AbstractFixer::setWhitespacesConfig
];

// @TODO: 3.0 should be removed
$exceptionMethodsPerClass = [
\PhpCsFixer\Event\Event::class => ['stopPropagation'],
];

$definedMethods = $this->getPublicMethodNames($rc);

$extraMethods = array_diff(
$definedMethods,
$allowedMethods,
$exceptionMethods,
isset($exceptionMethodsPerClass[$className]) ? $exceptionMethodsPerClass[$className] : []
$exceptionMethods
);

sort($extraMethods);
Expand Down Expand Up @@ -472,7 +465,6 @@ public function testAllCodeContainSingleClassy($className)
$rc = new \ReflectionClass($className);
$file = $rc->getFileName();
$tokens = Tokens::fromCode(file_get_contents($file));
$isEvent = Event::class === $rc->getName(); // remove this exception when no longer needed
$classyIndex = null;

static::assertTrue($tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds()), sprintf('File "%s" should contains a classy.', $file));
Expand All @@ -484,7 +476,7 @@ public function testAllCodeContainSingleClassy($className)
break;
}

if (!$token->isGivenKind($headerTypes) && !$token->equalsAny([';', '=', '(', ')']) && !$isEvent) {
if (!$token->isGivenKind($headerTypes) && !$token->equalsAny([';', '=', '(', ')'])) {
static::fail(sprintf('File "%s" should only contains single classy, found "%s" @ %d.', $file, $token->toJson(), $index));
}
}
Expand All @@ -499,11 +491,7 @@ public function testAllCodeContainSingleClassy($className)

$classyEndIndex = $tokens->findBlockEnd(Tokens::BLOCK_TYPE_CURLY_BRACE, $nextTokenOfKind);

if ($isEvent) {
static::assertNotNull($tokens->getNextNonWhitespace($classyEndIndex), sprintf('File "%s" should not only contains a single classy.', $file));
} else {
static::assertNull($tokens->getNextNonWhitespace($classyEndIndex), sprintf('File "%s" should only contains a single classy.', $file));
}
static::assertNull($tokens->getNextNonWhitespace($classyEndIndex), sprintf('File "%s" should only contains a single classy.', $file));
}

public function provideSrcClassCases()
Expand Down
33 changes: 0 additions & 33 deletions tests/Event/EventTest.php

This file was deleted.