| Conditions | 15 |
| Paths | 16384 |
| Total Lines | 35 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 19 | public function handle($request, Closure $next) |
||
|
1 ignored issue
–
show
|
|||
| 20 | { |
||
| 21 | // fire up symfony |
||
| 22 | if (! defined('SF_APP')) { |
||
| 23 | define('SF_APP', 'frontend'); |
||
| 24 | define('SF_ENVIRONMENT', env('SF_ENVIRONMENT', 'prod')); |
||
| 25 | define('SF_DEBUG', env('SF_DEBUG', 'false')); |
||
| 26 | } |
||
| 27 | if (! defined('SF_ROOT_DIR')) { |
||
| 28 | define('SF_ROOT_DIR', env('SF_ROOT_DIR')); |
||
| 29 | } |
||
| 30 | |||
| 31 | $_SERVER['HTTP_HOST'] = (empty($_SERVER['HTTP_HOST'])) ? $request->getHost() : $_SERVER['HTTP_HOST']; |
||
| 32 | $_SERVER['SERVER_NAME'] = (empty($_SERVER['SERVER_NAME'])) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']; |
||
| 33 | $_SERVER['SERVER_PORT'] = (empty($_SERVER['SERVER_PORT'])) ? 80 : $_SERVER['SERVER_PORT']; |
||
| 34 | $_SERVER['HTTP_USER_AGENT'] = (empty($_SERVER['HTTP_USER_AGENT'])) ? 'PHP5/CLI' : $_SERVER['HTTP_USER_AGENT']; |
||
| 35 | $_SERVER['REMOTE_ADDR'] = (empty($_SERVER['REMOTE_ADDR'])) ? '127.0.0.1' : $_SERVER['REMOTE_ADDR']; |
||
| 36 | $_SERVER['REQUEST_METHOD'] = (empty($_SERVER['REQUEST_METHOD'])) ? strtoupper($request->getMethod()) : $_SERVER['REQUEST_METHOD']; |
||
| 37 | $_SERVER['PATH_INFO'] = (empty($_SERVER['PATH_INFO'])) ? $request->getPathInfo() : $_SERVER['PATH_INFO']; |
||
| 38 | $_SERVER['REQUEST_URI'] = (empty($_SERVER['REQUEST_URI'])) ? $request->getUri() : $_SERVER['REQUEST_URI']; |
||
| 39 | $_SERVER['SCRIPT_NAME'] = (empty($_SERVER['SCRIPT_NAME'])) ? '/index.php' : $_SERVER['SCRIPT_NAME']; |
||
| 40 | $_SERVER['SCRIPT_FILENAME'] = (empty($_SERVER['SCRIPT_FILENAME'])) ? '/index.php' : $_SERVER['SCRIPT_FILENAME']; |
||
| 41 | $_SERVER['QUERY_STRING'] = (empty($_SERVER['QUERY_STRING'])) ? $request->getQueryString() : $_SERVER['QUERY_STRING']; |
||
| 42 | require_once SF_ROOT_DIR . DIRECTORY_SEPARATOR . 'apps' . DIRECTORY_SEPARATOR . SF_APP . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'config.php'; |
||
| 43 | //let symfony handle/render the request |
||
| 44 | |||
| 45 | /** @var \sfWebResponse $symfonyResponse */ |
||
| 46 | $symfonyResponse = sfContext::getInstance()->getController()->dispatch(); |
||
| 47 | //throw away the symfony rendered buffer |
||
| 48 | while (ob_get_level()) { |
||
| 49 | ob_end_clean(); |
||
| 50 | } |
||
| 51 | |||
| 52 | //make a new laravel response object and assign the content generated from symfony |
||
| 53 | return new Response($symfonyResponse->getContent()); |
||
| 54 | } |
||
| 56 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths