use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
// Import SPL stuff
+use \InvalidArgumentException;
use \SplFileInfo;
/**
* @return $stackInstance An instance of a StackableFile class
*/
public static final function createFileStackInstance (string $prefix, string $stackName) {
+ // Validate parameter
+ //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-FACTORY: prefix=%s,stackName=%s - CALLED!', $prefix, $stackName));
+ if (empty($prefix)) {
+ // Throw IAE
+ throw new InvalidArgumentException('Parameter "prefix" is empty');
+ } elseif (empty($stackName)) {
+ // Throw it again
+ throw new InvalidArgumentException('Paramter "stackName" is empty');
+ }
+
// Construct file stack name
$fileInfoInstance = new SplFileInfo(sprintf('%s%s/%s.%s',
FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('root_base_path'),
}
// Return the instance
+ //* NOISY-DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-FACTORY: stackInstance=%s - EXIT!', $stackInstance->__toString()));
return $stackInstance;
}