Completed
Push — master ( a96253...c20805 )
by Nikolas
02:38
created
src/delivery/web/Url.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -148,16 +148,16 @@
 block discarded – undo
148 148
     public function __toString() {
149 149
         $queries = array();
150 150
         foreach ($this->flattenParams($this->parameters) as $key => $value) {
151
-            $queries[] = $key . '=' . urlencode($value);
151
+            $queries[] = $key.'='.urlencode($value);
152 152
         }
153
-        $port = $this->port ? self::PORT_SEPARATOR . $this->port : '';
154
-        $scheme = $this->scheme ? $this->scheme . self::SCHEME_SEPARATOR : '';
155
-        $server = $this->host ? $scheme . self::HOST_PREFIX . $this->host . $port : '';
153
+        $port = $this->port ? self::PORT_SEPARATOR.$this->port : '';
154
+        $scheme = $this->scheme ? $this->scheme.self::SCHEME_SEPARATOR : '';
155
+        $server = $this->host ? $scheme.self::HOST_PREFIX.$this->host.$port : '';
156 156
         return
157 157
             $server
158 158
             . implode('/', $this->path)
159
-            . ($queries ? self::QUERY_STRING_SEPARATOR . implode('&', $queries) : '')
160
-            . ($this->fragment ? self::FRAGMENT_SEPARATOR . $this->fragment : '');
159
+            . ($queries ? self::QUERY_STRING_SEPARATOR.implode('&', $queries) : '')
160
+            . ($this->fragment ? self::FRAGMENT_SEPARATOR.$this->fragment : '');
161 161
     }
162 162
 
163 163
     private function flattenParams($parameters, $i = 0) {
Please login to merge, or discard this patch.
src/delivery/web/home/ActionListRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
 
83 83
             if ($action->getDescription()) {
84 84
                 $caption[] = new Element('small', [], [
85
-                    '- ' . $this->parser->shorten($action->getDescription())
85
+                    '- '.$this->parser->shorten($action->getDescription())
86 86
                 ]);
87 87
             }
88 88
 
Please login to merge, or discard this patch.
src/delivery/web/ExecutionToken.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/delivery/web/ActionForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/delivery/web/adapters/silex/SilexParameterReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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()
Please login to merge, or discard this patch.
src/delivery/web/Element.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/delivery/web/ActionResult.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
src/delivery/web/fields/ArrayField.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/delivery/web/fields/ImageField.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function render(Parameter $parameter, $value) {
88 88
         return
89
-            $this->renderImagePreservation($parameter, $value ? $value->getFile() : null) .
89
+            $this->renderImagePreservation($parameter, $value ? $value->getFile() : null).
90 90
             new Element('div', ['class' => 'image-cropper'], [
91 91
                 new Element('label', [], [
92 92
                     new Element('span', ['class' => 'btn btn-success'], ['Choose Image']),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 new Element("input", [
107 107
                     'type' => 'hidden',
108 108
                     'class' => "image-data",
109
-                    'name' => $parameter->getName() . '[encoded]'
109
+                    'name' => $parameter->getName().'[encoded]'
110 110
                 ]),
111 111
 
112 112
                 new Element('div', ['class' => 'image-container', 'style' => 'display: none;'], [
@@ -150,20 +150,20 @@  discard block
 block discarded – undo
150 150
     }
151 151
 
152 152
     private function renderAspectRatioButtons() {
153
-        return array_map(function ($ratio) {
153
+        return array_map(function($ratio) {
154 154
             list($nom, $den) = $ratio;
155 155
             return $this->renderButton("$nom:$den", "Fix aspect ratio to $nom:$den", "$(this).setOption('setAspectRatio', $nom/$den)");
156 156
         }, $this->getAspectRatios());
157 157
     }
158 158
 
159 159
     private function renderRotationButtons() {
160
-        return array_map(function ($angle) {
160
+        return array_map(function($angle) {
161 161
             return $this->renderButton("$angle&deg;", "Rotate by $angle degree", "$(this).setOption('rotate', $angle)");
162 162
         }, $this->getRotatingAngles());
163 163
     }
164 164
 
165 165
     protected function renderIconButton($glyphIcon, $title, $onClick) {
166
-        return $this->renderButton(new Element('span', ['class' => 'glyphicon glyphicon-' . $glyphIcon]), $title, $onClick);
166
+        return $this->renderButton(new Element('span', ['class' => 'glyphicon glyphicon-'.$glyphIcon]), $title, $onClick);
167 167
     }
168 168
 
169 169
     protected function renderButton($caption, $title, $onClick) {
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @return array|\rtens\domin\delivery\web\Element[]
180 180
      */
181 181
     public function headElements(Parameter $parameter) {
182
-        $script = file_get_contents(__DIR__ . '/js/ImageField.js');
182
+        $script = file_get_contents(__DIR__.'/js/ImageField.js');
183 183
 
184 184
         $script = str_replace(
185 185
             '$cropperOptions$',
Please login to merge, or discard this patch.