Skip to content

Commit

Permalink
Make magic methods explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrans committed Aug 20, 2024
1 parent 74967c0 commit f708e25
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 23 additions & 1 deletion QueryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,30 @@ public function __construct(
/**
* Append the given clause components and parameters to their existing
* counterparts for the specified clause.
*
* @method select(): self
* @method insert(): self
* @method replace(): self
* @method update(): self
* @method delete(): self
* @method from(): self
* @method join(): self
* @method set(): self
* @method columns(): self
* @method values(): self
* @method where(): self
* @method group(): self
* @method having(): self
* @method order(): self
* @method limit(): self
* @method offset(): self
* @method as(): self
* @method duplicate(): self
* @method modify(): self
* @method forupdate(): self
* @seal-methods
*/
public function __call($method, $args) {
public function __call(string $method, array $args) {
$method = strtolower($method);

if (!isset(self::$methods[$method])) {
Expand Down
2 changes: 0 additions & 2 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="QueryGenerator.php">
<MissingParamType>
<code><![CDATA[$args]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$method]]></code>
<code><![CDATA[$skipClause]]></code>
Expand Down

0 comments on commit f708e25

Please sign in to comment.