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