Passed
Push — master ( c86ace...13d1a4 )
by Akmal
01:06
created

BarController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 3
1
<?php declare(strict_types=1);
2
3
namespace OpenEngine\Mika\Core\Components\Route\Tests\Dummy\Bar\Controllers;
4
5
use OpenEngine\Mika\Core\Components\Http\Message\Response\Response;
6
use Psr\Http\Message\RequestInterface;
7
use Psr\Http\Message\StreamFactoryInterface;
8
9
class BarController
10
{
11
    /**
12
     * BarController constructor.
13
     * @param StreamFactoryInterface $streamFactory
14
     */
15
    public function __construct(StreamFactoryInterface $streamFactory)
16
    {
17
        // do nothing
18
    }
19
20
    /**
21
     * @param RequestInterface $request
22
     * @return Response
23
     */
24
    public function defaultAction(RequestInterface $request): Response
25
    {
26
        return new Response('called method is: ' . $request->getMethod());
27
    }
28
29
    /**
30
     * @param RequestInterface $request
31
     * @param string $name
32
     * @param $type
33
     * @param int $age
34
     * @return Response
35
     */
36
    public function frameworkNameAction(RequestInterface $request, string $name, $type, int $age): Response
37
    {
38
        return new Response(
39
            'method: ' . $request->getMethod() . '; ' .
40
            'name: ' . $name . '; ' .
41
            'type: ' . $type . '; ' .
42
            'age: ' . $age
43
        );
44
    }
45
46
}
47