8000 Merge branch '2.7' · symfony/symfony@d4057bc · GitHub
[go: up one dir, main page]

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 d4057bc

Browse files
Merge branch '2.7'
* 2.7: (26 commits) [Form] fixed a maxlength overring on a guessing [Debug] Show only unique class candidates [FrameworkBundle] make GetSetMethodNormalizer available by default [SecurityBundle] Firewall providers building - code cleaning [Filesystem] symlink use RealPath instead LinkTarget [DependencyInjection] Remove duplicate declaration in PhpDumper terminals are not interactive on Travis Revert "[DependencyInjection] backport perf optim" [WebProfiler] Tweaked ajax requests toolbar css reset [WebProfilerBundle] replaced pattern to path attribute in routes definitions. fix phpdoc's alignment Fixed deprecation version Fix missing addExpressionLanguageProvider (used by service container to add expression providers) Fixed the AuthenticationProviderInterface alignment Fixed the proxy-manager version constraint Fix missing space in label_attr fix DumpDataCollectorTest after CS changes avoid risky tests Fixed typo in SecurityContext PHPDoc [FrameworkBundle][Template name] avoid error message for the shortcut notation. ...
2 parents f4e7fd7 + 7185d50 commit d4057bc

File tree

54 files changed

+405
-182
lines changed

Some content is hidden

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

54 files changed

+405
-182
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"monolog/monolog": "~1.11",
7676
"propel/propel1": "~1.6",
7777
"ircmaxell/password-compat": "~1.0",
78-
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev",
78+
"ocramius/proxy-manager": "~0.3.1",
7979
"egulias/email-validator": "~1.2"
8080
},
8181
"autoload": {

src/Symfony/Bridge/ProxyManager/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": ">=5.3.3",
2020
"symfony/dependency-injection": "~2.3",
21-
"ocramius/proxy-manager": ">=0.3.1,<0.6-dev"
21+
"ocramius/proxy-manager": "~0.3.1"
2222
},
2323
"require-dev": {
2424
"symfony/config": "~2.3"

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
161161
{% endif %}
162162
{% if parent_label_class is defined %}
163-
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ parent_label_class)|trim}) %}
163+
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
164164
{% endif %}
165165
{% if label is empty %}
166166
{% set label = name|humanize %}

src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@
1515
<argument type="collection" />
1616
<argument type="collection" />
1717
</service>
18+
19+
<!-- Normalizer -->
20+
<service id="serializer.normalizer.get_set_method" class="Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer" public="false">
21+
<!-- Run after all custom serializers -->
22+
<tag name="serializer.normalizer" priority="-1000" />
23+
</service>
24+
1825
<!-- Encoders -->
1926
<service id="serializer.encoder.xml" class="%serializer.encoder.xml.class%" public="false" >
2027
<tag name="serializer.encoder" />

src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Templating;
1313

14-
use Symfony\Component\Templating\TemplateNameParserInterface;
1514
use Symfony\Component\Templating\TemplateReferenceInterface;
1615
use Symfony\Component\HttpKernel\KernelInterface;
16+
use Symfony\Component\Templating\TemplateNameParser as BaseTemplateNameParser;
1717

1818
/**
1919
* TemplateNameParser converts template names from the short notation
@@ -22,7 +22,7 @@
2222
*
2323
* @author Fabien Potencier <fabien@symfony.com>
2424
*/
25-
class TemplateNameParser implements TemplateNameParserInterface
25+
class TemplateNameParser extends BaseTemplateNameParser
2626
{
2727
protected $kernel;
2828
protected $cache = array();
@@ -56,7 +56,7 @@ public function parse($name)
5656
}
5757

5858
if (!preg_match('/^([^:]*):([^:]*):(.+)\.([^\.]+)\.([^\.]+)$/', $name, $matches)) {
59-
throw new \InvalidArgumentException(sprintf('Template name "%s" is not valid (format is "bundle:section:template.format.engine").', $name));
59+
return parent::parse($name);
6060
}
6161

