Merge branch '4.3' into 4.4

* 4.3:
  Adopt `@PHPUnit55Migration:risky` rule of php-cs-fixer
This commit is contained in:
Nicolas Grekas 2019-08-03 16:00:43 +02:00
commit 83f1dca60c
31 changed files with 99 additions and 104 deletions

View File

@ -8,8 +8,9 @@ return PhpCsFixer\Config::create()
->setRules([ ->setRules([
'@Symfony' => true, '@Symfony' => true,
'@Symfony:risky' => true, '@Symfony:risky' => true,
'@PHPUnit48Migration:risky' => true, '@PHPUnit75Migration:risky' => true,
'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice 'php_unit_dedicate_assert' => ['target' => '3.5'],
'phpdoc_no_empty_return' => false, // triggers almost always false positive
'array_syntax' => ['syntax' => 'short'], 'array_syntax' => ['syntax' => 'short'],
'fopen_flags' => false, 'fopen_flags' => false,
'ordered_imports' => true, 'ordered_imports' => true,

View File

@ -165,7 +165,7 @@ class ConsoleLoggerTest extends TestCase
if (method_exists($this, 'createPartialMock')) { if (method_exists($this, 'createPartialMock')) {
$dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']); $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']);
} else { } else {
$dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']); $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']);
} }
$dummy->method('__toString')->willReturn('DUMMY'); $dummy->method('__toString')->willReturn('DUMMY');

View File

