lonnieezell / Bonfire2

CodeIgniter 4-based application skeleton

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creation of dynamic property Config\Validation::$users is deprecated

kenjis opened this issue · comments

Bonfire2 does not work with PHP 8.2.

The following patch fixes the errors.
Is the validation rule used actually?

--- a/src/Config/Registrar.php
+++ b/src/Config/Registrar.php
@@ -80,12 +80,12 @@ class Registrar
                 PasswordRules::class,
                 UserRules::class,
             ],
-            'users' => [
-                'email'      => 'required|valid_email|unique_email[{id}]',
-                'username'   => 'required|string|is_unique[users.username,id,{id}]',
-                'first_name' => 'permit_empty|string|min_length[3]',
-                'last_name'  => 'permit_empty|string|min_length[3]',
-            ],
+//            'users' => [
+//                'email'      => 'required|valid_email|unique_email[{id}]',
+//                'username'   => 'required|string|is_unique[users.username,id,{id}]',
+//                'first_name' => 'permit_empty|string|min_length[3]',
+//                'last_name'  => 'permit_empty|string|min_length[3]',
+//            ],
         ];
     }
 

It does seem that these rules are not used; UserController class uses config directly (line 141: $rules = config('Users')->validation;