This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of the [code] |
||
5 | * |
||
6 | * Copyright (C) [year] [author] |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Plugin\[code]\ServiceProvider; |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
13 | |||
14 | use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; |
||
15 | use Monolog\Handler\FingersCrossedHandler; |
||
16 | use Monolog\Handler\RotatingFileHandler; |
||
17 | use Monolog\Logger; |
||
18 | use Plugin\[code]\Form\Type\[code]ConfigType; |
||
19 | use Silex\Application as BaseApplication; |
||
20 | use Silex\ServiceProviderInterface; |
||
21 | |||
22 | class [code]ServiceProvider implements ServiceProviderInterface |
||
0 ignored issues
–
show
This class is not in CamelCase format.
Classes in PHP are usually named in CamelCase. In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well. Thus the name database provider becomes
Loading history...
|
|||
23 | { |
||
24 | |||
25 | public function register(BaseApplication $app) |
||
0 ignored issues
–
show
|
|||
26 | { |
||
27 | // プラグイン用設定画面 |
||
28 | $app->match('/'.$app['config']['admin_route'].'/plugin/[code]/config', 'Plugin\[code]\Controller\ConfigController::index')->bind('plugin_[code]_config'); |
||
29 | |||
30 | // 独自コントローラ |
||
31 | $app->match('/plugin/[lower_code]/hello', 'Plugin\[code]\Controller\[code]Controller::index')->bind('plugin_[code]_hello'); |
||
32 | |||
33 | // Form |
||
34 | $app['form.types'] = $app->share($app->extend('form.types', function ($types) use ($app) { |
||
35 | $types[] = new [code]ConfigType(); |
||
0 ignored issues
–
show
|
|||
36 | |||
37 | return $types; |
||
38 | })); |
||
39 | |||
40 | // Repository |
||
41 | |||
42 | // Service |
||
43 | |||
44 | // メッセージ登録 |
||
45 | // $file = __DIR__ . '/../Resource/locale/message.' . $app['locale'] . '.yml'; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
41% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
46 | // $app['translator']->addResource('yaml', $file, $app['locale']); |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
80% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
47 | |||
48 | // load config |
||
49 | // プラグイン独自の定数はconfig.ymlの「const」パラメータに対して定義し、$app['[lower_code]config']['定数名']で利用可能 |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
59% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
50 | // if (isset($app['config']['[code]']['const'])) { |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
85% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
51 | // $config = $app['config']; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
60% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
52 | // $app['[lower_code]config'] = $app->share(function () use ($config) { |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
63% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
53 | // return $config['[code]']['const']; |
||
0 ignored issues
–
show
Unused Code
Comprehensibility
introduced
by
82% of this comment could be valid code. Did you maybe forget this after debugging?
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.
Loading history...
|
|||
54 | // }); |
||
55 | // } |
||
56 | |||
57 | // ログファイル設定 |
||
58 | $app['monolog.logger.[lower_code]'] = $app->share(function ($app) { |
||
59 | |||
60 | $logger = new $app['monolog.logger.class']('[lower_code]'); |
||
0 ignored issues
–
show
|
|||
61 | |||
62 | $filename = $app['config']['root_dir'].'/app/log/[lower_code].log'; |
||
63 | $RotateHandler = new RotatingFileHandler($filename, $app['config']['log']['max_files'], Logger::INFO); |
||
64 | $RotateHandler->setFilenameFormat( |
||
65 | '[lower_code]_{date}', |
||
66 | 'Y-m-d' |
||
67 | ); |
||
68 | |||
69 | $logger->pushHandler( |
||
70 | new FingersCrossedHandler( |
||
71 | $RotateHandler, |
||
72 | new ErrorLevelActivationStrategy(Logger::ERROR), |
||
73 | 0, |
||
74 | true, |
||
75 | true, |
||
76 | Logger::INFO |
||
77 | ) |
||
78 | ); |
||
79 | |||
80 | return $logger; |
||
81 | }); |
||
82 | |||
83 | } |
||
84 | |||
85 | public function boot(BaseApplication $app) |
||
0 ignored issues
–
show
|
|||
86 | { |
||
87 | } |
||
88 | |||
89 | } |
||
90 |