Skip to content

Commit 842031f

Browse files
patinthehatactions-user
authored andcommitted
Fix styling
1 parent 8e3f981 commit 842031f

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

src/Code/FunctionCallLocation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class FunctionCallLocation implements CodeLocation
66
{
7-
/** @var string $name */
7+
/** @var string */
88
public $name;
99

1010
/** @var int */

src/Searcher.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Permafrost\PhpCodeSearch;
44

5-
use Permafrost\PhpCodeSearch\Results\SearchError;
65
use Permafrost\PhpCodeSearch\Results\FileSearchResults;
6+
use Permafrost\PhpCodeSearch\Results\SearchError;
77
use Permafrost\PhpCodeSearch\Support\File;
88
use Permafrost\PhpCodeSearch\Visitors\FunctionCallVisitor;
99
use PhpParser\Error;
@@ -16,7 +16,7 @@
1616

1717
class Searcher
1818
{
19-
/** @var ParserFactory $parser */
19+
/** @var ParserFactory */
2020
protected $parser;
2121

2222
/** @var array */
@@ -58,7 +58,7 @@ public function static(array $names): self
5858

5959
public function assignments(array $varNames): self
6060
{
61-
$varNames = array_map(function($item) {
61+
$varNames = array_map(function ($item) {
6262
return ltrim($item, '$');
6363
}, $varNames);
6464

@@ -138,7 +138,7 @@ protected function findCalls(array $ast, string $class, ?string $nodeNameProp, a
138138
return $nodes;
139139
}
140140

141-
return array_filter($nodes, function(Node $node) use ($names, $nodeNameProp) {
141+
return array_filter($nodes, function (Node $node) use ($names, $nodeNameProp) {
142142
// if (! isset($node->{$nodeNameProp}->parts)) {
143143
// return false;
144144
// }
@@ -183,7 +183,7 @@ protected function sortNodesByLineNumber(...$items)
183183
{
184184
$result = array_merge(...$items);
185185

186-
usort($result, function($a, $b) {
186+
usort($result, function ($a, $b) {
187187
if ($a->name->getAttribute('startLine') > $b->name->getAttribute('startLine')) {
188188
return 1;
189189
}

src/Visitors/FunctionCallVisitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010

1111
class FunctionCallVisitor extends NodeVisitorAbstract
1212
{
13-
/** @var FileSearchResults $results */
13+
/** @var FileSearchResults */
1414
protected $results;
1515

1616
public function __construct(FileSearchResults $results)
1717
{
1818
$this->results = $results;
1919
}
2020

21-
public function enterNode(Node $node) {
21+
public function enterNode(Node $node)
22+
{
2223
if ($node instanceof FuncCall) {
2324
$location = FunctionCallLocation::create(
2425
$node->name->parts[0],

tests/Code/FunctionCallLocationTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ public function it_creates_an_object_with_the_correct_properties()
1717

1818
$this->assertMatchesObjectSnapshot($location);
1919
}
20-
2120
}

tests/Results/FileSearchResultsTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ public function it_returns_true_if_it_has_errors()
2929
$this->assertTrue($results->hasErrors());
3030
$this->assertCount(1, $results->errors);
3131
}
32-
3332
}

tests/Support/FileTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,4 @@ public function it_gets_the_contents_of_a_file()
5959

6060
$this->assertMatchesTextSnapshot($file->contents());
6161
}
62-
63-
64-
6562
}

0 commit comments

Comments
 (0)