Skip to content

Commit

Permalink
fixed traits not allowing multiple arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoJF committed Nov 4, 2019
1 parent 84c6c9b commit 4457a99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/Traits/HandlesCommandList.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ public function bootCommandList()
$this->commands = new CommandList();
}

public function addCommands($commands)
public function addCommands(...$args)
{
$this->commands->addItem($commands);
$this->commands->addItem(...$args);

return $this;
}

public function addCommand($command)
public function addCommand(...$args)
{
return $this->addCommands($command);
return $this->addCommands(...$args);
}

public function commands($commands)
public function commands(...$args)
{
return $this->addCommands($commands);
return $this->addCommands(...$args);
}

public function command($commands)
public function command(...$args)
{
return $this->addCommands($commands);
return $this->addCommands(...$args);
}
}
16 changes: 8 additions & 8 deletions src/Traits/HandlesServerList.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ public function bootServerList()
$this->servers = new ServerList();
}

public function addServers($servers)
public function addServers(...$args)
{
$this->servers->addItem($servers);
$this->servers->addItem(...$args);

return $this;
}

public function servers($servers)
public function servers(...$args)
{
return $this->addServers($servers);
return $this->addServers(...$args);
}

public function addServer($server)
public function addServer(...$args)
{
return $this->addServers($server);
return $this->addServers(...$args);
}

public function server($server)
public function server(...$args)
{
return $this->addServers($server);
return $this->addServers(...$args);
}
}

0 comments on commit 4457a99

Please sign in to comment.