Skip to content

Commit

Permalink
Remove static methods from form builder interfaces
Browse files Browse the repository at this point in the history
Resolves #4468
  • Loading branch information
TimWolla committed Nov 8, 2021
1 parent ad97c48 commit 524c867
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 66 deletions.
37 changes: 0 additions & 37 deletions wcfsetup/install/files/lib/system/form/builder/IFormNode.class.php
Expand Up @@ -286,41 +286,4 @@ public function removeDependency($dependencyId);
* nodes are valid. A `IFormField` object is valid if its value is valid.
*/
public function validate();

/**
* Creates a new element with the given id.
*
* @param string $id node id
* @return static this node
*
* @throws \InvalidArgumentException if the given id is already used by another element or otherwise is invalid
*/
public static function create($id);

/**
* Checks if the given attribute name class a and a valid attribute name.
*
* @param string $name checked argument name
*
* @throws \InvalidArgumentException if the given attribute name is invalid
*/
public static function validateAttribute($name);

/**
* Checks if the given parameter class a and a valid node class.
*
* @param string $class checked class
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function validateClass($class);

/**
* Checks if the given parameter is a and a valid node id.
*
* @param string $id checked id
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function validateId($id);
}
Expand Up @@ -57,11 +57,4 @@ public function hasFieldAttribute(string $name): bool;
* @return static this form field
*/
public function removeFieldAttribute(string $name);

/**
* Checks if the given name is a valid additional attribute name.
*
* @throws \InvalidArgumentException if the given additional attribute name is invalid
*/
public static function validateFieldAttribute(string $name);
}
Expand Up @@ -170,8 +170,12 @@ protected function id($id)
}

/**
* @inheritDoc
* @return static
* Creates a new dependency with the given id.
*
* @param string $id id of the created dependency
* @return static newly created dependency
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function create($id)
{
Expand Down
Expand Up @@ -93,14 +93,4 @@ public function getHtml();
* @return string id of the dependency
*/
public function getId();

/**
* Creates a new dependency with the given id.
*
* @param string $id id of the created dependency
* @return static newly created dependency
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function create($id);
}
Expand Up @@ -81,7 +81,11 @@ public function getId()
}

/**
* @inheritDoc
* Checks if the given parameter is a and a valid validator id.
*
* @param mixed $id checked id
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function validateId($id)
{
Expand Down
Expand Up @@ -38,13 +38,4 @@ public function __invoke(IFormField $field);
* @return string id of the dependency
*/
public function getId();

/**
* Checks if the given parameter is a and a valid validator id.
*
* @param mixed $id checked id
*
* @throws \InvalidArgumentException if the given id is invalid
*/
public static function validateId($id);
}

0 comments on commit 524c867

Please sign in to comment.