path; } /** * Set Path. * * @param string $pValue File path * @param bool $pVerifyFile Verify file * * @throws FileNotFoundException * * @return self */ public function setPath(string $pValue = '', bool $pVerifyFile = true) { if ($pVerifyFile) { if (!\file_exists($pValue)) { throw new FileNotFoundException($pValue); } if (0 == $this->width && 0 == $this->height) { // Get width/height list($this->width, $this->height) = \getimagesize($pValue); } } $this->path = $pValue; return $this; } /** * Get Filename. * * @return string */ public function getFilename(): string { return $this->path ? \basename($this->path) : ''; } /** * Get Extension. * * @return string */ public function getExtension(): string { $exploded = \explode('.', $this->getFilename()); return $exploded[\count($exploded) - 1]; } /** * Get indexed filename (using image index). * * @param string $numSlide * * @return string */ public function getIndexedFilename($numSlide) { return 'background_' . $numSlide . '.' . $this->getExtension(); } }