<?php
 abstract class vB_Utility_Filescanner { use vB_Utility_Trait_NoSerialize; protected $enabled = false; protected $errors = []; final public function __construct($vboptions) { $this->enabled = $this->checkDependencies($vboptions); if ($this->enabled) { $this->initialize($vboptions); } } final public function isEnabled() { return (bool) $this->enabled; } final public function fetchErrors() { return $this->errors; } final public function clearErrors() { $this->errors = []; } protected function initialize($vboptions) { } protected function checkDependencies($vboptions) { return true; } abstract protected function scanFile($filename); } 