From: Matthias Schmidt Date: Fri, 13 Jul 2018 06:54:21 +0000 (+0200) Subject: Unify method names in ClassNameFormField X-Git-Tag: 5.2.0_Alpha_1~680^2~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=435952bf97a4b7aea493efa8d2452c28995448b5;p=GitHub%2FWoltLab%2FWCF.git Unify method names in ClassNameFormField and fix some other code style issues. See #2509 --- diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php index 910ab7b4e6..4a6f09d3dd 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ClassNameFormField.class.php @@ -1,8 +1,8 @@ __implementedInterface; } - /** - * Returns `true` if the entered class must be instantiable. By default, - * `true` is returned. - * - * @return bool - */ - public function getIsInstantiable(): bool { - return $this->__isInstantiable; - } - /** * Returns name of the interface the entered class must implement or an * empty string if the entered class does not have to implement any specific @@ -137,15 +127,25 @@ class ClassNameFormField extends TextFormField { /** * Sets whether entered class must be instantiable and returns this field. * - * @param bool $isInstantiable determines if entered class must be instantiable - * @return static this field + * @param bool $instantiable determines if entered class must be instantiable + * @return static this field */ - public function isInstantiable(bool $isInstantiable = true): ClassNameFormField { - $this->__isInstantiable = $isInstantiable; + public function instantiable(bool $instantiable = true): ClassNameFormField { + $this->__instantiable = $instantiable; return $this; } + /** + * Returns `true` if the entered class must be instantiable. By default, + * `true` is returned. + * + * @return bool + */ + public function isInstantiable(): bool { + return $this->__instantiable; + } + /** * Returns the name of the class the entered class must extend. * @@ -216,7 +216,7 @@ class ClassNameFormField extends TextFormField { ) ); } - else if ($this->getIsInstantiable()) { + else if ($this->isInstantiable()) { $reflection = new \ReflectionClass($text); $isSingleton = is_subclass_of($text, SingletonFactory::class);