Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 111bdc5

Browse filesBrowse files
Merge branch '2.8'
* 2.8: Added the right revision date for status code registry [Config] Fix enum default value in Yaml dumper fixed typo. [Translation][File dumper] allow get file content without writing in file. Finnish translation fix [CssSelector] Optimize regexs matching simple selectors Fix the phpdoc in the CssSelector TranslatorInterface [Console] Add clock mock to fix transient test on HHVM [DomCrawler] Optimize the regex used to find namespace prefixes [VarDumper] Add EnumStub for dumping virtual collections with casters [Finder] Deprecate adapters and related classes [EventDispatcher] skip one lazy loading call [EventDispatcher] fix memory leak in a getListeners [WebProfilerBundle] added btn-link. Remove duplication of the handling of regex filters in the Finder Default to stderr for console helpers (only merge if #15794 gets merged) Conflicts: src/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php src/Symfony/Component/EventDispatcher/EventDispatcher.php src/Symfony/Component/VarDumper/Tests/CliDumperTest.php src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php
2 parents 5ae3499 + b75755c commit 111bdc5
Copy full SHA for 111bdc5

File tree

84 files changed

+606
-342
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

84 files changed

+606
-342
lines changed

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
{% endif %}
163163

164164
{% if stack %}
165-
<a class="text-small sf-toggle" data-toggle-selector="#{{ id }}" data-toggle-alt-content="Hide stack trace">Show strack trace</a>
165+
<button class="btn-link text-small sf-toggle" data-toggle-selector="#{{ id }}" data-toggle-alt-content="Hide stack trace">Show strack trace</button>
166166
{% endif %}
167167

168168
{% for index, call in stack if index > 1 %}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@
179179
{% endif %}
180180

181181
{% if message.parameters|length > 0 %}
182-
<a class="newline text-small sf-toggle" data-toggle-selector="#parameters-{{ loop.index }}" data-toggle-alt-content="Hide parameters">Show parameters</a>
182+
<button class="btn-link newline text-small sf-toggle" data-toggle-selector="#parameters-{{ loop.index }}" data-toggle-alt-content="Hide parameters">Show parameters</button>
183183

184184
<div id="parameters-{{ loop.index }}" class="hidden">
185185
{% for parameters in message.parameters %}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@
387387
}
388388
389389
Sfjs.addEventListener(toggles[i], 'click', function(e) {
390+
e.preventDefault();
391+
390392
var toggle = e.target || e.srcElement;
391393
var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
392394
@@ -406,8 +408,6 @@
406408
var originalContent = toggle.getAttribute('data-toggle-original-content');
407409
var altContent = toggle.getAttribute('data-toggle-alt-content');
408410
toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
409-
410-
e.preventDefault();
411411
});
412412
}
413413
}

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig
+12-1Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,18 @@ button {
115115
height: 16px;
116116
vertical-align: middle;
117117
}
118-
118+
.btn-link {
119+
border-color: transparent;
120+
color: #218BC3;
121+
text-decoration: none;
122+
background-color: transparent;
123+
outline: none;
124+
border: 0;
125+
padding: 0;
126+
}
127+
.btn-link:hover {
128+
text-decoration: underline;
129+
}
119130
{# Tables
120131
------------------------------------------------------------------------- #}
121132
table, tr, th, td {

‎src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/Dumper/YamlReferenceDumper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private function writeNode(NodeInterface $node, $depth = 0)
9393
}
9494
} elseif ($node instanceof EnumNode) {
9595
$comments[] = 'One of '.implode('; ', array_map('json_encode', $node->getValues()));
96-
$default = '~';
96+
$default = $node->hasDefaultValue() ? Inline::dump($node->getDefaultValue()) : '~';
9797
} else {
9898
$default = '~';
9999

‎src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private function getConfigurationAsString()
3737
return str_replace("\n", PHP_EOL, <<<EOL
3838
<!-- Namespace: http://example.org/schema/dic/acme_root -->
3939
<!-- scalar-required: Required -->
40+
<!-- enum-with-default: One of "this"; "that" -->
4041
<!-- enum: One of "this"; "that" -->
4142
<config
4243
boolean="true"
@@ -48,6 +49,7 @@ private function getConfigurationAsString()
4849
scalar-array-empty=""
4950
scalar-array-defaults="elem1,elem2"
5051
scalar-required=""
52+
enum-with-default="this"
5153
enum=""
5254
>
5355

‎src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Definition/Dumper/YamlReferenceDumperTest.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ private function getConfigurationAsString()
4343
- elem1
4444
- elem2
4545
scalar_required: ~ # Required
46+
enum_with_default: this # One of "this"; "that"
4647
enum: ~ # One of "this"; "that"
4748
4849
# some info

‎src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public function getConfigTreeBuilder()
3434
->scalarNode('scalar_array_empty')->defaultValue(array())->end()
3535
->scalarNode('scalar_array_defaults')->defaultValue(array('elem1', 'elem2'))->end()
3636
->scalarNode('scalar_required')->isRequired()->end()
37+
->enumNode('enum_with_default')->values(array('this', 'that'))->defaultValue('this')->end()
3738
->enumNode('enum')->values(array('this', 'that'))->end()
3839
->arrayNode('array')
3940
->info('some info')

‎src/Symfony/Component/Console/Helper/ProcessHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/ProcessHelper.php
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Helper;
1313

14+
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1415
use Symfony\Component\Console\Output\OutputInterface;
1516
use Symfony\Component\Process\Exception\ProcessFailedException;
1617
use Symfony\Component\Process\Process;
@@ -37,6 +38,10 @@ class ProcessHelper extends Helper
3738
*/
3839
public function run(OutputInterface $output, $cmd, $error = null, $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE)
3940
{
41+
if ($output instanceof ConsoleOutputInterface) {
42+
$output = $output->getErrorOutput();
43+
}
44+
4045
$formatter = $this->getHelperSet()->get('debug_formatter');
4146

4247
if (is_array($cmd)) {
@@ -109,6 +114,10 @@ public function mustRun(OutputInterface $output, $cmd, $error = null, $callback
109114
*/
110115
public function wrapCallback(OutputInterface $output, Process $process, $callback = null)
111116
{
117+
if ($output instanceof ConsoleOutputInterface) {
118+
$output = $output->getErrorOutput();
119+
}
120+
112121
$formatter = $this->getHelperSet()->get('debug_formatter');
113122

114123
return function ($type, $buffer) use ($output, $process, $callback, $formatter) {

‎src/Symfony/Component/Console/Helper/ProgressBar.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/ProgressBar.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Console\Helper;
1313

14+
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1415
use Symfony\Component\Console\Output\OutputInterface;
1516

1617
/**
@@ -54,6 +55,10 @@ class ProgressBar
5455
*/
5556
public function __construct(OutputInterface $output, $max = 0)
5657
{
58+
if ($output instanceof ConsoleOutputInterface) {
59+
$output = $output->getErrorOutput();
60+
}
61+
5762
$this->output = $output;
5863
$this->setMaxSteps($max);
5964

‎src/Symfony/Component/Console/Helper/QuestionHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/QuestionHelper.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Console\Helper;
1313

1414
use Symfony\Component\Console\Input\InputInterface;
15+
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1516
use Symfony\Component\Console\Output\OutputInterface;
1617
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
1718
use Symfony\Component\Console\Question\Question;
@@ -41,6 +42,10 @@ class QuestionHelper extends Helper
4142
*/
4243
public function ask(InputInterface $input, OutputInterface $output, Question $question)
4344
{
45+
if ($output instanceof ConsoleOutputInterface) {
46+
$output = $output->getErrorOutput();
47+
}
48+
4449
if (!$input->isInteractive()) {
4550
return $question->getDefault();
4651
}
+41Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <fabien@symfony.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Console\Helper;
13+
14+
use Symfony\Component\Console\Tests;
15+
16+
function time()
17+
{
18+
return Tests\time();
19+
}
20+
21+
namespace Symfony\Component\Console\Tests;
22+
23+
function with_clock_mock($enable = null)
24+
{
25+
static $enabled;
26+
27+
if (null === $enable) {
28+
return $enabled;
29+
}
30+
31+
$enabled = $enable;
32+
}
33+
34+
function time()
35+
{
36+
if (!with_clock_mock()) {
37+
return \time();
38+
}
39+
40+
return $_SERVER['REQUEST_TIME'];
41+
}

‎src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ public function parse($source)
3333
{
3434
// Matches an optional namespace, optional element, and required class
3535
// $source = 'test|input.ab6bd_field';
36-
// $matches = array (size=5)
37-
// 0 => string 'test:input.ab6bd_field' (length=22)
38-
// 1 => string 'test:' (length=5)
39-
// 2 => string 'test' (length=4)
40-
// 3 => string 'input' (length=5)
41-
// 4 => string 'ab6bd_field' (length=11)
42-
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) {
36+
// $matches = array (size=4)
37+
// 0 => string 'test|input.ab6bd_field' (length=22)
38+
// 1 => string 'test' (length=4)
39+
// 2 => string 'input' (length=5)
40+
// 3 => string 'ab6bd_field' (length=11)
41+
if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+\.([\w-]++)$/i', trim($source), $matches)) {
4342
return array(
44-
new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
43+
new SelectorNode(new ClassNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])),
4544
);
4645
}
4746

‎src/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/Parser/Shortcut/ElementParser.php
+6-7Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,12 @@ public function parse($source)
3232
{
3333
// Matches an optional namespace, required element or `*`
3434
// $source = 'testns|testel';
35-
// $matches = array (size=4)
36-
// 0 => string 'testns:testel' (length=13)
37-
// 1 => string 'testns:' (length=7)
38-
// 2 => string 'testns' (length=6)
39-
// 3 => string 'testel' (length=6)
40-
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)$/i', trim($source), $matches)) {
41-
return array(new SelectorNode(new ElementNode($matches[2] ?: null, $matches[3])));
35+
// $matches = array (size=3)
36+
// 0 => string 'testns|testel' (length=13)
37+
// 1 => string 'testns' (length=6)
38+
// 2 => string 'testel' (length=6)
39+
if (preg_match('/^(?:([a-z]++)\|)?([\w-]++|\*)$/i', trim($source), $matches)) {
40+
return array(new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2])));
4241
}
4342

4443
return array();

‎src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,14 @@ public function parse($source)
3333
{
3434
// Matches an optional namespace, optional element, and required id
3535
// $source = 'test|input#ab6bd_field';
36-
// $matches = array (size=5)
37-
// 0 => string 'test:input#ab6bd_field' (length=22)
38-
// 1 => string 'test:' (length=5)
39-
// 2 => string 'test' (length=4)
40-
// 3 => string 'input' (length=5)
41-
// 4 => string 'ab6bd_field' (length=11)
42-
if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) {
36+
// $matches = array (size=4)
37+
// 0 => string 'test|input#ab6bd_field' (length=22)
38+
// 1 => string 'test' (length=4)
39+
// 2 => string 'input' (length=5)
40+
// 3 => string 'ab6bd_field' (length=11)
41+
if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+#([\w-]++)$/i', trim($source), $matches)) {
4342
return array(
44-
new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])),
43+
new SelectorNode(new HashNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])),
4544
);
4645
}
4746

