Skip to content

Commit 979fec2

Browse files
mpociotgithub-actions[bot]
authored andcommitted
Fix styling
1 parent d8f7f50 commit 979fec2

File tree

12 files changed

+43
-25
lines changed

12 files changed

+43
-25
lines changed

src/Commands/MinifyApplicationCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function handle()
1515

1616
if (! is_dir($appPath)) {
1717
$this->error('The app path is not a directory');
18+
1819
return;
1920
}
2021

src/Compactor/Php.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function compactContent(string $contents): string
2626
$tokens = PhpToken::tokenize($contents);
2727
$tokenCount = count($tokens);
2828

29-
for ($index = 0; $index < $tokenCount; ++$index) {
29+
for ($index = 0; $index < $tokenCount; $index++) {
3030
$token = $tokens[$index];
3131
$tokenText = $token->text;
3232

@@ -69,7 +69,7 @@ protected function compactContent(string $contents): string
6969
&& $nextToken->is(T_WHITESPACE)
7070
) {
7171
$whitespace .= $nextToken->text;
72-
++$index;
72+
$index++;
7373
}
7474

7575
// reduce wide spaces
@@ -107,15 +107,15 @@ private function compactAnnotations(string $docblock): string
107107
}
108108

109109
/**
110-
* @param list<PhpToken> $tokens
110+
* @param list<PhpToken> $tokens
111111
*/
112112
private static function findAttributeCloser(array $tokens, int $opener): ?int
113113
{
114114
$tokenCount = count($tokens);
115115
$brackets = [$opener];
116116
$closer = null;
117117

118-
for ($i = ($opener + 1); $i < $tokenCount; ++$i) {
118+
for ($i = ($opener + 1); $i < $tokenCount; $i++) {
119119
$tokenText = $tokens[$i]->text;
120120

121121
// Allow for short arrays within attributes.
@@ -139,7 +139,7 @@ private static function findAttributeCloser(array $tokens, int $opener): ?int
139139
}
140140

141141
/**
142-
* @param non-empty-list<PhpToken> $tokens
142+
* @param non-empty-list<PhpToken> $tokens
143143
*/
144144
private function retokenizeAttribute(array &$tokens, int $opener): ?array
145145
{

src/ContextMenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public function __construct(protected Client $client)
1313

1414
public function register(Menu $menu)
1515
{
16-
$items = $menu->toArray()["submenu"];
16+
$items = $menu->toArray()['submenu'];
1717

1818
$this->client->post('context', [
19-
'entries' => $items
19+
'entries' => $items,
2020
]);
2121
}
2222
}

src/Dialog.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
class Dialog
88
{
99
protected $title;
10+
1011
protected $defaultPath;
12+
1113
protected $buttonLabel;
14+
1215
protected $properties = [
1316
'openFile',
1417
];
@@ -96,6 +99,7 @@ public function show()
9699
if (! in_array('multiSelections', $this->properties)) {
97100
return $result[0] ?? null;
98101
}
102+
99103
return $result;
100104
}
101105
}

src/Dock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ public function __construct(protected Client $client)
1313

1414
public function menu(Menu $menu)
1515
{
16-
$items = $menu->toArray()["submenu"];
16+
$items = $menu->toArray()['submenu'];
1717

1818
$this->client->post('dock', [
19-
'items' => $items
19+
'items' => $items,
2020
]);
2121
}
2222
}

src/Events/MenuBar/MenuBarClicked.php

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

55
use Illuminate\Broadcasting\Channel;
66
use Illuminate\Broadcasting\InteractsWithSockets;
7-
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
87
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
98
use Illuminate\Foundation\Events\Dispatchable;
109
use Illuminate\Queue\SerializesModels;
@@ -16,7 +15,7 @@ class MenuBarClicked implements ShouldBroadcastNow
1615
public function broadcastOn()
1716
{
1817
return [
19-
new Channel('nativephp')
18+
new Channel('nativephp'),
2019
];
2120
}
2221
}

