@@ -6,17 +6,17 @@ |
||
6 | 6 | |
7 | 7 | abstract class Request extends FormRequest |
8 | 8 | { |
9 | - public function __construct() |
|
10 | - { |
|
11 | - parent::__construct(); |
|
9 | + public function __construct() |
|
10 | + { |
|
11 | + parent::__construct(); |
|
12 | 12 | |
13 | - $this->validateMac(); |
|
14 | - } |
|
13 | + $this->validateMac(); |
|
14 | + } |
|
15 | 15 | |
16 | - public function validateMac() |
|
17 | - { |
|
18 | - app('validator')->extend('mac', function ($attribute, $value, $parameters) { |
|
19 | - return preg_match('/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/', $value); |
|
20 | - }); |
|
21 | - } |
|
16 | + public function validateMac() |
|
17 | + { |
|
18 | + app('validator')->extend('mac', function ($attribute, $value, $parameters) { |
|
19 | + return preg_match('/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/', $value); |
|
20 | + }); |
|
21 | + } |
|
22 | 22 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function validateMac() |
17 | 17 | { |
18 | - app('validator')->extend('mac', function ($attribute, $value, $parameters) { |
|
18 | + app('validator')->extend('mac', function($attribute, $value, $parameters) { |
|
19 | 19 | return preg_match('/^(([0-9a-fA-F]{2}-){5}|([0-9a-fA-F]{2}:){5})[0-9a-fA-F]{2}$/', $value); |
20 | 20 | }); |
21 | 21 | } |
@@ -6,34 +6,34 @@ |
||
6 | 6 | |
7 | 7 | class StoreComputerRequest extends Request |
8 | 8 | { |
9 | - /** |
|
10 | - * Determine if the user is authorized to make this request. |
|
11 | - * |
|
12 | - * @return bool |
|
13 | - */ |
|
14 | - public function authorize() |
|
15 | - { |
|
16 | - return true; |
|
17 | - } |
|
9 | + /** |
|
10 | + * Determine if the user is authorized to make this request. |
|
11 | + * |
|
12 | + * @return bool |
|
13 | + */ |
|
14 | + public function authorize() |
|
15 | + { |
|
16 | + return true; |
|
17 | + } |
|
18 | 18 | |
19 | - /** |
|
20 | - * Get the validation rules that apply to the request. |
|
21 | - * |
|
22 | - * @return array |
|
23 | - */ |
|
24 | - public function rules() |
|
25 | - { |
|
26 | - return [ |
|
27 | - 'ip' => 'required|ip', |
|
28 | - 'mac' => 'required|mac', |
|
29 | - 'name' => 'required', |
|
30 | - 'group' => 'alpha_dash|max:30', |
|
31 | - 'public' => 'in:true,false,auto', |
|
32 | - ]; |
|
33 | - } |
|
19 | + /** |
|
20 | + * Get the validation rules that apply to the request. |
|
21 | + * |
|
22 | + * @return array |
|
23 | + */ |
|
24 | + public function rules() |
|
25 | + { |
|
26 | + return [ |
|
27 | + 'ip' => 'required|ip', |
|
28 | + 'mac' => 'required|mac', |
|
29 | + 'name' => 'required', |
|
30 | + 'group' => 'alpha_dash|max:30', |
|
31 | + 'public' => 'in:true,false,auto', |
|
32 | + ]; |
|
33 | + } |
|
34 | 34 | |
35 | - public function response(array $errors) |
|
36 | - { |
|
37 | - return new JsonResponse($errors, 422); |
|
38 | - } |
|
35 | + public function response(array $errors) |
|
36 | + { |
|
37 | + return new JsonResponse($errors, 422); |
|
38 | + } |
|
39 | 39 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | public function boot(Dispatcher $dispatcher) |
16 | 16 | { |
17 | - $dispatcher->mapUsing(function ($command) { |
|
17 | + $dispatcher->mapUsing(function($command) { |
|
18 | 18 | return Dispatcher::simpleMapping( |
19 | 19 | $command, 'PiFinder\Commands', 'PiFinder\Handlers\Commands' |
20 | 20 | ); |
@@ -7,27 +7,27 @@ |
||
7 | 7 | |
8 | 8 | class BusServiceProvider extends ServiceProvider |
9 | 9 | { |
10 | - /** |
|
11 | - * Bootstrap any application services. |
|
12 | - * |
|
13 | - * @param \Illuminate\Bus\Dispatcher $dispatcher |
|
14 | - */ |
|
15 | - public function boot(Dispatcher $dispatcher) |
|
16 | - { |
|
17 | - $dispatcher->mapUsing(function ($command) { |
|
18 | - return Dispatcher::simpleMapping( |
|
19 | - $command, |
|
20 | - \PiFinder\Commands::class, |
|
21 | - \PiFinder\Handlers\Commands::class |
|
22 | - ); |
|
23 | - }); |
|
24 | - } |
|
10 | + /** |
|
11 | + * Bootstrap any application services. |
|
12 | + * |
|
13 | + * @param \Illuminate\Bus\Dispatcher $dispatcher |
|
14 | + */ |
|
15 | + public function boot(Dispatcher $dispatcher) |
|
16 | + { |
|
17 | + $dispatcher->mapUsing(function ($command) { |
|
18 | + return Dispatcher::simpleMapping( |
|
19 | + $command, |
|
20 | + \PiFinder\Commands::class, |
|
21 | + \PiFinder\Handlers\Commands::class |
|
22 | + ); |
|
23 | + }); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Register any application services. |
|
28 | - */ |
|
29 | - public function register() |
|
30 | - { |
|
31 | - // |
|
32 | - } |
|
26 | + /** |
|
27 | + * Register any application services. |
|
28 | + */ |
|
29 | + public function register() |
|
30 | + { |
|
31 | + // |
|
32 | + } |
|
33 | 33 | } |
@@ -6,32 +6,32 @@ |
||
6 | 6 | |
7 | 7 | class MarkdownParser |
8 | 8 | { |
9 | - /** |
|
10 | - * Markdown parser instance. |
|
11 | - * |
|
12 | - * @var ParsedownExtra |
|
13 | - */ |
|
14 | - private $markdown; |
|
9 | + /** |
|
10 | + * Markdown parser instance. |
|
11 | + * |
|
12 | + * @var ParsedownExtra |
|
13 | + */ |
|
14 | + private $markdown; |
|
15 | 15 | |
16 | - /** |
|
17 | - * MarkdownParser constructor. |
|
18 | - * |
|
19 | - * @param ParsedownExtra $markdown |
|
20 | - */ |
|
21 | - public function __construct(ParsedownExtra $markdown) |
|
22 | - { |
|
23 | - $this->markdown = $markdown; |
|
24 | - } |
|
16 | + /** |
|
17 | + * MarkdownParser constructor. |
|
18 | + * |
|
19 | + * @param ParsedownExtra $markdown |
|
20 | + */ |
|
21 | + public function __construct(ParsedownExtra $markdown) |
|
22 | + { |
|
23 | + $this->markdown = $markdown; |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Parse a markdown document. |
|
28 | - * |
|
29 | - * @param $path |
|
30 | - * |
|
31 | - * @return mixed|string |
|
32 | - */ |
|
33 | - public function parse($path) |
|
34 | - { |
|
35 | - return $this->markdown->text($path); |
|
36 | - } |
|
26 | + /** |
|
27 | + * Parse a markdown document. |
|
28 | + * |
|
29 | + * @param $path |
|
30 | + * |
|
31 | + * @return mixed|string |
|
32 | + */ |
|
33 | + public function parse($path) |
|
34 | + { |
|
35 | + return $this->markdown->text($path); |
|
36 | + } |
|
37 | 37 | } |
@@ -4,17 +4,17 @@ |
||
4 | 4 | |
5 | 5 | abstract class Transformer |
6 | 6 | { |
7 | - /** |
|
8 | - * Transform a collection of items. |
|
9 | - * |
|
10 | - * @param array $items |
|
11 | - * |
|
12 | - * @return array |
|
13 | - */ |
|
14 | - public function transformCollection(array $items) |
|
15 | - { |
|
16 | - return array_map([$this, 'transform'], $items); |
|
17 | - } |
|
7 | + /** |
|
8 | + * Transform a collection of items. |
|
9 | + * |
|
10 | + * @param array $items |
|
11 | + * |
|
12 | + * @return array |
|
13 | + */ |
|
14 | + public function transformCollection(array $items) |
|
15 | + { |
|
16 | + return array_map([$this, 'transform'], $items); |
|
17 | + } |
|
18 | 18 | |
19 | - abstract public function transform($item); |
|
19 | + abstract public function transform($item); |
|
20 | 20 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | abstract class Event |
6 | 6 | { |
7 | - // |
|
7 | + // |
|
8 | 8 | } |
@@ -4,16 +4,16 @@ |
||
4 | 4 | |
5 | 5 | class DeviceTransformer extends Transformer |
6 | 6 | { |
7 | - public function transform($device) |
|
8 | - { |
|
9 | - return [ |
|
10 | - 'id' => $device['id'], |
|
11 | - 'ip' => $device['ip'], |
|
12 | - 'name' => $device['name'], |
|
13 | - 'group' => $device['group'], |
|
14 | - 'on_home_page' => $device['public'], |
|
15 | - 'device_added' => $device['created_at']->toIso8601String(), |
|
16 | - 'last_contact' => $device['updated_at']->toIso8601String(), |
|
17 | - ]; |
|
18 | - } |
|
7 | + public function transform($device) |
|
8 | + { |
|
9 | + return [ |
|
10 | + 'id' => $device['id'], |
|
11 | + 'ip' => $device['ip'], |
|
12 | + 'name' => $device['name'], |
|
13 | + 'group' => $device['group'], |
|
14 | + 'on_home_page' => $device['public'], |
|
15 | + 'device_added' => $device['created_at']->toIso8601String(), |
|
16 | + 'last_contact' => $device['updated_at']->toIso8601String(), |
|
17 | + ]; |
|
18 | + } |
|
19 | 19 | } |
@@ -9,5 +9,5 @@ |
||
9 | 9 | |
10 | 10 | abstract class Controller extends BaseController |
11 | 11 | { |
12 | - use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
|
12 | + use AuthorizesRequests, DispatchesJobs, ValidatesRequests; |
|
13 | 13 | } |
@@ -18,7 +18,6 @@ |
||
18 | 18 | /** |
19 | 19 | * Register any application authentication / authorization services. |
20 | 20 | * |
21 | - * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
22 | 21 | * |
23 | 22 | * @return void |
24 | 23 | */ |
@@ -6,26 +6,26 @@ |
||
6 | 6 | |
7 | 7 | class AuthServiceProvider extends ServiceProvider |
8 | 8 | { |
9 | - /** |
|
10 | - * The policy mappings for the application. |
|
11 | - * |
|
12 | - * @var array |
|
13 | - */ |
|
14 | - protected $policies = [ |
|
15 | - 'PiFinder\Model' => 'PiFinder\Policies\ModelPolicy', |
|
16 | - ]; |
|
9 | + /** |
|
10 | + * The policy mappings for the application. |
|
11 | + * |
|
12 | + * @var array |
|
13 | + */ |
|
14 | + protected $policies = [ |
|
15 | + 'PiFinder\Model' => 'PiFinder\Policies\ModelPolicy', |
|
16 | + ]; |
|
17 | 17 | |
18 | - /** |
|
19 | - * Register any application authentication / authorization services. |
|
20 | - * |
|
21 | - * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
22 | - * |
|
23 | - * @return void |
|
24 | - */ |
|
25 | - public function boot() |
|
26 | - { |
|
27 | - $this->registerPolicies(); |
|
18 | + /** |
|
19 | + * Register any application authentication / authorization services. |
|
20 | + * |
|
21 | + * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
|
22 | + * |
|
23 | + * @return void |
|
24 | + */ |
|
25 | + public function boot() |
|
26 | + { |
|
27 | + $this->registerPolicies(); |
|
28 | 28 | |
29 | - // |
|
30 | - } |
|
29 | + // |
|
30 | + } |
|
31 | 31 | } |