use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
// Import SPL stuff
+use \InvalidArgumentException;
use \SplFileInfo;
/**
*
* @param $infoInstance An instance of a SplFileInfo class
* @return $indexInstance An instance of a IndexableStack class
+ * @throws InvalidArgumentException If a parameter is invalid
*/
public static final function createFileStackIndexInstance (SplFileInfo $infoInstance, string $type) {
// If there is no handler?
- if (GenericRegistry::getRegistry()->instanceExists($type . '_index')) {
+ if (empty($type)) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "type" is empty');
+ } elseif (GenericRegistry::getRegistry()->instanceExists($type . '_index')) {
// Get handler from registry
$indexInstance = GenericRegistry::getRegistry()->getInstance($type . '_index');
} else {