@ -12,6 +12,7 @@
namespace Symfony\Component\Debug\Tests\Exception; namespace Symfony\Component\Debug\Tests\Exception;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException;
@ -35,6 +36,8 @@ use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
*/ */
class FlattenExceptionTest extends TestCase class FlattenExceptionTest extends TestCase
{ {
use ForwardCompatTestTrait;
public function testStatusCode() public function testStatusCode()
{ {
$flattened = FlattenException::create(new \RuntimeException(), 403); $flattened = FlattenException::create(new \RuntimeException(), 403);
@ -297,7 +300,7 @@ class FlattenExceptionTest extends TestCase
// assertEquals() does not like NAN values. // assertEquals() does not like NAN values.
$this->assertEquals($array[$i][0], 'float'); $this->assertEquals($array[$i][0], 'float');
$this->assertTrue(is_nan($array[$i++][1])); $this->assertNan($array[$i++][1]);
} }
public function testRecursionInArguments() public function testRecursionInArguments()

View File

@ -912,8 +912,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
* This methods allows for simple registration of service definition * This methods allows for simple registration of service definition
* with a fluid interface. * with a fluid interface.
* *
* @param string $id The service identifier * @param string $id The service identifier
* @param string $class|null The service class * @param string|null $class The service class
* *
* @return Definition A Definition instance * @return Definition A Definition instance
*/ */

View File

@ -571,7 +571,7 @@ class YamlFileLoader extends FileLoader
/** /**
* Parses a callable. * Parses a callable.
* *
* @param string|array $callable A callable reference * @param string|array $callable A callable reference
* *
* @throws InvalidArgumentException When errors occur * @throws InvalidArgumentException When errors occur
* *

View File

@ -55,15 +55,15 @@ class ContainerParametersResourceCheckerTest extends TestCase
public function isFreshProvider() public function isFreshProvider()
{ {
yield 'not fresh on missing parameter' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { yield 'not fresh on missing parameter' => [function (\PHPUnit\Framework\MockObject\MockObject $container) {
$container->method('hasParameter')->with('locales')->willReturn(false); $container->method('hasParameter')->with('locales')->willReturn(false);
}, false]; }, false];
yield 'not fresh on different value' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { yield 'not fresh on different value' => [function (\PHPUnit\Framework\MockObject\MockObject $container) {
$container->method('getParameter')->with('locales')->willReturn(['nl', 'es']); $container->method('getParameter')->with('locales')->willReturn(['nl', 'es']);
}, false]; }, false];
yield 'fresh on every identical parameters' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { yield 'fresh on every identical parameters' => [function (\PHPUnit\Framework\MockObject\MockObject $container) {
$container->expects($this->exactly(2))->method('hasParameter')->willReturn(true); $container->expects($this->exactly(2))->method('hasParameter')->willReturn(true);
$container->expects($this->exactly(2))->method('getParameter') $container->expects($this->exactly(2))->method('getParameter')
->withConsecutive( ->withConsecutive(

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\DependencyInjection\Tests;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;

View File

@ -29,7 +29,6 @@ use Symfony\Component\DependencyInjection\EnvVarProcessorInterface;
use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Exception\RuntimeException;
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\DependencyInjection\Parameter;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\DependencyInjection\ServiceLocator;

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -1,15 +1,15 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="<?= $this->charset ?>" /> <meta charset="<?= $this->charset; ?>" />
<meta name="robots" content="noindex,nofollow,noarchive" /> <meta name="robots" content="noindex,nofollow,noarchive" />
<title>An Error Occurred: <?= $statusText ?></title> <title>An Error Occurred: <?= $statusText; ?></title>
<style><?= $this->include('assets/css/error.css') ?></style> <style><?= $this->include('assets/css/error.css'); ?></style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<h1>Oops! An Error Occurred</h1> <h1>Oops! An Error Occurred</h1>
<h2>The server returned a "<?= $statusCode ?> <?= $statusText ?>".</h2> <h2>The server returned a "<?= $statusCode; ?> <?= $statusText; ?>".</h2>
<p> <p>
Something is broken. Please let us know what you were doing when this error occurred. Something is broken. Please let us know what you were doing when this error occurred.

View File

@ -1,25 +1,25 @@
<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : '' ?>"> <div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>">
<div class="exception-metadata"> <div class="exception-metadata">
<div class="container"> <div class="container">
<h2 class="exception-hierarchy"> <h2 class="exception-hierarchy">
<?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?> <?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?>
<a href="#trace-box-<?= $index + 2 ?>"><?= $this->abbrClass($previousException->getClass()) ?></a> <a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a>
<span class="icon"><?= $this->include('assets/images/chevron-right.svg') ?></span> <span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span>
<?php } ?> <?php } ?>
<a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()) ?></a> <a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a>
</h2> </h2>
<h2 class="exception-http"> <h2 class="exception-http">
HTTP <?= $statusCode ?> <small><?= $statusText ?></small> HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small>
</h2> </h2>
</div> </div>
</div> </div>
<div class="exception-message-wrapper"> <div class="exception-message-wrapper">
<div class="container"> <div class="container">
<h1 class="break-long-words exception-message<?= mb_strlen($exceptionMessage) > 180 ? ' long' : '' ?>"><?= $this->formatFileFromText(nl2br($exceptionMessage)) ?></h1> <h1 class="break-long-words exception-message<?= mb_strlen($exceptionMessage) > 180 ? ' long' : ''; ?>"><?= $this->formatFileFromText(nl2br($exceptionMessage)); ?></h1>
<div class="exception-illustration hidden-xs-down"> <div class="exception-illustration hidden-xs-down">
<?= $this->include('assets/images/symfony-ghost.svg.php') ?> <?= $this->include('assets/images/symfony-ghost.svg.php'); ?>
</div> </div>
</div> </div>
</div> </div>
@ -31,8 +31,8 @@
<?php <?php
$exceptionAsArray = $exception->toArray(); $exceptionAsArray = $exception->toArray();
$exceptionWithUserCode = []; $exceptionWithUserCode = [];
$exceptionAsArrayCount = \count($exceptionAsArray); $exceptionAsArrayCount = count($exceptionAsArray);
$last = \count($exceptionAsArray) - 1; $last = count($exceptionAsArray) - 1;
foreach ($exceptionAsArray as $i => $e) { foreach ($exceptionAsArray as $i => $e) {
foreach ($e['trace'] as $trace) { foreach ($e['trace'] as $trace) {
if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) { if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) {
@ -43,7 +43,7 @@
?> ?>
<h3 class="tab-title"> <h3 class="tab-title">
<?php if ($exceptionAsArrayCount > 1) { ?> <?php if ($exceptionAsArrayCount > 1) { ?>
Exceptions <span class="badge"><?= $exceptionAsArrayCount ?></span> Exceptions <span class="badge"><?= $exceptionAsArrayCount; ?></span>
<?php } else { ?> <?php } else { ?>
Exception Exception
<?php } ?> <?php } ?>
@ -55,7 +55,7 @@
echo $this->include('views/traces.html.php', [ echo $this->include('views/traces.html.php', [
'exception' => $e, 'exception' => $e,
'index' => $i + 1, 'index' => $i + 1,
'expand' => \in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i), 'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i),
]); ]);
} }
?> ?>
@ -63,15 +63,15 @@
</div> </div>
<?php if ($logger) { ?> <?php if ($logger) { ?>
<div class="tab <?= !$logger->getLogs() ? 'disabled' : '' ?>"> <div class="tab <?= !$logger->getLogs() ? 'disabled' : ''; ?>">
<h3 class="tab-title"> <h3 class="tab-title">
Logs Logs
<?php if ($logger->countErrors()) { ?><span class="badge status-error"><?= $logger->countErrors() ?></span><?php } ?> <?php if ($logger->countErrors()) { ?><span class="badge status-error"><?= $logger->countErrors(); ?></span><?php } ?>
</h3> </h3>
<div class="tab-content"> <div class="tab-content">
<?php if ($logger->getLogs()) { ?> <?php if ($logger->getLogs()) { ?>
<?= $this->include('views/logs.html.php', ['logs' => $logger->getLogs()]) ?> <?= $this->include('views/logs.html.php', ['logs' => $logger->getLogs()]); ?>
<?php } else { ?> <?php } else { ?>
<div class="empty"> <div class="empty">
<p>No log messages</p> <p>No log messages</p>
@ -84,7 +84,7 @@
<div class="tab"> <div class="tab">
<h3 class="tab-title"> <h3 class="tab-title">
<?php if ($exceptionAsArrayCount > 1) { ?> <?php if ($exceptionAsArrayCount > 1) { ?>
Stack Traces <span class="badge"><?= $exceptionAsArrayCount ?></span> Stack Traces <span class="badge"><?= $exceptionAsArrayCount; ?></span>
<?php } else { ?> <?php } else { ?>
Stack Trace Stack Trace
<?php } ?> <?php } ?>
@ -108,7 +108,7 @@
<h3 class="tab-title">Output content</h3> <h3 class="tab-title">Output content</h3>
<div class="tab-content"> <div class="tab-content">
<?= $currentContent ?> <?= $currentContent; ?>
</div> </div>
</div> </div>
<?php } ?> <?php } ?>

View File

@ -1,41 +1,41 @@
<!-- <?= $_message = sprintf('%s (%d %s)', $exceptionMessage, $statusCode, $statusText) ?> --> <!-- <?= $_message = sprintf('%s (%d %s)', $exceptionMessage, $statusCode, $statusText); ?> -->
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="<?= $this->charset ?>" /> <meta charset="<?= $this->charset; ?>" />
<meta name="robots" content="noindex,nofollow" /> <meta name="robots" content="noindex,nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" /> <meta name="viewport" content="width=device-width,initial-scale=1" />
<title><?= $_message ?></title> <title><?= $_message; ?></title>
<link rel="icon" type="image/png" href="<?= $this->include('assets/images/favicon.png.base64') ?>"> <link rel="icon" type="image/png" href="<?= $this->include('assets/images/favicon.png.base64'); ?>">
<style><?= $this->include('assets/css/exception.css') ?></style> <style><?= $this->include('assets/css/exception.css'); ?></style>
<style><?= $this->include('assets/css/exception_full.css') ?></style> <style><?= $this->include('assets/css/exception_full.css'); ?></style>
</head> </head>
<body> <body>
<header> <header>
<div class="container"> <div class="container">
<h1 class="logo"><?= $this->include('assets/images/symfony-logo.svg') ?> Symfony Exception</h1> <h1 class="logo"><?= $this->include('assets/images/symfony-logo.svg'); ?> Symfony Exception</h1>
<div class="help-link"> <div class="help-link">
<a href="https://symfony.com/doc/<?= Symfony\Component\HttpKernel\Kernel::VERSION ?>/index.html"> <a href="https://symfony.com/doc/<?= Symfony\Component\HttpKernel\Kernel::VERSION; ?>/index.html">
<span class="icon"><?= $this->include('assets/images/icon-book.svg') ?></span> <span class="icon"><?= $this->include('assets/images/icon-book.svg'); ?></span>
<span class="hidden-xs-down">Symfony</span> Docs <span class="hidden-xs-down">Symfony</span> Docs
</a> </a>
</div> </div>
<div class="help-link"> <div class="help-link">
<a href="https://symfony.com/support"> <a href="https://symfony.com/support">
<span class="icon"><?= $this->include('assets/images/icon-support.svg') ?></span> <span class="icon"><?= $this->include('assets/images/icon-support.svg'); ?></span>
<span class="hidden-xs-down">Symfony</span> Support <span class="hidden-xs-down">Symfony</span> Support
</a> </a>
</div> </div>
</div> </div>
</header> </header>
<?= $this->include('views/exception.html.php', $context) ?> <?= $this->include('views/exception.html.php', $context); ?>
<script> <script>
<?= $this->include('assets/js/exception.js') ?> <?= $this->include('assets/js/exception.js'); ?>
</script> </script>
</body> </body>
</html> </html>
<!-- <?= $_message ?> --> <!-- <?= $_message; ?> -->

View File

@ -1,5 +1,5 @@
<table class="logs" data-filter-level="Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug" data-filters> <table class="logs" data-filter-level="Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug" data-filters>
<?php $channelIsDefined = isset($logs[0]['channel']) ?> <?php $channelIsDefined = isset($logs[0]['channel']); ?>
<thead> <thead>
<tr> <tr>
<th data-filter="level">Level</th> <th data-filter="level">Level</th>
@ -19,20 +19,20 @@
$severity = $log['context']['exception']['severity'] ?? false; $severity = $log['context']['exception']['severity'] ?? false;
$status = E_DEPRECATED === $severity || E_USER_DEPRECATED === $severity ? 'warning' : 'normal'; $status = E_DEPRECATED === $severity || E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
} ?> } ?>
<tr class="status-<?= $status ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])) ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']) ?>"<?php } ?> <tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>
<td class="text-small" nowrap> <td class="text-small" nowrap>
<span class="colored text-bold"><?= $this->escape($log['priorityName']) ?></span> <span class="colored text-bold"><?= $this->escape($log['priorityName']); ?></span>
<span class="text-muted newline"><?= (new \DateTime($log['timestamp']))->format('H:i:s') ?></span> <span class="text-muted newline"><?= (new \DateTime($log['timestamp']))->format('H:i:s'); ?></span>
</td> </td>
<?php if ($channelIsDefined) { ?> <?php if ($channelIsDefined) { ?>
<td class="text-small text-bold nowrap"> <td class="text-small text-bold nowrap">
<?= $this->escape($log['channel']) ?> <?= $this->escape($log['channel']); ?>
</td> </td>
<?php } ?> <?php } ?>
<td> <td>
<?= $this->formatLogMessage($log['message'], $log['context']) ?> <?= $this->formatLogMessage($log['message'], $log['context']); ?>
<?php if ($log['context']) { ?> <?php if ($log['context']) { ?>
<pre class="text-muted prewrap m-t-5"><?= json_encode($log['context'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ?></pre> <pre class="text-muted prewrap m-t-5"><?= json_encode($log['context'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?></pre>
<?php } ?> <?php } ?>
</td> </td>
</tr> </tr>

View File

@ -1,11 +1,11 @@
<div class="trace-line-header break-long-words <?= $trace['file'] ? 'sf-toggle' : '' ?>" data-toggle-selector="#trace-html-<?= $prefix ?>-<?= $i ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : '' ?>"> <div class="trace-line-header break-long-words <?= $trace['file'] ? 'sf-toggle' : ''; ?>" data-toggle-selector="#trace-html-<?= $prefix; ?>-<?= $i; ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : ''; ?>">
<?php if ($trace['file']) { ?> <?php if ($trace['file']) { ?>
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg') ?></span> <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg'); ?></span>
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square.svg') ?></span> <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square.svg'); ?></span>
<?php } ?> <?php } ?>
<?php if ('compact' !== $style && $trace['function']) { ?> <?php if ('compact' !== $style && $trace['function']) { ?>
<span class="trace-class"><?= $this->abbrClass($trace['class']) ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type'] ?></span><?php } ?><span class="trace-method"><?= $trace['function'] ?></span><span class="trace-arguments">(<?= $this->formatArgs($trace['args']) ?>)</span> <span class="trace-class"><?= $this->abbrClass($trace['class']); ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type']; ?></span><?php } ?><span class="trace-method"><?= $trace['function']; ?></span><span class="trace-arguments">(<?= $this->formatArgs($trace['args']); ?>)</span>
<?php } ?> <?php } ?>
<?php if ($trace['file']) { ?> <?php if ($trace['file']) { ?>
@ -17,24 +17,24 @@
?> ?>
<span class="block trace-file-path"> <span class="block trace-file-path">
in in
<a href="<?= $fileLink ?>"> <a href="<?= $fileLink; ?>">
<?= implode(\DIRECTORY_SEPARATOR, array_slice($filePathParts, 0, -1)).\DIRECTORY_SEPARATOR ?><strong><?= end($filePathParts) ?></strong> <?= implode(\DIRECTORY_SEPARATOR, array_slice($filePathParts, 0, -1)).\DIRECTORY_SEPARATOR; ?><strong><?= end($filePathParts); ?></strong>
</a> </a>
<?php if ('compact' === $style && $trace['function']) { ?> <?php if ('compact' === $style && $trace['function']) { ?>
<span class="trace-type"><?= $trace['type'] ?></span> <span class="trace-type"><?= $trace['type']; ?></span>
<span class="trace-method"><?= $trace['function'] ?></span> <span class="trace-method"><?= $trace['function']; ?></span>
<?php } ?> <?php } ?>
(line <?= $lineNumber ?>) (line <?= $lineNumber; ?>)
</span> </span>
<?php } ?> <?php } ?>
</div> </div>
<?php if ($trace['file']) { ?> <?php if ($trace['file']) { ?>
<div id="trace-html-<?= $prefix.'-'.$i ?>" class="trace-code sf-toggle-content"> <div id="trace-html-<?= $prefix.'-'.$i; ?>" class="trace-code sf-toggle-content">
<?= strtr($this->fileExcerpt($trace['file'], $trace['line'], 5), [ <?= strtr($this->fileExcerpt($trace['file'], $trace['line'], 5), [
'#DD0000' => 'var(--highlight-string)', '#DD0000' => 'var(--highlight-string)',
'#007700' => 'var(--highlight-keyword)', '#007700' => 'var(--highlight-keyword)',
'#0000BB' => 'var(--highlight-default)', '#0000BB' => 'var(--highlight-default)',
'#FF8000' => 'var(--highlight-comment)', '#FF8000' => 'var(--highlight-comment)',
]) ?> ]); ?>
</div> </div>
<?php } ?> <?php } ?>

View File

@ -1,24 +1,24 @@
<div class="trace trace-as-html" id="trace-box-<?= $index ?>"> <div class="trace trace-as-html" id="trace-box-<?= $index; ?>">
<div class="trace-details"> <div class="trace-details">
<div class="trace-head"> <div class="trace-head">
<span class="sf-toggle" data-toggle-selector="#trace-html-<?= $index ?>" data-toggle-initial="<?= $expand ? 'display' : '' ?>"> <span class="sf-toggle" data-toggle-selector="#trace-html-<?= $index; ?>" data-toggle-initial="<?= $expand ? 'display' : ''; ?>">
<h3 class="trace-class"> <h3 class="trace-class">
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg') ?></span> <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg') ?></span> <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); ?></span>
<span class="trace-namespace"> <span class="trace-namespace">
<?= implode('\\', array_slice(explode('\\', $exception['class']), 0, -1)) ?><?= \count(explode('\\', $exception['class'])) > 1 ? '\\' : '' ?> <?= implode('\\', array_slice(explode('\\', $exception['class']), 0, -1)); ?><?= count(explode('\\', $exception['class'])) > 1 ? '\\' : ''; ?>
</span> </span>
<?= ($parts = explode('\\', $exception['class'])) ? end($parts) : '' ?> <?= ($parts = explode('\\', $exception['class'])) ? end($parts) : ''; ?>
</h3> </h3>
<?php if ($exception['message'] && $index > 1) { ?> <?php if ($exception['message'] && $index > 1) { ?>
<p class="break-long-words trace-message"><?= $this->escape($exception['message']) ?></p> <p class="break-long-words trace-message"><?= $this->escape($exception['message']); ?></p>
<?php } ?> <?php } ?>
</span> </span>
</div> </div>
<div id="trace-html-<?= $index ?>" class="sf-toggle-content"> <div id="trace-html-<?= $index; ?>" class="sf-toggle-content">
<?php <?php
$isFirstUserCode = true; $isFirstUserCode = true;
foreach ($exception['trace'] as $i => $trace) { foreach ($exception['trace'] as $i => $trace) {
@ -27,13 +27,13 @@
if ($displayCodeSnippet) { if ($displayCodeSnippet) {
$isFirstUserCode = false; $isFirstUserCode = false;
} ?> } ?>
<div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : '' ?>"> <div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>">
<?= $this->include('views/trace.html.php', [ <?= $this->include('views/trace.html.php', [
'prefix' => $index, 'prefix' => $index,
'i' => $i, 'i' => $i,
'trace' => $trace, 'trace' => $trace,
'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''), 'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''),
]) ?> ]); ?>
</div> </div>
<?php <?php
} ?> } ?>

View File

@ -1,20 +1,20 @@
<table class="trace trace-as-text"> <table class="trace trace-as-text">
<thead class="trace-head"> <thead class="trace-head">
<tr> <tr>
<th class="sf-toggle" data-toggle-selector="#trace-text-<?= $index ?>" data-toggle-initial="<?= 1 === $index ? 'display' : '' ?>"> <th class="sf-toggle" data-toggle-selector="#trace-text-<?= $index; ?>" data-toggle-initial="<?= 1 === $index ? 'display' : ''; ?>">
<h3 class="trace-class"> <h3 class="trace-class">
<?php if ($numExceptions > 1) { ?> <?php if ($numExceptions > 1) { ?>
<span class="text-muted">[<?= $numExceptions - $index + 1 ?>/<?= $numExceptions ?>]</span> <span class="text-muted">[<?= $numExceptions - $index + 1; ?>/<?= $numExceptions; ?>]</span>
<?php } ?> <?php } ?>
<?= ($parts = explode('\\', $exception['class'])) ? end($parts) : '' ?> <?= ($parts = explode('\\', $exception['class'])) ? end($parts) : ''; ?>
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg') ?></span> <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg') ?></span> <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); ?></span>
</h3> </h3>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody id="trace-text-<?= $index ?>"> <tbody id="trace-text-<?= $index; ?>">
<tr> <tr>
<td> <td>
<?php if ($exception['trace']) { ?> <?php if ($exception['trace']) { ?>
@ -31,7 +31,7 @@
echo 'at '.$trace['class'].$trace['type'].$trace['function'].'('.$this->formatArgsAsText($trace['args']).')'; echo 'at '.$trace['class'].$trace['type'].$trace['function'].'('.$this->formatArgsAsText($trace['args']).')';
} }
if ($trace['file'] && $trace['line']) { if ($trace['file'] && $trace['line']) {
echo ($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file'], $trace['line'])), [' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : ''); echo($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file'], $trace['line'])), [' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');
} }
} }
?> ?>

View File

@ -509,6 +509,7 @@ class NumberToLocalizedStringTransformerTest extends TestCase
/** /**
* @dataProvider nanRepresentationProvider * @dataProvider nanRepresentationProvider
*
* @see https://github.com/symfony/symfony/issues/3161 * @see https://github.com/symfony/symfony/issues/3161
*/ */
public function testReverseTransformDisallowsNaN($nan) public function testReverseTransformDisallowsNaN($nan)

View File

@ -28,7 +28,6 @@ class ButtonTypeTest extends BaseTypeTest
} }
/** /**
*
* @param string $emptyData * @param string $emptyData
* @param null $expectedData * @param null $expectedData
*/ */

