@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * @param string $file |
9 | 9 | */ |
10 | - function register_annotation_file(string $file) |
|
10 | + function register_annotation_file (string $file) |
|
11 | 11 | { |
12 | 12 | if (!is_file($file)) { |
13 | 13 | return false; |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * Retrieve all annotations of a giving object |
22 | 22 | */ |
23 | 23 | if (!function_exists('get_class_annotations')) { |
24 | - function get_class_annotations($element, $annotation = null) |
|
24 | + function get_class_annotations ($element, $annotation = null) |
|
25 | 25 | { |
26 | 26 | $class = $element; |
27 | 27 | if (is_object($element)) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Retrieve annotations of a especific property of a giving object |
40 | 40 | */ |
41 | 41 | if (!function_exists('get_property_annotations')) { |
42 | - function get_property_annotations($element, $property = null, $annotation = null) |
|
42 | + function get_property_annotations ($element, $property = null, $annotation = null) |
|
43 | 43 | { |
44 | 44 | $class = $element; |
45 | 45 | if (is_object($element) && !($element instanceof \ReflectionClass)) { |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | |
58 | 58 | $reflectClass = new \ReflectionClass($class); |
59 | 59 | $reflectProperties = $reflectClass->getProperties(); |
60 | - $annotations = []; |
|
60 | + $annotations = [ ]; |
|
61 | 61 | foreach ($reflectProperties as $property) { |
62 | - $annotations[$property->getName()] = get_property_annotations($reflectClass, $property, $annotation); |
|
62 | + $annotations[ $property->getName() ] = get_property_annotations($reflectClass, $property, $annotation); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | return $annotations; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | function register_annotation_file(string $file) |
11 | 11 | { |
12 | 12 | if (!is_file($file)) { |
13 | - return false; |
|
13 | + return FALSE; |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | return \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($file); |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * Retrieve all annotations of a giving object |
22 | 22 | */ |
23 | 23 | if (!function_exists('get_class_annotations')) { |
24 | - function get_class_annotations($element, $annotation = null) |
|
24 | + function get_class_annotations($element, $annotation = NULL) |
|
25 | 25 | { |
26 | 26 | $class = $element; |
27 | 27 | if (is_object($element)) { |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * Retrieve annotations of a especific property of a giving object |
40 | 40 | */ |
41 | 41 | if (!function_exists('get_property_annotations')) { |
42 | - function get_property_annotations($element, $property = null, $annotation = null) |
|
42 | + function get_property_annotations($element, $property = NULL, $annotation = NULL) |
|
43 | 43 | { |
44 | 44 | $class = $element; |
45 | 45 | if (is_object($element) && !($element instanceof \ReflectionClass)) { |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | /** |
9 | 9 | * @param string $file |
10 | 10 | */ |
11 | - function register_annotation_file(string $file) |
|
11 | + function register_annotation_file (string $file) |
|
12 | 12 | { |
13 | 13 | if (!is_file($file)) { |
14 | 14 | return false; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | /** |
26 | 26 | * @param string $dir |
27 | 27 | */ |
28 | - function register_annotation_dir(string $dir) |
|
28 | + function register_annotation_dir (string $dir) |
|
29 | 29 | { |
30 | 30 | if (!is_dir($dir)) { |
31 | 31 | return false; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $handle = opendir($dir); |
35 | 35 | while ($path = readdir($handle)) { |
36 | - $toRegisterPath = implode(DIRECTORY_SEPARATOR, [$dir, $path]); |
|
36 | + $toRegisterPath = implode(DIRECTORY_SEPARATOR, [ $dir, $path ]); |
|
37 | 37 | register_annotation_file($toRegisterPath); |
38 | 38 | } |
39 | 39 | |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | * Default binding a repository interface to a concret class |
46 | 46 | */ |
47 | 47 | if (!function_exists('bind_repository_interface')) { |
48 | - function bind_repository_interface(string $repositoryInterface, string $repository, string $entity) |
|
48 | + function bind_repository_interface (string $repositoryInterface, string $repository, string $entity) |
|
49 | 49 | { |
50 | 50 | app()->bind($repositoryInterface, function ($app) use ($repository, $entity) { |
51 | 51 | return new $repository( |
52 | - $app['em'], |
|
53 | - $app['em']->getClassMetaData($entity) |
|
52 | + $app[ 'em' ], |
|
53 | + $app[ 'em' ]->getClassMetaData($entity) |
|
54 | 54 | ); |
55 | 55 | }); |
56 | 56 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | * Dump and die. |
61 | 61 | */ |
62 | 62 | if (!function_exists('dd')) { |
63 | - function dd() |
|
63 | + function dd () |
|
64 | 64 | { |
65 | 65 | $args = func_get_args(); |
66 | 66 | foreach ($args as $arg) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * Print and die |
75 | 75 | */ |
76 | 76 | if (!function_exists('pd')) { |
77 | - function pd() |
|
77 | + function pd () |
|
78 | 78 | { |
79 | 79 | $args = func_get_args(); |
80 | 80 | foreach ($args as $arg) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * Dump and return |
89 | 89 | */ |
90 | 90 | if (!function_exists('dr')) { |
91 | - function dr() |
|
91 | + function dr () |
|
92 | 92 | { |
93 | 93 | $args = func_get_args(); |
94 | 94 | $result = ''; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string $version = 'v1' |
123 | 123 | * @param bool $abort = true |
124 | 124 | */ |
125 | - function bdClassExists(string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
125 | + function bdClassExists (string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
126 | 126 | { |
127 | 127 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
128 | 128 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param string $version = 'v1' |
150 | 150 | * @param bool $abort = true |
151 | 151 | */ |
152 | - function bdInterfaceExists(string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
152 | + function bdInterfaceExists (string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
153 | 153 | { |
154 | 154 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
155 | 155 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param string $version = 'v1' |
172 | 172 | * @param bool $abort = true |
173 | 173 | */ |
174 | - function bdInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
174 | + function bdInterfaceClass (string $className, string $version = 'v1', bool $abort = true) |
|
175 | 175 | { |
176 | 176 | return bdInterfaceExists(config('bludata.generator.paths.interfaces'), $className.'Interface', $version, $abort); |
177 | 177 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @param string $version = 'v1' |
184 | 184 | * @param bool $abort = true |
185 | 185 | */ |
186 | - function bdContractClass(string $className, string $version = 'v1', bool $abort = true) |
|
186 | + function bdContractClass (string $className, string $version = 'v1', bool $abort = true) |
|
187 | 187 | { |
188 | 188 | return bdInterfaceExists(config('bludata.generator.paths.contracts'), $className.'Interface', $version, $abort); |
189 | 189 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param string $version = 'v1' |
196 | 196 | * @param bool $abort = true |
197 | 197 | */ |
198 | - function bdContract(string $className, string $version = 'v1', bool $abort = true) |
|
198 | + function bdContract (string $className, string $version = 'v1', bool $abort = true) |
|
199 | 199 | { |
200 | 200 | return app(bdContractClass($className, $version, $abort)); |
201 | 201 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param string $version = 'v1' |
208 | 208 | * @param bool $abort = true |
209 | 209 | */ |
210 | - function bdRepositoryInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
210 | + function bdRepositoryInterfaceClass (string $className, string $version = 'v1', bool $abort = true) |
|
211 | 211 | { |
212 | 212 | return bdInterfaceClass($className.'Repository', $version, $abort); |
213 | 213 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @param string $version = 'v1' |
220 | 220 | * @param bool $abort = true |
221 | 221 | */ |
222 | - function bdRepositoryClass(string $className, string $version = 'v1', bool $abort = true) |
|
222 | + function bdRepositoryClass (string $className, string $version = 'v1', bool $abort = true) |
|
223 | 223 | { |
224 | 224 | return bdClassExists(config('bludata.generator.paths.repositories'), $className.'Repository', $version, $abort); |
225 | 225 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @param string $version = 'v1' |
232 | 232 | * @param bool $abort = true |
233 | 233 | */ |
234 | - function bdRepository(string $className, string $version = 'v1', bool $abort = true) |
|
234 | + function bdRepository (string $className, string $version = 'v1', bool $abort = true) |
|
235 | 235 | { |
236 | 236 | return app(bdRepositoryInterfaceClass($className, $version, $abort)); |
237 | 237 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param string $version = 'v1' |
244 | 244 | * @param bool $abort = true |
245 | 245 | */ |
246 | - function bdServiceInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
246 | + function bdServiceInterfaceClass (string $className, string $version = 'v1', bool $abort = true) |
|
247 | 247 | { |
248 | 248 | return bdInterfaceClass($className.'Service', $version, $abort); |
249 | 249 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @param string $version = 'v1' |
256 | 256 | * @param bool $abort = true |
257 | 257 | */ |
258 | - function bdServiceClass(string $className, string $version = 'v1', bool $abort = true) |
|
258 | + function bdServiceClass (string $className, string $version = 'v1', bool $abort = true) |
|
259 | 259 | { |
260 | 260 | return bdClassExists(config('bludata.generator.paths.services'), $className.'Service', $version, $abort); |
261 | 261 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param string $version = 'v1' |
268 | 268 | * @param bool $abort = true |
269 | 269 | */ |
270 | - function bdService(string $className, string $version = 'v1', bool $abort = true) |
|
270 | + function bdService (string $className, string $version = 'v1', bool $abort = true) |
|
271 | 271 | { |
272 | 272 | return app(bdServiceInterfaceClass($className, $version, $abort)); |
273 | 273 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @param string $version = 'v1' |
280 | 280 | * @param bool $abort = true |
281 | 281 | */ |
282 | - function bdEntityClass(string $className, string $version = 'v1', bool $abort = true) |
|
282 | + function bdEntityClass (string $className, string $version = 'v1', bool $abort = true) |
|
283 | 283 | { |
284 | 284 | return bdClassExists(config('bludata.generator.paths.entities'), $className, $version, $abort); |
285 | 285 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * @param string $version = 'v1' |
292 | 292 | * @param bool $abort = true |
293 | 293 | */ |
294 | - function bdEntity(string $className, string $version = 'v1', bool $abort = true) |
|
294 | + function bdEntity (string $className, string $version = 'v1', bool $abort = true) |
|
295 | 295 | { |
296 | 296 | return app(bdEntityClass($className, $version, $abort)); |
297 | 297 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | function register_annotation_file(string $file) |
12 | 12 | { |
13 | 13 | if (!is_file($file)) { |
14 | - return false; |
|
14 | + return FALSE; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | return \Doctrine\Common\Annotations\AnnotationRegistry::registerFile($file); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | function register_annotation_dir(string $dir) |
29 | 29 | { |
30 | 30 | if (!is_dir($dir)) { |
31 | - return false; |
|
31 | + return FALSE; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $handle = opendir($dir); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | register_annotation_file($toRegisterPath); |
38 | 38 | } |
39 | 39 | |
40 | - return true; |
|
40 | + return TRUE; |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | if ($type == 'boolean') { |
102 | 102 | $result = $arg ? 'true' : 'false'; |
103 | 103 | } else { |
104 | - $result = print_r($arg, true); |
|
104 | + $result = print_r($arg, TRUE); |
|
105 | 105 | } |
106 | 106 | $result = sprintf('(%s) %s', $type, $result); |
107 | 107 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string $version = 'v1' |
123 | 123 | * @param bool $abort = true |
124 | 124 | */ |
125 | - function bdClassExists(string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
125 | + function bdClassExists(string $folder, string $className, string $version = 'v1', bool $abort = TRUE) |
|
126 | 126 | { |
127 | 127 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
128 | 128 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | abort(500, 'Undefined \''.$className.'\''); |
135 | 135 | } |
136 | 136 | |
137 | - return null; |
|
137 | + return NULL; |
|
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param string $version = 'v1' |
150 | 150 | * @param bool $abort = true |
151 | 151 | */ |
152 | - function bdInterfaceExists(string $folder, string $className, string $version = 'v1', bool $abort = true) |
|
152 | + function bdInterfaceExists(string $folder, string $className, string $version = 'v1', bool $abort = TRUE) |
|
153 | 153 | { |
154 | 154 | $entityClass = config('bludata.generator.rootNamespace').'\\'.$folder.'\\'.$version.'\\'.$className; |
155 | 155 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | abort(500, 'Undefined \''.$className.'\''); |
162 | 162 | } |
163 | 163 | |
164 | - return null; |
|
164 | + return NULL; |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @param string $version = 'v1' |
172 | 172 | * @param bool $abort = true |
173 | 173 | */ |
174 | - function bdInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
174 | + function bdInterfaceClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
175 | 175 | { |
176 | 176 | return bdInterfaceExists(config('bludata.generator.paths.interfaces'), $className.'Interface', $version, $abort); |
177 | 177 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @param string $version = 'v1' |
184 | 184 | * @param bool $abort = true |
185 | 185 | */ |
186 | - function bdContractClass(string $className, string $version = 'v1', bool $abort = true) |
|
186 | + function bdContractClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
187 | 187 | { |
188 | 188 | return bdInterfaceExists(config('bludata.generator.paths.contracts'), $className.'Interface', $version, $abort); |
189 | 189 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @param string $version = 'v1' |
196 | 196 | * @param bool $abort = true |
197 | 197 | */ |
198 | - function bdContract(string $className, string $version = 'v1', bool $abort = true) |
|
198 | + function bdContract(string $className, string $version = 'v1', bool $abort = TRUE) |
|
199 | 199 | { |
200 | 200 | return app(bdContractClass($className, $version, $abort)); |
201 | 201 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | * @param string $version = 'v1' |
208 | 208 | * @param bool $abort = true |
209 | 209 | */ |
210 | - function bdRepositoryInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
210 | + function bdRepositoryInterfaceClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
211 | 211 | { |
212 | 212 | return bdInterfaceClass($className.'Repository', $version, $abort); |
213 | 213 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | * @param string $version = 'v1' |
220 | 220 | * @param bool $abort = true |
221 | 221 | */ |
222 | - function bdRepositoryClass(string $className, string $version = 'v1', bool $abort = true) |
|
222 | + function bdRepositoryClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
223 | 223 | { |
224 | 224 | return bdClassExists(config('bludata.generator.paths.repositories'), $className.'Repository', $version, $abort); |
225 | 225 | } |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @param string $version = 'v1' |
232 | 232 | * @param bool $abort = true |
233 | 233 | */ |
234 | - function bdRepository(string $className, string $version = 'v1', bool $abort = true) |
|
234 | + function bdRepository(string $className, string $version = 'v1', bool $abort = TRUE) |
|
235 | 235 | { |
236 | 236 | return app(bdRepositoryInterfaceClass($className, $version, $abort)); |
237 | 237 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param string $version = 'v1' |
244 | 244 | * @param bool $abort = true |
245 | 245 | */ |
246 | - function bdServiceInterfaceClass(string $className, string $version = 'v1', bool $abort = true) |
|
246 | + function bdServiceInterfaceClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
247 | 247 | { |
248 | 248 | return bdInterfaceClass($className.'Service', $version, $abort); |
249 | 249 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @param string $version = 'v1' |
256 | 256 | * @param bool $abort = true |
257 | 257 | */ |
258 | - function bdServiceClass(string $className, string $version = 'v1', bool $abort = true) |
|
258 | + function bdServiceClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
259 | 259 | { |
260 | 260 | return bdClassExists(config('bludata.generator.paths.services'), $className.'Service', $version, $abort); |
261 | 261 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param string $version = 'v1' |
268 | 268 | * @param bool $abort = true |
269 | 269 | */ |
270 | - function bdService(string $className, string $version = 'v1', bool $abort = true) |
|
270 | + function bdService(string $className, string $version = 'v1', bool $abort = TRUE) |
|
271 | 271 | { |
272 | 272 | return app(bdServiceInterfaceClass($className, $version, $abort)); |
273 | 273 | } |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | * @param string $version = 'v1' |
280 | 280 | * @param bool $abort = true |
281 | 281 | */ |
282 | - function bdEntityClass(string $className, string $version = 'v1', bool $abort = true) |
|
282 | + function bdEntityClass(string $className, string $version = 'v1', bool $abort = TRUE) |
|
283 | 283 | { |
284 | 284 | return bdClassExists(config('bludata.generator.paths.entities'), $className, $version, $abort); |
285 | 285 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * @param string $version = 'v1' |
292 | 292 | * @param bool $abort = true |
293 | 293 | */ |
294 | - function bdEntity(string $className, string $version = 'v1', bool $abort = true) |
|
294 | + function bdEntity(string $className, string $version = 'v1', bool $abort = TRUE) |
|
295 | 295 | { |
296 | 296 | return app(bdEntityClass($className, $version, $abort)); |
297 | 297 | } |
@@ -6,8 +6,7 @@ |
||
6 | 6 | use Illuminate\Foundation\Application; |
7 | 7 | use Illuminate\Support\Facades\Route; |
8 | 8 | |
9 | -class BaseApplication extends Application |
|
10 | -{ |
|
9 | +class BaseApplication extends Application { |
|
11 | 10 | public function publicRoutes(string $uri, string $controller, Closure $routes = null, array $options = []) |
12 | 11 | { |
13 | 12 | $options['only'] = $options['only'] ?? ['index', 'show', 'destroyed']; |
@@ -8,21 +8,21 @@ |
||
8 | 8 | |
9 | 9 | class BaseApplication extends Application |
10 | 10 | { |
11 | - public function publicRoutes(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
11 | + public function publicRoutes(string $uri, string $controller, Closure $routes = NULL, array $options = []) |
|
12 | 12 | { |
13 | 13 | $options['only'] = $options['only'] ?? ['index', 'show', 'destroyed']; |
14 | 14 | |
15 | 15 | return $this->resourceRoutes($uri, $controller, $routes, $options); |
16 | 16 | } |
17 | 17 | |
18 | - public function routesWithPermission(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
18 | + public function routesWithPermission(string $uri, string $controller, Closure $routes = NULL, array $options = []) |
|
19 | 19 | { |
20 | 20 | $options['only'] = $options['only'] ?? ['store', 'update', 'destroyed', 'restoreDestroyed']; |
21 | 21 | |
22 | 22 | return $this->resourceRoutes($uri, $controller, $routes, $options); |
23 | 23 | } |
24 | 24 | |
25 | - public function resourceRoutes(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
25 | + public function resourceRoutes(string $uri, string $controller, Closure $routes = NULL, array $options = []) |
|
26 | 26 | { |
27 | 27 | $options['name'] = $options['name'] ?? $uri; |
28 | 28 | $options['only'] = $options['only'] ?? []; |
@@ -8,62 +8,62 @@ |
||
8 | 8 | |
9 | 9 | class BaseApplication extends Application |
10 | 10 | { |
11 | - public function publicRoutes(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
11 | + public function publicRoutes (string $uri, string $controller, Closure $routes = null, array $options = [ ]) |
|
12 | 12 | { |
13 | - $options['only'] = $options['only'] ?? ['index', 'show', 'destroyed']; |
|
13 | + $options[ 'only' ] = $options[ 'only' ] ?? [ 'index', 'show', 'destroyed' ]; |
|
14 | 14 | |
15 | 15 | return $this->resourceRoutes($uri, $controller, $routes, $options); |
16 | 16 | } |
17 | 17 | |
18 | - public function routesWithPermission(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
18 | + public function routesWithPermission (string $uri, string $controller, Closure $routes = null, array $options = [ ]) |
|
19 | 19 | { |
20 | - $options['only'] = $options['only'] ?? ['store', 'update', 'destroyed', 'restoreDestroyed']; |
|
20 | + $options[ 'only' ] = $options[ 'only' ] ?? [ 'store', 'update', 'destroyed', 'restoreDestroyed' ]; |
|
21 | 21 | |
22 | 22 | return $this->resourceRoutes($uri, $controller, $routes, $options); |
23 | 23 | } |
24 | 24 | |
25 | - public function resourceRoutes(string $uri, string $controller, Closure $routes = null, array $options = []) |
|
25 | + public function resourceRoutes (string $uri, string $controller, Closure $routes = null, array $options = [ ]) |
|
26 | 26 | { |
27 | - $options['name'] = $options['name'] ?? $uri; |
|
28 | - $options['only'] = $options['only'] ?? []; |
|
29 | - $options['except'] = $options['except'] ?? []; |
|
27 | + $options[ 'name' ] = $options[ 'name' ] ?? $uri; |
|
28 | + $options[ 'only' ] = $options[ 'only' ] ?? [ ]; |
|
29 | + $options[ 'except' ] = $options[ 'except' ] ?? [ ]; |
|
30 | 30 | |
31 | - $exceptAll = isset($options['except'][0]) && $options['except'][0] == '*'; |
|
31 | + $exceptAll = isset($options[ 'except' ][ 0 ]) && $options[ 'except' ][ 0 ] == '*'; |
|
32 | 32 | |
33 | 33 | if (!$exceptAll) { |
34 | - if (in_array('index', $options['only']) && !in_array('index', $options['except'])) { |
|
34 | + if (in_array('index', $options[ 'only' ]) && !in_array('index', $options[ 'except' ])) { |
|
35 | 35 | Route::get($uri, $controller.'@index') |
36 | - ->name($options['name'].'.index'); |
|
36 | + ->name($options[ 'name' ].'.index'); |
|
37 | 37 | } |
38 | 38 | |
39 | - if (in_array('show', $options['only']) && !in_array('show', $options['except'])) { |
|
39 | + if (in_array('show', $options[ 'only' ]) && !in_array('show', $options[ 'except' ])) { |
|
40 | 40 | Route::get($uri.'/{uuid}', $controller.'@show') |
41 | - ->name($options['name'].'.show'); |
|
41 | + ->name($options[ 'name' ].'.show'); |
|
42 | 42 | } |
43 | 43 | |
44 | - if (in_array('store', $options['only']) && !in_array('store', $options['except'])) { |
|
44 | + if (in_array('store', $options[ 'only' ]) && !in_array('store', $options[ 'except' ])) { |
|
45 | 45 | Route::post($uri, $controller.'@store') |
46 | - ->name($options['name'].'.store'); |
|
46 | + ->name($options[ 'name' ].'.store'); |
|
47 | 47 | } |
48 | 48 | |
49 | - if (in_array('update', $options['only']) && !in_array('update', $options['except'])) { |
|
49 | + if (in_array('update', $options[ 'only' ]) && !in_array('update', $options[ 'except' ])) { |
|
50 | 50 | Route::put($uri.'/{uuid}', $controller.'@update') |
51 | - ->name($options['name'].'.update'); |
|
51 | + ->name($options[ 'name' ].'.update'); |
|
52 | 52 | } |
53 | 53 | |
54 | - if (in_array('destroy', $options['only']) && !in_array('destroy', $options['except'])) { |
|
54 | + if (in_array('destroy', $options[ 'only' ]) && !in_array('destroy', $options[ 'except' ])) { |
|
55 | 55 | Route::delete($uri.'/{uuid}', $controller.'@destroy') |
56 | - ->name($options['name'].'.destroy'); |
|
56 | + ->name($options[ 'name' ].'.destroy'); |
|
57 | 57 | } |
58 | 58 | |
59 | - if (in_array('destroyed', $options['only']) && !in_array('destroyed', $options['except'])) { |
|
59 | + if (in_array('destroyed', $options[ 'only' ]) && !in_array('destroyed', $options[ 'except' ])) { |
|
60 | 60 | Route::get($uri.'/destroyed', $controller.'@destroyed') |
61 | - ->name($options['name'].'.destroyed'); |
|
61 | + ->name($options[ 'name' ].'.destroyed'); |
|
62 | 62 | } |
63 | 63 | |
64 | - if (in_array('restoreDestroyed', $options['only']) && !in_array('restoreDestroyed', $options['except'])) { |
|
64 | + if (in_array('restoreDestroyed', $options[ 'only' ]) && !in_array('restoreDestroyed', $options[ 'except' ])) { |
|
65 | 65 | Route::post($uri.'/{uuid}', $controller.'@restoreDestroyed') |
66 | - ->name($options['name'].'.restoreDestroyed'); |
|
66 | + ->name($options[ 'name' ].'.restoreDestroyed'); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @return void |
36 | 36 | */ |
37 | - public function __construct() |
|
37 | + public function __construct () |
|
38 | 38 | { |
39 | 39 | $this->middleware('guest'); |
40 | 40 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * |
47 | 47 | * @return \Illuminate\Contracts\Validation\Validator |
48 | 48 | */ |
49 | - protected function validator(array $data) |
|
49 | + protected function validator (array $data) |
|
50 | 50 | { |
51 | 51 | return Validator::make($data, [ |
52 | 52 | 'name' => 'required|string|max:255', |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @return \LaravelSeed\User |
64 | 64 | */ |
65 | - protected function create(array $data) |
|
65 | + protected function create (array $data) |
|
66 | 66 | { |
67 | 67 | return User::create([ |
68 | - 'name' => $data['name'], |
|
69 | - 'email' => $data['email'], |
|
70 | - 'password' => bcrypt($data['password']), |
|
68 | + 'name' => $data[ 'name' ], |
|
69 | + 'email' => $data[ 'email' ], |
|
70 | + 'password' => bcrypt($data[ 'password' ]), |
|
71 | 71 | ]); |
72 | 72 | } |
73 | 73 | } |
@@ -7,8 +7,7 @@ |
||
7 | 7 | use LaravelSeed\Http\Controllers\Controller; |
8 | 8 | use LaravelSeed\User; |
9 | 9 | |
10 | -class RegisterController extends Controller |
|
11 | -{ |
|
10 | +class RegisterController extends Controller { |
|
12 | 11 | /* |
13 | 12 | |-------------------------------------------------------------------------- |
14 | 13 | | Register Controller |
@@ -4,19 +4,19 @@ |
||
4 | 4 | |
5 | 5 | interface Repository |
6 | 6 | { |
7 | - public function findAll(); |
|
7 | + public function findAll (); |
|
8 | 8 | |
9 | - public function findBy(array $filters): array; |
|
9 | + public function findBy (array $filters): array; |
|
10 | 10 | |
11 | - public function findOneBy(array $filters): Entity; |
|
11 | + public function findOneBy (array $filters): Entity; |
|
12 | 12 | |
13 | - public function find($id): Entity; |
|
13 | + public function find ($id): Entity; |
|
14 | 14 | |
15 | - public function findAllRemoved(); |
|
15 | + public function findAllRemoved (); |
|
16 | 16 | |
17 | - public function findRemoved(): Entity; |
|
17 | + public function findRemoved (): Entity; |
|
18 | 18 | |
19 | - public function createEntity(): Entity; |
|
19 | + public function createEntity (): Entity; |
|
20 | 20 | |
21 | - public function remove(): Entity; |
|
21 | + public function remove (): Entity; |
|
22 | 22 | } |
@@ -2,8 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace Bludata\Doctrine\Common\Contracts; |
4 | 4 | |
5 | -interface Repository |
|
6 | -{ |
|
5 | +interface Repository { |
|
7 | 6 | public function findAll(); |
8 | 7 | |
9 | 8 | public function findBy(array $filters): array; |
@@ -6,47 +6,47 @@ |
||
6 | 6 | |
7 | 7 | interface Entity |
8 | 8 | { |
9 | - public function getId(); |
|
9 | + public function getId (); |
|
10 | 10 | |
11 | - public function getCreatedAt(): DateTime; |
|
11 | + public function getCreatedAt (): DateTime; |
|
12 | 12 | |
13 | - public function getUpdatedAt(): DateTime; |
|
13 | + public function getUpdatedAt (): DateTime; |
|
14 | 14 | |
15 | - public function getDeletedAt(): DateTime; |
|
15 | + public function getDeletedAt (): DateTime; |
|
16 | 16 | |
17 | - public function getRepository(): Repository; |
|
17 | + public function getRepository (): Repository; |
|
18 | 18 | |
19 | - public function preRemove(); |
|
19 | + public function preRemove (); |
|
20 | 20 | |
21 | - public function postRemove(); |
|
21 | + public function postRemove (); |
|
22 | 22 | |
23 | - public function prePersist(); |
|
23 | + public function prePersist (); |
|
24 | 24 | |
25 | - public function postPersist(); |
|
25 | + public function postPersist (); |
|
26 | 26 | |
27 | - public function preUpdate(); |
|
27 | + public function preUpdate (); |
|
28 | 28 | |
29 | - public function postUpdate(); |
|
29 | + public function postUpdate (); |
|
30 | 30 | |
31 | - public function preFlush(); |
|
31 | + public function preFlush (); |
|
32 | 32 | |
33 | - public function postFlush(); |
|
33 | + public function postFlush (); |
|
34 | 34 | |
35 | - public function persist(): Entity; |
|
35 | + public function persist (): Entity; |
|
36 | 36 | |
37 | - public function flush(): Entity; |
|
37 | + public function flush (): Entity; |
|
38 | 38 | |
39 | - public function remove(): Entity; |
|
39 | + public function remove (): Entity; |
|
40 | 40 | |
41 | - public function undelete(): Entity; |
|
41 | + public function undelete (): Entity; |
|
42 | 42 | |
43 | - public function fillable(): array; |
|
43 | + public function fillable (): array; |
|
44 | 44 | |
45 | - public function onlyStore(): array; |
|
45 | + public function onlyStore (): array; |
|
46 | 46 | |
47 | - public function onlyUpdate(): array; |
|
47 | + public function onlyUpdate (): array; |
|
48 | 48 | |
49 | - public function toArray(array $options = []): array; |
|
49 | + public function toArray (array $options = [ ]): array; |
|
50 | 50 | |
51 | - public function toObject(array $options): Entity; |
|
51 | + public function toObject (array $options): Entity; |
|
52 | 52 | } |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use DateTime; |
6 | 6 | |
7 | -interface Entity |
|
8 | -{ |
|
7 | +interface Entity { |
|
9 | 8 | public function getId(); |
10 | 9 | |
11 | 10 | public function getCreatedAt(): DateTime; |
@@ -4,8 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Bludata\Doctrine\Common\Contracts\Repository; |
6 | 6 | |
7 | -abstract class BaseRepository implements Repository |
|
8 | -{ |
|
7 | +abstract class BaseRepository implements Repository { |
|
9 | 8 | |
10 | 9 | } |
11 | 10 |
@@ -11,8 +11,7 @@ |
||
11 | 11 | * @ORM\HasLifecycleCallbacks |
12 | 12 | * @Gedmo\SoftDeleteable(fieldName="deletedAt", timeAware=false) |
13 | 13 | */ |
14 | -abstract class BaseEntity implements Entity |
|
15 | -{ |
|
14 | +abstract class BaseEntity implements Entity { |
|
16 | 15 | /** |
17 | 16 | * @ORM\Id |
18 | 17 | * @ORM\Column(type="guid", name="id") |
@@ -119,7 +119,7 @@ |
||
119 | 119 | |
120 | 120 | public function undelete(): Entity |
121 | 121 | { |
122 | - $this->deletedAt = null; |
|
122 | + $this->deletedAt = NULL; |
|
123 | 123 | |
124 | 124 | return $this; |
125 | 125 | } |
@@ -37,101 +37,101 @@ |
||
37 | 37 | */ |
38 | 38 | protected $deletedAt; |
39 | 39 | |
40 | - public function getId() |
|
40 | + public function getId () |
|
41 | 41 | { |
42 | 42 | return $this->id; |
43 | 43 | } |
44 | 44 | |
45 | - public function getCreatedAt(): DateTime |
|
45 | + public function getCreatedAt (): DateTime |
|
46 | 46 | { |
47 | 47 | return $this->createdAt; |
48 | 48 | } |
49 | 49 | |
50 | - public function getUpdatedAt(): DateTime |
|
50 | + public function getUpdatedAt (): DateTime |
|
51 | 51 | { |
52 | 52 | return $this->createdAt; |
53 | 53 | } |
54 | 54 | |
55 | - public function getDeletedAt(): DateTime |
|
55 | + public function getDeletedAt (): DateTime |
|
56 | 56 | { |
57 | 57 | return $this->deletedAt; |
58 | 58 | } |
59 | 59 | |
60 | - public function getRepository(): Repository |
|
60 | + public function getRepository (): Repository |
|
61 | 61 | { |
62 | 62 | } |
63 | 63 | |
64 | - public function preRemove() |
|
64 | + public function preRemove () |
|
65 | 65 | { |
66 | 66 | } |
67 | 67 | |
68 | - public function postRemove() |
|
68 | + public function postRemove () |
|
69 | 69 | { |
70 | 70 | } |
71 | 71 | |
72 | - public function prePersist() |
|
72 | + public function prePersist () |
|
73 | 73 | { |
74 | 74 | } |
75 | 75 | |
76 | - public function postPersist() |
|
76 | + public function postPersist () |
|
77 | 77 | { |
78 | 78 | } |
79 | 79 | |
80 | - public function preUpdate() |
|
80 | + public function preUpdate () |
|
81 | 81 | { |
82 | 82 | } |
83 | 83 | |
84 | - public function postUpdate() |
|
84 | + public function postUpdate () |
|
85 | 85 | { |
86 | 86 | } |
87 | 87 | |
88 | - public function preFlush() |
|
88 | + public function preFlush () |
|
89 | 89 | { |
90 | 90 | } |
91 | 91 | |
92 | - public function postFlush() |
|
92 | + public function postFlush () |
|
93 | 93 | { |
94 | 94 | } |
95 | 95 | |
96 | - public function persist(): Entity |
|
96 | + public function persist (): Entity |
|
97 | 97 | { |
98 | 98 | } |
99 | 99 | |
100 | - public function flush(): Entity |
|
100 | + public function flush (): Entity |
|
101 | 101 | { |
102 | 102 | } |
103 | 103 | |
104 | - public function remove(): Entity |
|
104 | + public function remove (): Entity |
|
105 | 105 | { |
106 | 106 | } |
107 | 107 | |
108 | - public function undelete(): Entity |
|
108 | + public function undelete (): Entity |
|
109 | 109 | { |
110 | 110 | $this->deletedAt = null; |
111 | 111 | |
112 | 112 | return $this; |
113 | 113 | } |
114 | 114 | |
115 | - public function fillable(): array |
|
115 | + public function fillable (): array |
|
116 | 116 | { |
117 | - return []; |
|
117 | + return [ ]; |
|
118 | 118 | } |
119 | 119 | |
120 | - public function onlyStore(): array |
|
120 | + public function onlyStore (): array |
|
121 | 121 | { |
122 | - return []; |
|
122 | + return [ ]; |
|
123 | 123 | } |
124 | 124 | |
125 | - public function onlyUpdate(): array |
|
125 | + public function onlyUpdate (): array |
|
126 | 126 | { |
127 | - return []; |
|
127 | + return [ ]; |
|
128 | 128 | } |
129 | 129 | |
130 | - public function toArray(array $options = []): array |
|
130 | + public function toArray (array $options = [ ]): array |
|
131 | 131 | { |
132 | 132 | } |
133 | 133 | |
134 | - public function toObject(array $options): Entity |
|
134 | + public function toObject (array $options): Entity |
|
135 | 135 | { |
136 | 136 | } |
137 | 137 | } |
@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace LaravelSeed\Contracts\Repositories; |
4 | 4 | |
5 | -interface Rota |
|
6 | -{ |
|
5 | +interface Rota { |
|
7 | 6 | |
8 | 7 | } |