Skip to content

Commit a657a07

Browse files
authored
Merge pull request #538 from timacdonald/facade
Automatically update Facade docblocks
2 parents d22ed91 + ebc6c68 commit a657a07

File tree

6 files changed

+60
-15
lines changed

6 files changed

+60
-15
lines changed

.github/workflows/facade.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: facades
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
8+
jobs:
9+
update:
10+
runs-on: ubuntu-22.04
11+
12+
strategy:
13+
fail-fast: true
14+
15+
name: Facade DocBlocks
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.1
25+
tools: composer:v2
26+
coverage: none
27+
28+
- name: Install dependencies
29+
uses: nick-fields/retry@v2
30+
with:
31+
timeout_minutes: 5
32+
max_attempts: 5
33+
command: "composer config repositories.facade-documenter vcs [email protected]:laravel/facade-documenter.git && composer require --dev laravel/facade-documenter:dev-main"
34+
35+
- name: Update facade docblocks
36+
run: php -f vendor/bin/facade.php -- Inertia\\Inertia
37+
38+
- name: Commit facade docblocks
39+
uses: stefanzweifel/git-auto-commit-action@v4
40+
with:
41+
commit_message: Update facade docblocks
42+
file_pattern: src/

src/Inertia.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
namespace Inertia;
44

55
use Illuminate\Support\Facades\Facade;
6-
use Illuminate\Contracts\Support\Arrayable;
76

87
/**
98
* @method static void setRootView(string $name)
10-
* @method static void share($key, $value = null)
11-
* @method static array getShared(string $key = null, $default = null)
12-
* @method static array flushShared()
13-
* @method static void version($version)
14-
* @method static int|string getVersion()
15-
* @method static LazyProp lazy(callable $callback)
16-
* @method static Response render($component, array|Arrayable $props = [])
17-
* @method static \Symfony\Component\HttpFoundation\Response location(string $url)
9+
* @method static void share(string|array|\Illuminate\Contracts\Support\Arrayable $key, mixed $value = null)
10+
* @method static mixed getShared(string|null $key = null, mixed $default = null)
11+
* @method static void flushShared()
12+
* @method static void version(\Closure|string|null $version)
13+
* @method static string getVersion()
14+
* @method static \Inertia\LazyProp lazy(callable $callback)
15+
* @method static \Inertia\Response render(string $component, array|\Illuminate\Contracts\Support\Arrayable $props = [])
16+
* @method static \Symfony\Component\HttpFoundation\Response location(string|\Illuminate\Http\RedirectResponse $url)
17+
* @method static void macro(string $name, object|callable $macro)
18+
* @method static void mixin(object $mixin, bool $replace = true)
19+
* @method static bool hasMacro(string $name)
20+
* @method static void flushMacros()
1821
*
1922
* @see \Inertia\ResponseFactory
2023
*/

src/Response.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(string $component, $props, string $rootView = 'app',
3838

3939
/**
4040
* @param string|array $key
41-
* @param mixed|null $value
41+
* @param mixed $value
4242
*
4343
* @return $this
4444
*/
@@ -55,7 +55,7 @@ public function with($key, $value = null): self
5555

5656
/**
5757
* @param string|array $key
58-
* @param mixed|null $value
58+
* @param mixed $value
5959
*
6060
* @return $this
6161
*/

src/ResponseFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setRootView(string $name): void
3131

3232
/**
3333
* @param string|array|Arrayable $key
34-
* @param mixed|null $value
34+
* @param mixed $value
3535
*/
3636
public function share($key, $value = null): void
3737
{
@@ -45,7 +45,7 @@ public function share($key, $value = null): void
4545
}
4646

4747
/**
48-
* @param mixed|null $default
48+
* @param mixed $default
4949
*
5050
* @return mixed
5151
*/

src/Testing/Concerns/Has.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function hasAll($key): self
3636
}
3737

3838
/**
39-
* @param mixed|null $value
39+
* @param mixed $value
4040
*
4141
* @return $this
4242
*/

tests/Stubs/ExampleMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
class ExampleMiddleware extends Middleware
1111
{
1212
/**
13-
* @var mixed|null
13+
* @var mixed
1414
*/
1515
protected $version;
1616

0 commit comments

Comments
 (0)