|
@@ -37,10 +37,10 @@ discard block |
|
|
block discarded – undo |
|
37
|
37
|
public function boot() |
|
38
|
38
|
{ |
|
39
|
39
|
$this->publishes([ |
|
40
|
|
- __DIR__.'/lang/validation/'.App::getLocale().'.php' => resource_path('lang/validation/'.App::getLocale().'.php'), |
|
|
40
|
+ __DIR__ . '/lang/validation/' . App::getLocale() . '.php' => resource_path('lang/validation/' . App::getLocale() . '.php'), |
|
41
|
41
|
]); |
|
42
|
42
|
|
|
43
|
|
- foreach (glob(__DIR__.'/Rules/*.php') as $file) { |
|
|
43
|
+ foreach (glob(__DIR__ . '/Rules/*.php') as $file) { |
|
44
|
44
|
require_once $file; |
|
45
|
45
|
|
|
46
|
46
|
// get the file name of the current file without the extension |
|
@@ -48,9 +48,9 @@ discard block |
|
|
block discarded – undo |
|
48
|
48
|
$class = basename($file, '.php'); |
|
49
|
49
|
|
|
50
|
50
|
$Rule = 'Iamfarhad\Validation\Rules'; |
|
51
|
|
- if (class_exists($Rule.'\\'.$class)) { |
|
52
|
|
- $reflectionClass = new \ReflectionClass($Rule.'\\'.$class); |
|
53
|
|
- if (! $reflectionClass->isInstance((object) AbstractValidationRule::class)) { |
|
|
51
|
+ if (class_exists($Rule . '\\' . $class)) { |
|
|
52
|
+ $reflectionClass = new \ReflectionClass($Rule . '\\' . $class); |
|
|
53
|
+ if (!$reflectionClass->isInstance((object) AbstractValidationRule::class)) { |
|
54
|
54
|
throw new \Exception('this extenstion is not instance of ValidationRuleInterface'); |
|
55
|
55
|
} |
|
56
|
56
|
$module = $reflectionClass->newInstanceArgs([]); |
Please login to merge, or discard this patch.