private function isAllowedExtension($extension = null)
    {
        if(!$extension && $this->extension) {
            $extension = $this->extension;
        }

        if(!$extension) {
            throw new \Exception("No extension given");
        }

        if(array_intersect([strtolower($extension),strtoupper($extension)], self::allowedExtensions())) {
            return true;
        }
        return false;
    }
private function isAllowedExtension($extension = null)
    {
        if(!$extension && $this->extension) {
            $extension = $this->extension;
        }

        if(!$extension) {
            throw new \Exception("No extension given");
        }

        if(array_intersect([strtolower($extension),strtoupper($extension)], self::allowedExtensions())) {
            return true;
        }
        return false;
    }
private function isAllowedExtension ( $ extension = null ) { if ( ! $ extension && $ this -> extension ) { $ extension = $ this -> extension ; } if ( ! $ extension ) { throw new \ Exception ( "No extension given" ) ; } if ( array_intersect ( [ strtolower ( $ extension ) , strtoupper ( $ extension ) ] , self :: allowedExtensions ( ) ) ) { return true ; } return false ; }
Check if an extension is allowed to be uploaded.

@param  null $extension
@return bool
@throws \Exception
Check if an extension is allowed to be uploaded .