CaptchaController::getCaptcha()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Shetabit\Captcha\Drivers\Simple\Controllers;
4
5
use App\Http\Controllers\Controller;
0 ignored issues
show
Bug introduced by
The type App\Http\Controllers\Controller was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Shetabit\Captcha\CaptchaManager;
7
8
/**
9
 * Class CaptchaController
10
 *
11
 */
12
class CaptchaController extends Controller
13
{
14
    /**
15
     * Get captcha image
16
     *
17
     * @return mixed
18
     */
19
    public function getCaptcha()
20
    {
21
        return response(
22
            app('shetabit-captcha')->prepareDriver()->prepareCaptchaImage(),
0 ignored issues
show
Bug introduced by
The method prepareDriver() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

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

22
            app('shetabit-captcha')->/** @scrutinizer ignore-call */ prepareDriver()->prepareCaptchaImage(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
            200,
24
            ['content-type' => 'image/png']
25
        );
26
    }
27
}
28