Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update Facade docblocks #538

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/facade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: facades

on:
push:
branches:
- 'master'

jobs:
update:
runs-on: ubuntu-22.04

strategy:
fail-fast: true

name: Facade DocBlocks

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none

- name: Install dependencies
uses: nick-fields/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: "composer config repositories.facade-documenter vcs git@github.com:laravel/facade-documenter.git && composer require --dev laravel/facade-documenter:dev-main"

- name: Update facade docblocks
run: php -f vendor/bin/facade.php -- Inertia\\Inertia

- name: Commit facade docblocks
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update facade docblocks
file_pattern: src/
21 changes: 12 additions & 9 deletions src/Inertia.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
namespace Inertia;

use Illuminate\Support\Facades\Facade;
use Illuminate\Contracts\Support\Arrayable;

/**
* @method static void setRootView(string $name)
* @method static void share($key, $value = null)
* @method static array getShared(string $key = null, $default = null)
* @method static array flushShared()
* @method static void version($version)
* @method static int|string getVersion()
* @method static LazyProp lazy(callable $callback)
* @method static Response render($component, array|Arrayable $props = [])
* @method static \Symfony\Component\HttpFoundation\Response location(string $url)
* @method static void share(string|array|\Illuminate\Contracts\Support\Arrayable $key, mixed $value = null)
* @method static mixed getShared(string|null $key = null, mixed $default = null)
* @method static void flushShared()
* @method static void version(\Closure|string|null $version)
* @method static string getVersion()
* @method static \Inertia\LazyProp lazy(callable $callback)
* @method static \Inertia\Response render(string $component, array|\Illuminate\Contracts\Support\Arrayable $props = [])
* @method static \Symfony\Component\HttpFoundation\Response location(string|\Illuminate\Http\RedirectResponse $url)
* @method static void macro(string $name, object|callable $macro)
* @method static void mixin(object $mixin, bool $replace = true)
* @method static bool hasMacro(string $name)
* @method static void flushMacros()
*
* @see \Inertia\ResponseFactory
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(string $component, $props, string $rootView = 'app',

/**
* @param string|array $key
* @param mixed|null $value
* @param mixed $value
*
* @return $this
*/
Expand All @@ -55,7 +55,7 @@ public function with($key, $value = null): self

/**
* @param string|array $key
* @param mixed|null $value
* @param mixed $value
*
* @return $this
*/
Expand Down
4 changes: 2 additions & 2 deletions src/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function setRootView(string $name): void

/**
* @param string|array|Arrayable $key
* @param mixed|null $value
* @param mixed $value
*/
public function share($key, $value = null): void
{
Expand All @@ -45,7 +45,7 @@ public function share($key, $value = null): void
}

/**
* @param mixed|null $default
* @param mixed $default
*
* @return mixed
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Testing/Concerns/Has.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function hasAll($key): self
}

/**
* @param mixed|null $value
* @param mixed $value
*
* @return $this
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Stubs/ExampleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class ExampleMiddleware extends Middleware
{
/**
* @var mixed|null
* @var mixed
*/
protected $version;

Expand Down
Loading