| @@ -122,9 +122,9 @@ | ||
| 122 | 122 | // No use reflection method for performance, also this just a simple call. |
| 123 | 123 | // Manipulate the POST as raw data. |
| 124 | 124 | $_POST = $request->get_data(); |
| 125 | 125 | |
| 126 | - return $object->$method( $request ); | |
| 126 | + return call_user_func( array( $object, $method ), $request ); | |
| 127 | 127 | } else { |
| 128 | 128 | $this->log( sprintf( 'class not found when executing: %s %s', $class_name, $method ), self::INTERNAL_LOG ); |
| 129 | 129 | } |
| 130 | 130 | } |
| @@ -162,9 +162,9 @@ | ||
| 162 | 162 | * @param string $class_name The class name. |
| 163 | 163 | * |
| 164 | 164 | * @return mixed The route associated with the intention, or null if not found. |
| 165 | 165 | */ |
| 166 | - public function get_route( $method, $class_name ) { | |
| 166 | + public function get_route( $method, $class_name ): mixed { | |
| 167 | 167 | $intention = $this->get_intention( $class_name, $method ); |
| 168 | 168 | |
| 169 | 169 | try { |
| 170 | 170 | return wd_di()->get( sprintf( 'route.%s', $intention ) ); |
| @@ -170,8 +170,10 @@ | ||
| 170 | 170 | return wd_di()->get( sprintf( 'route.%s', $intention ) ); |
| 171 | 171 | } catch ( Exception $e ) { |
| 172 | 172 | $this->log( $e->getMessage(), self::INTERNAL_LOG ); |
| 173 | 173 | } |
| 174 | + | |
| 175 | + return null; | |
| 174 | 176 | } |
| 175 | 177 | |
| 176 | 178 | /** |
| 177 | 179 | * Retrieves the nonce for a given method and class name. |
| @@ -180,9 +182,9 @@ | ||
| 180 | 182 | * @param string $class_name The class name. |
| 181 | 183 | * |
| 182 | 184 | * @return mixed The nonce associated with the intention, or null if not found. |
| 183 | 185 | */ |
| 184 | - public function get_nonce( $method, $class_name ) { | |
| 186 | + public function get_nonce( $method, $class_name ): mixed { | |
| 185 | 187 | $intention = $this->get_intention( $class_name, $method ); |
| 186 | 188 | |
| 187 | 189 | try { |
| 188 | 190 | return wd_di()->get( sprintf( 'nonce.%s', $intention ) ); |
| @@ -188,8 +190,10 @@ | ||
| 188 | 190 | return wd_di()->get( sprintf( 'nonce.%s', $intention ) ); |
| 189 | 191 | } catch ( Exception $e ) { |
| 190 | 192 | $this->log( $e->getMessage(), self::INTERNAL_LOG ); |
| 191 | 193 | } |
| 194 | + | |
| 195 | + return null; | |
| 192 | 196 | } |
| 193 | 197 | |
| 194 | 198 | /** |
| 195 | 199 | * Check OPcache is enabled or not. |