View File

@ -20,11 +20,7 @@ class TranslationFilesTest extends TestCase
*/ */
public function testTranslationFileIsValid($filePath) public function testTranslationFileIsValid($filePath)
{ {
if (class_exists('PHPUnit_Util_XML')) { \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
} else {
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
}
$this->addToAssertionCount(1); $this->addToAssertionCount(1);
} }

View File

@ -142,7 +142,7 @@ class LoggerTest extends TestCase
if (method_exists($this, 'createPartialMock')) { if (method_exists($this, 'createPartialMock')) {
$dummy = $this->createPartialMock(DummyTest::class, ['__toString']); $dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
} else { } else {
$dummy = $this->getMock(DummyTest::class, ['__toString']); $dummy = $this->createPartialMock(DummyTest::class, ['__toString']);
} }
$dummy->expects($this->atLeastOnce()) $dummy->expects($this->atLeastOnce())
->method('__toString') ->method('__toString')

View File

@ -92,8 +92,8 @@ class TimezoneTransformer extends Transformer
* *
* @return string A timezone identifier * @return string A timezone identifier
* *
* @see http://php.net/manual/en/timezones.others.php * @see http://php.net/manual/en/timezones.others.php
* @see http://www.twinsun.com/tz/tz-link.htm * @see http://www.twinsun.com/tz/tz-link.htm
* *
* @throws NotImplementedException When the GMT time zone have minutes offset different than zero * @throws NotImplementedException When the GMT time zone have minutes offset different than zero
* @throws \InvalidArgumentException When the value can not be matched with pattern * @throws \InvalidArgumentException When the value can not be matched with pattern