6262
$template = new TemplateReference($matches[1], $matches[2], $matches[3], $matches[4], $matches[5]);

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ protected static function bootKernel(array $options = array())
141141
static::$kernel->boot();
142142
}
143143

144-
/**
144+
/**
145145
* Creates a Kernel.
146146
*
147147
* Available options:

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public function serialize()
101101

102102
public function unserialize($str)
103103< 10000 div class="diff-text-inner"> {
104-
call_user_func_array(array($this, '__construct'), unserialize($str));
104+
$a = unserialize($str);
105+
$this->__construct($a[0], $a[1], $a[2], $a[3]);
105106
}
106107

107108
protected function getKernelParameters()

src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TemplateNameParserTest.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1515
use Symfony\Bundle\FrameworkBundle\Templating\TemplateNameParser;
1616
use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference;
17+
use Symfony\Component\Templating\TemplateReference as BaseTemplateReference;
1718

1819
class TemplateNameParserTest extends TestCase
1920
{
@@ -63,25 +64,17 @@ public function getLogicalNameToTemplateProvider()
6364
array(':Post:index.html.php', new TemplateReference('', 'Post', 'index', 'html', 'php')),
6465
array('::index.html.php', new TemplateReference('', '', 'index', 'html', 'php')),
6566
array('FooBundle:Post:foo.bar.index.html.php', new TemplateReference('FooBundle', 'Post', 'foo.bar.index', 'html', 'php')),
67+
array('/path/to/section/name.php', new BaseTemplateReference('/path/to/section/name.php', 'php')),
68+
array('name.twig', new BaseTemplateReference('name.twig', 'twig')),
69+
array('name', new BaseTemplateReference('name')),
6670
);
6771
}
6872

6973
/**
70-
* @dataProvider getInvalidLogicalNameProvider
7174
* @expectedException \InvalidArgumentException
7275
*/
73-
public function testParseInvalidName($name)
76+
public function testParseValidNameWithNotFoundBundle()
7477
{
75-
$this->parser->parse($name);
76-
}
77-
78-
public function getInvalidLogicalNameProvider()
79-
{
80-
return array(
81-
array('BarBundle:Post:index.html.php'),
82-
array('FooBundle:Post:index'),
83-
array('FooBundle:Post'),
84-
array('FooBundle:Post:foo:bar'),
85-
);
78+
$this->parser->parse('BarBundle:Post:index.html.php');
8679
}
8780
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ private function createUserDaoProvider($name, $provider, ContainerBuilder $conta
513513
{
514514
$name = $this->getUserProviderId(strtolower($name));
515515

516+
// Doctrine Entity and In-memory DAO provider are managed by factories
516517
foreach ($this->userProviderFactories as $factory) {
517518
$key = str_replace('-', '_', $factory->getKey());
518519

@@ -539,37 +540,12 @@ private function createUserDaoProvider($name, $provider, ContainerBuilder $conta
539540

540541
$container
541542
->setDefinition($name, new DefinitionDecorator('security.user.provider.chain'))
542-
->addArgument($providers)
543-
;
544-
545-
return $name;
546-
}
547-
548-
// Doctrine Entity DAO provider
549-
if (isset($provider['entity'])) {
550-
$container
551-
->setDefinition($name, new DefinitionDecorator('security.user.provider.entity'))
552-
->addArgument($provider['entity']['class'])
553-
->addArgument($provider['entity']['property'])
554-
;
543+
->addArgument($providers);
555544

556545
return $name;
557546
}
558547

559-
// In-memory DAO provider
560-
$definition = $container->setDefinition($name, new DefinitionDecorator('security.user.provider.in_memory'));
561-
foreach ($provider['users'] as $username => $user) {
562-
$userId = $name.'_'.$username;
563-
564-
$container
565-
->setDefinition($userId, new DefinitionDecorator('security.user.provider.in_memory.user'))
566-
->setArguments(array($username, (string) $user['password'], $user['roles']))
567-
;
568-
569-
$definition->addMethodCall('createUser', array(new Reference($userId)));
570-
}
571-
572-
return $name;
548+
throw new InvalidConfigurationException(sprintf('Unable to create definition for "%s" user provider', $name));
573549
}
574550

575551
private function getUserProviderId($name)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider;
4+
5+
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
6+
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
7+
use Symfony\Component\DependencyInjection\ContainerBuilder;
8+
9+
class DummyProvider implements UserProviderFactoryInterface
10+
{
11+
public function create(ContainerBuilder $container, $id, $config)
12+
{
13+
14+
}
15+
16+
public function getKey()
17+
{
18+
return 'foo';
19+
}
20+
21+
public function addConfiguration(NodeDefinition $node)
22+
{
23+
24+
}
25+
}

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
1515
use Symfony\Bundle\SecurityBundle\SecurityBundle;
16+
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider\DummyProvider;
1617
use Symfony\Component\DependencyInjection\ContainerBuilder;
1718

1819
class SecurityExtensionTest extends \PHPUnit_Framework_TestCase
@@ -66,6 +67,33 @@ public function testFirewallWithoutAuthenticationListener()
6667
$container->compile();
6768
}
6869

70+
/**
71+
* @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException
72+
* @expectedExceptionMessage Unable to create definition for "security.user.provider.concrete.my_foo" user provider
73+
*/
74+
public function testFirewallWithInvalidUserProvider()
75+
{
76+
$container = $this->getRawContainer();
77+
78+
$extension = $container->getExtension('security');
79+
$extension->addUserProviderFactory(new DummyProvider());
80+
81+
$container->loadFromExtension('security', array(
82+
'providers' => array(
83+
'my_foo' => array('foo' => []),
84+
),
85+
86+
'firewalls' => array(
87+
'some_firewall' => array(
88+
'pattern' => '/.*',
89+
'http_basic' => [],
90+
),
91+
),
92+
));
93+
94+
$container->compile();
95+
}
96+
6997
protected function getRawContainer()
7098
{
7199
$container = new ContainerBuilder();

src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public function serialize()
101101

102102
public function unserialize($str)
103103
{
104-
call_user_func_array(array($this, '__construct'), unserialize($str));
104+
$a = unserialize($str);
105+
$this->__construct($a[0], $a[1], $a[2], $a[3]);
105106
}
106107

107108
protected function getKernelParameters()

src/Symfony/Bundle/TwigBundle/Tests/Controller/ExceptionControllerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function testShowActionCanBeForcedToShowErrorPage()
5252
);
5353

5454
$request = Request::create('whatever', 'GET');
55+
$request->headers->set('X-Php-Ob-Level', 1);
5556
$request->attributes->set('showException', false);
5657
$exception = FlattenException::create(new \Exception(), 404);
5758
$controller = new ExceptionController($twig, /* "showException" defaults to --> */ true);
@@ -71,6 +72,7 @@ public function testFallbackToHtmlIfNoTemplateForRequestedFormat()
7172
);
7273

