Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 076dec5

Browse files
Merge branch 'master' into missing-existence-resource
2 parents cece6d4 + 46daa35 commit 076dec5

File tree

76 files changed

+640
-305
lines changed

Some content is hidden

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

76 files changed

+640
-305
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ script:
9696
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'"$REPORT"; fi
9797
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi
9898
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
99-
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi
99+
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && SYMFONY_DEPRECATIONS_HELPER=weak ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi
100100
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY"$REPORT"; fi
101101
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --no-progress --ansi --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'"$REPORT"; fi
102102
# Test the PhpUnit bridge using the original phpunit script

UPGRADE-3.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1907,3 +1907,9 @@ UPGRADE FROM 2.x to 3.0
19071907
```php
19081908
$request->query->get('foo')['bar'];
19091909
```
1910+
### Monolog Bridge
1911+
1912+
* `Symfony\Bridge\Monolog\Logger::emerg()` was removed. Use `emergency()` which is PSR-3 compatible.
1913+
* `Symfony\Bridge\Monolog\Logger::crit()` was removed. Use `critical()` which is PSR-3 compatible.
1914+
* `Symfony\Bridge\Monolog\Logger::err()` was removed. Use `error()` which is PSR-3 compatible.
1915+
* `Symfony\Bridge\Monolog\Logger::warn()` was removed. Use `warning()` which is PSR-3 compatible.

UPGRADE-3.3.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ Debug
1414
DependencyInjection
1515
-------------------
1616

17+
* Autowiring-types have been deprecated, use aliases instead.
18+
19+
Before:
20+
21+
```xml
22+
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false">
23+
<autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type>
24+
</service>
25+
```
26+
27+
After:
28+
29+
```xml
30+
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
31+
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
32+
```
33+
1734
* The `Reference` and `Alias` classes do not make service identifiers lowercase anymore.
1835

1936
* Case insensitivity of service identifiers is deprecated and will be removed in 4.0.
@@ -46,6 +63,15 @@ HttpKernel
4663
* The `Psr6CacheClearer::addPool()` method has been deprecated. Pass an array of pools indexed
4764
by name to the constructor instead.
4865

66+
Process
67+
-------
68+
69+
* Not inheriting environment variables is deprecated.
70+
71+
* Configuring `proc_open()` options is deprecated.
72+
73+
* Configuring Windows and sigchild compatibility is deprecated - they will be always enabled in 4.0.
74+
4975
Security
5076
--------
5177

@@ -58,6 +84,8 @@ SecurityBundle
5884
* The `FirewallContext::getContext()` method has been deprecated and will be removed in 4.0.
5985
Use the `getListeners()` method instead.
6086

87+
* The `FirewallMap::$map` and `$container` properties have been deprecated and will be removed in 4.0.
88+
6189
TwigBridge
6290
----------
6391

UPGRADE-4.0.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,23 @@ Debug
2424
DependencyInjection
2525
-------------------
2626

27+
* Autowiring-types have been removed, use aliases instead.
28+
29+
Before:
30+
31+
```xml
32+
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false">
33+
<autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type>
34+
</service>
35+
```
36+
37+
After:
38+
39+
```xml
40+
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
41+
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
42+
```
43+
2744
* Service identifiers are now case sensitive.
2845

2946
* The `Reference` and `Alias` classes do not make service identifiers lowercase anymore.
@@ -164,6 +181,8 @@ SecurityBundle
164181

165182
* The `FirewallContext::getContext()` method has been removed, use the `getListeners()` method instead.
166183

184+
* The `FirewallMap::$map` and `$container` properties have been removed.
185+
167186
HttpFoundation
168187
---------------
169188

@@ -206,6 +225,15 @@ HttpKernel
206225
* The `Psr6CacheClearer::addPool()` method has been removed. Pass an array of pools indexed
207226
by name to the constructor instead.
208227

228+
Process
229+
-------
230+
231+
* Environment variables are always inherited in sub-processes.
232+
233+
* Configuring `proc_open()` options has been removed.
234+
235+
* Configuring Windows and sigchild compatibility is not possible anymore - they are always enabled.
236+
209237
Security
210238
--------
211239

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,9 @@ private function getContainerDefinitionData(Definition $definition, $omitTags =
220220
'shared' => $definition->isShared(),
221221
'abstract' => $definition->isAbstract(),
222222
'autowire' => $definition->isAutowired(),
223-
'autowiring_types' => array(),
224223
);
225224

