//* NOISY-DEBUG: */ printf('[%s:%d]: isEnabled[]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($isEnabled));
if (!is_bool($isEnabled)) {
// Throw exception
- throw new UnexpectedValueException(sprintf('isEnabled[]=%s is unexpected', gettype($isEnabled)));
+ throw new UnexpectedValueException(sprintf('isEnabled[]=%s is unexpected', gettype($isEnabled)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Return it
continue;
} elseif (!is_dir($realPathName)) {
// Is not a directory
- throw new UnexpectedValueException(sprintf('realPathName=%s is not a directory', $realPathName));
+ throw new UnexpectedValueException(sprintf('realPathName=%s is not a directory', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_readable($realPathName)) {
// Not readable
- throw new UnexpectedValueException(sprintf('realPathName=%s cannot be read from', $realPathName));
+ throw new UnexpectedValueException(sprintf('realPathName=%s cannot be read from', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Try to load the application classes
continue;
} elseif (!is_dir($realPathName)) {
// Is not a directory
- throw new UnexpectedValueException(sprintf('realPathName=%s is not a directory', $realPathName));
+ throw new UnexpectedValueException(sprintf('realPathName=%s is not a directory', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_readable($realPathName)) {
// Not readable
- throw new UnexpectedValueException(sprintf('realPathName=%s cannot be read from', $realPathName));
+ throw new UnexpectedValueException(sprintf('realPathName=%s cannot be read from', $realPathName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Try to load the application classes
const EXCEPTION_DIR_POINTER_INVALID = 0x019;
const EXCEPTION_FILE_POINTER_INVALID = 0x01a;
const EXCEPTION_INVALID_RESOURCE = 0x01b;
- const EXCEPTION_UNEXPECTED_OBJECT = 0x01c;
const EXCEPTION_LIMIT_ELEMENT_IS_UNSUPPORTED = 0x01d;
const EXCEPTION_GETTER_IS_MISSING = 0x01e;
const EXCEPTION_ARRAY_EXPECTED = 0x01f;
const EXCEPTION_MISSING_ELEMENT = 0x02f;
const EXCEPTION_HEADERS_ALREADY_SENT = 0x030;
const EXCEPTION_DEFAULT_CONTROLLER_GONE = 0x031;
- const EXCEPTION_CLASS_NOT_FOUND = 0x032;
const EXCEPTION_REQUIRED_INTERFACE_MISSING = 0x033;
const EXCEPTION_FATAL_ERROR = 0x034;
const EXCEPTION_FILE_NOT_FOUND = 0x035;
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('HTTP-CLIENT: responseArray()=%d', count($responseArray)));
if (count($responseArray) < 2) {
// Not expected count
- throw new UnexpectedValueException(sprintf('responseArray()=%d must have at least two elements', count($responseArray)));
+ throw new UnexpectedValueException(sprintf('responseArray()=%d must have at least two elements', count($responseArray)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Analyze first header line
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (empty($criteriaKey)) {
// Throw it again
throw new InvalidArgumentException('Parameter "criteriaKey" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Invoke inner method
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
} elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
// Throw UAE
- throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)));
+ throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
throw new InvalidArgumentException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
} elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
// Throw UAE
- throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)));
+ throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not accepted', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Add it with generic method
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Add the configuration entry as a criteria
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// First nothing matches and nothing is counted
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[%s]=%s', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaValue));
if ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+ throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
throw new InvalidArgumentException('Parameter "criteriaType" is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!in_array($criteriaType, self::$CRITERIA_TYPES)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType));
+ throw new UnexpectedValueException(sprintf('criteriaType=%s is not supported', $criteriaType), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!$this->isValidGenericArrayGroup('criteria', $criteriaType)) {
// Not intialized yet
throw new BadMethodCallException(sprintf('Method cannot be invoked before criteriaType=%s is initialized!', $criteriaType), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[%s]=%s', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaValue));
if ((strpos($criteriaKey, 'my-') !== false) || (strpos($criteriaKey, 'my_') !== false)) {
// Throw UAE
- throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey));
+ throw new UnexpectedValueException(sprintf('criteriaKey=%s has illegal prefix "my"', $criteriaKey), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (is_array($criteriaValue) || is_bool($criteriaValue) || is_object($criteriaValue) || is_resource($criteriaValue)) {
// Throw it again
- throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not supported', gettype($criteriaValue)));
+ throw new UnexpectedValueException(sprintf('criteriaValue[]=%s is not supported', gettype($criteriaValue)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Convert dashes to underscore
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\FileNotFoundException;
use Org\Mxchange\CoreFramework\Generic\FrameworkException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Result\Database\BaseDatabaseResult;
use Org\Mxchange\CoreFramework\Traits\Compressor\Channel\CompressorChannelTrait;
use Org\Mxchange\CoreFramework\Traits\Handler\Io\IoHandlerTrait;
// Import SPL stuff
use \InvalidArgumentException;
use \SplFileInfo;
-use \UnexpectedValueException;
/**
* Database backend class for storing objects in locally created files.
*
* @param $dataSetInstance An instance of a StorableCriteria class
* @return void
- * @throws UnexpectedValueException If $tableName is empty
+ * @throws InvalidArgumentException If $tableName is empty
* @throws SqlException If an SQL error occurs
*/
public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) {
// Is "cache" there?
if (empty($tableName)) {
// Should never be an empty string
- throw new UnexpectedValueException('Class field dataSetInstance->tableName is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
+ throw new InvalidArgumentException('Class field dataSetInstance->tableName is empty', FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
} elseif (!isset($this->pathNames[$tableName])) {
// "Cache" is not present, so create and assign it
$this->pathNames[$tableName] = FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('local_database_path') . $tableName . DIRECTORY_SEPARATOR;
$factoryInstance = new ObjectFactory();
// Then throw an exception
- throw new NoClassException(array($factoryInstance, $fullClassName), self::EXCEPTION_CLASS_NOT_FOUND);
+ throw new NoClassException([$factoryInstance, $fullClassName], FrameworkInterface::EXCEPTION_CLASS_NOT_FOUND);
}
// Split class name on backslash to check naming-convention
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-BINARY-FILE: fileSize[%s]=%d', gettype($fileSize), $fileSize));
if (!is_int($fileSize)) {
// Bad file?
- throw new UnexpectedValueException(sprintf('fileSize[]=%s is unexpected', gettype($fileSize)));
+ throw new UnexpectedValueException(sprintf('fileSize[]=%s is unexpected', gettype($fileSize)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Is more than 0 returned?
* This method will return true if an emptied (nulled) entry has been found.
*
* @return $isValid Whether the next entry is valid
- * @throws UnexpectedValueException If some value is not expected
* @throws BadMethodCallException If this->indexInstance is not properly set
*/
public function isValid () {
* This method will return true if an emptied (nulled) entry has been found.
*
* @return $isValid Whether the next entry is valid
- * @throws UnexpectedValueException If some value is not expected
* @throws BadMethodCallException If this->stackInstance is not properly set
*/
public function isValid () {
// Is it valid?
if (!is_string($data)) {
// Is not a string
- throw new UnexpectedValueException(sprintf('Returned data[]=%s is not expected.', gettype($data)));
+ throw new UnexpectedValueException(sprintf('Returned data[]=%s is not expected.', gettype($data)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Then return it
// Make sure the required array key is there
if (!isset($fileData['size'])) {
// Not valid array
- throw new UnexpectedValueException(sprintf('fileData=%s has no element "size"', print_r($fileData, TRUE)));
+ throw new UnexpectedValueException(sprintf('fileData=%s has no element "size"', print_r($fileData, TRUE)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Return size
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] expectedMatches=%d,lineArray()=%d', __METHOD__, __LINE__, $expectedMatches, count($lineArray)));
if (($expectedMatches > 0) && (count($lineArray) !== $expectedMatches)) {
// Invalid line found as strict count matching is requested
- throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches));
+ throw new UnexpectedValueException(sprintf('lineArray()=%d has not expected count %d', count($lineArray), $expectedMatches), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Return it
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\BaseFilter;
use Org\Mxchange\CoreFramework\Filter\Filterable;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Loader\NoClassException;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Request\Requestable;
// Does the guest class exist?
if (!class_exists($className)) {
// Then abort here
- throw new NoClassException (array($this, $className), self::EXCEPTION_CLASS_NOT_FOUND);
+ throw new NoClassException ([$this, $className], FrameworkInterface::EXCEPTION_CLASS_NOT_FOUND);
}
// Now try the dynamic login
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Handler\BaseHandler;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Task\Taskable;
// If the task is 'idle_loop', a deplay of zero seconds is fine
if ($intervalDelay < 0) {
// Invalid configuration value
- throw new UnexpectedValueException(sprintf('taskName=%s has intervalDelay=%d below zero', $taskName, $intervalDelay));
+ throw new UnexpectedValueException(sprintf('taskName=%s has intervalDelay=%d below zero', $taskName, $intervalDelay), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($startupDelay < 0) {
// Invalid configuration value
- throw new UnexpectedValueException(sprintf('taskName=%s has startupDelay=%d below zero', $taskName, $startupDelay));
+ throw new UnexpectedValueException(sprintf('taskName=%s has startupDelay=%d below zero', $taskName, $startupDelay), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($maxRuns < 0) {
// Invalid configuration value
- throw new UnexpectedValueException(sprintf('taskName=%s has maxRuns=%d below zero', $taskName, $maxRuns));
+ throw new UnexpectedValueException(sprintf('taskName=%s has maxRuns=%d below zero', $taskName, $maxRuns), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($taskName != 'idle_loop' && $intervalDelay == 0) {
// Only idle_loop can have a zero interval delay
- throw new UnexpectedValueException(sprintf('taskName=%s has zero interval delay which is only valid for "idle_loop" task', $taskName));
+ throw new UnexpectedValueException(sprintf('taskName=%s has zero interval delay which is only valid for "idle_loop" task', $taskName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($taskName != 'idle_loop' && $startupDelay == 0) {
// Only idle_loop can have a zero interval delay
- throw new UnexpectedValueException(sprintf('taskName=%s has zero startup delay which is only valid for "idle_loop" task', $taskName));
+ throw new UnexpectedValueException(sprintf('taskName=%s has zero startup delay which is only valid for "idle_loop" task', $taskName), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Create the entry
// Import SPL stuff
use \SplFileInfo;
-use \UnexpectedValueException;
/**
* A general index class
strlen($data),
$data,
$this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (empty(trim($data, chr(0)))) {
// Empty file header
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-INDEX: File header is empty - EXIT!');
throw new UnexpectedValueException(sprintf('data=%s does not end with "%s"',
$data,
chr(BinaryFile::SEPARATOR_HEADER_ENTRIES)
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Okay, then remove it
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('BASE-FILE-INDEX: HEADER_INDEX_ELEMENT_COUNT=%d,header()=%d', BinaryFile::HEADER_INDEX_ELEMENT_COUNT, count($header)));
if (count($header) != BinaryFile::HEADER_INDEX_ELEMENT_COUNT) {
// Bad header
- throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT));
+ throw new UnexpectedValueException(sprintf('header()=%d is not expected value %d', count($header), BinaryFile::HEADER_INDEX_ELEMENT_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($header[BinaryFile::HEADER_NAME_MAGIC] !== Indexable::INDEX_MAGIC) {
// Magic must be in first element
- throw new UnexpectedValueException(sprintf('header[%s]=%s is not the expected magic (%s)', BinaryFile::HEADER_NAME_MAGIC, $header[BinaryFile::HEADER_NAME_MAGIC], Indexable::INDEX_MAGIC));
+ throw new UnexpectedValueException(sprintf('header[%s]=%s is not the expected magic (%s)', BinaryFile::HEADER_NAME_MAGIC, $header[BinaryFile::HEADER_NAME_MAGIC], Indexable::INDEX_MAGIC), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]) != BinaryFile::LENGTH_COUNT) {
// Length of total entries not matching
- throw new UnexpectedValueException(sprintf('header[%s](%d)=%s does not have expected length %d', BinaryFile::HEADER_NAME_TOTAL_ENTRIES, strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]), $header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES], BinaryFile::LENGTH_COUNT));
+ throw new UnexpectedValueException(sprintf('header[%s](%d)=%s does not have expected length %d', BinaryFile::HEADER_NAME_TOTAL_ENTRIES, strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]), $header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES], BinaryFile::LENGTH_COUNT), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Decode count
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FILE-STACK-INDEX: stackName=%s,hash{}=0x%s,gapPosition=%s', $stackName, bin2hex($data[StackableFile::ARRAY_NAME_HASH]), $gapPosition));
if ($gapPosition <= ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)) {
// Not valid gap position returned
- throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)));
+ throw new UnexpectedValueException(sprintf('gapPosition[%s]=%d is smaller or equal headerSize+1=%d', gettype($gapPosition), $gapPosition, ($this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize() + 1)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Then write the data at that gap
// Import SPL stuff
use \BadMethodCallException;
use \LogicException;
+use \UnexpectedValueException;
/**
* A registry iterator
throw new BadMethodCallException(sprintf('this->key=%s is last key in this iteration. Forgot to invoke valid() before?', $this->key()), FrameworkInterface::EXCEPTION_BAD_METHOD_CALL);
} elseif ($registryType == 'invalid') {
// Not changed!
- throw new UnexpectedValueException('registryType has not been changed.');
+ throw new UnexpectedValueException('registryType has not been changed.', FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Yes, then advance to that entry
// The recipient should be a user instance, right?
if (!$recipientInstance instanceof ManageableMember) {
// Invalid entry found!
- throw new UnexpectedValueException(sprintf('recipientInstance[]=%s does not implement ManageableMember', gettype($recipientInstance)));
+ throw new UnexpectedValueException(sprintf('recipientInstance[]=%s does not implement ManageableMember', gettype($recipientInstance)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// User class found, so entry is valid, first load the template
// And validate it
if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
// This command has an invalid instance!
- throw new UnexpectedValueException(sprintf('commandInstance for commandName=%s is not object (%s) or does not implement Commandable.', $commandName, gettype($commandInstance)), self::EXCEPTION_INVALID_COMMAND);
+ throw new UnexpectedValueException(sprintf('commandInstance for commandName=%s is not object (%s) or does not implement Commandable.', $commandName, gettype($commandInstance)), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Set last command
strlen($data),
$data,
$this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (empty(trim($data, chr(0)))) {
// Empty header, file is freshly pre-allocated
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-FILE-STACK: Empty file header detected - EXIT!');
throw new UnexpectedValueException(sprintf('data=%s does not have separator=0x%s at the end.',
$data,
dechex(BinaryFile::SEPARATOR_HEADER_ENTRIES)
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Okay, then remove it
$data,
count($header),
BinaryFile::HEADER_STACK_ELEMENT_COUNT
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif ($header[BinaryFile::HEADER_NAME_MAGIC] != StackableFile::STACK_MAGIC) {
// Bad magic
throw new InvalidMagicException($data, self::EXCEPTION_BAD_MAGIC);
strlen($header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES]),
$header[BinaryFile::HEADER_NAME_TOTAL_ENTRIES],
BinaryFile::LENGTH_COUNT
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]) != BinaryFile::LENGTH_POSITION) {
// Position length not valid
throw new UnexpectedValueException(sprintf('header[%s](%d)=%s is not expected %d length',
strlen($header[BinaryFile::HEADER_NAME_SEEK_POSITION]),
$header[BinaryFile::HEADER_NAME_SEEK_POSITION],
BinaryFile::LENGTH_POSITION
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Decode count and seek position
gettype($gapPosition),
$gapPosition,
$this->getIteratorInstance()->getBinaryFileInstance()->getHeaderSize()
- ));
+ ), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
}
// Then write the data at that gap
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
// Is the base path valid?
if (empty($templateBasePath)) {
// Base path is empty
- throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_dir($templateBasePath)) {
// Is not a path
throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
// Is the base path valid?
if (empty($templateBasePath)) {
// Base path is empty
- throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_dir($templateBasePath)) {
// Is not a path
throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Image\BaseImage;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
// Is the base path valid?
if (empty($templateBasePath)) {
// Base path is empty
- throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_dir($templateBasePath)) {
// Is not a path
throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Mailer\DeliverableMail;
use Org\Mxchange\CoreFramework\Parser\Parseable;
// Is the base path valid?
if (empty($templateBasePath)) {
// Base path is empty
- throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_dir($templateBasePath)) {
// Is not a path
throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filesystem\InvalidDirectoryException;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
use Org\Mxchange\CoreFramework\Menu\RenderableMenu;
use Org\Mxchange\CoreFramework\Parser\Parseable;
// Is the base path valid?
if (empty($templateBasePath)) {
// Base path is empty
- throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new UnexpectedValueException(sprintf('[%s:%d] Variable templateBasePath is empty.', $templateInstance->__toString(), __LINE__), FrameworkInterface::EXCEPTION_UNEXPECTED_VALUE);
} elseif (!is_dir($templateBasePath)) {
// Is not a path
throw new InvalidDirectoryException(array($templateInstance, $templateBasePath), self::EXCEPTION_INVALID_PATH_NAME);
// Import SPL stuff
use \InvalidArgumentException;
use \SplFileInfo;
+use \UnexpectedValueException;
/**
* This class contains static helper functions for console applications
const EXCEPTION_LOGIC_EXCEPTION = 0x201;
const EXCEPTION_UNSPPORTED_OPERATION = 0x202;
const EXCEPTION_UNEXPECTED_VALUE = 0x203;
+ const EXCEPTION_CLASS_NOT_FOUND = 0x204;
/**
* Getter for field name