State = $State; } /** * @param Context $Context * @param State $State * @param Block|null $Block * @return static|null */ public static function build( Context $Context, State $State, Block $Block = null ) { if (\preg_match( '/^\[(.+?)\]:[ ]*+?(?:[ ]+["\'(](.+)["\')])?[ ]*+$/', $Context->line()->text(), $matches )) { $id = \strtolower($matches[1]); $Data = [ 'url' => $matches[2], 'title' => isset($matches[3]) ? $matches[3] : null, ]; $State = $State->setting( $State->get(DefinitionBook::class)->setting($id, $Data) ); return new self($State); } return null; } /** @return State */ public function latestState() { return $this->State; } /** * @return Invisible */ public function stateRenderable() { return new Invisible; } }