for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @author stev leibelt <[email protected]>
* @since 2017-04-12
*/
namespace Net\Bazzline\Component\ApacheServerStatusParser\Service\Content\Fetcher;
use RuntimeException;
abstract class AbstractFetcher implements FetcherInterface
{
* @return array
* @throws RuntimeException
public function fetch()
//begin of business logic
$contentAsString = strip_tags($this->fetchContentAsStringOrThrowRuntimeException());
$contentAsArray = explode(PHP_EOL, $contentAsString);
$lines = array_filter(
$contentAsArray,
function($item) {
return (strlen(trim($item)) > 0);
}
);
return $lines;
//end of business logic
* @return string
abstract protected function fetchContentAsStringOrThrowRuntimeException();