@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public function generate($actionId) { |
23 | 23 | $time = time(); |
24 | - return $this->hash($actionId, $time) . self::SEPARATOR . $time; |
|
24 | + return $this->hash($actionId, $time).self::SEPARATOR.$time; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function isValid($token, $actionId) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | private function hash($actionId, $time) { |
33 | - return md5($this->secret . $actionId . $time); |
|
33 | + return md5($this->secret.$actionId.$time); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function setTimeout($sec) { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | if ($actionField instanceof WebField) { |
43 | 43 | return $actionField; |
44 | 44 | } |
45 | - throw new \Exception(get_class($actionField) . " must implement WebField"); |
|
45 | + throw new \Exception(get_class($actionField)." must implement WebField"); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | private function readParameters(ParameterReader $reader, FieldRegistry $fields, Action $action) { |
@@ -50,7 +50,7 @@ |
||
50 | 50 | } else if ($value instanceof UploadedFile) { |
51 | 51 | return [ |
52 | 52 | 'name' => $value->getClientOriginalName(), |
53 | - 'tmp_name' => $value->getPath() . DIRECTORY_SEPARATOR . $value->getFilename(), |
|
53 | + 'tmp_name' => $value->getPath().DIRECTORY_SEPARATOR.$value->getFilename(), |
|
54 | 54 | 'error' => $value->getError(), |
55 | 55 | 'size' => $value->getSize(), |
56 | 56 | 'type' => $value->getType() |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | return |
45 | - "<{$this->name}$attributes>" . |
|
46 | - $this->makeChildren() . |
|
45 | + "<{$this->name}$attributes>". |
|
46 | + $this->makeChildren(). |
|
47 | 47 | "</{$this->name}>"; |
48 | 48 | } |
49 | 49 | |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | private function makeAttributes() { |
55 | 55 | $attributes = []; |
56 | 56 | foreach ($this->attributes as $key => $value) { |
57 | - $attributes[] = $key . '="' . htmlentities($value) . '"'; |
|
57 | + $attributes[] = $key.'="'.htmlentities($value).'"'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | if (empty($attributes)) { |
61 | 61 | return ''; |
62 | 62 | } |
63 | 63 | |
64 | - return ' ' . implode(' ', $attributes); |
|
64 | + return ' '.implode(' ', $attributes); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | private function makeChildren() { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } else if (count($children) == 1 && strpos($children[0], "\n") === false) { |
76 | 76 | return $children[0]; |
77 | 77 | } else { |
78 | - return "\n" . implode("\n", $children) . "\n"; |
|
78 | + return "\n".implode("\n", $children)."\n"; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
82 | 82 | \ No newline at end of file |
@@ -72,7 +72,7 @@ |
||
72 | 72 | 'output' => null |
73 | 73 | ]; |
74 | 74 | |
75 | - call_user_func([$this, 'handle' . (new \ReflectionClass($result))->getShortName()], $result); |
|
75 | + call_user_func([$this, 'handle'.(new \ReflectionClass($result))->getShortName()], $result); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | protected function handleFailedResult(FailedResult $result) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | if ($serialized[0] == self::EMPTY_LIST_VALUE) { |
45 | 45 | $serialized = array_values(array_slice($serialized, 1)); |
46 | 46 | } |
47 | - $serialized = array_map(function ($item) use ($itemParameter) { |
|
47 | + $serialized = array_map(function($item) use ($itemParameter) { |
|
48 | 48 | return $this->fields->getField($itemParameter)->inflate($itemParameter, $item); |
49 | 49 | }, $serialized); |
50 | 50 | return $serialized; |
@@ -68,19 +68,19 @@ discard block |
||
68 | 68 | $items = [ |
69 | 69 | new Element('input', [ |
70 | 70 | 'type' => 'hidden', |
71 | - 'name' => $parameter->getName() . '[0]', |
|
71 | + 'name' => $parameter->getName().'[0]', |
|
72 | 72 | 'value' => self::EMPTY_LIST_VALUE |
73 | 73 | ]) |
74 | 74 | ]; |
75 | 75 | |
76 | 76 | $index = 1; |
77 | 77 | foreach ($value as $item) { |
78 | - $items[] = $this->makeInputGroup($innerField, $this->makeInnerParameter($parameter, '[' . $index++ . ']'), $id, $item); |
|
78 | + $items[] = $this->makeInputGroup($innerField, $this->makeInnerParameter($parameter, '['.$index++.']'), $id, $item); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | $newItems = []; |
82 | 82 | for ($i = 0; $i < $this->numberOfNewItems(); $i++) { |
83 | - $newItems[] = $this->makeInputGroup($innerField, $this->makeInnerParameter($parameter, '[' . $index++ . ']'), $id); |
|
83 | + $newItems[] = $this->makeInputGroup($innerField, $this->makeInnerParameter($parameter, '['.$index++.']'), $id); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return (string)new Element('div', [], [ |
@@ -161,6 +161,6 @@ discard block |
||
161 | 161 | private function makeInnerParameter(Parameter $parameter, $suffix = '') { |
162 | 162 | /** @var ArrayType $type */ |
163 | 163 | $type = $parameter->getType(); |
164 | - return new Parameter($parameter->getName() . $suffix, $type->getItemType()); |
|
164 | + return new Parameter($parameter->getName().$suffix, $type->getItemType()); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | \ No newline at end of file |
@@ -18,21 +18,21 @@ |
||
18 | 18 | 'class' => 'form-control', |
19 | 19 | 'type' => 'number', |
20 | 20 | 'size' => 3, |
21 | - 'name' => $parameter->getName() . '[d]', |
|
21 | + 'name' => $parameter->getName().'[d]', |
|
22 | 22 | 'value' => $value ? $value->d : null]), |
23 | 23 | new Element('span', [], ['days']), |
24 | 24 | new Element('input', [ |
25 | 25 | 'class' => 'form-control', |
26 | 26 | 'type' => 'number', |
27 | 27 | 'size' => 3, |
28 | - 'name' => $parameter->getName() . '[h]', |
|
28 | + 'name' => $parameter->getName().'[h]', |
|
29 | 29 | 'value' => $value ? $value->h : null]), |
30 | 30 | new Element('span', [], ['hours']), |
31 | 31 | new Element('input', [ |
32 | 32 | 'class' => 'form-control', |
33 | 33 | 'type' => 'number', |
34 | 34 | 'size' => 3, |
35 | - 'name' => $parameter->getName() . '[i]', |
|
35 | + 'name' => $parameter->getName().'[i]', |
|
36 | 36 | 'value' => $value ? $value->i : null]), |
37 | 37 | new Element('span', [], ['minutes']), |
38 | 38 | ]); |
@@ -34,7 +34,7 @@ |
||
34 | 34 | * @return mixed |
35 | 35 | */ |
36 | 36 | public function inflate(Parameter $parameter, $serialized) { |
37 | - $param = new Parameter($parameter->getName() . '-value', $this->getOptionType($parameter)); |
|
37 | + $param = new Parameter($parameter->getName().'-value', $this->getOptionType($parameter)); |
|
38 | 38 | return $this->fields->getField($param)->inflate($param, $serialized); |
39 | 39 | } |
40 | 40 |
@@ -64,9 +64,9 @@ |
||
64 | 64 | private function renderOptions(Parameter $parameter, $value, $id) { |
65 | 65 | $fields = []; |
66 | 66 | foreach ($this->getTypes($parameter) as $i => $type) { |
67 | - $optionParameter = new Parameter($parameter->getName() . "[multi-$i]", $type); |
|
67 | + $optionParameter = new Parameter($parameter->getName()."[multi-$i]", $type); |
|
68 | 68 | $selected = is_null($value) && $i == 0 || $type->is($value); |
69 | - $fields[] = new Element('div', ['class' => 'multi-control' . ($selected ? '' : ' not-selected'), 'id' => "$id-multi-option-$i"], [ |
|
69 | + $fields[] = new Element('div', ['class' => 'multi-control'.($selected ? '' : ' not-selected'), 'id' => "$id-multi-option-$i"], [ |
|
70 | 70 | $this->getField($optionParameter)->render($optionParameter, $type->is($value) ? $value : null) |
71 | 71 | ]); |
72 | 72 | } |