Completed
Push — master ( 023f78...6a6774 )
by Yaro
11:25 queued 01:52
created
src/Commands/CreateDefinitionArtisanCommand.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -50,6 +50,9 @@
 block discarded – undo
50 50
         echo $showMethod;
51 51
     } // end doGenerateMethods
52 52
     
53
+    /**
54
+     * @param string $uri
55
+     */
53 56
     private function trimAdminPrefix($uri)
54 57
     {
55 58
         $segments = array_filter(explode('/', $uri));
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $methodPostfix = camel_case('show_'. preg_replace('~2~', '_to_', $this->table));
37 37
         $this->info('Routes:');
38 38
         $route = "Route::any('". $this->trimAdminPrefix($this->getRequestUri) 
39
-                  . "', 'TableAdminController@". $methodPostfix ."');";
39
+                    . "', 'TableAdminController@". $methodPostfix ."');";
40 40
         $this->line($route);
41 41
         
42 42
         $this->info('Methods:');
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 use Symfony\Component\Console\Input\InputArgument;
7 7
 
8 8
 
9
-class CreateDefinitionArtisanCommand extends Command 
9
+class CreateDefinitionArtisanCommand extends Command
10 10
 {
11 11
 
12 12
     protected $name = 'jarboe:definition';
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
     public function fire()
22 22
     {
23 23
         $this->table = $this->argument('table');
24
-        $this->stub  = file_get_contents(__DIR__ .'/../../stubs/definition.stub');
24
+        $this->stub  = file_get_contents(__DIR__.'/../../stubs/definition.stub');
25 25
         
26
-        $fields = \DB::select(\DB::raw('SHOW FULL COLUMNS FROM '. $this->table));
26
+        $fields = \DB::select(\DB::raw('SHOW FULL COLUMNS FROM '.$this->table));
27 27
         $this->doFillStub($fields);
28 28
         
29 29
         $this->doSaveStub();
@@ -33,20 +33,20 @@  discard block
 block discarded – undo
33 33
     
34 34
     private function doGenerateMethods()
35 35
     {
36
-        $methodPostfix = camel_case('show_'. preg_replace('~2~', '_to_', $this->table));
36
+        $methodPostfix = camel_case('show_'.preg_replace('~2~', '_to_', $this->table));
37 37
         $this->info('Routes:');
38
-        $route = "Route::any('". $this->trimAdminPrefix($this->getRequestUri) 
39
-                  . "', 'TableAdminController@". $methodPostfix ."');";
38
+        $route = "Route::any('".$this->trimAdminPrefix($this->getRequestUri) 
39
+                  . "', 'TableAdminController@".$methodPostfix."');";
40 40
         $this->line($route);
41 41
         
42 42
         $this->info('Methods:');
43
-        $showMethod = 'public function show'. $methodPostfix .'()'. PHP_EOL;
44
-        $showMethod .= '{' . PHP_EOL;
45
-        $showMethod .= '    $options = array(' . PHP_EOL;
46
-        $showMethod .= "        'def_name' => '". $this->definition ."'," . PHP_EOL;
47
-        $showMethod .= '    );' . PHP_EOL;
48
-        $showMethod .= '    return Jarboe::table($options);' . PHP_EOL . PHP_EOL;
49
-        $showMethod .= '} // end show'. $methodPostfix . PHP_EOL . PHP_EOL;
43
+        $showMethod = 'public function show'.$methodPostfix.'()'.PHP_EOL;
44
+        $showMethod .= '{'.PHP_EOL;
45
+        $showMethod .= '    $options = array('.PHP_EOL;
46
+        $showMethod .= "        'def_name' => '".$this->definition."',".PHP_EOL;
47
+        $showMethod .= '    );'.PHP_EOL;
48
+        $showMethod .= '    return Jarboe::table($options);'.PHP_EOL.PHP_EOL;
49
+        $showMethod .= '} // end show'.$methodPostfix.PHP_EOL.PHP_EOL;
50 50
         echo $showMethod;
51 51
     } // end doGenerateMethods
52 52
     
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                 continue;
100 100
             }
101 101
             
102
-            $this->comment($field['Field'] .':');
102
+            $this->comment($field['Field'].':');
103 103
             if (!$this->confirm('Add field to definition? [y|n]')) {
104 104
                 continue;
105 105
             }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             return $template;
125 125
         }
126 126
         
127
-        $template .= sprintf("        '%s' => array(\n", 'many2many_'. str_random(6));
127
+        $template .= sprintf("        '%s' => array(\n", 'many2many_'.str_random(6));
128 128
         $template .= sprintf("            'caption' => '%s',\n", 'Связи');
129 129
         $template .= "            'type' => 'many_to_many',\n";
130 130
         $template .= $this->getManyToManyFieldType($field);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     
168 168
     private function getFieldCaption($field)
169 169
     {
170
-        $caption = $field['Comment'] ? : $field['Field'];
170
+        $caption = $field['Comment'] ?: $field['Field'];
171 171
         return sprintf("            'caption' => '%s',\n", $caption);
172 172
     } // end getFieldCaption
173 173
     
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             
203 203
             $references = \DB::select(
204 204
                 \DB::raw("select concat(table_name, '.', column_name) as 'fk', concat(referenced_table_name, '.', referenced_column_name) as 'ref' from information_schema.key_column_usage where referenced_table_name is not null HAVING fk = ?"), 
205
-                array($this->table .'.'. $field['Field'])
205
+                array($this->table.'.'.$field['Field'])
206 206
             );
207 207
             
208 208
             // cuz one2many
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $additional .= sprintf("            'foreign_table' => '%s',\n", $foreignTable);
216 216
             $additional .= sprintf("            'foreign_key_field' => '%s',\n", $foreignKey);
217 217
             $additional .= sprintf("            'foreign_value_field' => '%s', //change me\n", $foreignKey);
218
-            $additional .= sprintf("            'alias' => '%s',\n", $this->table . $foreignTable);
218
+            $additional .= sprintf("            'alias' => '%s',\n", $this->table.$foreignTable);
219 219
         } elseif ($field['Field'] == 'datetime') {
220 220
             $type = 'datetime';
221 221
         } elseif ($field['Field'] == 'timestamp') {
@@ -246,13 +246,13 @@  discard block
 block discarded – undo
246 246
     private function doSaveStub()
247 247
     {
248 248
         $postfix = '';
249
-        if (file_exists(base_path() .'/resources/definitions/'. $this->table .'.php')) {
250
-            $postfix = '_'. time();
249
+        if (file_exists(base_path().'/resources/definitions/'.$this->table.'.php')) {
250
+            $postfix = '_'.time();
251 251
         }
252 252
         
253
-        $this->definition = $this->table . $postfix;
253
+        $this->definition = $this->table.$postfix;
254 254
         
255
-        $path = base_path() .'/resources/definitions/'. $this->definition .'.php';
255
+        $path = base_path().'/resources/definitions/'.$this->definition.'.php';
256 256
         file_put_contents($path, $this->stub);
257 257
     } // end doSaveStub
258 258
     
Please login to merge, or discard this patch.
src/Fields/AbstractField.php 3 patches
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -33,6 +33,9 @@  discard block
 block discarded – undo
33 33
     
34 34
     protected function onAssets() {} // end onAssets
35 35
     
36
+    /**
37
+     * @param string $ident
38
+     */
36 39
     public function getDefinitionOption($ident, $default = null)
37 40
     {
38 41
         $value = array_get($this->definition, $ident);
@@ -74,16 +77,25 @@  discard block
 block discarded – undo
74 77
         return $attributes;
75 78
     } // end _prepareAttributes
76 79
 
80
+    /**
81
+     * @param string $ident
82
+     */
77 83
     protected function getOption($ident)
78 84
     {
79 85
         return $this->options[$ident];
80 86
     } // end getOption
81 87
 
88
+    /**
89
+     * @param string $ident
90
+     */
82 91
     public function getAttribute($ident, $default = false)
83 92
     {
84 93
         return array_key_exists($ident, $this->attributes) ? $this->attributes[$ident] : $default;
85 94
     } // end getAttribute
86 95
     
96
+    /**
97
+     * @param string $ident
98
+     */
87 99
     public function getRequiredAttribute($ident)
88 100
     {
89 101
         if (!array_key_exists($ident, $this->attributes)) {
@@ -238,6 +250,9 @@  discard block
 block discarded – undo
238 250
         return $input->render();
239 251
     } // end getFilterInput
240 252
 
253
+    /**
254
+     * @param string $methodName
255
+     */
241 256
     protected function hasCustomHandlerMethod($methodName)
242 257
     {
243 258
         return $this->handler && is_callable(array($this->handler, $methodName));
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 use Illuminate\Support\Facades\Validator;
9 9
 
10 10
 
11
-abstract class AbstractField 
11
+abstract class AbstractField
12 12
 {
13 13
 
14 14
     protected $fieldName;
@@ -31,7 +31,9 @@  discard block
 block discarded – undo
31 31
         $this->onAssets();
32 32
     } // end __construct
33 33
     
34
-    protected function onAssets() {} // end onAssets
34
+    protected function onAssets()
35
+    {
36
+} // end onAssets
35 37
     
36 38
     public function getDefinitionOption($ident, $default = null)
37 39
     {
@@ -358,9 +360,13 @@  discard block
 block discarded – undo
358 360
         return '';
359 361
     } // end getRowColor
360 362
     
361
-    public function afterInsert($id, $values) {} // end afterInsert
363
+    public function afterInsert($id, $values)
364
+    {
365
+} // end afterInsert
362 366
     
363
-    public function afterUpdate($id, $values) {} // end afterUpdate
367
+    public function afterUpdate($id, $values)
368
+    {
369
+} // end afterUpdate
364 370
 
365 371
     abstract public function onSearchFilter(&$db, $value);
366 372
     
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     public function getRequiredAttribute($ident)
88 88
     {
89 89
         if (!array_key_exists($ident, $this->attributes)) {
90
-            throw new \RuntimeException('Field ['. $this->getFieldName() .'] requires ['. $ident .'] attribute');
90
+            throw new \RuntimeException('Field ['.$this->getFieldName().'] requires ['.$ident.'] attribute');
91 91
         }
92 92
         
93 93
         return $this->attributes[$ident];
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
             }
108 108
         }
109 109
         
110
-        $fieldName = $this->getFieldName() . $postfix;
110
+        $fieldName = $this->getFieldName().$postfix;
111 111
         // postfix used for getting values for form - tabs loop
112 112
         // so there is no need to force appending postfix
113 113
         if ($this->getAttribute('tabs') && !$postfix) {
114 114
             $tabs = $this->getAttribute('tabs');
115
-            $fieldName = $fieldName . $tabs[0]['postfix'];
115
+            $fieldName = $fieldName.$tabs[0]['postfix'];
116 116
         }
117 117
         $value = isset($row[$fieldName]) ? $row[$fieldName] : '';
118 118
         
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         $type = $this->getAttribute('type');
160 160
 
161
-        $input = View::make('admin::tb.input.'. $type);
161
+        $input = View::make('admin::tb.input.'.$type);
162 162
         $input->value = $this->getValue($row);
163 163
         $input->name  = $this->getFieldName();
164 164
         $input->rows  = $this->getAttribute('rows');
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         
185 185
         $type = $this->getAttribute('type');
186 186
         
187
-        $input = View::make('admin::tb.input.tab.'. $type);
187
+        $input = View::make('admin::tb.input.tab.'.$type);
188 188
         $input->value = $this->getValue($row);
189 189
         $input->name  = $this->getFieldName();
190 190
         $input->rows  = $this->getAttribute('rows');
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
         $type = $this->getAttribute('filter');
233 233
 
234
-        $input = View::make('admin::tb.filter.'. $type);
234
+        $input = View::make('admin::tb.filter.'.$type);
235 235
         $input->name = $this->getFieldName();
236 236
         $input->value = $filter;
237 237
 
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
         $tabs = $this->getAttribute('tabs');
267 267
         if ($tabs) {
268 268
             foreach ($tabs as $tab) {
269
-                $name = $this->definition['db']['table'] .'.'. $this->getFieldName() . $tab['postfix'];
269
+                $name = $this->definition['db']['table'].'.'.$this->getFieldName().$tab['postfix'];
270 270
                 $db->addSelect($name);
271 271
             }
272 272
         } else {
273
-            $db->addSelect($this->definition['db']['table'] .'.'. $this->getFieldName());
273
+            $db->addSelect($this->definition['db']['table'].'.'.$this->getFieldName());
274 274
         }
275 275
     } // end onSelectValue
276 276
     
Please login to merge, or discard this patch.
src/Fields/ManyToManyField.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -177,6 +177,9 @@
 block discarded – undo
177 177
         return $input->render();
178 178
     } // end getEditInputWithExtra
179 179
     
180
+    /**
181
+     * @param boolean $segmentCount
182
+     */
180 183
     private function doDivideOnParts($array, $segmentCount)
181 184
     {
182 185
         $dataCount = count($array);
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,8 +33,8 @@
 block discarded – undo
33 33
         $values = is_array($values) ? $values : explode(',', $values);
34 34
         
35 35
         DB::table($this->getAttribute('mtm_table'))
36
-          ->where($this->getAttribute('mtm_key_field'), $id)
37
-          ->delete();
36
+            ->where($this->getAttribute('mtm_key_field'), $id)
37
+            ->delete();
38 38
         
39 39
         $data = array();
40 40
         if ($this->getAttribute('show_type') == 'extra') {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 use Jarboe;
8 8
 
9 9
 
10
-class ManyToManyField extends AbstractField 
10
+class ManyToManyField extends AbstractField
11 11
 {
12 12
 
13 13
     protected function onAssets()
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             return $this->getEditInputSelectWithAjaxSearch($row);
120 120
         }
121 121
 
122
-        $input = View::make('admin::tb.input.many2many_'. $showType);
122
+        $input = View::make('admin::tb.input.many2many_'.$showType);
123 123
         $input->selected = array();
124 124
         if ($row) {
125 125
             $input->selected = $this->getRelatedExternalFieldOptions($row);
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
 
194 194
     protected function getRelatedExternalFieldOptions($row, $isGetAll = false)
195 195
     {
196
-        $keyField = $this->getAttribute('mtm_table') .'.'. $this->getAttribute('mtm_external_key_field');
197
-        $valueField = $this->getAttribute('mtm_external_table') .'.'. $this->getAttribute('mtm_external_value_field');
196
+        $keyField = $this->getAttribute('mtm_table').'.'.$this->getAttribute('mtm_external_key_field');
197
+        $valueField = $this->getAttribute('mtm_external_table').'.'.$this->getAttribute('mtm_external_value_field');
198 198
         $externalTable = $this->getAttribute('mtm_external_table');
199
-        $externalForeignKey = $externalTable .'.'. $this->getAttribute('mtm_external_foreign_key_field');
199
+        $externalForeignKey = $externalTable.'.'.$this->getAttribute('mtm_external_foreign_key_field');
200 200
         
201
-        $options = DB::table($this->getAttribute('mtm_table'))->orderBy($externalTable .'.id', 'desc');
201
+        $options = DB::table($this->getAttribute('mtm_table'))->orderBy($externalTable.'.id', 'desc');
202 202
         $options->select($keyField, $valueField);
203 203
         if ($isGetAll) {
204
-            $options->addSelect($this->getAttribute('mtm_table') .'.*');
204
+            $options->addSelect($this->getAttribute('mtm_table').'.*');
205 205
         }
206 206
 
207 207
         $options->join($externalTable, $keyField, '=', $externalForeignKey);
@@ -236,9 +236,9 @@  discard block
 block discarded – undo
236 236
     
237 237
     protected function getAllExternalFieldOptions($isGetAll = false)
238 238
     {
239
-        $valueField = $this->getAttribute('mtm_external_table') .'.'. $this->getAttribute('mtm_external_value_field');
239
+        $valueField = $this->getAttribute('mtm_external_table').'.'.$this->getAttribute('mtm_external_value_field');
240 240
         $externalTable = $this->getAttribute('mtm_external_table');
241
-        $externalForeignKey = $externalTable .'.'. $this->getAttribute('mtm_external_foreign_key_field');
241
+        $externalForeignKey = $externalTable.'.'.$this->getAttribute('mtm_external_foreign_key_field');
242 242
         
243 243
         $options = DB::table($externalTable);
244 244
         if (!$isGetAll) {
@@ -274,13 +274,13 @@  discard block
 block discarded – undo
274 274
     public function getAjaxSearchResult($query, $limit, $page)
275 275
     {
276 276
         // TODO: create handler callback & lambda callback
277
-        $results = DB::table($this->getAttribute('mtm_external_table'))->orderBy($this->getAttribute('mtm_external_table') .'.id', 'desc')
277
+        $results = DB::table($this->getAttribute('mtm_external_table'))->orderBy($this->getAttribute('mtm_external_table').'.id', 'desc')
278 278
                     ->select('id', $this->getAttribute('mtm_external_value_field'))
279
-                    ->where($this->getAttribute('mtm_external_value_field'), 'LIKE', '%'. $query .'%')
279
+                    ->where($this->getAttribute('mtm_external_value_field'), 'LIKE', '%'.$query.'%')
280 280
                     ->take($limit)
281 281
                     ->skip(($limit * $page) - $limit)
282 282
                     ->get();
283
-        $results = $results ? : array();
283
+        $results = $results ?: array();
284 284
         
285 285
         $res = array();
286 286
         foreach ($results as $result) {
Please login to merge, or discard this patch.
src/Handlers/ActionsHandler.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -8,6 +8,9 @@  discard block
 block discarded – undo
8 8
     protected $def;
9 9
     protected $controller;
10 10
 
11
+    /**
12
+     * @param \Yaro\Jarboe\JarboeController $controller
13
+     */
11 14
     public function __construct(array $actionsDefinition, &$controller)
12 15
     {
13 16
         $this->def = $actionsDefinition;
@@ -134,6 +137,9 @@  discard block
 block discarded – undo
134 137
         return $action;
135 138
     } // end onRestoreButton
136 139
     
140
+    /**
141
+     * @param string $type
142
+     */
137 143
     public function isAllowed($type, $buttonDefinition = array())
138 144
     {
139 145
         $def = isset($this->def[$type]) ? $this->def[$type] : false;
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 namespace Yaro\Jarboe\Handlers;
4 4
 
5
-class ActionsHandler 
5
+class ActionsHandler
6 6
 {
7 7
     
8 8
     protected $def;
Please login to merge, or discard this patch.
src/Handlers/ExportHandler.php 3 patches
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -12,6 +12,9 @@  discard block
 block discarded – undo
12 12
     protected $def;
13 13
     protected $controller;
14 14
 
15
+    /**
16
+     * @param \Yaro\Jarboe\JarboeController $controller
17
+     */
15 18
     public function __construct(array $exportDefinition, &$controller)
16 19
     {
17 20
         $this->def = $exportDefinition;
@@ -184,6 +187,9 @@  discard block
 block discarded – undo
184 187
         $xls .= "        </Row>\n";
185 188
     } // end addXlsRow
186 189
     
190
+    /**
191
+     * @param string $xls
192
+     */
187 193
     private function addXlsCell($value, &$xls)
188 194
     {
189 195
         $style = '';
@@ -218,6 +224,9 @@  discard block
 block discarded – undo
218 224
         $xls .= "</Cell>\n";
219 225
     } // end addXlsCell
220 226
     
227
+    /**
228
+     * @param string $xls
229
+     */
221 230
     private function addXlsHeader(&$xls)
222 231
     {
223 232
         $xls .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">";
@@ -237,6 +246,9 @@  discard block
 block discarded – undo
237 246
         $xls .= "</Workbook>";
238 247
     } // end addXlsFooter
239 248
     
249
+    /**
250
+     * @param string $filename
251
+     */
240 252
     private function doSendHeaders($filename)
241 253
     {
242 254
         // disable caching
@@ -255,6 +267,9 @@  discard block
 block discarded – undo
255 267
         header('Content-Transfer-Encoding: binary');
256 268
     } // end doSendHeaders
257 269
     
270
+    /**
271
+     * @param string $ident
272
+     */
258 273
     private function getAttribute($ident, $default = false)
259 274
     {
260 275
         return isset($this->def[$ident]) ? $this->def[$ident] : $default;
Please login to merge, or discard this patch.
Braces   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 use Illuminate\Support\Facades\Input;
7 7
 
8 8
 
9
-class ExportHandler 
9
+class ExportHandler
10 10
 {
11 11
     
12 12
     protected $def;
@@ -206,8 +206,7 @@  discard block
 block discarded – undo
206 206
             $type = 'DateTime';
207 207
             $value = strftime("%Y-%m-%dT%H:%M:%S", $timestamp);
208 208
             $style = 'sDT'; // defined in header; tells excel to format date for display
209
-        }
210
-        else {
209
+        } else {
211 210
             $type = 'String';
212 211
         }
213 212
                 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
         $csvRow = '';
77 77
         foreach ($idents as $ident) {
78 78
             $field = $this->controller->getField($ident);
79
-            $csvRow .= '"'. $field->getAttribute('caption') .'"'. $delimiter;
79
+            $csvRow .= '"'.$field->getAttribute('caption').'"'.$delimiter;
80 80
         }
81 81
         foreach ($additional as $ident => $identCaption) {
82
-            $csvRow .= '"'. $identCaption .'"'. $delimiter;
82
+            $csvRow .= '"'.$identCaption.'"'.$delimiter;
83 83
         }
84 84
         $csvRow = rtrim($csvRow, $delimiter);
85 85
         $csv = $csvRow;
@@ -100,21 +100,21 @@  discard block
 block discarded – undo
100 100
                 if ($rowsHandler) {
101 101
                     $rowsHandler($row['id'], $row, $ident, $value);
102 102
                 }
103
-                $csvRow .= '"'. $value .'"'. $delimiter;
103
+                $csvRow .= '"'.$value.'"'.$delimiter;
104 104
             }
105 105
             foreach ($additional as $ident => $identCaption) {
106 106
                 $value = '';
107 107
                 if ($rowsHandler) {
108 108
                     $rowsHandler($row['id'], $row, $ident, $value);
109 109
                 }
110
-                $csvRow .= '"'. $value .'"'. $delimiter;
110
+                $csvRow .= '"'.$value.'"'.$delimiter;
111 111
             }
112 112
             $csvRow = rtrim($csvRow, $delimiter);
113 113
             $csv .= $csvRow;
114 114
         }
115 115
         
116 116
         $name = $this->getAttribute('filename', 'export');
117
-        $this->doSendHeaders($name .'_'. date("Y-m-d") .'.csv');
117
+        $this->doSendHeaders($name.'_'.date("Y-m-d").'.csv');
118 118
         
119 119
         die($csv);
120 120
     } // end doExportCsv
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
             // XXX:
129 129
             $from = Input::get('d.from', '01/01/1900');
130 130
             $from = strtotime(str_replace('/', '-', $from));
131
-            $from = date('Y-m-d', $from) .' 00:00:00';
131
+            $from = date('Y-m-d', $from).' 00:00:00';
132 132
             // XXX:
133 133
             $to = Input::get('d.$to', '01/01/2199');
134 134
             $to = strtotime(str_replace('/', '-', $to));
135
-            $to = date('Y-m-d', $to) .' 23:59:59';
135
+            $to = date('Y-m-d', $to).' 23:59:59';
136 136
             
137 137
             $between['field'] = $this->getAttribute('date_range_field');
138 138
             $between['values'] = array(
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         }
169 169
         
170 170
         $name = $this->getAttribute('filename', 'export');
171
-        $this->doSendHeaders($name .'_'. date("Y-m-d") .'.xls');
171
+        $this->doSendHeaders($name.'_'.date("Y-m-d").'.xls');
172 172
         
173 173
         $this->addXlsFooter($xls);
174 174
         
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         // Note we want to be very strict in what we consider a date. There is the possibility
200 200
         // of really screwing up the data if we try to reformat a string that was not actually 
201 201
         // intended to represent a date.
202
-        else if(preg_match("/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/", $value) &&
202
+        else if (preg_match("/^(\d{1,2}|\d{4})[\/\-]\d{1,2}[\/\-](\d{1,2}|\d{4})([^\d].+)?$/", $value) &&
203 203
                     ($timestamp = strtotime($value)) &&
204 204
                     ($timestamp > 0) &&
205 205
                     ($timestamp < strtotime('+500 years'))) {
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         $now = gmdate('D, d M Y H:i:s');
244 244
         header('Expires: Tue, 03 Jul 2001 06:00:00 GMT');
245 245
         header('Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate');
246
-        header('Last-Modified: '. $now .' GMT');
246
+        header('Last-Modified: '.$now.' GMT');
247 247
     
248 248
         // force download  
249 249
         header('Content-Type: application/force-download');
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         header('Content-Type: application/download');
252 252
     
253 253
         // disposition / encoding on response body
254
-        header('Content-Disposition: attachment;filename='. $filename);
254
+        header('Content-Disposition: attachment;filename='.$filename);
255 255
         header('Content-Transfer-Encoding: binary');
256 256
     } // end doSendHeaders
257 257
     
Please login to merge, or discard this patch.
src/Handlers/ImportHandler.php 4 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@  discard block
 block discarded – undo
13 13
     protected $def;
14 14
     protected $controller;
15 15
 
16
+    /**
17
+     * @param \Yaro\Jarboe\JarboeController $controller
18
+     */
16 19
     public function __construct(array $importDefinition, &$controller)
17 20
     {
18 21
         $this->def = $importDefinition;
@@ -114,6 +117,9 @@  discard block
 block discarded – undo
114 117
         die($csv);
115 118
     } // end doCsvTemplateDownload
116 119
     
120
+    /**
121
+     * @param string $filename
122
+     */
117 123
     private function doSendHeaders($filename)
118 124
     {
119 125
         // disable caching
@@ -132,6 +138,9 @@  discard block
 block discarded – undo
132 138
         header('Content-Transfer-Encoding: binary');
133 139
     } // end doSendHeaders
134 140
     
141
+    /**
142
+     * @param string $ident
143
+     */
135 144
     private function getAttribute($ident, $default = false)
136 145
     {
137 146
         return isset($this->def[$ident]) ? $this->def[$ident] : $default;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
                     $message = 'Пустые строки недопустимы для csv формата. Строка #'. $n;
67 67
                 } else {
68 68
                     $message = 'Не верное количество полей. Строка #'. $n .': '
69
-                             . count($row) .' из '. count($fields);
69
+                                . count($row) .' из '. count($fields);
70 70
                 }
71 71
                 throw new JarboeValidationException($message);
72 72
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 use DB;
8 8
 
9 9
 
10
-class ImportHandler 
10
+class ImportHandler
11 11
 {
12 12
     
13 13
     protected $def;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
             
64 64
             if (count($row) != count($fields)) {
65 65
                 if (is_null($row[0])) {
66
-                    $message = 'Пустые строки недопустимы для csv формата. Строка #'. $n;
66
+                    $message = 'Пустые строки недопустимы для csv формата. Строка #'.$n;
67 67
                 } else {
68
-                    $message = 'Не верное количество полей. Строка #'. $n .': '
69
-                             . count($row) .' из '. count($fields);
68
+                    $message = 'Не верное количество полей. Строка #'.$n.': '
69
+                             . count($row).' из '.count($fields);
70 70
                 }
71 71
                 throw new JarboeValidationException($message);
72 72
             }
@@ -103,13 +103,13 @@  discard block
 block discarded – undo
103 103
         
104 104
         $csv = '';
105 105
         foreach ($this->def['fields'] as $field => $caption) {
106
-            $csv .= '"'. $caption .'"'. $delimiter;
106
+            $csv .= '"'.$caption.'"'.$delimiter;
107 107
         }
108 108
         // remove extra tailing delimiter
109 109
         $csv = rtrim($csv, $delimiter);
110 110
         
111 111
         $name = $this->getAttribute('filename', 'import_template');
112
-        $this->doSendHeaders($name .'_'. date("Y-m-d") .'.csv');
112
+        $this->doSendHeaders($name.'_'.date("Y-m-d").'.csv');
113 113
         
114 114
         die($csv);
115 115
     } // end doCsvTemplateDownload
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $now = gmdate('D, d M Y H:i:s');
121 121
         header('Expires: Tue, 03 Jul 2001 06:00:00 GMT');
122 122
         header('Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate');
123
-        header('Last-Modified: '. $now .' GMT');
123
+        header('Last-Modified: '.$now.' GMT');
124 124
     
125 125
         // force download  
126 126
         header('Content-Type: application/force-download');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         header('Content-Type: application/download');
129 129
     
130 130
         // disposition / encoding on response body
131
-        header('Content-Disposition: attachment;filename='. $filename);
131
+        header('Content-Disposition: attachment;filename='.$filename);
132 132
         header('Content-Transfer-Encoding: binary');
133 133
     } // end doSendHeaders
134 134
     
Please login to merge, or discard this patch.
src/Handlers/QueryHandler.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -26,11 +26,17 @@
 block discarded – undo
26 26
         $this->dbOptions = $definition['db'];
27 27
     } // end __construct
28 28
 
29
+    /**
30
+     * @param string $ident
31
+     */
29 32
     protected function getOptionDB($ident)
30 33
     {
31 34
         return $this->dbOptions[$ident];
32 35
     } // end getOptionDB
33 36
 
37
+    /**
38
+     * @param string $ident
39
+     */
34 40
     protected function hasOptionDB($ident)
35 41
     {
36 42
         return isset($this->dbOptions[$ident]);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 use Session;
10 10
 
11 11
 
12
-class QueryHandler 
12
+class QueryHandler
13 13
 {
14 14
 
15 15
     protected $controller;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $this->prepareSelectValues();
53 53
         if ($isSelectAll) {
54
-            $this->db->addSelect($this->getOptionDB('table') .'.*');
54
+            $this->db->addSelect($this->getOptionDB('table').'.*');
55 55
         }
56 56
         
57 57
         $this->prepareFilterValues();
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
         $sessionPath = 'table_builder.'.$definitionName.'.order';
65 65
         $order = Session::get($sessionPath, array());
66 66
         if ($order && $isUserFilters) {
67
-            $this->db->orderBy($this->getOptionDB('table') .'.'. $order['field'], $order['direction']);
67
+            $this->db->orderBy($this->getOptionDB('table').'.'.$order['field'], $order['direction']);
68 68
         } else if ($this->hasOptionDB('order')) {
69 69
             $order = $this->getOptionDB('order');
70 70
             foreach ($order as $field => $direction) {
71
-                $this->db->orderBy($this->getOptionDB('table') .'.'. $field, $direction);
71
+                $this->db->orderBy($this->getOptionDB('table').'.'.$field, $direction);
72 72
             }
73 73
         }
74 74
 
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
 
137 137
     protected function prepareSelectValues()
138 138
     {
139
-        $this->db->select($this->getOptionDB('table') .'.id');
139
+        $this->db->select($this->getOptionDB('table').'.id');
140 140
         $def = $this->controller->getDefinition();
141 141
         if (isset($def['options']['is_sortable']) && $def['options']['is_sortable']) {
142 142
             // FIXME: changeable field name
143
-            $this->db->addSelect($this->getOptionDB('table') .'.priority');
143
+            $this->db->addSelect($this->getOptionDB('table').'.priority');
144 144
         }
145 145
         
146 146
         if (isset($def['options']['select_all']) && $def['options']['select_all']) {
147
-            $this->db->addSelect($this->getOptionDB('table') .'.*');
147
+            $this->db->addSelect($this->getOptionDB('table').'.*');
148 148
         }
149 149
 
150 150
         $fields = $this->controller->getFields();
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 $tabs = $field->getAttribute('tabs');
400 400
                 if ($tabs) {
401 401
                     foreach ($tabs as $tab) {
402
-                        $fieldName = $ident . $tab['postfix'];
402
+                        $fieldName = $ident.$tab['postfix'];
403 403
                         $field->doValidate($values[$fieldName]);
404 404
                     }
405 405
                 } else {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             $tabs = $field->getAttribute('tabs');
434 434
             if ($tabs) {
435 435
                 foreach ($tabs as $tab) {
436
-                    $fieldName = $ident . $tab['postfix'];
436
+                    $fieldName = $ident.$tab['postfix'];
437 437
                     $values[$fieldName] = $field->prepareQueryValue($values[$fieldName]);
438 438
                 }
439 439
             } else {
Please login to merge, or discard this patch.
src/helpers.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -76,6 +76,10 @@
 block discarded – undo
76 76
 
77 77
 if (!function_exists('cartesianRecurseIt'))
78 78
 {
79
+    /**
80
+     * @param integer $level
81
+     * @param boolean $isElementsDuplicated
82
+     */
79 83
     function cartesianRecurseIt($arr, $variant, $level, $result, $arrayCount, $isElementsDuplicated)
80 84
     {
81 85
         $level++;
Please login to merge, or discard this patch.
Braces   +22 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,15 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (!function_exists('urlify'))
4
-{
3
+if (!function_exists('urlify')) {
5 4
     function urlify($string)
6 5
     {
7 6
         return Jarboe::urlify($string);
8 7
     } // end urlify
9 8
 }
10 9
 
11
-if (!function_exists('__'))
12
-{
10
+if (!function_exists('__')) {
13 11
     function __()
14 12
     {
15 13
         /*
@@ -52,8 +50,7 @@  discard block
 block discarded – undo
52 50
     } // end __
53 51
 }
54 52
 
55
-if (!function_exists('dr'))
56
-{
53
+if (!function_exists('dr')) {
57 54
     function dr($array)
58 55
     {
59 56
         echo '<pre>';
@@ -62,8 +59,7 @@  discard block
 block discarded – undo
62 59
     } // end dr
63 60
 }
64 61
 
65
-if (!function_exists('cartesian'))
66
-{
62
+if (!function_exists('cartesian')) {
67 63
     function cartesian($arr, $isElementsDuplicated = false)
68 64
     {
69 65
         $variant = array();
@@ -74,8 +70,7 @@  discard block
 block discarded – undo
74 70
     } // end cartesian
75 71
 }
76 72
 
77
-if (!function_exists('cartesianRecurseIt'))
78
-{
73
+if (!function_exists('cartesianRecurseIt')) {
79 74
     function cartesianRecurseIt($arr, $variant, $level, $result, $arrayCount, $isElementsDuplicated)
80 75
     {
81 76
         $level++;
@@ -97,8 +92,7 @@  discard block
 block discarded – undo
97 92
     } // end cartesianRecurseIt
98 93
 }
99 94
 
100
-if (!function_exists('remove_bom'))
101
-{
95
+if (!function_exists('remove_bom')) {
102 96
     function remove_bom($val)
103 97
     {
104 98
         if (substr($val, 0, 3) == pack('CCC', 0xef, 0xbb, 0xbf)) {
@@ -108,8 +102,7 @@  discard block
 block discarded – undo
108 102
     } // end remove_bom
109 103
 }
110 104
 
111
-if (!function_exists('xml2array'))
112
-{
105
+if (!function_exists('xml2array')) {
113 106
     function xml2array(SimpleXMLElement $xml, $options = array())
114 107
     {
115 108
         $defaults = array(
@@ -131,8 +124,10 @@  discard block
 block discarded – undo
131 124
         foreach ($namespaces as $prefix => $namespace) {
132 125
             foreach ($xml->attributes($namespace) as $attributeName => $attribute) {
133 126
                 //replace characters in attribute name
134
-                if ($options['keySearch']) $attributeName =
127
+                if ($options['keySearch']) {
128
+                    $attributeName =
135 129
                         str_replace($options['keySearch'], $options['keyReplace'], $attributeName);
130
+                }
136 131
                 $attributeKey = $options['attributePrefix']
137 132
                         . ($prefix ? $prefix . $options['namespaceSeparator'] : '')
138 133
                         . $attributeName;
@@ -149,10 +144,14 @@  discard block
 block discarded – undo
149 144
                 list($childTagName, $childProperties) = each($childArray);
150 145
      
151 146
                 //replace characters in tag name
152
-                if ($options['keySearch']) $childTagName =
147
+                if ($options['keySearch']) {
148
+                    $childTagName =
153 149
                         str_replace($options['keySearch'], $options['keyReplace'], $childTagName);
150
+                }
154 151
                 //add namespace prefix, if any
155
-                if ($prefix) $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName;
152
+                if ($prefix) {
153
+                    $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName;
154
+                }
156 155
      
157 156
                 if (!isset($tagsArray[$childTagName])) {
158 157
                     //only entry with this key
@@ -176,7 +175,9 @@  discard block
 block discarded – undo
176 175
         //get text content of node
177 176
         $textContentArray = array();
178 177
         $plainText = trim((string)$xml);
179
-        if ($plainText !== '') $textContentArray[$options['textContent']] = $plainText;
178
+        if ($plainText !== '') {
179
+            $textContentArray[$options['textContent']] = $plainText;
180
+        }
180 181
      
181 182
         //stick it all together
182 183
         $propertiesArray = !$options['autoText'] || $attributesArray || $tagsArray || ($plainText === '')
@@ -189,9 +190,8 @@  discard block
 block discarded – undo
189 190
     } // end xml2array    
190 191
 }
191 192
 
192
-if (!function_exists('filesize_format'))
193
-{
194
-    function filesize_format($bytes) 
193
+if (!function_exists('filesize_format')) {
194
+    function filesize_format($bytes)
195 195
     {
196 196
         if ($bytes >= 1073741824) {
197 197
             $bytes = number_format($bytes / 1073741824, 1, '.', '') . ' Gb';
@@ -212,8 +212,7 @@  discard block
 block discarded – undo
212 212
 }
213 213
 
214 214
 
215
-if (!function_exists('get_path_by_id'))
216
-{
215
+if (!function_exists('get_path_by_id')) {
217 216
     function get_path_by_id($id, $pad = 6)
218 217
     {
219 218
         $id = str_pad($id, $pad, '0', STR_PAD_LEFT);
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         }
35 35
  
36 36
         $namespace = 'messages';
37
-        if (Request::is(ltrim(config('jarboe.admin.uri') .'/*', '/')) || Request::is(ltrim(config('jarboe.admin.uri'), '/'))) {
37
+        if (Request::is(ltrim(config('jarboe.admin.uri').'/*', '/')) || Request::is(ltrim(config('jarboe.admin.uri'), '/'))) {
38 38
             $namespace = 'admin';
39 39
         }
40 40
         
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
         $defaults = array(
116 116
             'namespaceSeparator' => ':', // you may want this to be something other than a colon
117 117
             'attributePrefix'    => '@', // to distinguish between attributes and nodes with the same name
118
-            'alwaysArray' => array(),    // array of xml tag names which should always become arrays
119
-            'autoArray'   => true,       // only create arrays for tags which appear more than once
120
-            'textContent' => '$',        // key used for the text content of elements
121
-            'autoText'    => true,       // skip textContent key if node has no attributes or child nodes
122
-            'keySearch'   => false,      // optional search and replace on tag and attribute names
118
+            'alwaysArray' => array(), // array of xml tag names which should always become arrays
119
+            'autoArray'   => true, // only create arrays for tags which appear more than once
120
+            'textContent' => '$', // key used for the text content of elements
121
+            'autoText'    => true, // skip textContent key if node has no attributes or child nodes
122
+            'keySearch'   => false, // optional search and replace on tag and attribute names
123 123
             'keyReplace'  => false       // replace values for above search values (as passed to str_replace())
124 124
         );
125 125
         $options = array_merge($defaults, $options);
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 if ($options['keySearch']) $attributeName =
135 135
                         str_replace($options['keySearch'], $options['keyReplace'], $attributeName);
136 136
                 $attributeKey = $options['attributePrefix']
137
-                        . ($prefix ? $prefix . $options['namespaceSeparator'] : '')
137
+                        . ($prefix ? $prefix.$options['namespaceSeparator'] : '')
138 138
                         . $attributeName;
139 139
                 $attributesArray[$attributeKey] = (string)$attribute;
140 140
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 if ($options['keySearch']) $childTagName =
153 153
                         str_replace($options['keySearch'], $options['keyReplace'], $childTagName);
154 154
                 //add namespace prefix, if any
155
-                if ($prefix) $childTagName = $prefix . $options['namespaceSeparator'] . $childTagName;
155
+                if ($prefix) $childTagName = $prefix.$options['namespaceSeparator'].$childTagName;
156 156
      
157 157
                 if (!isset($tagsArray[$childTagName])) {
158 158
                     //only entry with this key
@@ -194,15 +194,15 @@  discard block
 block discarded – undo
194 194
     function filesize_format($bytes) 
195 195
     {
196 196
         if ($bytes >= 1073741824) {
197
-            $bytes = number_format($bytes / 1073741824, 1, '.', '') . ' Gb';
197
+            $bytes = number_format($bytes / 1073741824, 1, '.', '').' Gb';
198 198
         } elseif ($bytes >= 1048576) {
199
-            $bytes = number_format($bytes / 1048576, 1, '.', '') . ' Mb';
199
+            $bytes = number_format($bytes / 1048576, 1, '.', '').' Mb';
200 200
         } elseif ($bytes >= 1024) {
201
-            $bytes = number_format($bytes / 1024, 1, '.', '') . ' Kb';
201
+            $bytes = number_format($bytes / 1024, 1, '.', '').' Kb';
202 202
         } elseif ($bytes > 1) {
203
-            $bytes = $bytes . ' bytes';
203
+            $bytes = $bytes.' bytes';
204 204
         } elseif ($bytes == 1) {
205
-            $bytes = $bytes . ' byte';
205
+            $bytes = $bytes.' byte';
206 206
         } else {
207 207
             $bytes = '0 bytes';
208 208
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         $id = str_pad($id, $pad, '0', STR_PAD_LEFT);
220 220
         $chunks = str_split($id, 2);
221 221
     
222
-        return implode('/', $chunks) .'/';
222
+        return implode('/', $chunks).'/';
223 223
     } // end get_path_by_id
224 224
 }
225 225
 
Please login to merge, or discard this patch.
src/JarboeController.php 4 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -115,6 +115,9 @@  discard block
 block discarded – undo
115 115
         return false;
116 116
     } // end createCustomHandlerInstance
117 117
 
118
+    /**
119
+     * @param string $methodName
120
+     */
118 121
     public function hasCustomHandlerMethod($methodName)
119 122
     {
120 123
         return $this->getCustomHandler() && is_callable(array($this->getCustomHandler(), $methodName));
@@ -170,6 +173,9 @@  discard block
 block discarded – undo
170 173
         return $this->definition;
171 174
     } // end getDefinition
172 175
     
176
+    /**
177
+     * @param string $ident
178
+     */
173 179
     public function getDefinitionOption($ident, $default = null)
174 180
     {
175 181
         $value = array_get($this->getDefinition(), $ident);
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 use Yaro\Jarboe\Handlers\ImportHandler;
13 13
 use Yaro\Jarboe\Handlers\CustomClosureHandler;
14 14
 use Yaro\Jarboe\Storage\Image as ImageStorage;
15
-use Yaro\Jarboe\Storage\File  as FileStorage;
15
+use Yaro\Jarboe\Storage\File as FileStorage;
16 16
 
17 17
 
18 18
 class JarboeController 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 use Yaro\Jarboe\Storage\File  as FileStorage;
16 16
 
17 17
 
18
-class JarboeController 
18
+class JarboeController
19 19
 {
20 20
 
21 21
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         if (isset($this->definition['callbacks'])) {
50 50
             $this->callbacks = new CustomClosureHandler($this->definition['callbacks'], $this);
51 51
         }
52
-        $this->fields  = $this->loadFields();
52
+        $this->fields = $this->loadFields();
53 53
 
54 54
         $this->actions      = new ActionsHandler($this->definition['actions'], $this);
55 55
         $this->export       = new ExportHandler($this->definition['export'], $this);
@@ -79,11 +79,11 @@  discard block
 block discarded – undo
79 79
         
80 80
         //
81 81
         if (!isset($this->definition['options']['action_url'])) {
82
-            $this->definition['options']['action_url'] = '/'. Request::path();
82
+            $this->definition['options']['action_url'] = '/'.Request::path();
83 83
             // for structure current node resolver
84 84
             $requestValues = Request::only('node');
85 85
             if ($requestValues['node']) {
86
-                $this->definition['options']['action_url'] .'?node='. $requestValues['node'];
86
+                $this->definition['options']['action_url'].'?node='.$requestValues['node'];
87 87
             }
88 88
         }
89 89
     } // end doPrepareDefinition
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     protected function createCustomHandlerInstance()
109 109
     {
110 110
         if (isset($this->definition['options']['handler'])) {
111
-            $handler = '\\'. $this->definition['options']['handler'];
111
+            $handler = '\\'.$this->definition['options']['handler'];
112 112
             return new $handler($this);
113 113
         }
114 114
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
     public function getCustomHandler()
129 129
     {
130
-        return $this->handler ? : $this->callbacks;
130
+        return $this->handler ?: $this->callbacks;
131 131
     } // end getCustomHandler
132 132
 
133 133
     public function getField($ident)
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     
220 220
     protected function createFieldInstance($name, $info)
221 221
     {
222
-        $className = 'Yaro\\Jarboe\\Fields\\'. ucfirst(camel_case($info['type'])) ."Field";
222
+        $className = 'Yaro\\Jarboe\\Fields\\'.ucfirst(camel_case($info['type']))."Field";
223 223
 
224 224
         return new $className(
225 225
             $name, 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     protected function getTableDefinition($table)
234 234
     {
235 235
         $table = preg_replace('~\.~', '/', $table);
236
-        $path = base_path('resources/definitions/'. $table .'.php');
236
+        $path = base_path('resources/definitions/'.$table.'.php');
237 237
 
238 238
         if (!file_exists($path)) {
239 239
             throw new \RuntimeException("Definition \n[{$path}]\n does not exist.");
Please login to merge, or discard this patch.