<?php
 namespace App\ExportData; abstract class ConvertAbstract { protected $xml; public function __construct(\SimpleXMLElement $xml) { $this->xml = $xml; } public function convert(\App\ExportData\OutputAbstract $output) { $this->process($output); if ($output->getOk()===null) { throw new \Exception("The conversion of an export data file in class `".get_called_class()."` should set the `ok` attribute as a true/false value; message thrown in output convert()."); } } abstract protected function process(\App\ExportData\OutputAbstract $output); } 