226-
foreach ($definition->getAutowiringTypes() as $autowiringType) {
225+
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
227226
$data['autowiring_types'][] = $autowiringType;
228227
}
229228

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ protected function describeContainerDefinition(Definition $definition, array $op
185185
."\n".'- Autowired: '.($definition->isAutowired() ? 'yes' : 'no')
186186
;
187187

188-
foreach ($definition->getAutowiringTypes() as $autowiringType) {
189-
$output .= "\n" . '- Autowiring Type: `' . $autowiringType . '`';
188+
foreach ($definition->getAutowiringTypes(false) as $autowiringType) {
189+
$output .= "\n".'- Autowiring Type: `'.$autowiringType.'`';
190190
}
191191

192192
if (isset($options['show_arguments']) && $options['show_arguments']) {

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,9 @@ protected function describeContainerDefinition(Definition $definition, array $op
294294
$tableRows[] = array('Abstract', $definition->isAbstract() ? 'yes' : 'no');
295295
$tableRows[] = array('Autowired', $definition->isAutowired() ? 'yes' : 'no');
296296

297-
$autowiringTypes = $definition->getAutowiringTypes();
298-
$tableRows[] = array('Autowiring Types', $autowiringTypes ? implode(', ', $autowiringTypes) : '-');
297+
if ($autowiringTypes = $definition->getAutowiringTypes(false)) {
298+
$tableRows[] = array('Autowiring Types', implode(', ', $autowiringTypes));
299+
}
299300

300301
if ($definition->getFile()) {
301302
$tableRows[] = array('Required File', $definition->getFile() ? $definition->getFile() : '-');

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/TemplatingPass.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

1414
use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as FrameworkBundleEngineInterface;
15+
use Symfony\Component\DependencyInjection\Alias;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1718
use Symfony\Component\Templating\EngineInterface as ComponentEngineInterface;
@@ -25,8 +26,8 @@ public function process(ContainerBuilder $container)
2526
}
2627

2728
if ($container->hasAlias('templating')) {
28-
$definition = $container->findDefinition('templating');
29-
$definition->setAutowiringTypes(array(ComponentEngineInterface::class, FrameworkBundleEngineInterface::class));
29+
$container->setAlias(ComponentEngineInterface::class, new Alias('templating', false));
30+
$container->setAlias(FrameworkBundleEngineInterface::class, new Alias('templating', false));
3031
}
3132

3233
if ($container->hasDefinition('templating.engine.php')) {

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Symfony\Component\Finder\Finder;
2828
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2929
use Symfony\Component\Config\FileLocator;
30-
use Symfony\Component\Config\Resource\ClassExistenceResource;
3130
use Symfony\Component\PropertyAccess\PropertyAccessor;
3231
use Symfony\Component\Serializer\Encoder\YamlEncoder;
3332
use Symfony\Component\Serializer\Encoder\CsvEncoder;
@@ -84,7 +83,6 @@ public function load(array $configs, ContainerBuilder $container)
8483

8584
$loader->load('fragment_renderer.xml');
8685

87-
$container->addResource(new ClassExistenceResource(Application::class));
8886
if (class_exists(Application::class)) {
8987
$loader->load('console.xml');
9088
}
@@ -1090,8 +1088,8 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
10901088
->getDefinition('annotations.cached_reader')
10911089
->replaceArgument(1, new Reference($cacheService))
10921090
->replaceArgument(2, $config['debug'])
1093-
->addAutowiringType(Reader::class)
10941091
;
1092+
$container->setAlias(Reader::class, new Alias('annotations.cached_reader', false));
10951093
} else {
10961094
$container->removeDefinition('annotations.cached_reader');
10971095
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
66

77
<services>
8-
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false">
9-
<autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type>
10-
</service>
8+
<service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" />
9+
<service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" />
1110

1211
<service id="annotations.cached_reader" class="Doctrine\Common\Annotations\CachedReader" public="false">
1312
<argument type="service" id="annotations.reader" />

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- Extractor -->
1616
<service id="property_info.reflection_extractor" class="Symfony\Component\PropertyInfo\Extractor\ReflectionExtractor" public="false">
1717
<tag name="property_info.list_extractor" priority="-1000" />
18-
<tag name="property_info.type_extractor" priority="-1000" />
18+
<tag name="property_info.type_extractor" priority="-1002" />
1919
<tag name="property_info.access_extractor" priority="-1000" />
2020
</service>
2121
</services>

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<services>
88
<service id="event_dispatcher" class="Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher">
99
<argument type="service" id="service_container" />
10-
<autowiring-type>Symfony\Component\EventDispatcher\EventDispatcherInterface</autowiring-type>
11-
<autowiring-type>Symfony\Component\EventDispatcher\EventDispatcher</autowiring-type>
1210
</service>
11+
<service id="Symfony\Component\EventDispatcher\EventDispatcherInterface" alias="event_dispatcher" public="false" />
12+
<service id="Symfony\Component\EventDispatcher\EventDispatcher" alias="event_dispatcher" public="false" />
1313

1414
<service id="http_kernel" class="Symfony\Component\HttpKernel\HttpKernel">
1515
<argument type="service" id="event_dispatcher" />
@@ -40,10 +40,8 @@
4040
<argument type="collection" />
4141
</service>
4242

43-
<service id="service_container" synthetic="true">
44-
<autowiring-type>Symfony\Component\DependencyInjection\ContainerInterface</autowiring-type>
45-
<autowiring-type>Symfony\Component\DependencyInjection\Container</autowiring-type>
46-
</service>
43+
<service id="Symfony\Component\DependencyInjection\ContainerInterface" alias="service_container" public="false" />
44+
<service id="Symfony\Component\DependencyInjection\Container" alias="service_container" public="false" />
4745

4846
<service id="kernel" synthetic="true" />
4947

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
<call method="setConfigCacheFactory">
1818
<argument type="service" id="config_cache_factory" />
1919
</call>
20-
21-
<autowiring-type>Symfony\Component\Translation\TranslatorInterface</autowiring-type>
2220
</service>
21+
<service id="Symfony\Component\Translation\TranslatorInterface" alias="translator" public="false" />
2322

2423
<service id="translator.logging" class="Symfony\Component\Translation\LoggingTranslator" public="false">
2524
<argument type="service" id="translator.logging.inner" />

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_1.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"shared": true,
1212
"abstract": true,
1313
"autowire": false,
14-
"autowiring_types": [],
1514
"file": null,
1615
"factory_class": "Full\\Qualified\\FactoryClass",
1716
"factory_method": "get",

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_1.txt

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
Information for Service "service_1"
44
===================================
55

6-
------------------ -----------------------------
7-
 Option   Value 
8-
------------------ -----------------------------
9-
Service ID service_1
10-
Class Full\Qualified\Class1
11-
Tags -
12-
Public yes
13-
Synthetic no
14-
Lazy yes
15-
Shared yes
16-
Abstract yes
17-
Autowired no
18-
Autowiring Types -
19-
Factory Class Full\Qualified\FactoryClass
20-
Factory Method get
21-
------------------ -----------------------------
6+
---------------- -----------------------------
7+
 Option   Value 
8+
---------------- -----------------------------
9+
Service ID service_1
10+
Class Full\Qualified\Class1
11+
Tags -
12+
Public yes
13+
Synthetic no
14+
Lazy yes
15+
Shared yes
16+
Abstract yes
17+
Autowired no
18+
Factory Class Full\Qualified\FactoryClass
19+
Factory Method get
20+
---------------- -----------------------------

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"shared": true,
1212
"abstract": false,
1313
"autowire": false,
14-
"autowiring_types": [],
1514
"file": "\/path\/to\/file",
1615
"factory_service": "factory.service",
1716
"factory_method": "get",

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,22 @@
33
Information for Service "service_2"
44
===================================
55

6-
------------------ ---------------------------------
7-
 Option   Value 
8-
------------------ ---------------------------------
9-
Service ID service_2
10-
Class Full\Qualified\Class2
11-
Tags tag1 (attr1: val1, attr2: val2)
12-
tag1 (attr3: val3)
13-
tag2
14-
Calls setMailer
15-
Public no
16-
Synthetic yes
17-
Lazy no
18-
Shared yes
19-
Abstract no
20-
Autowired no
21-
Autowiring Types -
22-
Required File /path/to/file
23-
Factory Service factory.service
24-
Factory Method get
25-
------------------ ---------------------------------
6+
----------------- ---------------------------------
7+
 Option   Value 
8+
----------------- ---------------------------------
9+
Service ID service_2
10+
Class Full\Qualified\Class2
11+
Tags tag1 (attr1: val1, attr2: val2)
12+
tag1 (attr3: val3)
13+
tag2
14+
Calls setMailer
15+
Public no
16+
Synthetic yes
17+
Lazy no
18+
Shared yes
19+
Abstract no
20+
Autowired no
21+
Required File /path/to/file
22+
Factory Service factory.service
23+
Factory Method get
24+
----------------- ---------------------------------

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
],
1616
"autowire": false,
17-
"autowiring_types": [],
1817
"arguments": [
1918
{
2019
"type": "service",
@@ -29,7 +28,6 @@
2928
"shared": true,
3029
"abstract": false,
3130
"autowire": false,
32-
"autowiring_types": [],
3331
"arguments": [
3432
"arg1",
3533
"arg2"

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"tags": [
1414

1515
],
16-
"autowire": false,
17-
"autowiring_types": []
16+
"autowire": false
1817
}
1918
},
2019
"aliases": {

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"tags": [
1414

1515
],
16-
"autowire": false,
17-
"autowiring_types": []
16+
"autowire": false
1817
},
1918
"definition_2": {
2019
"class": "Full\\Qualified\\Class2",
@@ -50,8 +49,7 @@
5049
"calls": [
5150
"setMailer"
5251
],
53-
"autowire": false,
54-
"autowiring_types": []
52+
"autowire": false
5553
}
5654
},
5755
"aliases": {

0 commit comments

Comments
 (0)