From ac4d098d576b3339d765bf0a265f3529be5f4679 Mon Sep 17 00:00:00 2001 From: donald_p Date: Sat, 8 Jun 2019 15:26:21 +0200 Subject: [PATCH 1/4] refactor: switch to Request Base --- Reflect.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Reflect.php b/Reflect.php index 12bd3d0..bc8daa7 100644 --- a/Reflect.php +++ b/Reflect.php @@ -5,10 +5,10 @@ use ReflectionMethod; use ReflectionFunction; -use Modulus\Http\Request; +use Modulus\Http\Request\Base; use Modulus\Utility\Groupable; -use Modulus\Framework\Mocks\RouteBinding; +use Modulus\Framework\Mocks\RouteBinding; use Illuminate\Database\Eloquent\Model as EloquentModel; use Illuminate\Database\Eloquent\Collection as EloquentCollection; @@ -20,7 +20,7 @@ class Reflect /** * $request * - * @var \Request + * @var \Modulus\Http\Request\Base */ public static $request; @@ -62,9 +62,8 @@ private function celebrate($params, $variables, $route, $i = 0, $args = []) : ar if (class_exists($class)) { $instance = new $class(); - if ($instance instanceof Request) { - $data = array_merge($_POST, $_FILES); - $request = new $class($data); + if ($instance instanceof Base) { + $request = new $class(); $args[$where] = $request; @@ -129,7 +128,7 @@ private function hasRequest($params, $variables, $i = null) : array { foreach($params as $key => $param) { $class = '\\' . $param->getType(); - if (class_exists($class) && new $class() instanceof Request) { + if (class_exists($class) && new $class() instanceof Base) { $i = $key; } } From d65a627220934e86de75b38645fd6c666a7461db Mon Sep 17 00:00:00 2001 From: donald_p Date: Sat, 8 Jun 2019 15:27:33 +0200 Subject: [PATCH 2/4] refactor: moved all classes to the src folder --- Accessor.php => src/Accessor.php | 0 Command.php => src/Command.php | 0 Event.php => src/Event.php | 0 Events.php => src/Events.php | 0 GlobalVariables.php => src/GlobalVariables.php | 0 Groupable.php => src/Groupable.php | 0 Mail.php => src/Mail.php | 0 Middleware.php => src/Middleware.php | 0 Notification.php => src/Notification.php | 0 Plugin.php => src/Plugin.php | 0 Process.php => src/Process.php | 0 Reflect.php => src/Reflect.php | 0 RouteQuery.php => src/RouteQuery.php | 0 Scheduler.php => src/Scheduler.php | 0 Seeder.php => src/Seeder.php | 0 Validate.php => src/Validate.php | 0 Variable.php => src/Variable.php | 0 View.php => src/View.php | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename Accessor.php => src/Accessor.php (100%) rename Command.php => src/Command.php (100%) rename Event.php => src/Event.php (100%) rename Events.php => src/Events.php (100%) rename GlobalVariables.php => src/GlobalVariables.php (100%) rename Groupable.php => src/Groupable.php (100%) rename Mail.php => src/Mail.php (100%) rename Middleware.php => src/Middleware.php (100%) rename Notification.php => src/Notification.php (100%) rename Plugin.php => src/Plugin.php (100%) rename Process.php => src/Process.php (100%) rename Reflect.php => src/Reflect.php (100%) rename RouteQuery.php => src/RouteQuery.php (100%) rename Scheduler.php => src/Scheduler.php (100%) rename Seeder.php => src/Seeder.php (100%) rename Validate.php => src/Validate.php (100%) rename Variable.php => src/Variable.php (100%) rename View.php => src/View.php (100%) diff --git a/Accessor.php b/src/Accessor.php similarity index 100% rename from Accessor.php rename to src/Accessor.php diff --git a/Command.php b/src/Command.php similarity index 100% rename from Command.php rename to src/Command.php diff --git a/Event.php b/src/Event.php similarity index 100% rename from Event.php rename to src/Event.php diff --git a/Events.php b/src/Events.php similarity index 100% rename from Events.php rename to src/Events.php diff --git a/GlobalVariables.php b/src/GlobalVariables.php similarity index 100% rename from GlobalVariables.php rename to src/GlobalVariables.php diff --git a/Groupable.php b/src/Groupable.php similarity index 100% rename from Groupable.php rename to src/Groupable.php diff --git a/Mail.php b/src/Mail.php similarity index 100% rename from Mail.php rename to src/Mail.php diff --git a/Middleware.php b/src/Middleware.php similarity index 100% rename from Middleware.php rename to src/Middleware.php diff --git a/Notification.php b/src/Notification.php similarity index 100% rename from Notification.php rename to src/Notification.php diff --git a/Plugin.php b/src/Plugin.php similarity index 100% rename from Plugin.php rename to src/Plugin.php diff --git a/Process.php b/src/Process.php similarity index 100% rename from Process.php rename to src/Process.php diff --git a/Reflect.php b/src/Reflect.php similarity index 100% rename from Reflect.php rename to src/Reflect.php diff --git a/RouteQuery.php b/src/RouteQuery.php similarity index 100% rename from RouteQuery.php rename to src/RouteQuery.php diff --git a/Scheduler.php b/src/Scheduler.php similarity index 100% rename from Scheduler.php rename to src/Scheduler.php diff --git a/Seeder.php b/src/Seeder.php similarity index 100% rename from Seeder.php rename to src/Seeder.php diff --git a/Validate.php b/src/Validate.php similarity index 100% rename from Validate.php rename to src/Validate.php diff --git a/Variable.php b/src/Variable.php similarity index 100% rename from Variable.php rename to src/Variable.php diff --git a/View.php b/src/View.php similarity index 100% rename from View.php rename to src/View.php From 0371d1d24c4581a02d1c0062ff76b556a8a1a913 Mon Sep 17 00:00:00 2001 From: donald_p Date: Sat, 8 Jun 2019 15:28:32 +0200 Subject: [PATCH 3/4] feat: autoload from the src folder --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 46f7b80..a4a3f1f 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ }, "autoload": { "psr-4": { - "Modulus\\Utility\\": "" + "Modulus\\Utility\\": "src/" } }, "minimum-stability": "stable" From 847920b9cdbeaf9506f4f76ae36f013081fda34c Mon Sep 17 00:00:00 2001 From: donald_p Date: Sat, 8 Jun 2019 15:29:02 +0200 Subject: [PATCH 4/4] package: version bump --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a4a3f1f..8018557 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "modulusphp/utility", "description": "Utility component for Modulus", - "version": "1.9.4.4", + "version": "1.9.4.5", "license": "MIT", "type": "package", "authors": [{