Skip to content

[PhpUnitBridge] bump "php" to 7.1+ and "phpunit" to 7.5+ #39419

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

Merged
merged 1 commit into from
Dec 13, 2020
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Symfony/Bridge/PhpUnit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

5.3.0
-----

* bumped the minimum PHP version to 7.1.3
* bumped the minimum PHPUnit version to 7.5

5.1.0
-----

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/ClassExistsMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static function trait_exists($name, $autoload = true)

public static function register($class)
{
$self = \get_called_class();
$self = static::class;

$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
if (0 < strpos($class, '\\Tests\\')) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/ClockMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static function gmdate($format, $timestamp = null)

public static function register($class)
{
$self = \get_called_class();
$self = static::class;

$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
if (0 < strpos($class, '\\Tests\\')) {
Expand Down
7 changes: 1 addition & 6 deletions src/Symfony/Bridge/PhpUnit/ConstraintTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,7 @@
use ReflectionClass;

$r = new ReflectionClass(Constraint::class);
if (\PHP_VERSION_ID < 70000 || !$r->getMethod('matches')->hasReturnType()) {
trait ConstraintTrait
{
use Legacy\ConstraintTraitForV6;
}
} elseif ($r->getProperty('exporter')->isProtected()) {
if ($r->getProperty('exporter')->isProtected()) {
trait ConstraintTrait
{
use Legacy\ConstraintTraitForV7;
Expand Down
8 changes: 1 addition & 7 deletions src/Symfony/Bridge/PhpUnit/CoverageListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@

namespace Symfony\Bridge\PhpUnit;

if (version_compare(\PHPUnit\Runner\Version::id(), '6.0.0', '<')) {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV5', 'Symfony\Bridge\PhpUnit\CoverageListener');
} elseif (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0', '<')) {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV6', 'Symfony\Bridge\PhpUnit\CoverageListener');
} else {
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener');
}
class_alias('Symfony\Bridge\PhpUnit\Legacy\CoverageListenerForV7', 'Symfony\Bridge\PhpUnit\CoverageListener');

if (false) {
class CoverageListener
Expand Down
14 changes: 4 additions & 10 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
*/
class DeprecationErrorHandler
{
const MODE_DISABLED = 'disabled';
const MODE_WEAK = 'max[total]=999999&verbose=0';
const MODE_STRICT = 'max[total]=0';
public const MODE_DISABLED = 'disabled';
public const MODE_WEAK = 'max[total]=999999&verbose=0';
public const MODE_STRICT = 'max[total]=0';

private $mode;
private $configuration;
Expand Down Expand Up @@ -238,13 +238,7 @@ private function getConfiguration()
return $this->configuration;
}
if (false === $mode = $this->mode) {
if (isset($_SERVER['SYMFONY_DEPRECATIONS_HELPER'])) {
$mode = $_SERVER['SYMFONY_DEPRECATIONS_HELPER'];
} elseif (isset($_ENV['SYMFONY_DEPRECATIONS_HELPER'])) {
$mode = $_ENV['SYMFONY_DEPRECATIONS_HELPER'];
} else {
$mode = getenv('SYMFONY_DEPRECATIONS_HELPER');
}
$mode = $_SERVER['SYMFONY_DEPRECATIONS_HELPER'] ?? $_ENV['SYMFONY_DEPRECATIONS_HELPER'] ?? getenv('SYMFONY_DEPRECATIONS_HELPER');
}
if ('strict' === $mode) {
return $this->configuration = Configuration::inStrictMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ public static function fromUrlEncodedString($serializedConfiguration)
}

return new self(
isset($normalizedConfiguration['max']) ? $normalizedConfiguration['max'] : [],
$normalizedConfiguration['max'] ?? [],
'',
$verboseOutput,
filter_var($normalizedConfiguration['generateBaseline'], \FILTER_VALIDATE_BOOLEAN),
Expand Down
26 changes: 13 additions & 13 deletions src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler/Deprecation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
*/
class Deprecation
{
const PATH_TYPE_VENDOR = 'path_type_vendor';
const PATH_TYPE_SELF = 'path_type_internal';
const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';
public const PATH_TYPE_VENDOR = 'path_type_vendor';
public const PATH_TYPE_SELF = 'path_type_internal';
public const PATH_TYPE_UNDETERMINED = 'path_type_undetermined';

const TYPE_SELF = 'type_self';
const TYPE_DIRECT = 'type_direct';
const TYPE_INDIRECT = 'type_indirect';
const TYPE_UNDETERMINED = 'type_undetermined';
public const TYPE_SELF = 'type_self';
public const TYPE_DIRECT = 'type_direct';
public const TYPE_INDIRECT = 'type_indirect';
public const TYPE_UNDETERMINED = 'type_undetermined';

private $trace = [];
private $message;
Expand Down Expand Up @@ -61,10 +61,10 @@ public function __construct($message, array $trace, $file)

$this->trace = $trace;

if ('trigger_error' === (isset($trace[1]['function']) ? $trace[1]['function'] : null)
&& (DebugClassLoader::class === ($class = (isset($trace[2]['class']) ? $trace[2]['class'] : null)) || LegacyDebugClassLoader::class === $class)
&& 'checkClass' === (isset($trace[2]['function']) ? $trace[2]['function'] : null)
&& null !== ($extraFile = (isset($trace[2]['args'][1]) ? $trace[2]['args'][1] : null))
if ('trigger_error' === ($trace[1]['function'] ?? null)
&& (DebugClassLoader::class === ($class = $trace[2]['class'] ?? null) || LegacyDebugClassLoader::class === $class)
&& 'checkClass' === ($trace[2]['function'] ?? null)
&& null !== ($extraFile = $trace[2]['args'][1] ?? null)
&& '' !== $extraFile
&& false !== $extraFile = realpath($extraFile)
) {
Expand Down Expand Up @@ -118,7 +118,7 @@ private function lineShouldBeSkipped(array $line)
}
$class = $line['class'];

return 'ReflectionMethod' === $class || 0 === strpos($class, 'PHPUnit_') || 0 === strpos($class, 'PHPUnit\\');
return 'ReflectionMethod' === $class || 0 === strpos($class, 'PHPUnit\\');
}

/**
Expand Down Expand Up @@ -290,7 +290,7 @@ private static function getVendors()
foreach (get_declared_classes() as $class) {
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
$r = new \ReflectionClass($class);
$v = \dirname(\dirname($r->getFileName()));
$v = \dirname($r->getFileName(), 2);
if (file_exists($v.'/composer/installed.json')) {
self::$vendors[] = $v;
$loader = require $v.'/autoload.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ public function addNotice()
*/
private function deprecationNotice($message)
{
if (!isset($this->deprecationNotices[$message])) {
$this->deprecationNotices[$message] = new DeprecationNotice();
}

return $this->deprecationNotices[$message];
return $this->deprecationNotices[$message] ?? $this->deprecationNotices[$message] = new DeprecationNotice();
}

public function count()
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Bridge/PhpUnit/DnsMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function dns_get_record($hostname, $type = \DNS_ANY, &$authns = nu
$records = [];

foreach (self::$hosts[$hostname] as $record) {
if (isset(self::$dnsTypes[$record['type']]) && (self::$dnsTypes[$record['type']] & $type)) {
if ((self::$dnsTypes[$record['type']] ?? 0) & $type) {
$records[] = array_merge(['host' => $hostname, 'class' => 'IN', 'ttl' => 1, 'type' => $record['type']], $record);
}
}
Expand All @@ -163,7 +163,7 @@ public static function dns_get_record($hostname, $type = \DNS_ANY, &$authns = nu

public static function register($class)
{
$self = \get_called_class();
$self = static::class;

$mockedNs = [substr($class, 0, strrpos($class, '\\'))];
if (0 < strpos($class, '\\Tests\\')) {
Expand Down
57 changes: 0 additions & 57 deletions src/Symfony/Bridge/PhpUnit/Legacy/CommandForV5.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
*
* @internal
*/
class CommandForV6 extends BaseCommand
class CommandForV7 extends BaseCommand
{
/**
* {@inheritdoc}
*/
protected function createRunner(): BaseRunner
{
$this->arguments['listeners'] = isset($this->arguments['listeners']) ? $this->arguments['listeners'] : [];
$this->arguments['listeners'] ?? $this->arguments['listeners'] = [];

$registeredLocally = false;

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/PhpUnit/Legacy/CommandForV9.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CommandForV9 extends BaseCommand
*/
protected function createRunner(): BaseRunner
{
$this->arguments['listeners'] = isset($this->arguments['listeners']) ? $this->arguments['listeners'] : [];
$this->arguments['listeners'] ?? $this->arguments['listeners'] = [];

$registeredLocally = false;

Expand Down
130 changes: 0 additions & 130 deletions src/Symfony/Bridge/PhpUnit/Legacy/ConstraintTraitForV6.php

This file was deleted.

Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy