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