public function ext() {
        return $this->_cache(__FUNCTION__, function($file) {
            /** @type \Transit\File $file */

            // @version 1.1.1 Removed because of fileinfo bug
            // return MimeType::getExtFromType($file->type(), true);

            // @version 1.2.0 Allow support for $_FILES array
            $path = $file->data('name') ?: $file->path();

            return mb_strtolower(pathinfo($path, PATHINFO_EXTENSION));
        });
    }
public function ext() {
        return $this->_cache(__FUNCTION__, function($file) {
            /** @type \Transit\File $file */

            // @version 1.1.1 Removed because of fileinfo bug
            // return MimeType::getExtFromType($file->type(), true);

            // @version 1.2.0 Allow support for $_FILES array
            $path = $file->data('name') ?: $file->path();

            return mb_strtolower(pathinfo($path, PATHINFO_EXTENSION));
        });
    }
public function ext ( ) { return $ this -> _cache ( __FUNCTION__ , function ( $ file ) { /** @type \Transit\File $file */ // @version 1.1.1 Removed because of fileinfo bug // return MimeType::getExtFromType($file->type(), true); // @version 1.2.0 Allow support for $_FILES array $ path = $ file -> data ( 'name' ) ? : $ file -> path ( ) ; return mb_strtolower ( pathinfo ( $ path , PATHINFO_EXTENSION ) ) ; } ) ; }
Return the extension.

@return string
Return the extension .