use wcf\data\object\type\ObjectTypeCache;
use wcf\form\AbstractForm;
use wcf\system\exception\IllegalLinkException;
-use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
// read bulk processable object type
$this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.bulkProcessableObject', $this->objectTypeName);
if ($this->objectType === null) {
- throw new SystemException("Unknown bulk processable object type '".$this->objectTypeName."'");
+ throw new \LogicException("Unknown bulk processable object type '".$this->objectTypeName."'");
}
// read conditions
if (ObjectTypeCache::getInstance()->getDefinitionByName($this->objectType->getProcessor()->getConditionObjectTypeDefinition()) === null) {
- throw new SystemException("Unknown condition object type definition '".$this->objectType->getProcessor()->getConditionObjectTypeDefinition()."'");
+ throw new \LogicException("Unknown condition object type definition '".$this->objectType->getProcessor()->getConditionObjectTypeDefinition()."'");
}
$conditionObjectTypes = ObjectTypeCache::getInstance()->getObjectTypes($this->objectType->getProcessor()->getConditionObjectTypeDefinition());
if (empty($conditionObjectTypes)) {
// read actions
if (ObjectTypeCache::getInstance()->getDefinitionByName($this->objectType->getProcessor()->getActionObjectTypeDefinition()) === null) {
- throw new SystemException("Unknown action object type definition '".$this->objectType->getProcessor()->getActionObjectTypeDefinition()."'");
+ throw new \LogicException("Unknown action object type definition '".$this->objectType->getProcessor()->getActionObjectTypeDefinition()."'");
}
$actions = ObjectTypeCache::getInstance()->getObjectTypes($this->objectType->getProcessor()->getActionObjectTypeDefinition());
foreach ($actions as $objectType) {
if (isset($this->actions[$objectType->action])) {
- throw new SystemException("Duplicate action with name '".$objectType->action."'");
+ throw new \LogicException("Duplicate action with name '".$objectType->action."'");
}
if ($objectType->validateOptions() && $objectType->validatePermissions()) {
<?php
namespace wcf\data\article;
use wcf\data\article\category\ArticleCategory;
-use wcf\system\exception\SystemException;
/**
* Represents a list of articles in a specific category.
*
* @param integer $categoryID
* @param boolean $includeChildCategories
- * @throws SystemException
+ * @throws \InvalidArgumentException
*/
public function __construct($categoryID, $includeChildCategories = false) {
ViewableArticleList::__construct();
if ($includeChildCategories) {
$category = ArticleCategory::getCategory($categoryID);
if ($category === null) {
- throw new SystemException("invalid category id '".$categoryID."' given");
+ throw new \InvalidArgumentException("invalid category id '".$categoryID."' given");
}
foreach ($category->getChildCategories() as $category) {
if ($category->isAccessible()) {
use wcf\data\page\Page;
use wcf\data\page\PageCache;
use wcf\data\DatabaseObject;
-use wcf\system\exception\SystemException;
+use wcf\system\exception\ImplementationException;
use wcf\system\html\output\HtmlOutputProcessor;
use wcf\system\page\handler\ILookupPageHandler;
use wcf\system\page\handler\IMenuPageHandler;
* Returns the IMenuPageHandler of the linked page.
*
* @return IMenuPageHandler|null
- * @throws SystemException
+ * @throws ImplementationException
*/
protected function getLinkPageHandler() {
$page = $this->getLinkPage();
$className = $page->handler;
$this->linkPageHandler = new $className;
if (!($this->linkPageHandler instanceof IMenuPageHandler)) {
- throw new SystemException("Expected a valid handler implementing '" . IMenuPageHandler::class . "'.");
+ throw new ImplementationException(get_class($this->linkPageHandler), IMenuPageHandler::class);
}
}
}
use wcf\data\page\Page;
use wcf\data\page\PageCache;
use wcf\data\DatabaseObject;
-use wcf\system\exception\SystemException;
+use wcf\system\exception\ImplementationException;
use wcf\system\page\handler\ILookupPageHandler;
use wcf\system\page\handler\IMenuPageHandler;
use wcf\system\WCF;
* Returns the page handler for this item.
*
* @return IMenuPageHandler|null
- * @throws SystemException
+ * @throws ImplementationException
*/
protected function getMenuPageHandler() {
$page = $this->getPage();
$className = $this->getPage()->handler;
$this->handler = new $className;
if (!($this->handler instanceof IMenuPageHandler)) {
- throw new SystemException("Expected a valid handler implementing '" . IMenuPageHandler::class . "'.");
+ throw new ImplementationException(get_class($this->handler), IMenuPageHandler::class);
}
}
}
use wcf\data\user\group\UserGroup;
use wcf\data\user\User;
use wcf\system\cache\runtime\UserRuntimeCache;
-use wcf\system\exception\SystemException;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
*
* @param string $objectType object type name
* @return integer object type id
- * @throws SystemException
+ * @throws \InvalidArgumentException
*/
public function getObjectTypeID($objectType) {
if (!isset($this->objectTypes[$objectType])) {
- throw new SystemException("Unknown object type '" . $objectType . "'");
+ throw new \InvalidArgumentException("Unknown object type '" . $objectType . "'");
}
return $this->objectTypes[$objectType]->objectTypeID;
* @param string $objectType object type name
* @param integer $objectID object id
* @param array $values list of user and group ids
- * @throws SystemException
+ * @throws \InvalidArgumentException
*/
public function setValues($objectType, $objectID, array $values) {
$objectTypeID = $this->getObjectTypeID($objectType);
// validate data of `$values`
if (empty($values['user']) && empty($values['group']) && !isset($values['allowAll'])) {
- throw new SystemException("Missing ACL configuration values.");
+ throw new \InvalidArgumentException("Missing ACL configuration values.");
}
// users
use wcf\system\condition\ConditionHandler;
use wcf\system\condition\IObjectListCondition;
use wcf\system\event\EventHandler;
-use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\StringUtil;
/**
* Creates a new instance of AbstractDynamicBoxController.
*
- * @throws SystemException
+ * @throws \LogicException
*/
public function __construct() {
if ($this->conditionDefinition) {
if (ObjectTypeCache::getInstance()->getDefinitionByName($this->conditionDefinition) === null) {
- throw new SystemException("Unknown object type definition '" . $this->conditionDefinition . "'");
+ throw new \LogicException("Unknown object type definition '" . $this->conditionDefinition . "'");
}
$this->conditionObjectTypes = ObjectTypeCache::getInstance()->getObjectTypes($this->conditionDefinition);
if ($this->defaultLimit !== null) {
if ($this->defaultLimit <= 0) {
- throw new SystemException("The default limit may has to be positive.");
+ throw new \LogicException("The default limit may has to be positive.");
}
$this->limit = $this->defaultLimit;