private function checkType($type) { if (!empty($this->allowTypes)) { return in_array(strtolower($type), $this->allowTypes); } return true; }