private function validMimeImage($extension, $mimes)
    {
        if (is_array($mimes)) {
            foreach ($mimes as $mime) {
                if (!strstr($mime, 'image/')) {
                    throw new \InvalidArgumentException(htmlspecialchars(
                        "The extension $extension is not an image extension."
                    ));
                }
            }
        } else {
            if (!strstr($mimes, 'image/')) {
                throw new \InvalidArgumentException(htmlspecialchars(
                    "The extension $extension is not an image extension."
                ));
            }
        }
    }
private function validMimeImage($extension, $mimes)
    {
        if (is_array($mimes)) {
            foreach ($mimes as $mime) {
                if (!strstr($mime, 'image/')) {
                    throw new \InvalidArgumentException(htmlspecialchars(
                        "The extension $extension is not an image extension."
                    ));
                }
            }
        } else {
            if (!strstr($mimes, 'image/')) {
                throw new \InvalidArgumentException(htmlspecialchars(
                    "The extension $extension is not an image extension."
                ));
            }
        }
    }
private function validMimeImage ( $ extension , $ mimes ) { if ( is_array ( $ mimes ) ) { foreach ( $ mimes as $ mime ) { if ( ! strstr ( $ mime , 'image/' ) ) { throw new \ InvalidArgumentException ( htmlspecialchars ( "The extension $extension is not an image extension." ) ) ; } } } else { if ( ! strstr ( $ mimes , 'image/' ) ) { throw new \ InvalidArgumentException ( htmlspecialchars ( "The extension $extension is not an image extension." ) ) ; } } }
Valide si un mimetype est celui d'une image.

@param string       $extension
@param string|array $mimes     Mimetype ou liste de mimetype.

@throws \InvalidArgumentException L'extension n'est pas une extension d'image.
Valide si un mimetype est celui d une image .