Skip to content

Commit 3180a59

Browse files
committed
pint
1 parent 1898ecf commit 3180a59

File tree

5 files changed

+9
-14
lines changed

5 files changed

+9
-14
lines changed

app/Contexts/AbstractContext.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function searchForVar(string $name): AssignmentValue|string|null
120120
public function searchForProperty(string $name)
121121
{
122122
if ($this instanceof ClassDefinition) {
123-
return collect($this->properties)->first(fn($prop) => $prop['name'] === $name);
123+
return collect($this->properties)->first(fn ($prop) => $prop['name'] === $name);
124124
}
125125

126126
return $this->parent?->searchForProperty($name) ?? null;
@@ -146,7 +146,7 @@ public function toArray(): array
146146
(count($this->start) > 0) ? ['start' => $this->start] : [],
147147
(count($this->end) > 0) ? ['end' => $this->end] : [],
148148
($this->hasChildren)
149-
? ['children' => array_map(fn($child) => $child->toArray(), $this->children)]
149+
? ['children' => array_map(fn ($child) => $child->toArray(), $this->children)]
150150
: [],
151151
);
152152
}

app/Parser/DetectWalker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function walk(?Node $node = null)
4646
callback: $this->handleContext(...),
4747
);
4848

49-
return collect($this->items)->map(fn($item) => Arr::except($item->toArray(), 'children'));
49+
return collect($this->items)->map(fn ($item) => Arr::except($item->toArray(), 'children'));
5050
}
5151

5252
protected function handleContext(Node $node, AbstractContext $context)
@@ -60,7 +60,7 @@ protected function handleContext(Node $node, AbstractContext $context)
6060
if ($node instanceof $nodeClass) {
6161
$this->items[] = $context;
6262

63-
$context->parent->children = array_filter($context->parent->children, fn($child) => $child !== $context);
63+
$context->parent->children = array_filter($context->parent->children, fn ($child) => $child !== $context);
6464
}
6565
}
6666

app/Parser/Parse.php

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

55
use App\Contexts\AbstractContext;
66
use App\Contexts\Base;
7-
use App\Contexts\Blade;
87
use Microsoft\PhpParser\Node;
98

109
class Parse

app/Parsers/FunctionDeclarationParser.php

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

55
use App\Contexts\AbstractContext;
66
use App\Contexts\MethodDefinition;
7-
use Microsoft\PhpParser\Node\QualifiedName;
87
use Microsoft\PhpParser\Node\Statement\FunctionDeclaration;
98
use Microsoft\PhpParser\Token;
109

@@ -18,7 +17,7 @@ class FunctionDeclarationParser extends AbstractParser
1817
public function parse(FunctionDeclaration $node)
1918
{
2019
$this->context->methodName = collect($node->getNameParts())->map(
21-
fn(Token $part) => $part->getText($node->getRoot()->getFullText())
20+
fn (Token $part) => $part->getText($node->getRoot()->getFullText())
2221
)->join('\\');
2322

2423
return $this->context;

app/Parsers/InlineHtmlParser.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
namespace App\Parsers;
44

55
use App\Contexts\AbstractContext;
6-
use App\Contexts\Argument;
76
use App\Contexts\Blade;
87
use App\Parser\Parse;
98
use App\Parser\Settings;
10-
use Illuminate\Support\Str;
119
use Microsoft\PhpParser\Node\Statement\InlineHtml;
1210
use Microsoft\PhpParser\Parser;
1311
use Microsoft\PhpParser\Range;
1412
use Stillat\BladeParser\Document\Document;
15-
use Stillat\BladeParser\Nodes\Components\ComponentNode;
1613
use Stillat\BladeParser\Nodes\DirectiveNode;
1714
use Stillat\BladeParser\Nodes\EchoNode;
1815
use Stillat\BladeParser\Nodes\EchoType;
@@ -98,15 +95,15 @@ protected function parseEchoNode(EchoNode $node)
9895

9996
Settings::$calculatePosition = function (Range $range) use ($node) {
10097
$prefix = match ($node->type) {
101-
EchoType::RawEcho => '{!!',
98+
EchoType::RawEcho => '{!!',
10299
EchoType::TripleEcho => '{{{',
103-
default => '{{',
100+
default => '{{',
104101
};
105102

106103
$suffix = match ($node->type) {
107-
EchoType::RawEcho => '!!}',
104+
EchoType::RawEcho => '!!}',
108105
EchoType::TripleEcho => '}}}',
109-
default => '}}',
106+
default => '}}',
110107
};
111108

112109
if ($range->start->line === 1) {

0 commit comments

Comments
 (0)