7374
$request = Request::create('whatever');
75+
$request->headers->set('X-Php-Ob-Level', 1);
7476
$request->setRequestFormat('txt');
7577
$exception = FlattenException::create(new \Exception());
7678
$controller = new ExceptionController($twig, false);

src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/profiler.xml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,47 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
66

7-
<route id="_profiler_home" pattern="/">
7+
<route id="_profiler_home" path="/">
88
<default key="_controller">web_profiler.controller.profiler:homeAction</default>
99
</route>
1010

11-
<route id="_profiler_search" pattern="/search">
11+
<route id="_profiler_search" path="/search">
1212
<default key="_controller">web_profiler.controller.profiler:searchAction</default>
1313
</route>
1414

15-
<route id="_profiler_search_bar" pattern="/search_bar">
15+
<route id="_profiler_search_bar" path="/search_bar">
1616
<default key="_controller">web_profiler.controller.profiler:searchBarAction</default>
1717
</route>
1818

19-
<route id="_profiler_purge" pattern="/purge">
19+
<route id="_profiler_purge" path="/purge">
2020
<default key="_controller">web_profiler.controller.profiler:purgeAction</default>
2121
</route>
2222

23-
<route id="_profiler_info" pattern="/info/{about}">
23+
<route id="_profiler_info" path="/info/{about}">
2424
<default key="_controller">web_profiler.controller.profiler:infoAction</default>
2525
</route>
2626