View File

@ -11,7 +11,6 @@
namespace Symfony\Component\Lock\Tests\Store; namespace Symfony\Component\Lock\Tests\Store;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Lock\Exception\LockExpiredException; use Symfony\Component\Lock\Exception\LockExpiredException;
use Symfony\Component\Lock\Key; use Symfony\Component\Lock\Key;
use Symfony\Component\Lock\PersistingStoreInterface; use Symfony\Component\Lock\PersistingStoreInterface;

View File

@ -69,6 +69,7 @@ class PdoStoreTest extends AbstractStoreTest
public function testInvalidTtlConstruct() public function testInvalidTtlConstruct()
{ {
$this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException'); $this->expectException('Symfony\Component\Lock\Exception\InvalidTtlException');
return new PdoStore('sqlite:'.self::$dbFile, [], 0.1, 0.1); return new PdoStore('sqlite:'.self::$dbFile, [], 0.1, 0.1);
} }
} }

View File

@ -20,11 +20,7 @@ class TranslationFilesTest extends TestCase
*/ */
public function testTranslationFileIsValid($filePath) public function testTranslationFileIsValid($filePath)
{ {
if (class_exists('PHPUnit_Util_XML')) { \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
} else {
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
}
$this->addToAssertionCount(1); $this->addToAssertionCount(1);
} }

