@@ -28,6 +28,6 @@ |
||
28 | 28 | */ |
29 | 29 | public function handle() |
30 | 30 | { |
31 | - $this->comment(PHP_EOL . Inspiring::quote() . PHP_EOL); |
|
31 | + $this->comment(PHP_EOL.Inspiring::quote().PHP_EOL); |
|
32 | 32 | } |
33 | 33 | } |
@@ -73,6 +73,6 @@ |
||
73 | 73 | return $this->nameList[$name]; |
74 | 74 | } |
75 | 75 | |
76 | - return isset($this->nameList[$locale . '.' . $name]) ? $this->nameList[$locale . '.' . $name] : null; |
|
76 | + return isset($this->nameList[$locale.'.'.$name]) ? $this->nameList[$locale.'.'.$name] : null; |
|
77 | 77 | } |
78 | 78 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | protected function addFallthroughRoute($controller, $uri) |
117 | 117 | { |
118 | - $localizedUri = app('translator')->get('routes.' . $uri . '.'); |
|
118 | + $localizedUri = app('translator')->get('routes.'.$uri.'.'); |
|
119 | 119 | if (false !== strpos($localizedUri, '.')) { |
120 | 120 | $localizedUri = $uri; |
121 | 121 | } |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | $localizedUriTranslationBitParts = []; |
135 | 135 | while (list($level, $bitName) = each($uriExploded)) { |
136 | 136 | if ($level == 0) { |
137 | - $localizedUriTranslationBitParts[$level] = 'routes.' . $bitName . '.'; |
|
137 | + $localizedUriTranslationBitParts[$level] = 'routes.'.$bitName.'.'; |
|
138 | 138 | } else { |
139 | - $localizedUriTranslationBitParts[$level] = trim($localizedUriTranslationBitParts[$level - 1], '.') . '.' . $bitName; |
|
139 | + $localizedUriTranslationBitParts[$level] = trim($localizedUriTranslationBitParts[$level - 1], '.').'.'.$bitName; |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | foreach ($localizedUriTranslationBitParts as $level => &$translationBitPart) { |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected function addResourceCreate($name, $base, $controller, $options) |
25 | 25 | { |
26 | - $uri = $this->getResourceUri($name) . '/' . app('translator')->get('routes..resources.create'); |
|
26 | + $uri = $this->getResourceUri($name).'/'.app('translator')->get('routes..resources.create'); |
|
27 | 27 | |
28 | 28 | $action = $this->getResourceAction($name, $controller, 'create', $options); |
29 | 29 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | protected function addResourceEdit($name, $base, $controller, $options) |
44 | 44 | { |
45 | - $uri = $this->getResourceUri($name) . '/{' . $base . '}/' . app('translator')->get('routes..resources.edit'); |
|
45 | + $uri = $this->getResourceUri($name).'/{'.$base.'}/'.app('translator')->get('routes..resources.edit'); |
|
46 | 46 | |
47 | 47 | $action = $this->getResourceAction($name, $controller, 'edit', $options); |
48 | 48 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | $this->filesystem = app('filesystem')->disk(); |
47 | 47 | $this->chunksExpireIn = config('filesystems.disks.local.chunks_expire_in'); |
48 | - $this->temporaryChunksFolder = DIRECTORY_SEPARATOR . '_chunks'; |
|
48 | + $this->temporaryChunksFolder = DIRECTORY_SEPARATOR.'_chunks'; |
|
49 | 49 | if (app('config')->has('filesystems.chunks_ttl') && is_int(config('filesystems.chunks_ttl'))) { |
50 | 50 | $this->chunksExpireIn = config('filesystems.chunks_ttl'); |
51 | 51 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | # Temp folder writable? |
91 | - if (!is_writable($absolutePathToTemporaryChunksFolder = config('filesystems.disks.local.root') . $this->temporaryChunksFolder) || !is_executable($absolutePathToTemporaryChunksFolder)) { |
|
91 | + if (!is_writable($absolutePathToTemporaryChunksFolder = config('filesystems.disks.local.root').$this->temporaryChunksFolder) || !is_executable($absolutePathToTemporaryChunksFolder)) { |
|
92 | 92 | throw new FileStreamExceptions\TemporaryUploadFolderNotWritableException; |
93 | 93 | } |
94 | 94 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | if ($totalNumberOfChunks > 1) { |
139 | 139 | $chunkIndex = intval($request->get('qqpartindex')); |
140 | - $targetFolder = $this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid; |
|
140 | + $targetFolder = $this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid; |
|
141 | 141 | if (!$this->filesystem->exists($targetFolder)) { |
142 | 142 | $this->filesystem->makeDirectory($targetFolder); |
143 | 143 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | if (!$file->isValid()) { |
146 | 146 | throw new FileStreamExceptions\UploadAttemptFailedException; |
147 | 147 | } |
148 | - $file->move(storage_path('app' . $targetFolder), $chunkIndex); |
|
148 | + $file->move(storage_path('app'.$targetFolder), $chunkIndex); |
|
149 | 149 | |
150 | 150 | return response()->json(['success' => true, 'uuid' => $fineUploaderUuid]); |
151 | 151 | } else { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $fineUploaderUuid = $request->get('qquuid'); |
169 | 169 | $chunkIndex = intval($request->get('qqpartindex')); |
170 | - $numberOfExistingChunks = count($this->filesystem->files($this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid)); |
|
170 | + $numberOfExistingChunks = count($this->filesystem->files($this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid)); |
|
171 | 171 | if ($numberOfExistingChunks < $chunkIndex) { |
172 | 172 | throw new FileStreamExceptions\UploadIncompleteException; |
173 | 173 | } |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $decimalPrefices = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; |
212 | 212 | $factor = intval(floor((strlen($bytes) - 1) / 3)); |
213 | 213 | |
214 | - return sprintf("%.{$decimals}f", $bytes / pow($binary ? 1024 : 1000, $factor)) . ' ' . $binary ? $binaryPrefices[$factor] : $decimalPrefices[$factor]; |
|
214 | + return sprintf("%.{$decimals}f", $bytes / pow($binary ? 1024 : 1000, $factor)).' '.$binary ? $binaryPrefices[$factor] : $decimalPrefices[$factor]; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | */ |
222 | 222 | public function getAbsolutePath($path) |
223 | 223 | { |
224 | - return config('filesystems.disks.local.root') . DIRECTORY_SEPARATOR . trim($path, DIRECTORY_SEPARATOR); |
|
224 | + return config('filesystems.disks.local.root').DIRECTORY_SEPARATOR.trim($path, DIRECTORY_SEPARATOR); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | { |
271 | 271 | # Prelim |
272 | 272 | $fineUploaderUuid = $request->get('qquuid'); |
273 | - $chunksFolder = $this->temporaryChunksFolder . DIRECTORY_SEPARATOR . $fineUploaderUuid; |
|
273 | + $chunksFolder = $this->temporaryChunksFolder.DIRECTORY_SEPARATOR.$fineUploaderUuid; |
|
274 | 274 | $totalNumberOfChunks = $request->has('qqtotalparts') ? intval($request->get('qqtotalparts')) : 1; |
275 | 275 | |
276 | 276 | # Do we have all chunks? |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | # We have all chunks, proceed with combine. |
283 | 283 | $targetStream = fopen($this->getAbsolutePath($fineUploaderUuid), 'wb'); |
284 | 284 | for ($i = 0; $i < $totalNumberOfChunks; $i++) { |
285 | - $chunkStream = fopen($this->getAbsolutePath($chunksFolder . DIRECTORY_SEPARATOR . $i), 'rb'); |
|
285 | + $chunkStream = fopen($this->getAbsolutePath($chunksFolder.DIRECTORY_SEPARATOR.$i), 'rb'); |
|
286 | 286 | stream_copy_to_stream($chunkStream, $targetStream); |
287 | 287 | fclose($chunkStream); |
288 | 288 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | throw new \Exception(); |
51 | 51 | } |
52 | 52 | |
53 | - return $query->where('mime', 'like', $type . '/%'); |
|
53 | + return $query->where('mime', 'like', $type.'/%'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | /** |
@@ -50,11 +50,11 @@ discard block |
||
50 | 50 | # Fetch reference entity |
51 | 51 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
52 | 52 | if (is_null($referenceEntity)) { |
53 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
53 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | \DB::transaction( |
57 | - function () use ($newEntityName, $referenceEntity) { |
|
57 | + function() use ($newEntityName, $referenceEntity) { |
|
58 | 58 | # Create new entity |
59 | 59 | $newEntity = \DB::table($this->table); |
60 | 60 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | # Fetch reference entity |
92 | 92 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
93 | 93 | if (is_null($referenceEntity)) { |
94 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
94 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | \DB::transaction( |
98 | - function () use ($newEntityName, $referenceEntity) { |
|
98 | + function() use ($newEntityName, $referenceEntity) { |
|
99 | 99 | # Create new entity |
100 | 100 | $newEntity = \DB::table($this->table); |
101 | 101 | |
@@ -147,11 +147,11 @@ discard block |
||
147 | 147 | # Fetch reference entity |
148 | 148 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
149 | 149 | if (is_null($referenceEntity)) { |
150 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
150 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | \DB::transaction( |
154 | - function () use ($newEntityName, $referenceEntity) { |
|
154 | + function() use ($newEntityName, $referenceEntity) { |
|
155 | 155 | # Create new entity |
156 | 156 | $newEntity = \DB::table($this->table); |
157 | 157 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | # Fetch reference entity |
189 | 189 | $referenceEntity = \DB::table($this->table)->where('id', $referenceEntityId)->first(); |
190 | 190 | if (is_null($referenceEntity)) { |
191 | - throw new \InvalidArgumentException("Reference entity with id: " . $referenceEntityId . " not found!"); |
|
191 | + throw new \InvalidArgumentException("Reference entity with id: ".$referenceEntityId." not found!"); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | \DB::transaction( |
195 | - function () use ($newEntityName, $referenceEntity) { |
|
195 | + function() use ($newEntityName, $referenceEntity) { |
|
196 | 196 | # Create new entity |
197 | 197 | $newEntity = \DB::table($this->table); |
198 | 198 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | # Round up delete-ables |
223 | 223 | $referenceEntity = \DB::table($this->table)->select('left_range', 'right_range', \DB::raw('right_range - left_range + 1 as range_width'))->where('id', $id)->first(); |
224 | 224 | if (is_null($referenceEntity)) { |
225 | - throw new \InvalidArgumentException("Reference entity with id: " . $id . " not found!"); |
|
225 | + throw new \InvalidArgumentException("Reference entity with id: ".$id." not found!"); |
|
226 | 226 | } |
227 | 227 | $completeListOfEntitiesToDeleteIncludingOrphans = \DB::table($this->table) |
228 | 228 | ->where('left_range', '>=', $referenceEntity->left_range) |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | |
231 | 231 | # Perform either a soft-delete or hard-delete |
232 | 232 | return \DB::transaction( |
233 | - function () use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) { |
|
233 | + function() use ($referenceEntity, $doSoftDelete, $completeListOfEntitiesToDeleteIncludingOrphans) { |
|
234 | 234 | if ($doSoftDelete) { |
235 | 235 | # Soft delete |
236 | 236 | $removeResult = $completeListOfEntitiesToDeleteIncludingOrphans->update(['deleted_at' => Carbon::now()]); |
@@ -241,10 +241,10 @@ discard block |
||
241 | 241 | # Update ranges |
242 | 242 | \DB::table($this->table) |
243 | 243 | ->where('right_range', '>', $referenceEntity->right_range) |
244 | - ->update(['right_range' => \DB::raw('right_range - ' . $referenceEntity->range_width)]); |
|
244 | + ->update(['right_range' => \DB::raw('right_range - '.$referenceEntity->range_width)]); |
|
245 | 245 | \DB::table($this->table) |
246 | 246 | ->where('left_range', '>', $referenceEntity->right_range) |
247 | - ->update(['left_range' => \DB::raw('left_range - ' . $referenceEntity->range_width)]); |
|
247 | + ->update(['left_range' => \DB::raw('left_range - '.$referenceEntity->range_width)]); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | return $removeResult; |
@@ -274,11 +274,11 @@ discard block |
||
274 | 274 | |
275 | 275 | # Prelim |
276 | 276 | empty($id) && $id = 1; |
277 | - $nestedEntities = \DB::table($this->table . ' as node') |
|
277 | + $nestedEntities = \DB::table($this->table.' as node') |
|
278 | 278 | ->select('node.id', 'node.name') |
279 | 279 | ->leftJoin( |
280 | - $this->table . ' as parent', |
|
281 | - function (JoinClause $join) { |
|
280 | + $this->table.' as parent', |
|
281 | + function(JoinClause $join) { |
|
282 | 282 | $join->on('node.left_range', '<=', 'parent.right_range') |
283 | 283 | ->on('node.left_range', '>=', 'parent.left_range'); |
284 | 284 | }); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | 'connections' => [ |
44 | 44 | 'sqlite' => [ |
45 | 45 | 'driver' => 'sqlite', |
46 | - 'database' => storage_path() . '/database.sqlite', |
|
46 | + 'database' => storage_path().'/database.sqlite', |
|
47 | 47 | 'prefix' => '', |
48 | 48 | ], |
49 | 49 | 'mysql' => [ |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getCompleted($completed) |
40 | 40 | { |
41 | - return (bool)$completed; |
|
41 | + return (bool) $completed; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setCompleted($completed) |
50 | 50 | { |
51 | - $this->attributes['completed'] = (bool)$completed; |
|
51 | + $this->attributes['completed'] = (bool) $completed; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | public function getCode() |