| 1 |
<?php |
| 2 |
namespace Elementor\Core\Logger\Items; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly. |
| 6 |
} |
| 7 |
|
| 8 |
class JS extends File { |
| 9 |
|
| 10 |
const FORMAT = 'JS: date [type X times][file:line:column] message [meta]'; |
| 11 |
|
| 12 |
protected $column; |
| 13 |
|
| 14 |
public function __construct( $args ) { |
| 15 |
parent::__construct( $args ); |
| 16 |
$this->column = $args['column']; |
| 17 |
$this->file = $args['url']; |
| 18 |
$this->date = gmdate( 'Y-m-d H:i:s', $args['timestamp'] ); |
| 19 |
} |
| 20 |
|
| 21 |
#[\ReturnTypeWillChange] |
| 22 |
public function jsonSerialize() { |
| 23 |
$json_arr = parent::jsonSerialize(); |
| 24 |
$json_arr['column'] = $this->column; |
| 25 |
return $json_arr; |
| 26 |
} |
| 27 |
|
| 28 |
public function deserialize( $properties ) { |
| 29 |
parent::deserialize( $properties ); |
| 30 |
$this->column = ! empty( $properties['column'] ) && is_string( $properties['column'] ) ? $properties['column'] : ''; |
| 31 |
} |
| 32 |
|
| 33 |
public function get_name() { |
| 34 |
return 'JS'; |
| 35 |
} |
| 36 |
} |
| 37 |
|