View File

@ -55,6 +55,7 @@ class GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest extends Greate
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\PositiveOrZero" constraint cannot be set.'); $this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\PositiveOrZero" constraint cannot be set.');
return new PositiveOrZero(['propertyPath' => 'field']); return new PositiveOrZero(['propertyPath' => 'field']);
} }
@ -62,6 +63,7 @@ class GreaterThanOrEqualValidatorWithPositiveOrZeroConstraintTest extends Greate
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\PositiveOrZero" constraint cannot be set.'); $this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\PositiveOrZero" constraint cannot be set.');
return new PositiveOrZero(['value' => 0]); return new PositiveOrZero(['value' => 0]);
} }

View File

@ -53,6 +53,7 @@ class GreaterThanValidatorWithPositiveConstraintTest extends GreaterThanValidato
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\Positive" constraint cannot be set.'); $this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\Positive" constraint cannot be set.');
return new Positive(['propertyPath' => 'field']); return new Positive(['propertyPath' => 'field']);
} }
@ -60,6 +61,7 @@ class GreaterThanValidatorWithPositiveConstraintTest extends GreaterThanValidato
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\Positive" constraint cannot be set.'); $this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\Positive" constraint cannot be set.');
return new Positive(['value' => 0]); return new Positive(['value' => 0]);
} }