27-
<route id="_profiler_phpinfo" pattern="/phpinfo">
27+
<route id="_profiler_phpinfo" path="/phpinfo">
2828
<default key="_controller">web_profiler.controller.profiler:phpinfoAction</default>
2929
</route>
3030

31-
<route id="_profiler_search_results" pattern="/{token}/search/results">
31+
<route id="_profiler_search_results" path="/{token}/search/results">
3232
<default key="_controller">web_profiler.controller.profiler:searchResultsAction</default>
3333
</route>
3434

35-
<route id="_profiler" pattern="/{token}">
35+
<route id="_profiler" path="/{token}">
3636
<default key="_controller">web_profiler.controller.profiler:panelAction</default>
3737
</route>
3838

39-
<route id="_profiler_router" pattern="/{token}/router">
39+
<route id="_profiler_router" path="/{token}/router">
4040
<default key="_controller">web_profiler.controller.router:panelAction</default>
4141
</route>
4242

43-
<route id="_profiler_exception" pattern="/{token}/exception">
43+
<route id="_profiler_exception" path="/{token}/exception">
4444
<default key="_controller">web_profiler.controller.exception:showAction</default>
4545
</route>
4646

47-
<route id="_profiler_exception_css" pattern="/{token}/exception.css">
47+
<route id="_profiler_exception_css" path="/{token}/exception.css">
4848
<default key="_controller">web_profiler.controller.exception:cssAction</default>
4949
</route>
5050

src/Symfony/Bundle/WebProfilerBundle/Resources/config/routing/wdt.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
55
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
66

7-
<route id="_wdt" pattern="/{token}">
7+
<route id="_wdt" path="/{token}">
88
<default key="_controller">web_profiler.controller.profiler:toolbarAction</default>
99
</route>
1010
</routes>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.css.twig

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,25 @@
5151
cursor: help;
5252
}
5353
.sf-toolbarreset span,
54-
.sf-toolbarreset div {
54+
.sf-toolbarreset div,
55+
.sf-toolbarreset td,
56+
.sf-toolbarreset th {
5557
font-size: 11px;
5658
}
5759
.sf-toolbarreset img {
5860
width: auto;
5961
display: inline;
6062
}
61-
63+
.sf-toolbarreset table {
64+
border-collapse: collapse;
65+
border-spacing: 0;
66+
background-color: #000;
67+
margin: 0;
68+
padding: 0;
69+
border: 0;
70+
width: 100%;
71+
table-layout: auto;
72+
}
6273
.sf-toolbarreset .hide-button {
6374
display: block;
6475
position: absolute;
@@ -289,12 +300,11 @@
289300
overflow-y: auto;
290301
}
291302

292-
table.sf-toolbar-ajax-requests {
293-
border-collapse: collapse;
294-
}
295303
.sf-toolbar-ajax-requests th, .sf-toolbar-ajax-requests td {
296304
border-bottom: 1px solid #ddd;
297305
padding: 0 4px;
306+
color: #2f2f2f;
307+
background-color: #fff;
298308
}
299309
.sf-toolbar-ajax-requests th {
300310
background-color: #eee;

src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ public static function buildExpressions(array $expressions)
225225
{
226226
foreach ($expressions as $k => $expr) {
227227
if ($expr instanceof ExprBuilder) {
228-
$expressions[$k] = function ($v) use ($expr) {
229-
return call_user_func($expr->ifPart, $v) ? call_user_func($expr->thenPart, $v) : $v;
228+
$if = $expr->ifPart;
229+
$then = $expr->thenPart;
230+
$expressions[$k] = function ($v) use ($if, $then) {
231+
return $if($v) ? $then($v) : $v;
230232
};
231233
}
232234
}

0 commit comments

Comments
 (0)
0