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 Media; |
||
4 | |||
5 | use Silex\Application; |
||
6 | use Silex\ServiceProviderInterface; |
||
7 | use Media\Exception\InvalidConfigurationException; |
||
8 | |||
9 | class MediaServiceProvider implements ServiceProviderInterface |
||
10 | { |
||
11 | |||
12 | public function boot(Application $app) |
||
13 | { |
||
14 | |||
15 | } |
||
16 | |||
17 | public function register(Application $app) |
||
18 | { |
||
19 | |||
20 | // if (!$app->offsetExists('upload.path')) { |
||
0 ignored issues
–
show
|
|||
21 | // throw new InvalidConfigurationException; |
||
22 | // } |
||
23 | |||
24 | if ($app->offsetExists('form.factory')) { |
||
25 | $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
||
26 | $types[] = new Form\Type\MediaType($app); |
||
27 | return $types; |
||
28 | })); |
||
29 | } |
||
30 | |||
31 | if ($app->offsetExists('twig')) { |
||
32 | $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig) use ($app) { |
||
33 | $twig->addExtension(new Twig\MediaExtension($app)); |
||
34 | return $twig; |
||
35 | })); |
||
36 | |||
37 | $app['twig.path'] = array_merge($app['twig.path'], array( |
||
38 | __DIR__ . DIRECTORY_SEPARATOR . 'Resources' . DIRECTORY_SEPARATOR . 'views' |
||
39 | )); |
||
40 | |||
41 | $app['twig.form.templates'] = array_merge($app['twig.form.templates'], array("media.type.html.twig")); |
||
42 | } |
||
43 | } |
||
44 | |||
45 | } |
||
46 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.