Passed
Push — master ( 3c3ffa...a17b3d )
by Stéphane
03:03
created

libs/Server/ExtensionMimeTypeGuesser.php (1 issue)

1
<?php namespace Todaymade\Daux\Server;
2
3
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface;
4
5
/**
6
 * Guesses the mime type using the file's extension
7
 */
8
class ExtensionMimeTypeGuesser implements MimeTypeGuesserInterface
0 ignored issues
show
Deprecated Code introduced by Stéphane Goetz
The interface Symfony\Component\HttpFo...imeTypeGuesserInterface has been deprecated: since Symfony 4.3, use {@link MimeTypesInterface} instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

8
class ExtensionMimeTypeGuesser implements /** @scrutinizer ignore-deprecated */ MimeTypeGuesserInterface

This interface has been deprecated. The supplier of the interface has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the interface will be removed and what other interface to use instead.

Loading history...
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function guess($path)
14
    {
15
        $extension = pathinfo($path,PATHINFO_EXTENSION);
16
17
        if ($extension == "css") {
18
            return "text/css";
19
        }
20
21
        if ($extension == "js") {
22
            return "application/javascript";
23
        }
24
    }
25
}
26