<?php
abstract class ReadDataStrategyAbstract
{
private $_filename;
public function __construct($filename)
{
$this->_filename = $filename;
}
public function getData()
{
if (!is_readable($this->getFilename())) {
throw new RuntimeException('File [' . $this->getFilename() . '] is not readable.');
}
return $this->_readData($this->getFilename());
}
public function getFilename()
{
return $this->_filename;
}
protected abstract function _readData($filename);
}