Passed
Pull Request — master (#9)
by Pavel
11:27
created

AttributesHelper::getAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
ccs 6
cts 6
cp 1
rs 9.6666
cc 1
eloc 6
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Routing;
4
5
final class AttributesHelper
6
{
7
    /**
8
     * Return default attributes for route
9
     *
10
     * @param Route  $method
11
     * @param string $name
12
     *
13
     * @return array
14
     */
15 1
    public static function getAttributes(Route $method, $name)
16
    {
17
        return [
18 1
            '_route'                => $name,
19 1
            '_controller'           => $method->getController(),
20 1
            '_with_default_context' => $method->includeDefaultContext(),
21 1
            '_context'              => $method->getContext(),
22 1
        ];
23
    }
24
}
25