Elementor\System_Info\Main::create_reporter PHP Method

create_reporter() public method

public create_reporter ( array $properties ) : WP_Error | false | Base_Reporter
$properties array
return WP_Error | false | Elementor\System_Info\Classes\Abstracts\Base_Reporter
    public function create_reporter(array $properties)
    {
        $properties = Model_Helper::prepare_properties($this->get_settings('reporter_properties'), $properties);
        $reporter_class = $properties['class_name'] ? $properties['class_name'] : $this->get_reporter_class($properties['name']);
        $reporter_class = $this->get_settings('namespaces.classes_namespace') . '\\' . $reporter_class;
        $reporter = new $reporter_class($properties);
        if (!$reporter instanceof Base_Reporter) {
            return new \WP_Error('Each reporter must to be an instance or sub-instance of Base_Reporter class');
        }
        if (!$reporter->is_enabled()) {
            return false;
        }
        return $reporter;
    }