View File

@ -53,6 +53,7 @@ class LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest extends LessThanO
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\NegativeOrZero" constraint cannot be set.'); $this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\NegativeOrZero" constraint cannot be set.');
return new NegativeOrZero(['propertyPath' => 'field']); return new NegativeOrZero(['propertyPath' => 'field']);
} }
@ -60,6 +61,7 @@ class LessThanOrEqualValidatorWithNegativeOrZeroConstraintTest extends LessThanO
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\NegativeOrZero" constraint cannot be set.'); $this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\NegativeOrZero" constraint cannot be set.');
return new NegativeOrZero(['value' => 0]); return new NegativeOrZero(['value' => 0]);
} }

View File

@ -53,6 +53,7 @@ class LessThanValidatorWithNegativeConstraintTest extends LessThanValidatorTest
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\Negative" constraint cannot be set.'); $this->expectExceptionMessage('The "propertyPath" option of the "Symfony\Component\Validator\Constraints\Negative" constraint cannot be set.');
return new Negative(['propertyPath' => 'field']); return new Negative(['propertyPath' => 'field']);
} }
@ -60,6 +61,7 @@ class LessThanValidatorWithNegativeConstraintTest extends LessThanValidatorTest
{ {
$this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException'); $this->expectException('Symfony\Component\Validator\Exception\ConstraintDefinitionException');
$this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\Negative" constraint cannot be set.'); $this->expectExceptionMessage('The "value" option of the "Symfony\Component\Validator\Constraints\Negative" constraint cannot be set.');
return new Negative(['value' => 0]); return new Negative(['value' => 0]);
} }

