Skip to content

Commit 8121c83

Browse files
committed
Merge remote-tracking branch 'origin/master'
split: 5b726dc15ef2bacbe76a8e2f20731238f5a7ecfe
1 parent c0e7e0c commit 8121c83

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

Parser/Node.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ class Node extends AstNode implements NodeInterface
3434
* @param TokenInterface $token the token that created the node
3535
*/
3636
public function __construct(
37-
TokenInterface $token = null,
38-
SourceLocationInterface $sourceLocation = null,
37+
?TokenInterface $token = null,
38+
?SourceLocationInterface $sourceLocation = null,
3939
$level = null,
40-
NodeInterface $parent = null,
41-
array $children = null
40+
?NodeInterface $parent = null,
41+
?array $children = null
4242
) {
4343
parent::__construct($parent, $children);
4444

@@ -77,7 +77,7 @@ public function getToken()
7777
*
7878
* @return $this
7979
*/
80-
public function setOuterNode(NodeInterface $node = null)
80+
public function setOuterNode(?NodeInterface $node = null)
8181
{
8282
$this->outerNode = $node;
8383

Parser/State.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class State implements OptionInterface, EventManagerInterface
101101
*/
102102
private $interpolationNodes;
103103

104-
public function __construct(Parser $parser, \Iterator $tokens, array $options = null)
104+
public function __construct(Parser $parser, \Iterator $tokens, ?array $options = null)
105105
{
106106
$this->parser = $parser;
107107
$this->level = 0;
@@ -329,7 +329,7 @@ private function getNamedHandler($handler)
329329
*
330330
* @return $this
331331
*/
332-
public function handleToken(TokenInterface $token = null)
332+
public function handleToken(?TokenInterface $token = null)
333333
{
334334
$token = $token ?: $this->getToken();
335335
$className = get_class($token);
@@ -534,7 +534,7 @@ public function parentNodeIs(array $classNames)
534534
*
535535
* @return Node The newly created node
536536
*/
537-
public function createNode($className, TokenInterface $token = null)
537+
public function createNode($className, ?TokenInterface $token = null)
538538
{
539539
if (!is_subclass_of($className, Node::class)) {
540540
throw new \InvalidArgumentException(
@@ -630,7 +630,7 @@ public function store()
630630
*
631631
* @throws ParserException
632632
*/
633-
public function throwException($message, $code = 0, TokenInterface $relatedToken = null, $previous = null)
633+
public function throwException($message, $code = 0, ?TokenInterface $relatedToken = null, $previous = null)
634634
{
635635
$lexer = $this->parser->getLexer();
636636
//This will basically check for a source location for this Node. The process is like:

ParserException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct(
1717
SourceLocation $location,
1818
$message = '',
1919
$code = 0,
20-
TokenInterface $relatedToken = null,
20+
?TokenInterface $relatedToken = null,
2121
$previous = null
2222
) {
2323
parent::__construct($location, $message, $code, $previous);

0 commit comments

Comments
 (0)