From 435952bf97a4b7aea493efa8d2452c28995448b5 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Fri, 13 Jul 2018 08:54:21 +0200 Subject: [PATCH] Unify method names in ClassNameFormField and fix some other code style issues. See #2509 --- .../field/ClassNameFormField.class.php | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) 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); -- 2.20.1