8000 Merge branch '4.1' into 4.2 · symfony/symfony@cf8cc19 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf8cc19

Browse files
committed
Merge branch '4.1' into 4.2
* 4.1: the string "0" is a valid service identifier remove unreachable code updated MimeType extensions
2 parents 18bb3e1 + 55c871d commit cf8cc19

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

src/Symfony/Bridge/Twig/Tests/Node/TransNodeTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ protected function getVariableGetterWithoutStrictCheck($name)
4949

5050
protected function getVariableGetterWithStrictCheck($name)
5151
{
52-
if (Environment::VERSION_ID > 20404) {
53-
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
54-
}
55-
5652
if (Environment::MAJOR_VERSION >= 2) {
57-
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name);
53+
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
5854
}
5955

6056
return sprintf('($context["%s"] ?? $this->getContext($context, "%1$s"))', $name);

src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
497497

498498
switch ($arg->getAttribute('type')) {
499499
case 'service':
500-
if (!$arg->getAttribute('id')) {
500+
if ('' === $arg->getAttribute('id')) {
501501
throw new InvalidArgumentException(sprintf('Tag "<%s>" with type="service" has no or empty "id" attribute in "%s".', $name, $file));
502502
}
503503

@@ -561,7 +561,7 @@ private function getArgumentsAsPhp(\DOMElement $node, $name, $file, $lowercase =
561561
* @param \DOMNode $node
562562
* @param mixed $name
563563
*
564-
* @return array
564+
* @return \DOMElement[]
565565
*/
566566
private function getChildren(\DOMNode $node, $name)
567567
{

src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services6.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,9 @@
6161
</service>
6262
<service id="alias_for_foo" alias="foo" />
6363
<service id="another_alias_for_foo" alias="foo" public="false" />
64+
<service id="0" class="FooClass" />
65+
<service id="1" class="FooClass">
66+
<argument type="service" id="0" />
67+
</service>
6468
</services>
6569
</container>

src/Symfony/Component/HttpFoundation/File/MimeType/MimeTypeExtensionGuesser.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
2020
* A map of mime types and their default extensions.
2121
*
2222
* This list has been placed under the public domain by the Apache HTTPD project.
23-
* This list has been updated from upstream on 2013-04-23.
23+
* This list has been updated from upstream on 2019-01-14.
2424
*
25-
* @see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
25+
* @see https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
2626
*/
27-
protected $defaultExtensions = array(
27+
protected $defaultExtensions = [
2828
'application/andrew-inset' => 'ez',
2929
'application/applixware' => 'aw',
3030
'application/atom+xml' => 'atom',
@@ -618,7 +618,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
618618
'audio/adpcm' => 'adp',
619619
'audio/basic' => 'au',
620620
'audio/midi' => 'mid',
621-
'audio/mp4' => 'mp4a',
621+
'audio/mp4' => 'm4a',
622622
'audio/mpeg' => 'mpga',
623623
'audio/ogg' => 'oga',
624624
'audio/s3m' => 's3m',
@@ -653,6 +653,11 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
653653
'chemical/x-cml' => 'cml',
654654
'chemical/x-csml' => 'csml',
655655
'chemical/x-xyz' => 'xyz',
656+
'font/collection' => 'ttc',
657+
'font/otf' => 'otf',
658+
'font/ttf' => 'ttf',
659+
'font/woff' => 'woff',
660+
'font/woff2' => 'woff2',
656661
'image/bmp' => 'bmp',
657662
'image/x-ms-bmp' => 'bmp',
658663
'image/cgm' => 'cgm',
@@ -669,8 +674,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
669674
'image/tiff' => 'tiff',
670675
'image/vnd.adobe.photoshop' => 'psd',
671676
'image/vnd.dece.graphic' => 'uvi',
672-
'image/vnd.dvb.subtitle' => 'sub',
673677
'image/vnd.djvu' => 'djvu',
678+
'image/vnd.dvb.subtitle' => 'sub',
674679
'image/vnd.dwg' => 'dwg',
675680
'image/vnd.dxf' => 'dxf',
676681
'image/vnd.fastbidsheet' => 'fbs',
@@ -732,8 +737,8 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
732737
'text/vcard' => 'vcard',
733738
'text/vnd.curl' => 'curl 28BE ',
734739
'text/vnd.curl.dcurl' => 'dcurl',
735-
'text/vnd.curl.scurl' => 'scurl',
736740
'text/vnd.curl.mcurl' => 'mcurl',
741+
'text/vnd.curl.scurl' => 'scurl',
737742
'text/vnd.dvb.subtitle' => 'sub',
738743
'text/vnd.fly' => 'fly',
739744
'text/vnd.fmi.flexstor' => 'flx',
@@ -747,10 +752,10 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
747752
'text/x-asm' => 's',
748753
'text/x-c' => 'c',
749754
'text/x-fortran' => 'f',
750-
'text/x-pascal' => 'p',
751755
'text/x-java-source' => 'java',
752-
'text/x-opml' => 'opml',
753756
'text/x-nfo' => 'nfo',
757+
'text/x-opml' => 'opml',
758+
'text/x-pascal' => 'p',
754759
'text/x-setext' => 'etx',
755760
'text/x-sfv' => 'sfv',
756761
'text/x-uuencode' => 'uu',
@@ -796,7 +801,7 @@ class MimeTypeExtensionGuesser implements ExtensionGuesserInterface
796801
'video/x-sgi-movie' => 'movie',
797802
'video/x-smv' => 'smv',
798803
'x-conference/x-cooltalk' => 'ice',
799-
);
804+
];
800805

801806
/**
802807
* {@inheritdoc}

0 commit comments

Comments
 (0)
0