Update exception messages in TSelectionFormField::options()
authorMatthias Schmidt <gravatronics@live.com>
Wed, 30 May 2018 05:13:46 +0000 (07:13 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 30 May 2018 05:13:46 +0000 (07:13 +0200)
See #2509

wcfsetup/install/files/lib/system/form/builder/field/TSelectionFormField.class.php

index c566f4f7bf8be117404024ebe5ec6a8c5046143d..8b3cd9fec9bfce5ccca73a269aa10185b67f734c 100644 (file)
@@ -88,14 +88,14 @@ trait TSelectionFormField {
         */
        public function options($options): ISelectionFormField {
                if (!is_array($options) && !is_callable($options) && !($options instanceof DatabaseObjectList)) {
-                       throw new \InvalidArgumentException("Given options are neither an array nor a callable, " . gettype($options) . " given.");
+                       throw new \InvalidArgumentException("The given options are neither an array, a callable nor an instance of '" . DatabaseObjectList::class . "', " . gettype($options) . " given.");
                }
                
                if (is_callable($options)) {
                        $options = $options();
                        
                        if (!is_array($options) && !($options instanceof DatabaseObjectList)) {
-                               throw new \UnexpectedValueException("The options callable is expected to return an array or database object list, " . gettype($options) . " returned.");
+                               throw new \UnexpectedValueException("The options callable is expected to return an array or an instance of '" . DatabaseObjectList::class . "', " . gettype($options) . " returned.");
                        }
                        
                        return $this->options($options);