From 61af8e9ebb5d680fb7625a062c27637b3cf7040b Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Tue, 14 Jul 2026 09:52:44 +0200 Subject: [PATCH 1/4] Implementing consistent Exceptions --- .../Access/Exception/AuthenticationFailed.php | 5 +- .../AuthenticationFailedException.php | 23 +++++++ libraries/src/Access/Exception/NotAllowed.php | 5 +- .../Access/Exception/NotAllowedException.php | 23 +++++++ .../Application/Exception/NotAcceptable.php | 5 +- .../Exception/NotAcceptableException.php | 23 +++++++ .../Controller/Exception/CheckinCheckout.php | 5 +- .../Exception/CheckinCheckoutException.php | 23 +++++++ .../Controller/Exception/ResourceNotFound.php | 5 +- .../Exception/ResourceNotFoundException.php | 23 +++++++ .../src/MVC/Controller/Exception/Save.php | 5 +- .../Controller/Exception/SaveException.php | 23 +++++++ .../MVC/Controller/Exception/SendEmail.php | 5 +- .../Exception/SendEmailException.php | 23 +++++++ .../Exception/BatchOperationException.php | 24 ++++++++ .../src/Object/LegacyErrorHandlingTrait.php | 13 +++- .../Exception/DuplicateEntryException.php | 59 ++++++++++++++++++ .../Exception/InvalidHierarchyException.php | 27 +++++++++ .../Exception/RecordNotFoundException.php | 23 +++++++ .../Exception/TableExceptionInterface.php | 24 ++++++++ .../Table/Exception/ValidationException.php | 60 +++++++++++++++++++ .../Exception/WorkflowStateException.php | 24 ++++++++ 22 files changed, 440 insertions(+), 10 deletions(-) create mode 100644 libraries/src/Access/Exception/AuthenticationFailedException.php create mode 100644 libraries/src/Access/Exception/NotAllowedException.php create mode 100644 libraries/src/Application/Exception/NotAcceptableException.php create mode 100644 libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php create mode 100644 libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php create mode 100644 libraries/src/MVC/Controller/Exception/SaveException.php create mode 100644 libraries/src/MVC/Controller/Exception/SendEmailException.php create mode 100644 libraries/src/MVC/Model/Exception/BatchOperationException.php create mode 100644 libraries/src/Table/Exception/DuplicateEntryException.php create mode 100644 libraries/src/Table/Exception/InvalidHierarchyException.php create mode 100644 libraries/src/Table/Exception/RecordNotFoundException.php create mode 100644 libraries/src/Table/Exception/TableExceptionInterface.php create mode 100644 libraries/src/Table/Exception/ValidationException.php create mode 100644 libraries/src/Table/Exception/WorkflowStateException.php diff --git a/libraries/src/Access/Exception/AuthenticationFailed.php b/libraries/src/Access/Exception/AuthenticationFailed.php index 70de55a7d6536..10b08ddf73cef 100644 --- a/libraries/src/Access/Exception/AuthenticationFailed.php +++ b/libraries/src/Access/Exception/AuthenticationFailed.php @@ -17,7 +17,10 @@ * Exception class defining an authentication failed event * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class AuthenticationFailed extends \RuntimeException +class AuthenticationFailed extends AuthenticationFailedException { } diff --git a/libraries/src/Access/Exception/AuthenticationFailedException.php b/libraries/src/Access/Exception/AuthenticationFailedException.php new file mode 100644 index 0000000000000..80131c7305d8c --- /dev/null +++ b/libraries/src/Access/Exception/AuthenticationFailedException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Access\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining an authentication failed event + * + * @since __DEPLOY_VERSION__ + */ +class AuthenticationFailedException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/Access/Exception/NotAllowed.php b/libraries/src/Access/Exception/NotAllowed.php index f3c7f593d61d2..88e2ab2602762 100644 --- a/libraries/src/Access/Exception/NotAllowed.php +++ b/libraries/src/Access/Exception/NotAllowed.php @@ -17,7 +17,10 @@ * Exception class defining a not allowed access * * @since 3.6.3 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class NotAllowed extends \RuntimeException +class NotAllowed extends NotAllowedException { } diff --git a/libraries/src/Access/Exception/NotAllowedException.php b/libraries/src/Access/Exception/NotAllowedException.php new file mode 100644 index 0000000000000..22a1686fa2682 --- /dev/null +++ b/libraries/src/Access/Exception/NotAllowedException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Access\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a not allowed access + * + * @since __DEPLOY_VERSION__ + */ +class NotAllowedException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/Application/Exception/NotAcceptable.php b/libraries/src/Application/Exception/NotAcceptable.php index 738810110f30e..39cec48be79ed 100644 --- a/libraries/src/Application/Exception/NotAcceptable.php +++ b/libraries/src/Application/Exception/NotAcceptable.php @@ -17,7 +17,10 @@ * Exception class defining a not acceptable class * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class NotAcceptable extends \RuntimeException +class NotAcceptable extends NotAcceptableException { } diff --git a/libraries/src/Application/Exception/NotAcceptableException.php b/libraries/src/Application/Exception/NotAcceptableException.php new file mode 100644 index 0000000000000..1af998e13c1ac --- /dev/null +++ b/libraries/src/Application/Exception/NotAcceptableException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Application\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a not acceptable class + * + * @since __DEPLOY_VERSION__ + */ +class NotAcceptableException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/MVC/Controller/Exception/CheckinCheckout.php b/libraries/src/MVC/Controller/Exception/CheckinCheckout.php index 775091df24988..1817942738bbd 100644 --- a/libraries/src/MVC/Controller/Exception/CheckinCheckout.php +++ b/libraries/src/MVC/Controller/Exception/CheckinCheckout.php @@ -17,7 +17,10 @@ * Checkin/checkout Exception * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class CheckinCheckout extends \RuntimeException +class CheckinCheckout extends CheckinCheckoutException { } diff --git a/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php b/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php new file mode 100644 index 0000000000000..878257eb53d11 --- /dev/null +++ b/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Controller\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Checkin/checkout Exception + * + * @since __DEPLOY_VERSION__ + */ +class CheckinCheckoutException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/MVC/Controller/Exception/ResourceNotFound.php b/libraries/src/MVC/Controller/Exception/ResourceNotFound.php index 8e9f8c477445a..586ea60890eca 100644 --- a/libraries/src/MVC/Controller/Exception/ResourceNotFound.php +++ b/libraries/src/MVC/Controller/Exception/ResourceNotFound.php @@ -17,7 +17,10 @@ * Exception class defining a resource not found exception * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class ResourceNotFound extends \RuntimeException +class ResourceNotFound extends ResourceNotFoundException { } diff --git a/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php b/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php new file mode 100644 index 0000000000000..c1c617719581b --- /dev/null +++ b/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Controller\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a resource not found exception + * + * @since __DEPLOY_VERSION__ + */ +class ResourceNotFoundException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/MVC/Controller/Exception/Save.php b/libraries/src/MVC/Controller/Exception/Save.php index a49900e2d5486..4e1834c461796 100644 --- a/libraries/src/MVC/Controller/Exception/Save.php +++ b/libraries/src/MVC/Controller/Exception/Save.php @@ -17,7 +17,10 @@ * Exception saving data * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class Save extends \RuntimeException +class Save extends SaveException { } diff --git a/libraries/src/MVC/Controller/Exception/SaveException.php b/libraries/src/MVC/Controller/Exception/SaveException.php new file mode 100644 index 0000000000000..b38480dd0c8a0 --- /dev/null +++ b/libraries/src/MVC/Controller/Exception/SaveException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Controller\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception saving data + * + * @since __DEPLOY_VERSION__ + */ +class SaveException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/MVC/Controller/Exception/SendEmail.php b/libraries/src/MVC/Controller/Exception/SendEmail.php index c729a9ee1a423..f0f07933e09a5 100644 --- a/libraries/src/MVC/Controller/Exception/SendEmail.php +++ b/libraries/src/MVC/Controller/Exception/SendEmail.php @@ -17,7 +17,10 @@ * Send email Exception * * @since 4.0.0 + * + * @deprecated __DEPLOY_VERSION__ will be removed in 8.0 + * Use the class with the Exception suffix instead. */ -class SendEmail extends \RuntimeException +class SendEmail extends SendEmailException { } diff --git a/libraries/src/MVC/Controller/Exception/SendEmailException.php b/libraries/src/MVC/Controller/Exception/SendEmailException.php new file mode 100644 index 0000000000000..21b2620b1bede --- /dev/null +++ b/libraries/src/MVC/Controller/Exception/SendEmailException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Controller\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Send email Exception + * + * @since __DEPLOY_VERSION__ + */ +class SendEmailException extends \RuntimeException +{ +} \ No newline at end of file diff --git a/libraries/src/MVC/Model/Exception/BatchOperationException.php b/libraries/src/MVC/Model/Exception/BatchOperationException.php new file mode 100644 index 0000000000000..096f032015db9 --- /dev/null +++ b/libraries/src/MVC/Model/Exception/BatchOperationException.php @@ -0,0 +1,24 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\MVC\Model\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a batch operation that could not be carried out, e.g. no items + * were selected or insufficient information was supplied to complete the batch request. + * + * @since __DEPLOY_VERSION__ + */ +class BatchOperationException extends \RuntimeException implements ModelExceptionInterface +{ +} \ No newline at end of file diff --git a/libraries/src/Object/LegacyErrorHandlingTrait.php b/libraries/src/Object/LegacyErrorHandlingTrait.php index 44fba9af46134..930bc5bad8a7e 100644 --- a/libraries/src/Object/LegacyErrorHandlingTrait.php +++ b/libraries/src/Object/LegacyErrorHandlingTrait.php @@ -99,7 +99,7 @@ public function getErrors() /** * Add an error message. * - * @param string $error Error message. + * @param string|\Throwable $error Error message or Exception object. * * @return void * @@ -111,8 +111,15 @@ public function getErrors() */ public function setError($error) { - if ($this->useExceptions && \is_string($error)) { - throw new \Exception($error, 500); + if ($this->useExceptions) { + // Preserve the concrete type of an already-built Exception/Throwable instead of collapsing it to a generic \Exception. + if ($error instanceof \Throwable) { + throw $error; + } + + if (\is_string($error)) { + throw new \Exception($error, 500); + } } $this->_errors[] = $error; diff --git a/libraries/src/Table/Exception/DuplicateEntryException.php b/libraries/src/Table/Exception/DuplicateEntryException.php new file mode 100644 index 0000000000000..ee2144cd49a22 --- /dev/null +++ b/libraries/src/Table/Exception/DuplicateEntryException.php @@ -0,0 +1,59 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a unique-key violation, e.g. a duplicate alias, name or username. + * + * @since __DEPLOY_VERSION__ + */ +class DuplicateEntryException extends ValidationException +{ + /** + * The name of the field holding the duplicate value. + * + * @var string + * @since __DEPLOY_VERSION__ + */ + private string $field; + + /** + * Constructor. + * + * @param string $message The exception message. + * @param string $field The name of the field holding the duplicate value. + * @param integer $code The exception code. + * @param ?\Throwable $previous The previous throwable used for exception chaining. + * + * @since __DEPLOY_VERSION__ + */ + public function __construct(string $message, string $field, int $code = 0, ?\Throwable $previous = null) + { + parent::__construct($message, [$field => $message], $code, $previous); + + $this->field = $field; + } + + /** + * Get the name of the field holding the duplicate value. + * + * @return string + * + * @since __DEPLOY_VERSION__ + */ + public function getField(): string + { + return $this->field; + } +} \ No newline at end of file diff --git a/libraries/src/Table/Exception/InvalidHierarchyException.php b/libraries/src/Table/Exception/InvalidHierarchyException.php new file mode 100644 index 0000000000000..cca695ea2aabb --- /dev/null +++ b/libraries/src/Table/Exception/InvalidHierarchyException.php @@ -0,0 +1,27 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a violation of a nested-set/parent-child invariant, e.g. moving + * a node to be a child of itself or an otherwise structurally inconsistent tree operation. + * + * Extends \LogicException rather than \RuntimeException: these conditions indicate a + * programming error or an invalid invocation, not a runtime data/user-input problem. + * + * @since __DEPLOY_VERSION__ + */ +class InvalidHierarchyException extends \LogicException implements TableExceptionInterface +{ +} \ No newline at end of file diff --git a/libraries/src/Table/Exception/RecordNotFoundException.php b/libraries/src/Table/Exception/RecordNotFoundException.php new file mode 100644 index 0000000000000..81114a68e772a --- /dev/null +++ b/libraries/src/Table/Exception/RecordNotFoundException.php @@ -0,0 +1,23 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a failure to load a record by its primary key. + * + * @since __DEPLOY_VERSION__ + */ +class RecordNotFoundException extends \RuntimeException implements TableExceptionInterface +{ +} \ No newline at end of file diff --git a/libraries/src/Table/Exception/TableExceptionInterface.php b/libraries/src/Table/Exception/TableExceptionInterface.php new file mode 100644 index 0000000000000..973391d98e0f6 --- /dev/null +++ b/libraries/src/Table/Exception/TableExceptionInterface.php @@ -0,0 +1,24 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Interface that all exceptions thrown from the Table layer should implement, so that + * calling Model code can catch every Table-layer failure with a single catch block. + * + * @since __DEPLOY_VERSION__ + */ +interface TableExceptionInterface extends \Throwable +{ +} \ No newline at end of file diff --git a/libraries/src/Table/Exception/ValidationException.php b/libraries/src/Table/Exception/ValidationException.php new file mode 100644 index 0000000000000..38bf7cddb9fa2 --- /dev/null +++ b/libraries/src/Table/Exception/ValidationException.php @@ -0,0 +1,60 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining a record that failed validation, e.g. a missing required field + * or a malformed value, as previously detected by Table::check(). + * + * @since __DEPLOY_VERSION__ + */ +class ValidationException extends \RuntimeException implements TableExceptionInterface +{ + /** + * Validation error messages, keyed by field name where known. + * + * @var string[] + * @since __DEPLOY_VERSION__ + */ + private array $fieldErrors; + + /** + * Constructor. + * + * @param string $message The exception message. + * @param string[] $fieldErrors Validation error messages, keyed by field name where known. + * @param integer $code The exception code. + * @param ?\Throwable $previous The previous throwable used for exception chaining. + * + * @since __DEPLOY_VERSION__ + */ + public function __construct(string $message, array $fieldErrors = [], int $code = 0, ?\Throwable $previous = null) + { + parent::__construct($message, $code, $previous); + + $this->fieldErrors = $fieldErrors; + } + + /** + * Get the validation error messages, keyed by field name where known. + * + * @return string[] + * + * @since __DEPLOY_VERSION__ + */ + public function getFieldErrors(): array + { + return $this->fieldErrors; + } +} \ No newline at end of file diff --git a/libraries/src/Table/Exception/WorkflowStateException.php b/libraries/src/Table/Exception/WorkflowStateException.php new file mode 100644 index 0000000000000..0e71f6decddd1 --- /dev/null +++ b/libraries/src/Table/Exception/WorkflowStateException.php @@ -0,0 +1,24 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +namespace Joomla\CMS\Table\Exception; + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Exception class defining an invalid workflow/publish-state transition, e.g. trying to + * disable a default workflow stage or transition an item that must first be published. + * + * @since __DEPLOY_VERSION__ + */ +class WorkflowStateException extends \RuntimeException implements TableExceptionInterface +{ +} \ No newline at end of file From 9948fb8b8a01a80ff0efc9a4f8adb975e9bb03c5 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Tue, 14 Jul 2026 09:53:54 +0200 Subject: [PATCH 2/4] Adding unittests for LegacyErrorHandlingTrait change --- .../Libraries/Cms/Object/CMSObjectTest.php | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/tests/Unit/Libraries/Cms/Object/CMSObjectTest.php b/tests/Unit/Libraries/Cms/Object/CMSObjectTest.php index 862318ced7a73..8a51cbcc455c5 100644 --- a/tests/Unit/Libraries/Cms/Object/CMSObjectTest.php +++ b/tests/Unit/Libraries/Cms/Object/CMSObjectTest.php @@ -248,4 +248,67 @@ public function testSetError() $object->getErrors() ); } + + /** + * Tests that setError() throws a string error wrapped in a generic \Exception once useExceptions is enabled. + * + * @group CMSObject + * @covers CMSObject::setError + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testSetErrorThrowsGenericExceptionForStringWhenUseExceptionsIsEnabled() + { + $object = new CMSObject(); + $object->setUseExceptions(true); + + $this->expectException(\Exception::class); + $this->expectExceptionMessage('A Test Error'); + + $object->setError('A Test Error'); + } + + /** + * Tests that setError() rethrows an already-built Throwable unchanged (preserving its concrete type) + * once useExceptions is enabled, instead of collapsing it into a generic \Exception. + * + * @group CMSObject + * @covers CMSObject::setError + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testSetErrorPreservesThrowableTypeWhenUseExceptionsIsEnabled() + { + $object = new CMSObject(); + $exception = new \RuntimeException('A Typed Error'); + $object->setUseExceptions(true); + + try { + $object->setError($exception); + $this->fail('Expected exception was not thrown.'); + } catch (\Throwable $caught) { + $this->assertSame($exception, $caught); + } + } + + /** + * Tests that setError() does not throw while useExceptions remains disabled, regardless of the argument type. + * + * @group CMSObject + * @covers CMSObject::setError + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testSetErrorDoesNotThrowWhenUseExceptionsIsDisabled() + { + $object = new CMSObject(); + $exception = new \RuntimeException('A Typed Error'); + + $object->setError($exception); + + $this->assertSame($exception, $object->getError(0, false)); + } } From b66da0744e479883f6b264da0a1ed7f4287720b3 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Wed, 15 Jul 2026 10:45:46 +0200 Subject: [PATCH 3/4] Convert com_categories, com_content, com_fields to exceptions --- .../src/Model/CategoryModel.php | 144 ++++++++++++++++-- .../com_content/src/Model/ArticleModel.php | 49 +++++- .../com_content/src/Model/ArticlesModel.php | 4 + .../com_fields/src/Model/FieldModel.php | 26 ++++ .../com_fields/src/Table/FieldTable.php | 10 ++ .../com_fields/src/Table/GroupTable.php | 5 + .../com_content/src/Model/ArticleModel.php | 2 +- .../com_content/src/Model/CategoryModel.php | 6 + .../com_content/src/Model/FormModel.php | 6 + 9 files changed, 240 insertions(+), 12 deletions(-) diff --git a/administrator/components/com_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index d5a0ef6780cf0..c318e98cb655f 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -10,7 +10,7 @@ namespace Joomla\Component\Categories\Administrator\Model; -use Joomla\CMS\Access\Rules; +use Joomla\CMS\Access\Exception\NotAllowedException; use Joomla\CMS\Association\AssociationServiceInterface; use Joomla\CMS\Categories\CategoryServiceInterface; use Joomla\CMS\Component\ComponentHelper; @@ -21,10 +21,12 @@ use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Controller\Exception\ResourceNotFoundException; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Category; +use Joomla\CMS\Table\Exception\DuplicateEntryException; use Joomla\CMS\UCM\UCMType; use Joomla\CMS\Versioning\VersionableModelInterface; use Joomla\CMS\Versioning\VersionableModelTrait; @@ -444,6 +446,10 @@ protected function preprocessForm(Form $form, $data, $group = 'content') // Check for an error. if ($form instanceof \Exception) { + if ($this->shouldUseExceptions()) { + throw $form; + } + $this->setError($form->getMessage()); return false; @@ -548,6 +554,12 @@ public function save($data) // Rebuild the path for the category: if (!$table->rebuildPath($table->id)) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; @@ -555,6 +567,12 @@ public function save($data) // Rebuild the paths of the category's children: if (!$table->rebuild($table->id, $table->lft, $table->level, $table->path)) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; @@ -629,6 +647,12 @@ public function rebuild() $table = $this->getTable(); if (!$table->rebuild()) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; @@ -658,6 +682,12 @@ public function saveorder($idArray = null, $lftArray = null) $table = $this->getTable(); if (!$table->saveorder($idArray, $lftArray)) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; @@ -747,14 +777,22 @@ protected function batchCopy($value, $pks, $contexts) // Check that the parent exists if ($parentId) { if (!$this->table->load($parentId)) { - if ($error = $this->table->getError()) { + if ($error = $this->table->getError(null, false)) { // Fatal error - $this->setError($error); + if ($this->shouldUseExceptions()) { + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + + $this->setError($error instanceof \Throwable ? $error->getMessage() : $error); return false; } // Non-fatal error + if ($this->shouldUseExceptions()) { + throw new ResourceNotFoundException(Text::_('JGLOBAL_BATCH_MOVE_PARENT_NOT_FOUND')); + } + $this->setError(Text::_('JGLOBAL_BATCH_MOVE_PARENT_NOT_FOUND')); $parentId = 0; } @@ -768,6 +806,10 @@ protected function batchCopy($value, $pks, $contexts) if (!$canCreate) { // Error since user cannot create in parent category + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); + } + $this->setError(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); return false; @@ -777,6 +819,12 @@ protected function batchCopy($value, $pks, $contexts) // If the parent is 0, set it to the ID of the root item in the tree if (empty($parentId)) { if (!$parentId = $this->table->getRootId()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -784,6 +832,10 @@ protected function batchCopy($value, $pks, $contexts) if (!$this->user->authorise('core.create', $extension)) { // Make sure we can create in root + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); + } + $this->setError(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); return false; @@ -802,6 +854,10 @@ protected function batchCopy($value, $pks, $contexts) try { $count = $db->loadResult(); } catch (\RuntimeException $e) { + if ($this->shouldUseExceptions()) { + throw $e; + } + $this->setError($e->getMessage()); return false; @@ -816,14 +872,22 @@ protected function batchCopy($value, $pks, $contexts) // Check that the row actually exists if (!$this->table->load($pk)) { - if ($error = $this->table->getError()) { + if ($error = $this->table->getError(null, false)) { // Fatal error - $this->setError($error); + if ($this->shouldUseExceptions()) { + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + + $this->setError($error instanceof \Throwable ? $error->getMessage() : $error); return false; } // Not fatal error + if ($this->shouldUseExceptions()) { + throw new ResourceNotFoundException(Text::sprintf('JGLOBAL_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + } + $this->setError(Text::sprintf('JGLOBAL_BATCH_MOVE_ROW_NOT_FOUND', $pk)); continue; } @@ -880,6 +944,12 @@ protected function batchCopy($value, $pks, $contexts) // Store the row. if (!$this->table->store()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -912,6 +982,12 @@ protected function batchCopy($value, $pks, $contexts) // Rebuild the hierarchy. if (!$this->table->rebuild()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -919,6 +995,12 @@ protected function batchCopy($value, $pks, $contexts) // Rebuild the tree path. if (!$this->table->rebuildPath($this->table->id)) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -951,14 +1033,22 @@ protected function batchMove($value, $pks, $contexts) // Check that the parent exists. if ($parentId) { if (!$this->table->load($parentId)) { - if ($error = $this->table->getError()) { + if ($error = $this->table->getError(null, false)) { // Fatal error. - $this->setError($error); + if ($this->shouldUseExceptions()) { + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + + $this->setError($error instanceof \Throwable ? $error->getMessage() : $error); return false; } // Non-fatal error. + if ($this->shouldUseExceptions()) { + throw new ResourceNotFoundException(Text::_('JGLOBAL_BATCH_MOVE_PARENT_NOT_FOUND')); + } + $this->setError(Text::_('JGLOBAL_BATCH_MOVE_PARENT_NOT_FOUND')); $parentId = 0; } @@ -972,6 +1062,10 @@ protected function batchMove($value, $pks, $contexts) if (!$canCreate) { // Error since user cannot create in parent category + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); + } + $this->setError(Text::_('COM_CATEGORIES_BATCH_CANNOT_CREATE')); return false; @@ -982,6 +1076,10 @@ protected function batchMove($value, $pks, $contexts) foreach ($pks as $pk) { if (!$this->user->authorise('core.edit', $extension . '.category.' . $pk)) { // Error since user cannot edit this category + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('COM_CATEGORIES_BATCH_CANNOT_EDIT')); + } + $this->setError(Text::_('COM_CATEGORIES_BATCH_CANNOT_EDIT')); return false; @@ -998,14 +1096,22 @@ protected function batchMove($value, $pks, $contexts) foreach ($pks as $pk) { // Check that the row actually exists if (!$this->table->load($pk)) { - if ($error = $this->table->getError()) { + if ($error = $this->table->getError(null, false)) { // Fatal error - $this->setError($error); + if ($this->shouldUseExceptions()) { + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + + $this->setError($error instanceof \Throwable ? $error->getMessage() : $error); return false; } // Not fatal error + if ($this->shouldUseExceptions()) { + throw new ResourceNotFoundException(Text::sprintf('JGLOBAL_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + } + $this->setError(Text::sprintf('JGLOBAL_BATCH_MOVE_ROW_NOT_FOUND', $pk)); continue; } @@ -1030,6 +1136,10 @@ protected function batchMove($value, $pks, $contexts) try { $children = array_merge($children, (array) $db->loadColumn()); } catch (\RuntimeException $e) { + if ($this->shouldUseExceptions()) { + throw $e; + } + $this->setError($e->getMessage()); return false; @@ -1043,6 +1153,10 @@ protected function batchMove($value, $pks, $contexts) ]; if ($table->load($conditions)) { + if ($this->shouldUseExceptions()) { + throw new DuplicateEntryException(Text::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS'), 'alias'); + } + $this->setError(Text::_('JLIB_DATABASE_ERROR_CATEGORY_UNIQUE_ALIAS')); return false; @@ -1051,6 +1165,12 @@ protected function batchMove($value, $pks, $contexts) // Store the row. if (!$this->table->store()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -1058,6 +1178,12 @@ protected function batchMove($value, $pks, $contexts) // Rebuild the tree path. if (!$this->table->rebuildPath()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; diff --git a/administrator/components/com_content/src/Model/ArticleModel.php b/administrator/components/com_content/src/Model/ArticleModel.php index 8b18f53989ad8..cf4ee33bb04d7 100644 --- a/administrator/components/com_content/src/Model/ArticleModel.php +++ b/administrator/components/com_content/src/Model/ArticleModel.php @@ -10,6 +10,7 @@ namespace Joomla\Component\Content\Administrator\Model; +use Joomla\CMS\Access\Exception\NotAllowedException; use Joomla\CMS\Date\Date; use Joomla\CMS\Event\AbstractEvent; use Joomla\CMS\Event\Model\AfterSaveEvent; @@ -21,8 +22,10 @@ use Joomla\CMS\Language\Associations; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\Language\Text; +use Joomla\CMS\MVC\Controller\Exception\ResourceNotFoundException; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; +use Joomla\CMS\MVC\Model\Exception\BatchOperationException; use Joomla\CMS\MVC\Model\WorkflowBehaviorTrait; use Joomla\CMS\MVC\Model\WorkflowModelInterface; use Joomla\CMS\Plugin\PluginHelper; @@ -229,6 +232,10 @@ protected function batchMove($value, $pks, $contexts) // Parent exists so we proceed foreach ($pks as $pk) { if (!$this->user->authorise('core.edit', $contexts[$pk])) { + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + } + $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; @@ -236,14 +243,22 @@ protected function batchMove($value, $pks, $contexts) // Check that the row actually exists if (!$this->table->load($pk)) { - if ($error = $this->table->getError()) { + if ($error = $this->table->getError(null, false)) { // Fatal error - $this->setError($error); + if ($this->shouldUseExceptions()) { + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + + $this->setError($error instanceof \Throwable ? $error->getMessage() : $error); return false; } // Not fatal error + if ($this->shouldUseExceptions()) { + throw new ResourceNotFoundException(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + } + $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); continue; } @@ -270,6 +285,12 @@ protected function batchMove($value, $pks, $contexts) // Check the row. if (!$this->table->check()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -277,6 +298,12 @@ protected function batchMove($value, $pks, $contexts) // Store the row. if (!$this->table->store()) { + if ($this->shouldUseExceptions()) { + $error = $this->table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($this->table->getError()); return false; @@ -713,6 +740,12 @@ public function save($data) // Create new category. if (!$categoryModel->save($category)) { + if ($this->shouldUseExceptions()) { + $error = $categoryModel->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($categoryModel->getError()); return false; @@ -857,6 +890,10 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n } if (empty($pks)) { + if ($this->shouldUseExceptions()) { + throw new BatchOperationException(Text::_('COM_CONTENT_NO_ITEM_SELECTED')); + } + $this->setError(Text::_('COM_CONTENT_NO_ITEM_SELECTED')); return false; @@ -880,6 +917,10 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n ); if ($eventResult->getArgument('abort', false)) { + if ($this->shouldUseExceptions()) { + throw new \RuntimeException(Text::_($eventResult->getArgument('abortReason'))); + } + $this->setError(Text::_($eventResult->getArgument('abortReason'))); return false; @@ -962,6 +1003,10 @@ public function featured($pks, $value = 0, $featuredUp = null, $featuredDown = n } } } catch (\Exception $e) { + if ($this->shouldUseExceptions()) { + throw $e; + } + $this->setError($e->getMessage()); return false; diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index 97b379cc68f48..666321480d108 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -772,6 +772,10 @@ public function getTransitions() $this->cache[$store] = $transitions; } } catch (\RuntimeException $e) { + if ($this->shouldUseExceptions()) { + throw $e; + } + $this->setError($e->getMessage()); return false; diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index 8026a3a99a349..8db386d390997 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -10,6 +10,7 @@ namespace Joomla\Component\Fields\Administrator\Model; +use Joomla\CMS\Access\Exception\NotAllowedException; use Joomla\CMS\Categories\CategoryServiceInterface; use Joomla\CMS\Categories\SectionNotFoundException; use Joomla\CMS\Component\ComponentHelper; @@ -22,6 +23,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Table\Exception\ValidationException; use Joomla\CMS\Table\Table; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; use Joomla\Database\DatabaseAwareInterface; @@ -181,6 +183,10 @@ public function save($data) $message = $this->checkDefaultValue($data); if ($message !== true) { + if ($this->shouldUseExceptions()) { + throw new ValidationException($message); + } + $this->setError($message); return false; @@ -1208,6 +1214,12 @@ protected function batchCopy($value, $pks, $contexts) $table->state = 0; if (!$table->store()) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; @@ -1230,6 +1242,10 @@ protected function batchCopy($value, $pks, $contexts) // Add the new ID to the array $newIds[$pk] = $newId; } else { + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE')); + } + $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE')); return false; @@ -1269,11 +1285,21 @@ protected function batchMove($value, $pks, $contexts) $table->group_id = $value; if (!$table->store()) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; } } else { + if ($this->shouldUseExceptions()) { + throw new NotAllowedException(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + } + $this->setError(Text::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); return false; diff --git a/administrator/components/com_fields/src/Table/FieldTable.php b/administrator/components/com_fields/src/Table/FieldTable.php index fdbd40c59c38e..db32eb9c4760d 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -14,6 +14,8 @@ use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; +use Joomla\CMS\Table\Exception\DuplicateEntryException; +use Joomla\CMS\Table\Exception\ValidationException; use Joomla\CMS\Table\Table; use Joomla\CMS\User\CurrentUserInterface; use Joomla\CMS\User\CurrentUserTrait; @@ -133,6 +135,10 @@ public function check() { // Check for valid name if (trim($this->title) == '') { + if ($this->shouldUseExceptions()) { + throw new ValidationException(Text::_('COM_FIELDS_MUSTCONTAIN_A_TITLE_FIELD')); + } + $this->setError(Text::_('COM_FIELDS_MUSTCONTAIN_A_TITLE_FIELD')); return false; @@ -154,6 +160,10 @@ public function check() $table = new self($this->getDatabase(), $this->getDispatcher()); if ($table->load(['name' => $this->name]) && ($table->id != $this->id || $this->id == 0)) { + if ($this->shouldUseExceptions()) { + throw new DuplicateEntryException(Text::_('COM_FIELDS_ERROR_UNIQUE_NAME'), 'name'); + } + $this->setError(Text::_('COM_FIELDS_ERROR_UNIQUE_NAME')); return false; diff --git a/administrator/components/com_fields/src/Table/GroupTable.php b/administrator/components/com_fields/src/Table/GroupTable.php index 95cb3bad47454..0cb71702e629c 100644 --- a/administrator/components/com_fields/src/Table/GroupTable.php +++ b/administrator/components/com_fields/src/Table/GroupTable.php @@ -13,6 +13,7 @@ use Joomla\CMS\Access\Rules; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; +use Joomla\CMS\Table\Exception\ValidationException; use Joomla\CMS\Table\Table; use Joomla\CMS\User\CurrentUserInterface; use Joomla\CMS\User\CurrentUserTrait; @@ -100,6 +101,10 @@ public function check() { // Check for a title. if (trim($this->title) == '') { + if ($this->shouldUseExceptions()) { + throw new ValidationException(Text::_('COM_FIELDS_MUSTCONTAIN_A_TITLE_GROUP')); + } + $this->setError(Text::_('COM_FIELDS_MUSTCONTAIN_A_TITLE_GROUP')); return false; diff --git a/components/com_content/src/Model/ArticleModel.php b/components/com_content/src/Model/ArticleModel.php index 602f900ef0c61..600b9246b226f 100644 --- a/components/com_content/src/Model/ArticleModel.php +++ b/components/com_content/src/Model/ArticleModel.php @@ -286,7 +286,7 @@ public function getItem($pk = null) $this->_item[$pk] = $data; } catch (\Exception $e) { - if ($e->getCode() == 404) { + if ($e->getCode() == 404 || $this->shouldUseExceptions()) { // Need to go through the error handler to allow Redirect to work. throw $e; } diff --git a/components/com_content/src/Model/CategoryModel.php b/components/com_content/src/Model/CategoryModel.php index d64a842b75b7c..6af430c583123 100644 --- a/components/com_content/src/Model/CategoryModel.php +++ b/components/com_content/src/Model/CategoryModel.php @@ -281,6 +281,12 @@ public function getItems() $this->_articles = $model->getItems(); if ($this->_articles === false) { + if ($this->shouldUseExceptions()) { + $error = $model->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($model->getError()); } } else { diff --git a/components/com_content/src/Model/FormModel.php b/components/com_content/src/Model/FormModel.php index 35933a855684e..d380a27cb10ad 100644 --- a/components/com_content/src/Model/FormModel.php +++ b/components/com_content/src/Model/FormModel.php @@ -93,6 +93,12 @@ public function getItem($itemId = null) // Check for a table object error. if ($return === false && $table->getError()) { + if ($this->shouldUseExceptions()) { + $error = $table->getError(null, false); + + throw $error instanceof \Throwable ? $error : new \RuntimeException((string) $error); + } + $this->setError($table->getError()); return false; From 598cd5111f265869194ec4186e96fae06c9599fc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 15 Jul 2026 09:49:40 +0000 Subject: [PATCH 4/4] Fix code style issues [skip ci] --- .../src/Access/Exception/AuthenticationFailedException.php | 2 +- libraries/src/Access/Exception/NotAllowedException.php | 2 +- libraries/src/Application/Exception/NotAcceptableException.php | 2 +- .../src/MVC/Controller/Exception/CheckinCheckoutException.php | 2 +- .../src/MVC/Controller/Exception/ResourceNotFoundException.php | 2 +- libraries/src/MVC/Controller/Exception/SaveException.php | 2 +- libraries/src/MVC/Controller/Exception/SendEmailException.php | 2 +- libraries/src/MVC/Model/Exception/BatchOperationException.php | 2 +- libraries/src/Table/Exception/DuplicateEntryException.php | 2 +- libraries/src/Table/Exception/InvalidHierarchyException.php | 2 +- libraries/src/Table/Exception/RecordNotFoundException.php | 2 +- libraries/src/Table/Exception/TableExceptionInterface.php | 2 +- libraries/src/Table/Exception/ValidationException.php | 2 +- libraries/src/Table/Exception/WorkflowStateException.php | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libraries/src/Access/Exception/AuthenticationFailedException.php b/libraries/src/Access/Exception/AuthenticationFailedException.php index 80131c7305d8c..70479ad33693a 100644 --- a/libraries/src/Access/Exception/AuthenticationFailedException.php +++ b/libraries/src/Access/Exception/AuthenticationFailedException.php @@ -20,4 +20,4 @@ */ class AuthenticationFailedException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/Access/Exception/NotAllowedException.php b/libraries/src/Access/Exception/NotAllowedException.php index 22a1686fa2682..f9e68c51dc2d5 100644 --- a/libraries/src/Access/Exception/NotAllowedException.php +++ b/libraries/src/Access/Exception/NotAllowedException.php @@ -20,4 +20,4 @@ */ class NotAllowedException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/Application/Exception/NotAcceptableException.php b/libraries/src/Application/Exception/NotAcceptableException.php index 1af998e13c1ac..34826c878a491 100644 --- a/libraries/src/Application/Exception/NotAcceptableException.php +++ b/libraries/src/Application/Exception/NotAcceptableException.php @@ -20,4 +20,4 @@ */ class NotAcceptableException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php b/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php index 878257eb53d11..e0c854ee65c94 100644 --- a/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php +++ b/libraries/src/MVC/Controller/Exception/CheckinCheckoutException.php @@ -20,4 +20,4 @@ */ class CheckinCheckoutException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php b/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php index c1c617719581b..7e50482fa761f 100644 --- a/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php +++ b/libraries/src/MVC/Controller/Exception/ResourceNotFoundException.php @@ -20,4 +20,4 @@ */ class ResourceNotFoundException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/MVC/Controller/Exception/SaveException.php b/libraries/src/MVC/Controller/Exception/SaveException.php index b38480dd0c8a0..171adef01270c 100644 --- a/libraries/src/MVC/Controller/Exception/SaveException.php +++ b/libraries/src/MVC/Controller/Exception/SaveException.php @@ -20,4 +20,4 @@ */ class SaveException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/MVC/Controller/Exception/SendEmailException.php b/libraries/src/MVC/Controller/Exception/SendEmailException.php index 21b2620b1bede..df959c27c5cf8 100644 --- a/libraries/src/MVC/Controller/Exception/SendEmailException.php +++ b/libraries/src/MVC/Controller/Exception/SendEmailException.php @@ -20,4 +20,4 @@ */ class SendEmailException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/libraries/src/MVC/Model/Exception/BatchOperationException.php b/libraries/src/MVC/Model/Exception/BatchOperationException.php index 096f032015db9..34116b66390d4 100644 --- a/libraries/src/MVC/Model/Exception/BatchOperationException.php +++ b/libraries/src/MVC/Model/Exception/BatchOperationException.php @@ -21,4 +21,4 @@ */ class BatchOperationException extends \RuntimeException implements ModelExceptionInterface { -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/DuplicateEntryException.php b/libraries/src/Table/Exception/DuplicateEntryException.php index ee2144cd49a22..c02d6e76c9dc8 100644 --- a/libraries/src/Table/Exception/DuplicateEntryException.php +++ b/libraries/src/Table/Exception/DuplicateEntryException.php @@ -56,4 +56,4 @@ public function getField(): string { return $this->field; } -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/InvalidHierarchyException.php b/libraries/src/Table/Exception/InvalidHierarchyException.php index cca695ea2aabb..ebb3cf045c9c7 100644 --- a/libraries/src/Table/Exception/InvalidHierarchyException.php +++ b/libraries/src/Table/Exception/InvalidHierarchyException.php @@ -24,4 +24,4 @@ */ class InvalidHierarchyException extends \LogicException implements TableExceptionInterface { -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/RecordNotFoundException.php b/libraries/src/Table/Exception/RecordNotFoundException.php index 81114a68e772a..9df753d53c865 100644 --- a/libraries/src/Table/Exception/RecordNotFoundException.php +++ b/libraries/src/Table/Exception/RecordNotFoundException.php @@ -20,4 +20,4 @@ */ class RecordNotFoundException extends \RuntimeException implements TableExceptionInterface { -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/TableExceptionInterface.php b/libraries/src/Table/Exception/TableExceptionInterface.php index 973391d98e0f6..14d43544224e6 100644 --- a/libraries/src/Table/Exception/TableExceptionInterface.php +++ b/libraries/src/Table/Exception/TableExceptionInterface.php @@ -21,4 +21,4 @@ */ interface TableExceptionInterface extends \Throwable { -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/ValidationException.php b/libraries/src/Table/Exception/ValidationException.php index 38bf7cddb9fa2..8b6061f1eccf6 100644 --- a/libraries/src/Table/Exception/ValidationException.php +++ b/libraries/src/Table/Exception/ValidationException.php @@ -57,4 +57,4 @@ public function getFieldErrors(): array { return $this->fieldErrors; } -} \ No newline at end of file +} diff --git a/libraries/src/Table/Exception/WorkflowStateException.php b/libraries/src/Table/Exception/WorkflowStateException.php index 0e71f6decddd1..266cfe6f1665f 100644 --- a/libraries/src/Table/Exception/WorkflowStateException.php +++ b/libraries/src/Table/Exception/WorkflowStateException.php @@ -21,4 +21,4 @@ */ class WorkflowStateException extends \RuntimeException implements TableExceptionInterface { -} \ No newline at end of file +}