gulp-phug 1.3.5 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +26 -0
  2. package/index.js +16 -3
  3. package/package.json +1 -1
  4. package/support/bootstrap.php +6 -0
  5. package/support/composer.json +1 -1
  6. package/support/composer.lock +14 -14
  7. package/support/vendor/composer/installed.json +15 -15
  8. package/support/vendor/composer/installed.php +17 -17
  9. package/support/vendor/composer/platform_check.php +2 -3
  10. package/support/vendor/phug/phug/.github/workflows/coverage.yml +12 -22
  11. package/support/vendor/phug/phug/.github/workflows/multi-tester.yml +7 -5
  12. package/support/vendor/phug/phug/.github/workflows/split.yml +12 -12
  13. package/support/vendor/phug/phug/.github/workflows/style.yml +2 -2
  14. package/support/vendor/phug/phug/.github/workflows/tests.yml +3 -4
  15. package/support/vendor/phug/phug/.multi-tester.yml +11 -13
  16. package/support/vendor/phug/phug/composer.json +8 -8
  17. package/support/vendor/phug/phug/src/Phug/Ast/Ast/Node.php +2 -2
  18. package/support/vendor/phug/phug/src/Phug/Ast/composer.json +1 -1
  19. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/AbstractNodeCompiler.php +4 -4
  20. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/Element/BlockElement.php +3 -3
  21. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentListNodeCompiler.php +1 -1
  22. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AssignmentNodeCompiler.php +1 -1
  23. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AttributeListNodeCompiler.php +1 -1
  24. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/AttributeNodeCompiler.php +1 -1
  25. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/BlockNodeCompiler.php +3 -3
  26. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CaseNodeCompiler.php +1 -1
  27. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CodeNodeCompiler.php +2 -2
  28. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/CommentNodeCompiler.php +1 -1
  29. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ConditionalNodeCompiler.php +1 -1
  30. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DoNodeCompiler.php +1 -1
  31. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DoctypeNodeCompiler.php +1 -1
  32. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/DocumentNodeCompiler.php +1 -1
  33. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/EachNodeCompiler.php +1 -1
  34. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ElementNodeCompiler.php +1 -1
  35. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ExpressionNodeCompiler.php +1 -1
  36. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/FilterNodeCompiler.php +1 -1
  37. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ForNodeCompiler.php +1 -1
  38. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/ImportNodeCompiler.php +1 -1
  39. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/KeywordNodeCompiler.php +1 -1
  40. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/MixinCallNodeCompiler.php +1 -1
  41. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/MixinNodeCompiler.php +1 -1
  42. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/TextNodeCompiler.php +1 -1
  43. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/VariableNodeCompiler.php +1 -1
  44. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/WhenNodeCompiler.php +1 -1
  45. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/WhileNodeCompiler.php +1 -1
  46. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompiler/YieldNodeCompiler.php +1 -1
  47. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler/NodeCompilerInterface.php +4 -4
  48. package/support/vendor/phug/phug/src/Phug/Compiler/Compiler.php +2 -2
  49. package/support/vendor/phug/phug/src/Phug/Compiler/CompilerInterface.php +2 -2
  50. package/support/vendor/phug/phug/src/Phug/Compiler/composer.json +5 -5
  51. package/support/vendor/phug/phug/src/Phug/DependencyInjection/composer.json +2 -2
  52. package/support/vendor/phug/phug/src/Phug/Event/composer.json +1 -1
  53. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/AbstractElement.php +1 -1
  54. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/AbstractFormat.php +2 -2
  55. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AbstractValueElement.php +3 -3
  56. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AnonymousBlockElement.php +1 -1
  57. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AssignmentElement.php +5 -5
  58. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/AttributeElement.php +3 -3
  59. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/CodeElement.php +3 -3
  60. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/KeywordElement.php +3 -3
  61. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/MarkupElement.php +4 -4
  62. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Element/VariableElement.php +5 -5
  63. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Event/FormatEvent.php +1 -1
  64. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/HtmlFormat.php +1 -1
  65. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/XhtmlFormat.php +1 -1
  66. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Format/XmlFormat.php +1 -1
  67. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/FormatInterface.php +1 -1
  68. package/support/vendor/phug/phug/src/Phug/Formatter/Formatter/Partial/PatternTrait.php +1 -1
  69. package/support/vendor/phug/phug/src/Phug/Formatter/composer.json +4 -4
  70. package/support/vendor/phug/phug/src/Phug/Invoker/composer.json +4 -4
  71. package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/AbstractToken.php +1 -1
  72. package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/AttributeScanner.php +1 -1
  73. package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/Scanner/IndentationScanner.php +1 -1
  74. package/support/vendor/phug/phug/src/Phug/Lexer/Lexer/TokenInterface.php +1 -1
  75. package/support/vendor/phug/phug/src/Phug/Lexer/composer.json +3 -3
  76. package/support/vendor/phug/phug/src/Phug/Parser/Parser/Node.php +5 -5
  77. package/support/vendor/phug/phug/src/Phug/Parser/Parser/State.php +4 -4
  78. package/support/vendor/phug/phug/src/Phug/Parser/ParserException.php +1 -1
  79. package/support/vendor/phug/phug/src/Phug/Parser/composer.json +4 -4
  80. package/support/vendor/phug/phug/src/Phug/Phug/Phug/Partial/PluginEnablerTrait.php +1 -1
  81. package/support/vendor/phug/phug/src/Phug/Phug/composer.json +4 -4
  82. package/support/vendor/phug/phug/src/Phug/Reader/Reader.php +4 -4
  83. package/support/vendor/phug/phug/src/Phug/Reader/composer.json +2 -2
  84. package/support/vendor/phug/phug/src/Phug/Renderer/Renderer/Task/TasksGroup.php +1 -1
  85. package/support/vendor/phug/phug/src/Phug/Renderer/composer.json +5 -5
  86. package/support/vendor/phug/phug/src/Phug/Util/CompatibilityUtil/TestCaseUntyped.php +5 -5
  87. package/support/vendor/phug/phug/src/Phug/Util/Util/SandBox.php +1 -1
  88. package/support/vendor/phug/phug/src/Phug/Util/composer.json +2 -2