View File

@ -20,11 +20,7 @@ class TranslationFilesTest extends TestCase
*/ */
public function testTranslationFileIsValid($filePath) public function testTranslationFileIsValid($filePath)
{ {
if (class_exists('PHPUnit_Util_XML')) { \PHPUnit\Util\XML::loadfile($filePath, false, false, true);
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
} else {
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
}
$this->addToAssertionCount(1); $this->addToAssertionCount(1);
} }

View File

@ -656,7 +656,6 @@ class InlineTest extends TestCase
} }
/** /**
*
* @dataProvider getNotPhpCompatibleMappingKeyData * @dataProvider getNotPhpCompatibleMappingKeyData
*/ */
public function testImplicitStringCastingOfMappingKeysIsDeprecated($yaml, $expected) public function testImplicitStringCastingOfMappingKeysIsDeprecated($yaml, $expected)

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Yaml\Tests;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait;
use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Parser;
use Symfony\Component\Yaml\Tag\TaggedValue; use Symfony\Component\Yaml\Tag\TaggedValue;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
@ -786,7 +785,6 @@ EOF
} }
/** /**
*
* > It is an error for two equal keys to appear in the same mapping node. * > It is an error for two equal keys to appear in the same mapping node.
* > In such a case the YAML processor may continue, ignoring the second * > In such a case the YAML processor may continue, ignoring the second
* > "key: value" pair and issuing an appropriate warning. This strategy * > "key: value" pair and issuing an appropriate warning. This strategy