mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Minor refactor to use type hints
This commit is contained in:
parent
0f27f2e842
commit
efaf20d005
@ -29,9 +29,9 @@ final class Parsedown
|
|||||||
|
|
||||||
public function __construct(StateBearer $StateBearer = null)
|
public function __construct(StateBearer $StateBearer = null)
|
||||||
{
|
{
|
||||||
$StateBearer = $StateBearer ?: new State;
|
$State = ($StateBearer ?? new State)->state();
|
||||||
|
|
||||||
$this->State = $StateBearer->state()->isolatedCopy();
|
$this->State = $State->isolatedCopy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,10 +102,7 @@ final class State implements StateBearer
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function state(): State
|
||||||
* @return State
|
|
||||||
*/
|
|
||||||
public function state()
|
|
||||||
{
|
{
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -4,8 +4,5 @@ namespace Erusev\Parsedown;
|
|||||||
|
|
||||||
interface StateBearer
|
interface StateBearer
|
||||||
{
|
{
|
||||||
/**
|
public function state(): State;
|
||||||
* @return State
|
|
||||||
*/
|
|
||||||
public function state();
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user