1 | <?php |
||
24 | class ElasticsearchRouteProvider implements RouteProviderInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var array Route map configuration to map Elasticsearch types and Controllers |
||
28 | */ |
||
29 | private $routeMap; |
||
30 | |||
31 | /** |
||
32 | * @var Manager |
||
33 | */ |
||
34 | private $manager; |
||
35 | |||
36 | /** |
||
37 | * ElasticsearchRouteProvider constructor. |
||
38 | * |
||
39 | * @param array $routeMap |
||
40 | */ |
||
41 | public function __construct(array $routeMap = []) |
||
45 | |||
46 | /** |
||
47 | * Returns Elasticsearch manager instance that was set in app/config.yml. |
||
48 | * |
||
49 | * @return Manager |
||
50 | */ |
||
51 | public function getManager() |
||
55 | |||
56 | /** |
||
57 | * @param Manager $manager |
||
58 | */ |
||
59 | public function setManager(Manager $manager) |
||
63 | |||
64 | /** |
||
65 | * @inheritDoc |
||
66 | */ |
||
67 | public function getRouteCollectionForRequest(Request $request) |
||
85 | |||
86 | /** |
||
87 | * @inheritDoc |
||
88 | */ |
||
89 | public function getRouteByName($name) |
||
93 | |||
94 | /** |
||
95 | * @inheritDoc |
||
96 | */ |
||
97 | public function getRoutesByNames($names) |
||
101 | } |
||
102 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.