Skip to content

Commit 1334e61

Browse files
committed
Add BadMethodCallException in Builder class
1 parent 91710ba commit 1334e61

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Builder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace ProAI\SuperMigrations;
44

5+
use BadMethodCallException;
6+
57
class Builder
68
{
79
/**
@@ -79,7 +81,11 @@ public function unlock()
7981
*/
8082
public function __call($method, $parameters)
8183
{
82-
if (!$this->lock && in_array($method, $this->passthru)) {
84+
if (! in_array($method, $this->passthru)) {
85+
throw new BadMethodCallException("Method [$method] does not exist.");
86+
}
87+
88+
if (! $this->lock) {
8389
array_unshift($parameters , $this->table);
8490

8591
return call_user_func_array([$this->schema, $method], $parameters);

0 commit comments

Comments
 (0)