Skip to content

Commit

Permalink
fix: ensure Input is compatible with the interface it implements
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsey committed Aug 7, 2021
1 parent a7812e6 commit c0a31af
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions src/CaptainHook/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,18 @@ public function getParameterOption($values, $default = false, bool $onlyParams =
throw $this->unsupportedMethod(__METHOD__);
}

public function bind(InputDefinition $definition): void
/**
* @return void
*/
public function bind(InputDefinition $definition)
{
// Do nothing. CaptainHook IO is already bound.
}

public function validate(): void
/**
* @return void
*/
public function validate()
{
// Do nothing. CaptainHook IO is already validated.
}
Expand Down Expand Up @@ -105,14 +111,21 @@ public function getArgument(string $name)
}

/**
* @param mixed $value
*
* @return void
*
* @inheritDoc
*/
public function setArgument(string $name, $value): void
public function setArgument(string $name, $value)
{
throw $this->unsupportedMethod(__METHOD__);
}

public function hasArgument(string $name): bool
/**
* @inheritDoc
*/
public function hasArgument(string $name)
{
return isset($this->getArguments()[$name]);
}
Expand All @@ -131,9 +144,13 @@ public function getOption(string $name)
}

/**
* @param mixed $value
*
* @return void
*
* @inheritDoc
*/
public function setOption(string $name, $value): void
public function setOption(string $name, $value)
{
throw $this->unsupportedMethod(__METHOD__);
}
Expand All @@ -143,12 +160,18 @@ public function hasOption(string $name)
throw $this->unsupportedMethod(__METHOD__);
}

public function isInteractive(): bool
/**
* @inheritDoc
*/
public function isInteractive()
{
return $this->captainHookIO->isInteractive();
}

public function setInteractive(bool $interactive): void
/**
* @return void
*/
public function setInteractive(bool $interactive)
{
throw $this->unsupportedMethod(__METHOD__);
}
Expand Down

0 comments on commit c0a31af

Please sign in to comment.