‎src/Symfony/Component/CssSelector/XPath/TranslatorInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/CssSelector/XPath/TranslatorInterface.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interface TranslatorInterface
2929
* @param string $cssExpr
3030
* @param string $prefix
3131
*
32-
* @return XPathExpr
32+
* @return string
3333
*/
3434
public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::');
3535

@@ -39,7 +39,7 @@ public function cssToXPath($cssExpr, $prefix = 'descendant-or-self::');
3939
* @param SelectorNode $selector
4040
* @param string $prefix
4141
*
42-
* @return XPathExpr
42+
* @return string
4343
*/
4444
public function selectorToXPath(SelectorNode $selector, $prefix = 'descendant-or-self::');
4545
}

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,13 @@ private function discoverNamespace(\DOMXPath $domxpath, $prefix)
10361036
}
10371037

10381038
/**
1039-
* @param $xpath
1039+
* @param string $xpath
10401040
*
10411041
* @return array
10421042
*/
10431043
private function findNamespacePrefixes($xpath)
10441044
{
1045-
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/:]/i', $xpath, $matches)) {
1045+
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*+):[^"\/:]/i', $xpath, $matches)) {
10461046
return array_unique($matches['prefix']);
10471047
}
10481048

‎src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php
+2-17Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function removeListener($eventName, $listener)
9999
}
100100

101101
/**
102-
* @see EventDispatcherInterface::hasListeners()
102+
* {@inheritdoc}
103103
*/
104104
public function hasListeners($eventName = null)
105105
{
@@ -115,7 +115,7 @@ public function hasListeners($eventName = null)
115115
}
116116

117117
/**
118-
* @see EventDispatcherInterface::getListeners()
118+
* {@inheritdoc}
119119
*/
120120
public function getListeners($eventName = null, $withPriorities = false)
121121
{
@@ -151,21 +151,6 @@ public function addSubscriberService($serviceId, $class)
151151
}
152152
}
153153

154-
/**
155-
* {@inheritdoc}
156-
*
157-
* Lazily loads listeners for this event from the dependency injection
158-
* container.
159-
*
160-
* @throws \InvalidArgumentException if the service is not defined
161-
*/
162-
public function dispatch($eventName, Event $event = null)
163-
{
164-
$this->lazyLoad($eventName);
165-
166-
return parent::dispatch($eventName, $event);
167-
}
168-
169154
public function getContainer()
170155
{
171156
return $this->container;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.