@@ -31,7 +31,7 @@ class Node implements NodeInterface
31
31
  * @param NodeInterface $parent
32
32
  * @param array $children
33
33
  */
34
- public function __construct(NodeInterface $parent = null, array $children = null)
34
+ public function __construct(?NodeInterface $parent = null, ?array $children = null)
35
35
  {
36
36
  $this->parent = null;
37
37
  $this->children = [];
@@ -77,7 +77,7 @@ class Node implements NodeInterface
77
77
  /**
78
78
  * {@inheritdoc}
79
79
  */
80
- public function setParent(NodeInterface $parent = null)
80
+ public function setParent(?NodeInterface $parent = null)
81
81
  {
82
82
  if ($this->parent === $parent) {
83
83
  return $this;
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "extra": {
39
39
  "branch-alias": {
40
- "dev-master": "1.x-dev"
40
+ "dev-master": "2.x-dev"
41
41
  }
42
42
  }
43
43
  }
@@ -41,7 +41,7 @@ abstract class AbstractNodeCompiler implements NodeCompilerInterface
41
41
  *
42
42
  * @return ElementInterface[]
43
43
  */
44
- public function getCompiledNodeList($nodeList, ElementInterface $element = null)
44
+ public function getCompiledNodeList($nodeList, ?ElementInterface $element = null)
45
45
  {
46
46
  return array_values(array_filter(array_map(
47
47
  function (NodeInterface $childNode) use ($element) {
@@ -59,7 +59,7 @@ abstract class AbstractNodeCompiler implements NodeCompilerInterface
59
59
  *
60
60
  * @return ElementInterface[]
61
61
  */
62
- public function getCompiledChildren(NodeInterface $node, ElementInterface $element = null)
62
+ public function getCompiledChildren(NodeInterface $node, ?ElementInterface $element = null)
63
63
  {
64
64
  return $this->getCompiledNodeList($node->getChildren(), $element);
65
65
  }
@@ -71,7 +71,7 @@ abstract class AbstractNodeCompiler implements NodeCompilerInterface
71
71
  * @param NodeInterface $node
72
72
  * @param ElementInterface|null $element
73
73
  */
74
- public function compileNodeChildren(NodeInterface $node, ElementInterface $element = null)
74
+ public function compileNodeChildren(NodeInterface $node, ?ElementInterface $element = null)
75
75
  {
76
76
  $children = array_filter($node->getChildren());
77
77
  array_walk($children, function (NodeInterface $childNode) use ($element) {
@@ -109,7 +109,7 @@ abstract class AbstractNodeCompiler implements NodeCompilerInterface
109
109
  }, $children));
110
110
  }
111
111
 
112
- private function compileParserNode(NodeInterface $node, ElementInterface $element = null)
112
+ private function compileParserNode(NodeInterface $node, ?ElementInterface $element = null)
113
113
  {
114
114
  return $node instanceof ParserNodeInterface
115
115
  ? $this->getCompiler()->compileNode($node, $element)
@@ -22,9 +22,9 @@ class BlockElement extends AbstractElement
22
22
  public function __construct(
23
23
  CompilerInterface $compiler,
24
24
  $name = '',
25
- ParserNode $originNode = null,
26
- NodeInterface $parent = null,
27
- array $children = null
25
+ ?ParserNode $originNode = null,
26
+ ?NodeInterface $parent = null,
27
+ ?array $children = null
28
28
  ) {
29
29
  $blocks = &$compiler->getBlocksByName($name);
30
30
  $blocks[] = $this;
@@ -9,7 +9,7 @@ use Phug\Parser\NodeInterface;
9
9
 
10
10
  class AssignmentListNodeCompiler extends AbstractNodeCompiler
11
11
  {
12
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
13
13
  {
14
14
  $this->getCompiler()->assert(
15
15
  $node instanceof AssignmentListNode,
@@ -13,7 +13,7 @@ use SplObjectStorage;
13
13
 
14
14
  class AssignmentNodeCompiler extends AbstractNodeCompiler
15
15
  {
16
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
16
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
17
17
  {
18
18
  $this->getCompiler()->assert(
19
19
  $node instanceof AssignmentNode,
@@ -9,7 +9,7 @@ use Phug\Parser\NodeInterface;
9
9
 
10
10
  class AttributeListNodeCompiler extends AbstractNodeCompiler
11
11
  {
12
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
13
13
  {
14
14
  $this->getCompiler()->assert(
15
15
  $node instanceof AttributeListNode,
@@ -57,7 +57,7 @@ class AttributeNodeCompiler extends AbstractNodeCompiler
57
57
  return $value;
58
58
  }
59
59
 
60
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
60
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
61
61
  {
62
62
  $this->getCompiler()->assert(
63
63
  $node instanceof AttributeNode,
@@ -12,7 +12,7 @@ use Phug\Parser\NodeInterface;
12
12
 
13
13
  class BlockNodeCompiler extends AbstractNodeCompiler
14
14
  {
15
- protected function compileAnonymousBlock(BlockNode $node, ElementInterface $parent = null)
15
+ protected function compileAnonymousBlock(BlockNode $node, ?ElementInterface $parent = null)
16
16
  {
17
17
  $mixin = $node;
18
18
  while ($mixin->hasParent() && !($mixin instanceof MixinNode)) {
@@ -38,7 +38,7 @@ class BlockNodeCompiler extends AbstractNodeCompiler
38
38
  return false;
39
39
  }
40
40
 
41
- protected function compileNamedBlock($name, BlockNode $node, ElementInterface $parent = null)
41
+ protected function compileNamedBlock($name, BlockNode $node, ?ElementInterface $parent = null)
42
42
  {
43
43
  $compiler = $this->getCompiler();
44
44
  $layout = $compiler->getLayout();
@@ -63,7 +63,7 @@ class BlockNodeCompiler extends AbstractNodeCompiler
63
63
  );
64
64
  }
65
65
 
66
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
66
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
67
67
  {
68
68
  $this->getCompiler()->assert(
69
69
  $node instanceof BlockNode,
@@ -8,7 +8,7 @@ use Phug\Parser\NodeInterface;
8
8
 
9
9
  class CaseNodeCompiler extends AbstractStatementNodeCompiler
10
10
  {
11
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
11
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
12
12
  {
13
13
  $this->getCompiler()->assert(
14
14
  $node instanceof CaseNode,
@@ -12,7 +12,7 @@ use Phug\Parser\NodeInterface;
12
12
 
13
13
  class CodeNodeCompiler extends AbstractNodeCompiler
14
14
  {
15
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
15
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
16
16
  {
17
17
  $this->getCompiler()->assert(
18
18
  $node instanceof CodeNode,
@@ -42,7 +42,7 @@ class CodeNodeCompiler extends AbstractNodeCompiler
42
42
  return $code;
43
43
  }
44
44
 
45
- private function getCodeElement(CodeNode $node, array $texts, array $children, ElementInterface $parent = null)
45
+ private function getCodeElement(CodeNode $node, array $texts, array $children, ?ElementInterface $parent = null)
46
46
  {
47
47
  if (count($texts) === count($children)) {
48
48
  return new CodeElement($this->getTextChildren($node), $node);
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class CommentNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof CommentNode,
@@ -9,7 +9,7 @@ use Phug\Util\TransformableInterface;
9
9
 
10
10
  class ConditionalNodeCompiler extends AbstractStatementNodeCompiler
11
11
  {
12
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
13
13
  {
14
14
  $compiler = $this->getCompiler();
15
15
 
@@ -8,7 +8,7 @@ use Phug\Parser\NodeInterface;
8
8
 
9
9
  class DoNodeCompiler extends AbstractStatementNodeCompiler
10
10
  {
11
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
11
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
12
12
  {
13
13
  $this->getCompiler()->assert(
14
14
  $node instanceof DoNode,
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class DoctypeNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $compiler = $this->getCompiler();
16
16
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class DocumentNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof DocumentNode,
@@ -76,7 +76,7 @@ class EachNodeCompiler extends AbstractStatementNodeCompiler
76
76
  return $loop;
77
77
  }
78
78
 
79
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
79
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
80
80
  {
81
81
  $this->getCompiler()->assert(
82
82
  $node instanceof EachNode,
@@ -14,7 +14,7 @@ use SplObjectStorage;
14
14
 
15
15
  class ElementNodeCompiler extends AbstractNodeCompiler
16
16
  {
17
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
17
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
18
18
  {
19
19
  $compiler = $this->getCompiler();
20
20
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class ExpressionNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof ExpressionNode,
@@ -40,7 +40,7 @@ class FilterNodeCompiler extends AbstractNodeCompiler
40
40
  }, $children));
41
41
  }
42
42
 
43
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
43
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
44
44
  {
45
45
  $compiler = $this->getCompiler();
46
46
  $compiler->assert(
@@ -8,7 +8,7 @@ use Phug\Parser\NodeInterface;
8
8
 
9
9
  class ForNodeCompiler extends EachNodeCompiler
10
10
  {
11
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
11
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
12
12
  {
13
13
  $this->getCompiler()->assert(
14
14
  $node instanceof ForNode,
@@ -51,7 +51,7 @@ class ImportNodeCompiler extends AbstractNodeCompiler
51
51
  *
52
52
  * @return null|ElementInterface
53
53
  */
54
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
54
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
55
55
  {
56
56
  $compiler = $this->getCompiler();
57
57
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class KeywordNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof KeywordNode,
@@ -14,7 +14,7 @@ use Phug\Parser\NodeInterface as ParserNodeInterface;
14
14
 
15
15
  class MixinCallNodeCompiler extends AbstractNodeCompiler
16
16
  {
17
- public function compileNode(ParserNodeInterface $node, ElementInterface $parent = null)
17
+ public function compileNode(ParserNodeInterface $node, ?ElementInterface $parent = null)
18
18
  {
19
19
  $compiler = $this->getCompiler();
20
20
  $compiler->assert(
@@ -13,7 +13,7 @@ use Phug\Parser\NodeInterface;
13
13
 
14
14
  class MixinNodeCompiler extends AbstractNodeCompiler
15
15
  {
16
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
16
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
17
17
  {
18
18
  $compiler = $this->getCompiler();
19
19
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class TextNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof TextNode,
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class VariableNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $compiler = $this->getCompiler();
16
16
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class WhenNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $this->getCompiler()->assert(
16
16
  $node instanceof WhenNode,
@@ -9,7 +9,7 @@ use Phug\Parser\NodeInterface;
9
9
 
10
10
  class WhileNodeCompiler extends AbstractStatementNodeCompiler
11
11
  {
12
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
12
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
13
13
  {
14
14
  $compiler = $this->getCompiler();
15
15
  $compiler->assert(
@@ -10,7 +10,7 @@ use Phug\Parser\NodeInterface;
10
10
 
11
11
  class YieldNodeCompiler extends AbstractNodeCompiler
12
12
  {
13
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
13
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
14
14
  {
15
15
  $compiler = $this->getCompiler();
16
16
  $compiler->assert(
@@ -16,7 +16,7 @@ interface NodeCompilerInterface
16
16
  *
17
17
  * @return array
18
18
  */
19
- public function getCompiledNodeList($nodeList, ElementInterface $parent = null);
19
+ public function getCompiledNodeList($nodeList, ?ElementInterface $parent = null);
20
20
 
21
21
  /**
22
22
  * @param NodeInterface $node
@@ -24,7 +24,7 @@ interface NodeCompilerInterface
24
24
  *
25
25
  * @return array
26
26
  */
27
- public function getCompiledChildren(NodeInterface $node, ElementInterface $parent = null);
27
+ public function getCompiledChildren(NodeInterface $node, ?ElementInterface $parent = null);
28
28
 
29
29
  /**
30
30
  * @param NodeInterface $node
@@ -32,7 +32,7 @@ interface NodeCompilerInterface
32
32
  *
33
33
  * @return mixed
34
34
  */
35
- public function compileNodeChildren(NodeInterface $node, ElementInterface $element = null);
35
+ public function compileNodeChildren(NodeInterface $node, ?ElementInterface $element = null);
36
36
 
37
37
  /**
38
38
  * @param ParserNodeInterface $node
@@ -40,7 +40,7 @@ interface NodeCompilerInterface
40
40
  *
41
41
  * @return null|BlockElement|ElementInterface
42
42
  */
43
- public function compileNode(ParserNodeInterface $node, ElementInterface $parent = null);
43
+ public function compileNode(ParserNodeInterface $node, ?ElementInterface $parent = null);
44
44
 
45
45
  /**
46
46
  * @return CompilerInterface
@@ -499,7 +499,7 @@ class Compiler implements ModuleContainerInterface, CompilerInterface, WithUpper
499
499
  *
500
500
  * @return ElementInterface
501
501
  */
502
- public function compileNode(NodeInterface $node, ElementInterface $parent = null)
502
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null)
503
503
  {
504
504
  $nodeEvent = new NodeEvent($node);
505
505
  $this->trigger($nodeEvent);
@@ -537,7 +537,7 @@ class Compiler implements ModuleContainerInterface, CompilerInterface, WithUpper
537
537
  * @param BlockElement $block
538
538
  * @param array $children
539
539
  */
540
- public function replaceBlock(BlockElement $block, array $children = null)
540
+ public function replaceBlock(BlockElement $block, ?array $children = null)
541
541
  {
542
542
  if ($parent = $block->getParent()) {
543
543
  foreach (array_reverse($children ?: $block->getChildren()) as $child) {
@@ -92,7 +92,7 @@ interface CompilerInterface extends ModuleContainerInterface
92
92
  * @param BlockElement $block
93
93
  * @param array $children
94
94
  */
95
- public function replaceBlock(BlockElement $block, array $children = null);
95
+ public function replaceBlock(BlockElement $block, ?array $children = null);
96
96
 
97
97
  /**
98
98
  * @throws CompilerException
@@ -133,7 +133,7 @@ interface CompilerInterface extends ModuleContainerInterface
133
133
  *
134
134
  * @return null|ElementInterface
135
135
  */
136
- public function compileNode(NodeInterface $node, ElementInterface $parent = null);
136
+ public function compileNode(NodeInterface $node, ?ElementInterface $parent = null);
137
137
 
138
138
  /**
139
139
  * @param string $input
@@ -24,10 +24,10 @@
24
24
  "minimum-stability": "dev",
25
25
  "require": {
26
26
  "php": ">=5.5.0",
27
- "phug/util": "^0.4.0 || ^1.0",
28
- "phug/formatter": "^0.5.50 || ^1.0",
29
- "phug/dependency-injection": "^1.1.2",
30
- "phug/parser": "^0.5.0 || ^1.0"
27
+ "phug/util": "^0.4.0 || ^1.0 || ^2.0",
28
+ "phug/formatter": "^0.5.50 || ^1.0 || ^2.0",
29
+ "phug/dependency-injection": "^1.1.2 || ^2.0",
30
+ "phug/parser": "^0.5.0 || ^1.0 || ^2.0"
31
31
  },
32
32
  "autoload": {
33
33
  "psr-4": {
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "extra": {
38
38
  "branch-alias": {
39
- "dev-master": "1.x-dev"
39
+ "dev-master": "2.x-dev"
40
40
  }
41
41
  }
42
42
  }
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "minimum-stability": "dev",
25
25
  "require": {
26
- "phug/util": "^0.4.0 || ^1.0"
26
+ "phug/util": "^0.4.0 || ^1.0 || ^2.0"
27
27
  },
28
28
  "autoload": {
29
29
  "psr-4": {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "extra": {
34
34
  "branch-alias": {
35
- "dev-master": "1.x-dev"
35
+ "dev-master": "2.x-dev"
36
36
  }
37
37
  }
38
38
  }
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "extra": {
34
34
  "branch-alias": {
35
- "dev-master": "1.x-dev"
35
+ "dev-master": "2.x-dev"
36
36
  }
37
37
  }
38
38
  }
@@ -20,7 +20,7 @@ abstract class AbstractElement extends Node implements ElementInterface
20
20
  * @param NodeInterface|null $parent
21
21
  * @param array|null $children
22
22
  */
23
- public function __construct(ParserNode $originNode = null, NodeInterface $parent = null, array $children = null)
23
+ public function __construct(?ParserNode $originNode = null, ?NodeInterface $parent = null, ?array $children = null)
24
24
  {
25
25
  $this->originNode = $originNode;
26
26
 
@@ -77,7 +77,7 @@ abstract class AbstractFormat implements FormatInterface, OptionInterface
77
77
  */
78
78
  private $debugCommentPattern = null;
79
79
 
80
- public function __construct(Formatter $formatter = null)
80
+ public function __construct(?Formatter $formatter = null)
81
81
  {
82
82
  $patterns = [
83
83
  'class_attribute' => static::CLASS_ATTRIBUTE,
@@ -1003,7 +1003,7 @@ abstract class AbstractFormat implements FormatInterface, OptionInterface
1003
1003
  return $this->formatElementChildren($document, 0);
1004
1004
  }
1005
1005
 
1006
- protected function throwException($message, ElementInterface $element = null)
1006
+ protected function throwException($message, ?ElementInterface $element = null)
1007
1007
  {
1008
1008
  $location = ($node = $element->getOriginNode()) && ($loc = $node->getSourceLocation())
1009
1009
  ? clone $loc
@@ -21,9 +21,9 @@ abstract class AbstractValueElement extends AbstractElement
21
21
  */
22
22
  public function __construct(
23
23
  $value = null,
24
- ParserNode $originNode = null,
25
- NodeInterface $parent = null,
26
- array $children = null
24
+ ?ParserNode $originNode = null,
25
+ ?NodeInterface $parent = null,
26
+ ?array $children = null
27
27
  ) {
28
28
  parent::__construct($originNode, $parent, $children);
29
29
 
@@ -7,7 +7,7 @@ use Phug\Parser\NodeInterface as ParserNode;
7
7
 
8
8
  class AnonymousBlockElement extends ExpressionElement
9
9
  {
10
- public function __construct(ParserNode $originNode = null, NodeInterface $parent = null, array $children = null)
10
+ public function __construct(?ParserNode $originNode = null, ?NodeInterface $parent = null, ?array $children = null)
11
11
  {
12
12
  parent::__construct('$__pug_children(get_defined_vars())', $originNode, $parent, $children);
13
13
  $this->uncheck();
@@ -31,11 +31,11 @@ class AssignmentElement extends AbstractElement implements AttributesInterface,
31
31
  */
32
32
  public function __construct(
33
33
  $name,
34
- SplObjectStorage $attributes = null,
35
- AssignmentContainerInterface $container = null,
36
- ParserNode $originNode = null,
37
- NodeInterface $parent = null,
38
- array $children = null
34
+ ?SplObjectStorage $attributes = null,
35
+ ?AssignmentContainerInterface $container = null,
36
+ ?ParserNode $originNode = null,
37
+ ?NodeInterface $parent = null,
38
+ ?array $children = null
39
39
  ) {
40
40
  parent::__construct($originNode, $parent, $children);
41
41
 
@@ -27,9 +27,9 @@ class AttributeElement extends AbstractValueElement implements OrderableInterfac
27
27
  public function __construct(
28
28
  $name,
29
29
  $value,
30
- ParserNode $originNode = null,
31
- NodeInterface $parent = null,
32
- array $children = null
30
+ ?ParserNode $originNode = null,
31
+ ?NodeInterface $parent = null,
32
+ ?array $children = null
33
33
  ) {
34
34
  parent::__construct($originNode, $parent, $children);
35
35
 
@@ -34,9 +34,9 @@ class CodeElement extends AbstractValueElement implements TransformableInterface
34
34
  */
35
35
  public function __construct(
36
36
  $value = null,
37
- ParserNode $originNode = null,
38
- NodeInterface $parent = null,
39
- array $children = null
37
+ ?ParserNode $originNode = null,
38
+ ?NodeInterface $parent = null,
39
+ ?array $children = null
40
40
  ) {
41
41
  parent::__construct($value, $originNode, $parent, $children);
42
42
 
@@ -27,9 +27,9 @@ class KeywordElement extends AbstractElement
27
27
  public function __construct(
28
28
  $name,
29
29
  $value,
30
- ParserNode $originNode = null,
31
- NodeInterface $parent = null,
32
- array $children = null
30
+ ?ParserNode $originNode = null,
31
+ ?NodeInterface $parent = null,
32
+ ?array $children = null
33
33
  ) {
34
34
  parent::__construct($originNode, $parent, $children);
35
35
 
@@ -32,10 +32,10 @@ class MarkupElement extends AbstractMarkupElement implements AttributesInterface
32
32
  public function __construct(
33
33
  $name,
34
34
  $autoClosed = false,
35
- SplObjectStorage $attributes = null,
36
- ParserNode $originNode = null,
37
- NodeInterface $parent = null,
38
- array $children = null
35
+ ?SplObjectStorage $attributes = null,
36
+ ?ParserNode $originNode = null,
37
+ ?NodeInterface $parent = null,
38
+ ?array $children = null
39
39
  ) {
40
40
  parent::__construct($originNode, $parent, $children);
41
41