Completed
Push — master ( 8acb1b...c6ccb9 )
by Derek Stephen
08:12
created

IndexController::learn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Bone\App\Controller;
4
5
use Bone\Controller\Controller;
6
use Laminas\Diactoros\Response\HtmlResponse;
7
use Psr\Http\Message\ResponseInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * Class IndexController
12
 * If you need to create a constructor, edit the package class to set it  up automatically via dependency injection
13
 * @package App\Controller
14
 *
15
 * The below annotations are for use with delboy1978uk/bone-open-api, youy can remove them if you wont be using it
16
 * @OA\Info(
17
 *     version="1.0.0",
18
 *     title="Bone Framework API",
19
 *     description="This be a swashbucklin' API."
20
 * )
21
 * @OA\ExternalDocumentation(
22
 *     description="By delboy1978uk",
23
 *     url="https://github.com/delboy1978uk/boneframework"
24
 * )
25
 * @OA\SecurityScheme(
26
 *     type="oauth2",
27
 *     name="bone-oauth2",
28
 *     securityScheme="bone-oauth2",
29
 *     @OA\Flow(
30
 *         flow="authorizationCode",
31
 *         authorizationUrl="https://awesome.scot/oauth2/authorize",
32
 *         scopes={
33
 *             "basic": "Access public API data",
34
 *             "register-client": "Create and rewgistger clients",
35
 *         }
36
 *     )
37
 * )
38
 * @OA\SecurityScheme(
39
 *     type="apiKey",
40
 *     in="header",
41
 *     securityScheme="api_key",
42
 *     name="api_key"
43
 * )
44
 */
45
class IndexController extends Controller
46
{
47
    /**
48
     * @param ServerRequestInterface $request
49
     * @param array $args
0 ignored issues
show
Bug introduced by
There is no parameter named $args. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
50
     * @return ResponseInterface
51
     */
52 1
    public function index(ServerRequestInterface $request) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
    {
54 1
        $body = $this->view->render('app::index');
55
56 1
        return new HtmlResponse($body);
57
    }
58
59
    /**
60
     * @param ServerRequestInterface $request
61
     * @param array $args
0 ignored issues
show
Bug introduced by
There is no parameter named $args. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
62
     * @return ResponseInterface
63
     */
64 1
    public function learn(ServerRequestInterface $request) : ResponseInterface
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
65
    {
66 1
        $body = $this->view->render('app::learn');
67
68 1
        return new HtmlResponse($body);
69
    }
70
}
71