/** * Returns the extension of the attached file, e.g 'jpg' for file.jpg. * * @param AttachmentInterface $attachment * @param string $styleName * * @return string */ protected function extension(AttachmentInterface $attachment, $styleName = '') { return pathinfo($attachment->originalFilename(), PATHINFO_EXTENSION); }