Skip to content

Commit 63a4e73

Browse files
committed
Update to newest drupol/php-conventions.
1 parent b1e3dc5 commit 63a4e73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+165
-167
lines changed

benchmarks/AbstractBench.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace drupol\phptree\benchmarks;
66

@@ -11,6 +11,6 @@ abstract class AbstractBench
1111
*/
1212
public function getData()
1313
{
14-
return \range(1, 100);
14+
return range(1, 100);
1515
}
1616
}

benchmarks/DrupolPhpTreeBench.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace drupol\phptree\benchmarks;
66

grumphp.yml.dist

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ imports:
22
- { resource: vendor/drupol/php-conventions/config/php71/grumphp.yml }
33

44
parameters:
5-
extensions:
6-
- drupol\PhpConventions\GrumphpTasksExtension
75
extra_tasks:
86
phpspec:
97
verbose: true

spec/drupol/phptree/Exporter/AsciiSpec.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

@@ -14,11 +14,11 @@ public function it_can_export_to_ascii(): void
1414
{
1515
$tree = new ValueNode('root', 2);
1616

17-
foreach (\range('A', 'Z') as $key => $value) {
17+
foreach (range('A', 'Z') as $key => $value) {
1818
$nodes[$value] = new ValueNode($value, 2);
1919
}
2020

21-
$tree->add(...\array_values($nodes));
21+
$tree->add(...array_values($nodes));
2222

2323
$expected = <<<'EOF'
2424
├─ root

spec/drupol/phptree/Exporter/GraphSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

spec/drupol/phptree/Exporter/GvSpec.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

@@ -34,23 +34,23 @@ public function it_can_export_to_dot_gv(): void
3434
->add($child1, $child2, $child3);
3535

3636
$nodes['root'] = [
37-
'hash' => \sha1(\spl_object_hash($tree)),
37+
'hash' => sha1(spl_object_hash($tree)),
3838
'value' => 'root',
3939
];
4040
$nodes['child1'] = [
41-
'hash' => \sha1(\spl_object_hash($child1)),
41+
'hash' => sha1(spl_object_hash($child1)),
4242
'value' => $child1->getValue(),
4343
];
4444
$nodes['child2'] = [
45-
'hash' => \sha1(\spl_object_hash($child2)),
45+
'hash' => sha1(spl_object_hash($child2)),
4646
'value' => $child2->getValue(),
4747
];
4848
$nodes['child3'] = [
49-
'hash' => \sha1(\spl_object_hash($child3)),
49+
'hash' => sha1(spl_object_hash($child3)),
5050
'value' => $child3->getValue(),
5151
];
5252
$nodes['child4'] = [
53-
'hash' => \sha1(\spl_object_hash($child4)),
53+
'hash' => sha1(spl_object_hash($child4)),
5454
'value' => $child4->getValue(),
5555
];
5656

spec/drupol/phptree/Exporter/ImageSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

spec/drupol/phptree/Exporter/SimpleArraySpec.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

@@ -21,11 +21,11 @@ public function it_can_export_to_an_array(): void
2121

2222
$nodes = [];
2323

24-
foreach (\range('A', 'J') as $value) {
24+
foreach (range('A', 'J') as $value) {
2525
$nodes[$value] = new ValueNode($value, 2);
2626
}
2727

28-
$tree->add(...\array_values($nodes));
28+
$tree->add(...array_values($nodes));
2929

3030
$return = [
3131
'value' => 'root',
@@ -80,11 +80,11 @@ public function it_can_throw_an_error_when_tree_is_not_a_valuenode(): void
8080
{
8181
$tree = new Node();
8282

83-
foreach (\range('A', 'Z') as $key => $value) {
83+
foreach (range('A', 'Z') as $key => $value) {
8484
$nodes[$value] = new Node();
8585
}
8686

87-
$tree->add(...\array_values($nodes));
87+
$tree->add(...array_values($nodes));
8888

8989
$this
9090
->shouldThrow(\InvalidArgumentException::class)

spec/drupol/phptree/Exporter/TextSpec.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Exporter;
66

@@ -20,11 +20,11 @@ public function it_can_export_to_text(): void
2020

2121
$nodes = [];
2222

23-
foreach (\range('A', 'J') as $value) {
23+
foreach (range('A', 'J') as $value) {
2424
$nodes[$value] = new ValueNode($value, 2);
2525
}
2626

27-
$tree->add(...\array_values($nodes));
27+
$tree->add(...array_values($nodes));
2828

2929
$this
3030
->export($tree)

spec/drupol/phptree/Importer/SimpleArraySpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Importer;
66

spec/drupol/phptree/Importer/TextSpec.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Importer;
66

@@ -19,11 +19,11 @@ public function it_can_import(): void
1919

2020
$nodes = [];
2121

22-
foreach (\range('A', 'J') as $value) {
22+
foreach (range('A', 'J') as $value) {
2323
$nodes[$value] = new ValueNode($value);
2424
}
2525

26-
$tree->add(...\array_values($nodes));
26+
$tree->add(...array_values($nodes));
2727

2828
$this
2929
->import($string)

spec/drupol/phptree/Modifier/ReverseSpec.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Modifier;
66

@@ -16,13 +16,13 @@ public function it_can_reverse_a_tree(): void
1616

1717
$nodes = [];
1818

19-
foreach (\range('A', 'E') as $value) {
19+
foreach (range('A', 'E') as $value) {
2020
$nodes[] = new ValueNode($value);
2121
}
2222
$tree1->add(...$nodes);
2323

2424
$tree2 = new ValueNode('root');
25-
$tree2->add(...\array_reverse($nodes));
25+
$tree2->add(...array_reverse($nodes));
2626

2727
$this
2828
->modify($tree1)

spec/drupol/phptree/Node/ABNodeSpec.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

@@ -12,7 +12,7 @@ public function it_balance_a_tree(): void
1212
{
1313
$this->beConstructedWith(1);
1414

15-
$data = \range(0, 40);
15+
$data = range(0, 40);
1616

1717
$nodes = [];
1818

spec/drupol/phptree/Node/AttributeNodeSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

spec/drupol/phptree/Node/KeyValueNodeSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

spec/drupol/phptree/Node/NaryNodeSpec.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

@@ -17,7 +17,7 @@ public function it_can_be_counted(): void
1717
{
1818
$this->beConstructedWith(2);
1919

20-
foreach (\range('A', 'Z') as $value) {
20+
foreach (range('A', 'Z') as $value) {
2121
$this->add(new ValueNode($value, 3));
2222
}
2323

spec/drupol/phptree/Node/NodeObjectBehavior.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

@@ -58,12 +58,12 @@ public function getMatchers(): array
5858
$left = (new GraphViz())->setFormat('png')->createImageFile($left);
5959
$right = (new GraphViz())->setFormat('png')->createImageFile($right);
6060

61-
return \file_get_contents($left) === \file_get_contents($right);
61+
return file_get_contents($left) === file_get_contents($right);
6262
},
6363
'haveSameGraphImageFile' => static function ($subject, $key) {
6464
$left = (new GraphViz())->setFormat('png')->createImageFile($subject);
6565

66-
return \file_get_contents($left) === \file_get_contents($key);
66+
return file_get_contents($left) === file_get_contents($key);
6767
},
6868
];
6969
}

spec/drupol/phptree/Node/NodeSpec.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

@@ -171,7 +171,7 @@ public function it_can_get_its_depth(): void
171171

172172
$nodes = [];
173173

174-
foreach (\range('A', 'Z') as $v) {
174+
foreach (range('A', 'Z') as $v) {
175175
$nodes[] = new ValueNode($v, 2);
176176
}
177177

@@ -190,7 +190,7 @@ public function it_can_get_its_height(): void
190190

191191
$tree = $this;
192192

193-
foreach (\range('A', 'B') as $key => $v) {
193+
foreach (range('A', 'B') as $key => $v) {
194194
$node = new ValueNode($v, 1);
195195
$tree->add($node);
196196
$tree = $node;
@@ -200,7 +200,7 @@ public function it_can_get_its_height(): void
200200
->height()
201201
->shouldReturn(2);
202202

203-
foreach (\range('C', 'F') as $key => $v) {
203+
foreach (range('C', 'F') as $key => $v) {
204204
$node = new ValueNode($v, 1);
205205
$tree->add($node);
206206
$tree = $node;
@@ -238,11 +238,11 @@ public function it_can_get_the_size(): void
238238
$nodes = [];
239239
$linearNodes = [];
240240

241-
foreach (\range('a', 'e') as $lowercaseValue) {
241+
foreach (range('a', 'e') as $lowercaseValue) {
242242
$node1 = new Node();
243243
$linearNodes[] = $node1;
244244

245-
foreach (\range('A', 'E') as $uppercaseValue) {
245+
foreach (range('A', 'E') as $uppercaseValue) {
246246
$node2 = new Node();
247247
$linearNodes[] = $node2;
248248

spec/drupol/phptree/Node/TrieNodeSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace spec\drupol\phptree\Node;
66

0 commit comments

Comments
 (0)