Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit8d4e3c5

Browse files
Merge branch '3.3' into 3.4
* 3.3: Have weak_vendors ignore deprecations from outside [HttpFoundation] fixed return type of method HeaderBag::get [HttpFoundation] Added "resource" type on Request::create docblock [Process] Skip environment variables with false value in Process Revert "bug#25789 Enableable ArrayNodeDefinition is disabled for empty configuration (kejwmen)" Formatting fix in upgrade 3.0 document don't split lines on carriage returns when dumping Revert "bug#25851 [Validator] Conflict with egulias/email-validator 2.0 (emodric)" [DI] compilation perf tweak [Validator] Conflict with egulias/email-validator 2.0 [Validator] add missing parent isset and add test
2 parentsd2a316f +fa7b760 commit8d4e3c5

File tree

18 files changed

+108
-57
lines changed

18 files changed

+108
-57
lines changed

‎src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,12 @@ public static function register($mode = 0)
7575
}
7676
}
7777
}
78-
$path =realpath($path) ?:$path;
78+
$realPath =realpath($path);
79+
if (false ===$realPath &&'-' !==$path &&'Standard input code' !==$path) {
80+
returntrue;
81+
}
7982
foreach ($vendorsas$vendor) {
80-
if (0 ===strpos($path,$vendor) &&false !==strpbrk(substr($path,strlen($vendor),1),'/'.DIRECTORY_SEPARATOR)) {
83+
if (0 ===strpos($realPath,$vendor) &&false !==strpbrk(substr($realPath,strlen($vendor),1),'/'.DIRECTORY_SEPARATOR)) {
8184
returntrue;
8285
}
8386
}
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
@trigger_error('I come from… afar! :D',E_USER_DEPRECATED);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
$phar =newPhar(__DIR__.DIRECTORY_SEPARATOR.'deprecation.phar',0,'deprecation.phar');
4+
$phar->buildFromDirectory(__DIR__.DIRECTORY_SEPARATOR.'deprecation');
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation
3+
--FILE--
4+
<?php
5+
6+
putenv('SYMFONY_DEPRECATIONS_HELPER=weak_vendors');
7+
putenv('ANSICON');
8+
putenv('ConEmuANSI');
9+
putenv('TERM');
10+
11+
$vendor =__DIR__;
12+
while (!file_exists($vendor.'/vendor')) {
13+
$vendor =dirname($vendor);
14+
}
15+
define('PHPUNIT_COMPOSER_INSTALL',$vendor.'/vendor/autoload.php');
16+
requirePHPUNIT_COMPOSER_INSTALL;
17+
require_once__DIR__.'/../../bootstrap.php';
18+
eval("@trigger_error('who knows where I come from?', E_USER_DEPRECATED);")
19+
20+
?>
21+
--EXPECTF--
22+
23+
Other deprecation notices (1)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Test DeprecationErrorHandler in weak vendors mode on eval()'d deprecation
3+
The phar can be regenerated by running php src/Symfony/Bridge/PhpUnit/Tests/DeprecationErrorHandler/generate_phar.php
4+
--FILE--
5+
<?php
6+
7+
putenv('SYMFONY_DEPRECATIONS_HELPER=weak_vendors');
8+
putenv('ANSICON');
9+
putenv('ConEmuANSI');
10+
putenv('TERM');
11+
12+
$vendor =__DIR__;
13+
while (!file_exists($vendor.'/vendor')) {
14+
$vendor =dirname($vendor);
15+
}
16+
define('PHPUNIT_COMPOSER_INSTALL',$vendor.'/vendor/autoload.php');
17+
requirePHPUNIT_COMPOSER_INSTALL;
18+
require_once__DIR__.'/../../bootstrap.php';
19+
\Phar::loadPhar(__DIR__.'/deprecation.phar','deprecation.phar');
20+
include'phar://deprecation.phar/deprecation.php';
21+
22+
?>
23+
--EXPECTF--
24+
25+
Other deprecation notices (1)

‎src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,7 @@ public function canBeEnabled()
283283
->beforeNormalization()
284284
->ifArray()
285285
->then(function ($v) {
286-
if (!isset($v['enabled'])) {
287-
$v['enabled'] = !empty($v);
288-
}
286+
$v['enabled'] =isset($v['enabled']) ?$v['enabled'] :true;
289287

290288
return$v;
291289
})

‎src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,6 @@ public function testCanBeDisabled()
207207
$this->assertTrue($this->getField($enabledNode,'defaultValue'));
208208
}
209209

210-
publicfunctiontestEnableableNodeIsDisabledForEmptyConfigurationWhenNormalized()
211-
{
212-
$config =array();
213-
214-
$node =newArrayNodeDefinition('root');
215-
$node->canBeEnabled();
216-
217-
$this->assertEquals(
218-
array('enabled' =>false),
219-
$node->getNode()->normalize($config),
220-
'An enableable node is disabled by default'
221-
);
222-
}
223-
224210
publicfunctiontestIgnoreExtraKeys()
225211
{
226212
$node =newArrayNodeDefinition('root');
@@ -296,7 +282,6 @@ public function getEnableableNodeFixtures()
296282
array(array('enabled' =>true,'foo' =>'baz'),array(array('foo' =>'baz')),'any configuration enables an enableable node'),
297283
array(array('enabled' =>false,'foo' =>'baz'),array(array('foo' =>'baz','enabled' =>false)),'An enableable node can be disabled'),
298284
array(array('enabled' =>false,'foo' =>'bar'),array(false),'false disables an enableable node'),
299-
array(array('enabled' =>false,'foo' =>'bar'),array(),'enableable node is disabled by default'),
300285
);
301286
}
302287

‎src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Config\Tests\Definition\Builder;
1313

1414
usePHPUnit\Framework\TestCase;
15-
useSymfony\Component\Config\Definition\Processor;
1615
useSymfony\Component\Config\Tests\Fixtures\Builder\NodeBuilderasCustomNodeBuilder;
1716
useSymfony\Component\Config\Definition\Builder\TreeBuilder;
1817

@@ -132,22 +131,4 @@ public function testDefinitionExampleGetsTransferredToNode()
132131
$this->assertInternalType('array',$tree->getExample());
133132
$this->assertEquals('example',$children['child']->getExample());
134133
}
135-
136-
publicfunctiontestRootNodeThatCanBeEnabledIsDisabledByDefault()
137-
{
138-
$builder =newTreeBuilder();
139-
140-
$builder->root('test')
141-
->canBeEnabled();
142-
143-
$tree =$builder->buildTree();
144-
$children =$tree->getChildren();
145-
146-
$this->assertFalse($children['enabled']->getDefaultValue());
147-
148-
$processor =newProcessor();
149-
$result =$processor->process($tree,array());
150-
151-
$this->assertEquals(array('enabled' =>false),$result);
152-
}
153134
}

‎src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function process(ContainerBuilder $container)
5252
*/
5353
protectedfunctionprocessValue($value,$isRoot =false)
5454
{
55-
if (is_array($value)) {
55+
if (\is_array($value)) {
5656
foreach ($valueas$k =>$v) {
5757
if ($isRoot) {
5858
$this->currentId =$k;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp