public function __construct($root) { if (!is_string($root)) { throw new InvalidArgumentException(sprintf("\$root must be of type string, %s given.", gettype($root))); } $this->root = rtrim(str_replace("\\", "/", $root), "/"); }