1
0
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:
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) 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
); );
} }
/** public function state(): State
* @return State
*/
public function state()
{ {
return $this; return $this;
} }

View File

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