filename = $filename; $this->localname = $localname; } public function setStripped(bool $stripped) { $this->stripped = $stripped; } public function getStripped():bool { return $this->stripped; } public function getFilename():string { return $this->filename; } public function getLocalName():string { return $this->localname; } public function addToPhar(\Phar $phar) { if ($this->stripped) { // strip and add } else { $phar->addFile( $this->getFilename(), $this->getLocalName() ); } } public function addFiltered(\Phar $phar, callable $filter) { $body = file_get_contents($this->filename); $body = call_user_func($filter, $body); $phar->addFromString($this->getLocalName(), $body); } public function getFilesize() { return filesize($this->filename); } }