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

Skip to content

Commit b9b8f9d

Browse files
committed
minor #30001 [FrameworkBundle] consolidate the mime types service definition (xabbuh)
This PR was merged into the 4.3-dev branch. Discussion ---------- [FrameworkBundle] consolidate the mime types service definition | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | I wonder if we couldn't simplify things by just initializing the default `MimeTypes` instance once the first one is going to be created. Commits ------- ce546f5 consolidate the mime types service definition
2 parents 865127b + ce546f5 commit b9b8f9d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/FrameworkBundle.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ public function boot()
7373
if ($trustedHosts = $this->container->getParameter('kernel.trusted_hosts')) {
7474
Request::setTrustedHosts($trustedHosts);
7575
}
76-
77-
if ($this->container->has('mime_types')) {
78-
$mt = $this->container->get('mime_types');
79-
$mt->setDefault($mt);
80-
}
8176
}
8277

8378
public function build(ContainerBuilder $container)

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
<services>
88
<defaults public="false" />
99

10-
<service id="mime_types" class="Symfony\Component\Mime\MimeTypes" public="true" />
10+
<service id="mime_types" class="Symfony\Component\Mime\MimeTypes">
11+
<call method="setDefault">
12+
<argument type="service" id="mime_types" />
13+
</call>
14+
</service>
1115
</services>
1216
</container>

0 commit comments

Comments
 (0)