Skip to content

Commit ac3d6df

Browse files
authored
Add Conditionable traits & phpdoc (#37)
* Add Conditionable traits & phpdoc * Fix styling * codestyle * make WindowManager conditionable * make fakes conditionable too - so tests are predictable * add regression test so these classes stay conditionable in the future @PeteBishwhip * fix prefer-lowest test matrix * test - only run architecture tests when pest has at least version 3 * wip - fix CI * fix CI --------- Co-authored-by: gwleuverink <17123491+gwleuverink@users.noreply.github.com>
1 parent 8f636d7 commit ac3d6df

20 files changed

+77
-0
lines changed

src/Alert.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67

78
class Alert
89
{
10+
use Conditionable;
11+
912
protected ?string $type = null;
1013

1114
protected ?string $title = null;

src/App.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67
use Phar;
78

89
class App
910
{
11+
use Conditionable;
12+
1013
public function __construct(protected Client $client) {}
1114

1215
public function quit(): void

src/AutoUpdater.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67

78
class AutoUpdater
89
{
10+
use Conditionable;
11+
912
public function __construct(protected Client $client) {}
1013

1114
public function checkForUpdates(): void

src/ChildProcess.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67
use Native\Desktop\Contracts\ChildProcess as ChildProcessContract;
78

89
class ChildProcess implements ChildProcessContract
910
{
11+
use Conditionable;
12+
1013
public readonly int $pid;
1114

1215
public readonly string $alias;

src/Clipboard.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67

78
class Clipboard
89
{
10+
use Conditionable;
11+
912
public function __construct(protected Client $client) {}
1013

1114
public function clear()

src/Dock.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
namespace Native\Desktop;
44

5+
use Illuminate\Support\Traits\Conditionable;
56
use Native\Desktop\Client\Client;
67
use Native\Desktop\Menu\Menu;
78

89
class Dock
910
{
11+
use Conditionable;
12+
1013
public function __construct(protected Client $client) {}
1114

1215
public function menu(Menu $menu)

src/Facades/Alert.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
* @method static static cancelId(int $cancelId)
1515
* @method static int show(string $message)
1616
* @method static bool error(string $title, string $message)
17+
* @method static static when($value = null, ?callable $callback = null, ?callable $default = null)
18+
* @method static static unless($value = null, ?callable $callback = null, ?callable $default = null)
1719
*/
1820
class Alert extends Facade
1921
{

src/Facades/App.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
* @method static bool openAtLogin(?bool $open = null)
2323
* @method static bool isEmojiPanelSupported()
2424
* @method static void showEmojiPanel()
25+
* @method static static when($value = null, ?callable $callback = null, ?callable $default = null)
26+
* @method static static unless($value = null, ?callable $callback = null, ?callable $default = null)
2527
*/
2628
class App extends Facade
2729
{

src/Facades/AutoUpdater.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* @method static void checkForUpdates()
99
* @method static void quitAndInstall()
1010
* @method static void downloadUpdate()
11+
* @method static static when($value = null, ?callable $callback = null, ?callable $default = null)
12+
* @method static static unless($value = null, ?callable $callback = null, ?callable $default = null)
1113
*/
1214
class AutoUpdater extends Facade
1315
{

src/Facades/ChildProcess.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* @method static \Native\Desktop\ChildProcess php(string|array $cmd, string $alias, array $env = null, bool $persistent = false, ?array $iniSettings = null)
1717
* @method static \Native\Desktop\ChildProcess artisan(string|array $cmd, string $alias, array $env = null, bool $persistent = false, ?array $iniSettings = null)
1818
* @method static void stop(string $alias = null)
19+
* @method static static when($value = null, ?callable $callback = null, ?callable $default = null)
20+
* @method static static unless($value = null, ?callable $callback = null, ?callable $default = null)
1921
*/
2022
class ChildProcess extends Facade
2123
{

0 commit comments

Comments
 (0)