Welcome Guest, Not a member yet? Register   Sign In
Deprecation Error with Wiredesign's HMVC extension on PHP 7.2
#6

(This post was last modified: 12-06-2017, 09:33 AM by koficypher.)

(12-06-2017, 08:36 AM)InsiteFX Wrote: Alright, here is another one you can try, again not TESTED.

PHP Code:
(is_array($module)) ? list($module$params) = makeEach($module) : $params NULL

// Add this new method to the bottom of the Module.php file.
public function makeEach(&$arr)
{
 
   $key key($arr);

 
   $result = ($key === null
 
       false 
        
: [$keycurrent($arr), 'key' => $key'value' => current($arr)];

 
   next($arr);

 
   return $result;


Add that new method to the bottom of the Module file.
Okay so that worked but i had to do some few changes to  your code.

i made the function you asked me to place at the bottom a static function and called it in that line using Self::makeEach so i ended up having something like this
PHP Code:
(is_array($module)) ? list($module$params) = Self::makeEach($module) : $params NULL
    
public static function 
makeEach(&$arr)
 
   {
         
   $key key($arr);

         
   $result = ($key === null
         
       false 
                
: [$keycurrent($arr), 'key' => $key'value' => current($arr)];

         
   next($arr);

         
   return $result;
    } 

And that did it... Thanks InsiteFX
Reply


Messages In This Thread
RE: Deprecation Error with Wiredesign's HMVC extension on PHP 7.2 - by koficypher - 12-06-2017, 09:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB