Skip to content
This repository was archived by the owner on Jan 27, 2025. It is now read-only.

Commit 0418166

Browse files
Merge pull request #34 from jonassiewertsen/add-linting
Add linting
2 parents 02ec8c5 + 98617b5 commit 0418166

File tree

6 files changed

+39
-18
lines changed

6 files changed

+39
-18
lines changed

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
push:
3+
4+
jobs:
5+
lint:
6+
name: "Lint"
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v3
11+
12+
- name: "Laravel Pint"
13+
uses: aglipanci/[email protected]
14+
with:
15+
preset: laravel
16+
pintVersion: 1.13.1
17+
18+
- name: Commit changes to GitHub
19+
uses: stefanzweifel/git-auto-commit-action@v4
20+
with:
21+
commit_message: "[auto commit] Linting"

config/config.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
|
1010
| So called synthesizers allow to add custom types to Livewire, which can
1111
| can be used to make Livewire aware of Statamic classes that you want
12-
| to work with, as it might make things easier.
12+
| to work with, as it might make things easier.
1313
|
1414
| It's recommended to remove or uncomment those synthesizers that are
15-
| not used in your application, to avoid overhead by loading those.
15+
| not used in your application, to avoid overhead by loading those.
1616
|
1717
| This features is experimental. It's ment to be tested and to played
1818
| with. As long as it is experimental, it can be changed and removed
@@ -27,6 +27,6 @@
2727
'classes' => [
2828
\Jonassiewertsen\Livewire\Synthesizers\EntryCollectionSynthesizer::class,
2929
\Jonassiewertsen\Livewire\Synthesizers\EntrySynthesizer::class,
30-
]
31-
]
32-
];
30+
],
31+
],
32+
];

src/ServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public function boot(): void
1717
{
1818
parent::boot();
1919

20-
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'statamic-livewire');
20+
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'statamic-livewire');
2121

2222
if ($this->app->runningInConsole()) {
2323
$this->publishes([
24-
__DIR__ . '/../config/config.php' => config_path('statamic-livewire.php'),
24+
__DIR__.'/../config/config.php' => config_path('statamic-livewire.php'),
2525
], 'statamic-livewire');
2626
}
2727

src/Synthesizers/EntryCollectionSynthesizer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
class EntryCollectionSynthesizer extends Synth
1010
{
1111
public static $key = 'entry-collection';
12-
12+
1313
public static function match($target)
1414
{
1515
return $target instanceof StatamicEntryCollection;
1616
}
17-
17+
1818
public function dehydrate($target)
1919
{
2020
$data = [];
@@ -29,9 +29,9 @@ public function dehydrate($target)
2929
];
3030
}
3131

32-
return [ $data, [] ];
32+
return [$data, []];
3333
}
34-
34+
3535
public function hydrate($values)
3636
{
3737
$items = [];
@@ -49,6 +49,6 @@ public function hydrate($values)
4949
$items[] = $entry;
5050
}
5151

52-
return New StatamicEntryCollection($items);
52+
return new StatamicEntryCollection($items);
5353
}
5454
}

src/Synthesizers/EntrySynthesizer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99
class EntrySynthesizer extends Synth
1010
{
1111
public static $key = 'entry-collection';
12-
12+
1313
public static function match($target)
1414
{
1515
return $target instanceof StatamicEntry;
1616
}
17-
17+
1818
public function dehydrate($entry)
1919
{
20-
return [
20+
return [
2121
[
2222
'collection' => $entry->collection()->handle() ?? null,
2323
'data' => $entry->data()->all(),
2424
'date' => $entry->collection()->dated() ? $entry->date() : null,
2525
'id' => $entry->id(),
2626
'slug' => $entry->slug() ?? null,
27-
], [] ];
27+
], []];
2828
}
29-
29+
3030
public function hydrate($value)
3131
{
3232
$entry = Entry::make()

src/Tags/Livewire.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function this(): string
4646
{
4747
$instanceId = $this->context['__livewire']->getId();
4848

49-
if (!count($this->params)) {
49+
if (! count($this->params)) {
5050
return "window.Livewire.find('{$instanceId}')";
5151
}
5252

0 commit comments

Comments
 (0)