Skip to content

Commit 5ec03eb

Browse files
OskarStarknicolas-grekas
authored andcommitted
[Asset][BrowserKit][Cache][Console][CssSelector] Use CPP
1 parent 3874347 commit 5ec03eb

19 files changed

+81
-132
lines changed

Node/AttributeNode.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,13 @@
2323
*/
2424
class AttributeNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
27-
private ?string $namespace;
28-
private string $attribute;
29-
private string $operator;
30-
private ?string $value;
31-
32-
public function __construct(NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value)
33-
{
34-
$this->selector = $selector;
35-
$this->namespace = $namespace;
36-
$this->attribute = $attribute;
37-
$this->operator = $operator;
38-
$this->value = $value;
26+
public function __construct(
27+
private NodeInterface $selector,
28+
private ?string $namespace,
29+
private string $attribute,
30+
private string $operator,
31+
private ?string $value,
32+
) {
3933
}
4034

4135
public function getSelector(): NodeInterface

Node/ClassNode.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
*/
2424
class ClassNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
27-
private string $name;
28-
29-
public function __construct(NodeInterface $selector, string $name)
30-
{
31-
$this->selector = $selector;
32-
$this->name = $name;
26+
public function __construct(
27+
private NodeInterface $selector,
28+
private string $name,
29+
) {
3330
}
3431

3532
public function getSelector(): NodeInterface

Node/CombinedSelectorNode.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,11 @@
2323
*/
2424
class CombinedSelectorNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
27-
private string $combinator;
28-
private NodeInterface $subSelector;
29-
30-
public function __construct(NodeInterface $selector, string $combinator, NodeInterface $subSelector)
31-
{
32-
$this->selector = $selector;
33-
$this->combinator = $combinator;
34-
$this->subSelector = $subSelector;
26+
public function __construct(
27+
private NodeInterface $selector,
28+
private string $combinator,
29+
private NodeInterface $subSelector,
30+
) {
3531
}
3632

3733
public function getSelector(): NodeInterface

Node/ElementNode.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
*/
2424
class ElementNode extends AbstractNode
2525
{
26-
private ?string $namespace;
27-
private ?string $element;
28-
29-
public function __construct(string $namespace = null, string $element = null)
30-
{
31-
$this->namespace = $namespace;
32-
$this->element = $element;
26+
public function __construct(
27+
private ?string $namespace = null,
28+
private ?string $element = null,
29+
) {
3330
}
3431

3532
public function getNamespace(): ?string

Node/FunctionNode.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@
2525
*/
2626
class FunctionNode extends AbstractNode
2727
{
28-
private NodeInterface $selector;
2928
private string $name;
30-
private array $arguments;
3129

3230
/**
3331
* @param Token[] $arguments
3432
*/
35-
public function __construct(NodeInterface $selector, string $name, array $arguments = [])
36-
{
37-
$this->selector = $selector;
33+
public function __construct(
34+
private NodeInterface $selector,
35+
string $name,
36+
private array $arguments = [],
37+
) {
3838
$this->name = strtolower($name);
39-
$this->arguments = $arguments;
4039
}
4140

4241
public function getSelector(): NodeInterface

Node/HashNode.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
*/
2424
class HashNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
27-
private string $id;
28-
29-
public function __construct(NodeInterface $selector, string $id)
30-
{
31-
$this->selector = $selector;
32-
$this->id = $id;
26+
public function __construct(
27+
private NodeInterface $selector,
28+
private string $id,
29+
) {
3330
}
3431

3532
public function getSelector(): NodeInterface

Node/NegationNode.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323
*/
2424
class NegationNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
27-
private NodeInterface $subSelector;
28-
29-
public function __construct(NodeInterface $selector, NodeInterface $subSelector)
30-
{
31-
$this->selector = $selector;
32-
$this->subSelector = $subSelector;
26+
public function __construct(
27+
private NodeInterface $selector,
28+
private NodeInterface $subSelector,
29+
) {
3330
}
3431

3532
public function getSelector(): NodeInterface

Node/PseudoNode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
*/
2424
class PseudoNode extends AbstractNode
2525
{
26-
private NodeInterface $selector;
2726
private string $identifier;
2827

29-
public function __construct(NodeInterface $selector, string $identifier)
30-
{
31-
$this->selector = $selector;
28+
public function __construct(
29+
private NodeInterface $selector,
30+
string $identifier,
31+
) {
3232
$this->identifier = strtolower($identifier);
3333
}
3434

Node/SelectorNode.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
*/
2424
class SelectorNode extends AbstractNode
2525
{
26-
private NodeInterface $tree;
2726
private ?string $pseudoElement;
2827

29-
public function __construct(NodeInterface $tree, string $pseudoElement = null)
30-
{
31-
$this->tree = $tree;
28+
public function __construct(
29+
private NodeInterface $tree,
30+
string $pseudoElement = null,
31+
) {
3232
$this->pseudoElement = $pseudoElement ? strtolower($pseudoElement) : null;
3333
}
3434

Node/Specificity.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,11 @@ class Specificity
2929
public const B_FACTOR = 10;
3030
public const C_FACTOR = 1;
3131

32-
private int $a;
33-
private int $b;
34-
private int $c;
35-
36-
public function __construct(int $a, int $b, int $c)
37-
{
38-
$this->a = $a;
39-
$this->b = $b;
40-
$this->c = $c;
32+
public function __construct(
33+
private int $a,
34+
private int $b,
35+
private int $c,
36+
) {
4137
}
4238

4339
public function plus(self $specificity): self

0 commit comments

Comments
 (0)