/** * @param string $file * @param int $width * @param int $height * @param int $method * @return string */ public function mask($file, $width, $height, $method) { $pathinfo = pathinfo($file); $ext = isset($pathinfo['extension']) ? $pathinfo['extension'] : 'img'; $replacements = [intval($width), intval($height), $pathinfo['filename'], $ext, Helpers::method2name($method), date('d'), date('m'), date('Y'), date('dmy'), time(), microtime()]; return str_replace($this->placeholders, $replacements, $this->mask); }