/** * $path_parts = [0]=>assets_path; [1]=>filename; [2]=>extension; */ public function __construct($file, Base $parentParser = null) { if (!$file instanceof File) { $extension = pathinfo($file, PATHINFO_EXTENSION); $file = new File($extension, $file); } $this->file = $file; if (!isset(self::$_first_parents[$file->extension()])) { self::$_first_parents[$file->extension()] = $this; } $this->parentParser = $parentParser; $this->firstParent()->add_required_file($file); }