src/GlobalShortcut.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class GlobalShortcut
88
{
99
protected string $key;
10+
1011
protected string $event;
1112

1213
public function __construct(protected Client $client)

src/Menu/Menu.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@
55
use Native\Laravel\Client\Client;
66
use Native\Laravel\Contracts\MenuItem;
77
use Native\Laravel\Enums\RolesEnum;
8-
use Native\Laravel\Menu\Items\Quit;
98
use Native\Laravel\Menu\Items\Event;
109
use Native\Laravel\Menu\Items\Link;
1110
use Native\Laravel\Menu\Items\Role;
1211
use Native\Laravel\Menu\Items\Separator;
13-
use Illuminate\Support\Facades\Http;
1412

1513
class Menu implements MenuItem
1614
{
@@ -29,10 +27,10 @@ public static function new(): static
2927

3028
public function register(): void
3129
{
32-
$items = $this->toArray()["submenu"];
30+
$items = $this->toArray()['submenu'];
3331

3432
$this->client->post('menu', [
35-
'items' => $items
33+
'items' => $items,
3634
]);
3735
}
3836

@@ -87,12 +85,12 @@ public function add(MenuItem $item): self
8785

8886
public function toArray(): array
8987
{
90-
$items = collect($this->items)->map(fn(MenuItem $item) => $item->toArray())->toArray();
88+
$items = collect($this->items)->map(fn (MenuItem $item) => $item->toArray())->toArray();
9189
$label = $this->prepend;
9290

9391
return [
94-
"label" => $label,
95-
"submenu" => $items,
92+
'label' => $label,
93+
'submenu' => $items,
9694
];
9795
}
9896
}

src/MenuBar.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,30 @@
22

33
namespace Native\Laravel;
44

5-
use Native\Laravel\Client\Client;
65
use Illuminate\Support\Facades\URL;
76
use Illuminate\Support\Str;
7+
use Native\Laravel\Client\Client;
88

99
class MenuBar
1010
{
1111
protected string $url = '';
12+
1213
protected string $icon = '';
14+
1315
protected int $width = 400;
16+
1417
protected int $height = 400;
18+
1519
protected $contextWindow;
20+
1621
protected bool $alwaysOnTop = false;
22+
1723
protected bool $transparent = false;
24+
1825
protected bool $showDockIcon = false;
26+
1927
protected string $vibrancy = 'appearance-based';
28+
2029
protected string $backgroundColor = '#FFFFFF';
2130

2231
protected string $id;
@@ -28,7 +37,6 @@ public function __construct(protected Client $client)
2837
}
2938

3039
public static function new(): static
31-
3240
{
3341
return new static(new Client());
3442
}

src/Process.php

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

77
class Process
88
{
9-
109
public function __construct(protected Client $client)
1110
{
1211
}
@@ -28,6 +27,6 @@ public function uptime(): float
2827

2928
public function fresh(): object
3029
{
31-
return (object)$this->client->get('process')->json();
30+
return (object) $this->client->get('process')->json();
3231
}
3332
}

src/Window.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,30 @@
22

33
namespace Native\Laravel;
44

5-
use Native\Laravel\Client\Client;
65
use Illuminate\Support\Facades\URL;
76
use Illuminate\Support\Str;
7+
use Native\Laravel\Client\Client;
88

99
class Window
1010
{
1111
protected string $url = '';
12+
1213
protected int $width = 400;
14+
1315
protected int $height = 400;
16+
1417
protected bool $alwaysOnTop = false;
18+
1519
protected bool $resizable = true;
20+
1621
protected bool $transparent = false;
22+
1723
protected string $titleBarStyle = 'default';
24+
1825
protected string $vibrancy = 'appearance-based';
26+
1927
protected string $backgroundColor = '#FFFFFF';
28+
2029
protected string $title = '';
2130

2231
protected string $id;
@@ -28,7 +37,6 @@ public function __construct(protected Client $client)
2837
}
2938

3039
public static function new(): static
31-
3240
{
3341
return new static(new Client());
3442
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Native\Laravel\Tests;
44

55
use Illuminate\Database\Eloquent\Factories\Factory;
6-
use Orchestra\Testbench\TestCase as Orchestra;
76
use Native\Laravel\NativeServiceProvider;
7+
use Orchestra\Testbench\TestCase as Orchestra;
88

99
class TestCase extends Orchestra
1010
{

0 commit comments

Comments
 (0)