protected function nameHasExtension(string $name, array $sortedExtensions) : bool
    {
        foreach ($sortedExtensions as $extension) {
            $lengthDifference = strlen($name) - strlen($extension);

            if ($lengthDifference > 0 && strpos($name, $extension, $lengthDifference) !== false) {
                return true;
            }
        }

        return false;
    }
protected function nameHasExtension(string $name, array $sortedExtensions) : bool
    {
        foreach ($sortedExtensions as $extension) {
            $lengthDifference = strlen($name) - strlen($extension);

            if ($lengthDifference > 0 && strpos($name, $extension, $lengthDifference) !== false) {
                return true;
            }
        }

        return false;
    }
protected function nameHasExtension ( string $ name , array $ sortedExtensions ) : bool { foreach ( $ sortedExtensions as $ extension ) { $ lengthDifference = strlen ( $ name ) - strlen ( $ extension ) ; if ( $ lengthDifference > 0 && strpos ( $ name , $ extension , $ lengthDifference ) !== false ) { return true ; } } return false ; }
Gets whether or not a name has an extension

@param string $name The name to check
@param array $sortedExtensions The list of sorted extensions to check against
@return bool True if the name has an extension, otherwise false
Gets whether or not a name has an extension