@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | return preg_replace_callback( |
22 | 22 | '/\{\{\s*(var|uri|get|post|header|cookie|method)(?:\.([a-z0-9-_]+))?\s*\}\}/i', |
23 | - function ($matches) use ($transactiondata) { |
|
23 | + function($matches) use ($transactiondata) { |
|
24 | 24 | return $this->getValueFromPlaceholder( |
25 | 25 | $matches[1], |
26 | 26 | isset($matches[2]) ? $matches[2] : null, |
@@ -9,6 +9,6 @@ |
||
9 | 9 | public function getValue(ServerRequestInterface $request) |
10 | 10 | { |
11 | 11 | $array = $request->getQueryParams(); |
12 | - return isset($array[$this->argument])? $array[$this->argument] : null; |
|
12 | + return isset($array[$this->argument]) ? $array[$this->argument] : null; |
|
13 | 13 | } |
14 | 14 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @param string $routeName |
71 | - * @param \PowerRoute\Common\TransactionData $transactionData |
|
71 | + * @param TransactionData $transactionData |
|
72 | 72 | */ |
73 | 73 | public function execute($routeName, TransactionData $transactionData) |
74 | 74 | { |
@@ -87,6 +87,9 @@ discard block |
||
87 | 87 | } |
88 | 88 | } |
89 | 89 | |
90 | + /** |
|
91 | + * @param ServerRequestInterface $request |
|
92 | + */ |
|
90 | 93 | private function evaluateConditions($route, $request) |
91 | 94 | { |
92 | 95 | if (!$route[ConfigOptions::CONFIG_NODE_CONDITION]) { |
@@ -108,6 +111,9 @@ discard block |
||
108 | 111 | throw new \RuntimeException('Invalid exception'); |
109 | 112 | } |
110 | 113 | |
114 | + /** |
|
115 | + * @param string $matcher |
|
116 | + */ |
|
111 | 117 | private function getConditionsMatcher($matcher) |
112 | 118 | { |
113 | 119 | if (!isset($this->conditionMatchers[$matcher])) { |
@@ -3,8 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Psr\Http\Message\ResponseInterface; |
5 | 5 | use Psr\Http\Message\ServerRequestInterface; |
6 | -use Mcustiel\PowerRoute\Common\Factories\MatcherFactory; |
|
7 | -use Mcustiel\PowerRoute\Common\Factories\InputSourceFactory; |
|
8 | 6 | use Mcustiel\PowerRoute\Common\Factories\ActionFactory; |
9 | 7 | use Mcustiel\PowerRoute\Common\TransactionData; |
10 | 8 | use JMS\Serializer\Exception\RuntimeException; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | foreach ($conditions as $condition) { |
17 | 17 | $inputSource = $this->getInputSource($condition); |
18 | 18 | $matcher = $this->getMatcher($condition); |
19 | - if (! $matcher->match($inputSource->getValue($request))) { |
|
19 | + if (!$matcher->match($inputSource->getValue($request))) { |
|
20 | 20 | return false; |
21 | 21 | } |
22 | 22 | } |
@@ -9,6 +9,6 @@ |
||
9 | 9 | public function getValue(ServerRequestInterface $request) |
10 | 10 | { |
11 | 11 | $array = $request->getQueryParams(); |
12 | - return isset($array[$this->argument])? $array[$this->argument] : null; |
|
12 | + return isset($array[$this->argument]) ? $array[$this->argument] : null; |
|
13 | 13 | } |
14 | 14 | } |