Completed
Push — master ( 8fe45b...3e4cf7 )
by Jeroen
08:37
created

MediaBundle/Helper/File/SVGExtensionGuesser.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\MediaBundle\Helper\File;
4
5
use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesserInterface;
6
7
@trigger_error(sprintf('The "%s" class is deprecated since KunstmaanMediaBundle 5.7 and will be removed in KunstmaanMediaBundle 6.0. Use the "symfony/mime" component instead.', __CLASS__), E_USER_DEPRECATED);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition here. This can introduce security issues, and is generally not recommended.

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
8
9
/**
10
 * @deprecated This class is deprecated since KunstmaanMediaBundle 5.7 and will be removed in KunstmaanMediaBundle 6.0. Use the "symfony/mime" component instead.
11
 */
12
class SVGExtensionGuesser implements ExtensionGuesserInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function guess($mimeType)
18
    {
19
        if ($mimeType === 'image/svg+xml') {
20
            return 'svg';
21
        }
22
23
        return null;
24
    }
25
}
26