Minor refactor to use type hints

This commit is contained in:
Aidan Woods 2021-10-12 18:05:58 +01:00
parent 0f27f2e842
commit efaf20d005
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
3 changed files with 4 additions and 10 deletions

View File

@ -29,9 +29,9 @@ final class Parsedown
public function __construct(StateBearer $StateBearer = null)
{
$StateBearer = $StateBearer ?: new State;
$State = ($StateBearer ?? new State)->state();
$this->State = $StateBearer->state()->isolatedCopy();
$this->State = $State->isolatedCopy();
}
/**

View File

@ -102,10 +102,7 @@ final class State implements StateBearer
);
}
/**
* @return State
*/
public function state()
public function state(): State
{
return $this;
}

View File

@ -4,8 +4,5 @@ namespace Erusev\Parsedown;
interface StateBearer
{
/**
* @return State
*/
public function state();
public function state(): State;
}