@@ -12,50 +12,50 @@ discard block |
||
12 | 12 | * |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - protected $path; |
|
15 | + protected $path; |
|
16 | 16 | |
17 | - /** |
|
17 | + /** |
|
18 | 18 | * Create a new plugin instance. |
19 | 19 | * |
20 | 20 | */ |
21 | - public function __construct() |
|
22 | - { |
|
23 | - $this->setPath(); |
|
24 | - } |
|
21 | + public function __construct() |
|
22 | + { |
|
23 | + $this->setPath(); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
26 | + /** |
|
27 | 27 | * Set the plugin autoload path. |
28 | 28 | * |
29 | 29 | * @return void |
30 | 30 | */ |
31 | - public function setPath() |
|
32 | - { |
|
31 | + public function setPath() |
|
32 | + { |
|
33 | 33 | $this->path = Reflect::getDirectory($this); |
34 | - } |
|
34 | + } |
|
35 | 35 | |
36 | - /** |
|
36 | + /** |
|
37 | 37 | * Get autoload path. |
38 | 38 | * |
39 | 39 | * @return string |
40 | 40 | */ |
41 | - public function path($append = null) |
|
42 | - { |
|
43 | - return is_null($append) ? $this->path |
|
44 | - : $this->path.'/'.ltrim(rtrim($append, '/'), '/').'/'; |
|
45 | - } |
|
41 | + public function path($append = null) |
|
42 | + { |
|
43 | + return is_null($append) ? $this->path |
|
44 | + : $this->path.'/'.ltrim(rtrim($append, '/'), '/').'/'; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
47 | + /** |
|
48 | 48 | * Get paths to templates. |
49 | 49 | * |
50 | 50 | * @return string |
51 | 51 | */ |
52 | - public function templatePaths() |
|
53 | - { |
|
54 | - $path = $this->path('templates'); |
|
55 | - return [$path]; |
|
56 | - } |
|
52 | + public function templatePaths() |
|
53 | + { |
|
54 | + $path = $this->path('templates'); |
|
55 | + return [$path]; |
|
56 | + } |
|
57 | 57 | |
58 | - /** |
|
58 | + /** |
|
59 | 59 | * Trigger an event callback. |
60 | 60 | * - onLoad |
61 | 61 | * - onDefine |
@@ -67,19 +67,19 @@ discard block |
||
67 | 67 | * - onValid |
68 | 68 | * - onInvalid |
69 | 69 | * |
70 | - * @param \Helmut\Forms\Form $form |
|
71 | - * @param string $name |
|
72 | - * @param array $params |
|
70 | + * @param \Helmut\Forms\Form $form |
|
71 | + * @param string $name |
|
72 | + * @param array $params |
|
73 | 73 | * @return mixed |
74 | 74 | */ |
75 | - public function event($form, $name, $params = []) |
|
76 | - { |
|
77 | - $name = Str::studly($name); |
|
75 | + public function event($form, $name, $params = []) |
|
76 | + { |
|
77 | + $name = Str::studly($name); |
|
78 | 78 | |
79 | - if (method_exists($this, 'on'.$name)) { |
|
80 | - return call_user_func_array(array($this, 'on'.$name), [$form, $params]); |
|
81 | - } |
|
79 | + if (method_exists($this, 'on'.$name)) { |
|
80 | + return call_user_func_array(array($this, 'on'.$name), [$form, $params]); |
|
81 | + } |
|
82 | 82 | |
83 | - } |
|
83 | + } |
|
84 | 84 | |
85 | 85 | } |