| @@ -4,9 +4,9 @@ | ||
| 4 | 4 | use Elementor\Core\Base\Module as BaseModule; |
| 5 | 5 | use Elementor\Data\Base\Processor; |
| 6 | 6 | |
| 7 | 7 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | - exit; // Exit if accessed directly. | |
| 8 | + exit; // Exit if accessed directly | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | class Manager extends BaseModule { |
| 12 | 12 | |
| @@ -109,8 +109,9 @@ | ||
| 109 | 109 | * Register endpoint format. |
| 110 | 110 | * |
| 111 | 111 | * @param string $command |
| 112 | 112 | * @param string $format |
| 113 | + * | |
| 113 | 114 | */ |
| 114 | 115 | public function register_endpoint_format( $command, $format ) { |
| 115 | 116 | $this->command_formats[ $command ] = rtrim( $format, '/' ); |
| 116 | 117 | } |
| @@ -115,11 +116,15 @@ | ||
| 115 | 116 | $this->command_formats[ $command ] = rtrim( $format, '/' ); |
| 116 | 117 | } |
| 117 | 118 | |
| 118 | 119 | public function register_rest_error_handler() { |
| 120 | + // TODO: Remove - Find better solution. | |
| 121 | + return; | |
| 122 | + | |
| 119 | 123 | if ( ! $this->is_internal() ) { |
| 120 | 124 | $logger_manager = \Elementor\Core\Logger\Manager::instance(); |
| 121 | - $logger_manager->register_error_handler(); | |
| 125 | + | |
| 126 | + set_error_handler( [ $logger_manager, 'rest_error_handler' ], E_ALL ); | |
| 122 | 127 | } |
| 123 | 128 | } |
| 124 | 129 | |
| 125 | 130 | /** |
| @@ -153,9 +158,9 @@ | ||
| 153 | 158 | /** |
| 154 | 159 | * Command extract args. |
| 155 | 160 | * |
| 156 | 161 | * @param string $command |
| 157 | - * @param array $args | |
| 162 | + * @param array $args | |
| 158 | 163 | * |
| 159 | 164 | * @return \stdClass |
| 160 | 165 | */ |
| 161 | 166 | public function command_extract_args( $command, $args = [] ) { |
| @@ -261,10 +266,10 @@ | ||
| 261 | 266 | |
| 262 | 267 | /** |
| 263 | 268 | * Run processor. |
| 264 | 269 | * |
| 265 | - * @param Processor $processor | |
| 266 | - * @param array $data | |
| 270 | + * @param \Elementor\Data\Base\Processor $processor | |
| 271 | + * @param array $data | |
| 267 | 272 | * |
| 268 | 273 | * @return mixed |
| 269 | 274 | */ |
| 270 | 275 | public function run_processor( $processor, $data ) { |
| @@ -279,11 +284,11 @@ | ||
| 279 | 284 | * Run processors. |
| 280 | 285 | * |
| 281 | 286 | * Filter them by class. |
| 282 | 287 | * |
| 283 | - * @param Processor[] $processors | |
| 284 | - * @param string $filter_by_class | |
| 285 | - * @param array $data | |
| 288 | + * @param \Elementor\Data\Base\Processor[] $processors | |
| 289 | + * @param string $filter_by_class | |
| 290 | + * @param array $data | |
| 286 | 291 | * |
| 287 | 292 | * @return false|array |
| 288 | 293 | */ |
| 289 | 294 | public function run_processors( $processors, $filter_by_class, $data ) { |
| @@ -312,9 +317,9 @@ | ||
| 312 | 317 | * Simulate rest API from within the backend. |
| 313 | 318 | * Use args as query. |
| 314 | 319 | * |
| 315 | 320 | * @param string $endpoint |
| 316 | - * @param array $args | |
| 321 | + * @param array $args | |
| 317 | 322 | * @param string $method |
| 318 | 323 | * |
| 319 | 324 | * @return \WP_REST_Response |
| 320 | 325 | */ |
| @@ -340,9 +345,9 @@ | ||
| 340 | 345 | * |
| 341 | 346 | * Wrapper for `$this->run_request` return `$response->getData()` instead of `$response`. |
| 342 | 347 | * |
| 343 | 348 | * @param string $endpoint |
| 344 | - * @param array $args | |
| 349 | + * @param array $args | |
| 345 | 350 | * @param string $method |
| 346 | 351 | * |
| 347 | 352 | * @return array |
| 348 | 353 | */ |