Make use of the new exception
authorMarcel Werk <burntime@woltlab.com>
Tue, 13 Feb 2024 17:11:13 +0000 (18:11 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Fri, 23 Feb 2024 13:43:02 +0000 (14:43 +0100)
wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php
wcfsetup/install/files/lib/data/object/type/ObjectType.class.php
wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php
wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItem.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupPermissionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php
wcfsetup/install/files/lib/system/event/EventHandler.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 53cb87e7b15e4eccefd1d9e26d46215ae649d2d2..39c2c81422794419e07661c069a6c42b247fe775 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace wcf\data;
 
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\SingletonFactory;
@@ -40,7 +41,7 @@ class ProcessibleDatabaseObject extends DatabaseObject
         if ($this->processor === null) {
             if ($this->className) {
                 if (!\class_exists($this->className)) {
-                    throw new SystemException("Unable to find class '" . $this->className . "'");
+                    throw new ClassNotFoundException($this->className);
                 }
                 if (!\is_subclass_of($this->className, static::$processorInterface)) {
                     throw new ImplementationException($this->className, static::$processorInterface);
index d878e9cc12582e6214dbf7d6e5e076b76f34b632..1a795dc1e526b9b5b607efcb55b6c8c05ad5fbdd 100644 (file)
@@ -8,6 +8,7 @@ use wcf\data\package\PackageCache;
 use wcf\data\ProcessibleDatabaseObject;
 use wcf\data\TDatabaseObjectOptions;
 use wcf\data\TDatabaseObjectPermissions;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\SingletonFactory;
@@ -86,7 +87,7 @@ class ObjectType extends ProcessibleDatabaseObject
         if ($this->processor === null) {
             if ($this->className) {
                 if (!\class_exists($this->className)) {
-                    throw new SystemException("Unable to find class '" . $this->className . "'");
+                    throw new ClassNotFoundException($this->className);
                 }
 
                 $definitionInterface = ObjectTypeCache::getInstance()
index 37839f791450b7383a7f773f1179693a6a29cda5..230b55d300e8581398091749cee6d4e13241c60e 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\data\user\option;
 use wcf\data\DatabaseObjectDecorator;
 use wcf\data\user\User;
 use wcf\system\cache\builder\UserOptionCacheBuilder;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\option\user\IUserOptionOutput;
@@ -75,7 +76,7 @@ class ViewableUserOption extends DatabaseObjectDecorator
         if (!isset(self::$outputObjects[$this->outputClass])) {
             // create instance
             if (!\class_exists($this->outputClass)) {
-                throw new SystemException("unable to find class '" . $this->outputClass . "'");
+                throw new ClassNotFoundException($this->outputClass);
             }
 
             // validate interface
index e27bd7139a23515d8fcde9ba8f88da70c941914d..1561b9333143e8dbb6a4b471dda04947980c9a54 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\data\user\profile\menu\item;
 use wcf\data\DatabaseObject;
 use wcf\data\TDatabaseObjectOptions;
 use wcf\data\TDatabaseObjectPermissions;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\ParentClassException;
 use wcf\system\exception\SystemException;
@@ -63,7 +64,7 @@ class UserProfileMenuItem extends DatabaseObject
     {
         if ($this->contentManager === null) {
             if (!\class_exists($this->className)) {
-                throw new SystemException("Unable to find class '" . $this->className . "'");
+                throw new ClassNotFoundException($this->className);
             }
 
             if (!\is_subclass_of($this->className, SingletonFactory::class)) {
index 12192c40f9c31c0f5e581ec5c41b5b01fd11cff4..a06fc8704f144f540b89cabd33de24a0e6adba00 100644 (file)
@@ -5,6 +5,7 @@ namespace wcf\system\cache\builder;
 use wcf\data\user\group\option\UserGroupOption;
 use wcf\data\user\group\UserGroup;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\option\user\group\IUserGroupOptionType;
@@ -187,7 +188,7 @@ class UserGroupPermissionCacheBuilder extends AbstractCacheBuilder
 
             // validate class
             if (!\class_exists($className)) {
-                throw new SystemException("unable to find class '" . $className . "'");
+                throw new ClassNotFoundException($className);
             }
             if (!\is_subclass_of($className, IUserGroupOptionType::class)) {
                 throw new ImplementationException($className, IUserGroupOptionType::class);
index 419fa39d5323a274e2f390a113a2bd86fcfcc870..5e43bbfe78358cede01cc17f0f3c5b80966dd17b 100644 (file)
@@ -7,6 +7,7 @@ use wcf\data\cronjob\CronjobEditor;
 use wcf\data\cronjob\log\CronjobLogEditor;
 use wcf\data\user\User;
 use wcf\system\cache\builder\CronjobCacheBuilder;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\session\SessionHandler;
@@ -264,7 +265,7 @@ final class CronjobScheduler extends SingletonFactory
     {
         $className = $cronjobEditor->className;
         if (!\class_exists($className)) {
-            throw new SystemException("unable to find class '" . $className . "'");
+            throw new ClassNotFoundException($className);
         }
 
         // verify class signature
index 2244a099c69c64ee8b92a2f10ff7cd09cfa469da..3b1ea2e258e4330d8c40742bf7916d2f1c24c6e0 100644 (file)
@@ -6,6 +6,7 @@ use wcf\data\event\listener\EventListener;
 use wcf\system\cache\builder\EventListenerCacheBuilder;
 use wcf\system\event\IEventListener as ILegacyEventListener;
 use wcf\system\event\listener\IParameterizedEventListener;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\SingletonFactory;
 
 /**
@@ -130,7 +131,7 @@ final class EventHandler extends SingletonFactory
         }
 
         if (!\class_exists($className)) {
-            throw new \LogicException("Unable to find class '" . $className . "'.");
+            throw new ClassNotFoundException($className);
         }
 
         $object = new $className();
index 502decb4f3ad1e1204c68e81ae0755c02df8c829..710e6ad4661d627685162d47fd008a6026090826 100644 (file)
@@ -20,6 +20,7 @@ use wcf\system\database\statement\PreparedStatement;
 use wcf\system\devtools\DevtoolsSetup;
 use wcf\system\Environment;
 use wcf\system\event\EventHandler;
+use wcf\system\exception\ClassNotFoundException;
 use wcf\system\exception\ImplementationException;
 use wcf\system\exception\SystemException;
 use wcf\system\form\container\GroupFormElementContainer;
@@ -785,7 +786,7 @@ class PackageInstallationDispatcher
         // valdidate class definition
         $className = $row['className'];
         if (!\class_exists($className)) {
-            throw new SystemException("unable to find class '" . $className . "'");
+            throw new ClassNotFoundException($className);
         }
 
         // set default value