adrum/inertia-phpstan 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adrum/inertia-phpstan

最新稳定版本:v1.0.0

Composer 安装命令:

composer require adrum/inertia-phpstan

包简介

PHPStan extension to validate Inertia.js page existence on disk

README 文档

README

A PHPStan extension that validates Inertia.js page existence on disk when used in Laravel controllers.

Features

  • Validates Inertia::render() static calls
  • Validates inertia() helper function calls
  • Validates $this->inertia() method calls in controllers
  • Supports multiple page directory configurations
  • Supports various file extensions (.vue, .jsx, .tsx, .js, .ts)
  • Handles both dot notation (Auth.Login) and slash notation (Auth/Login) for page names

Installation

composer require --dev adrum/inertia-phpstan

Configuration

Add the extension to your phpstan.neon:

includes:
    - vendor/adrum/inertia-phpstan/extension.neon

Usage

The extension will automatically validate that Inertia pages exist on disk when analyzing your controllers:

class UserController extends Controller
{
    public function dashboard()
    {
        // ✓ Will pass if resources/js/Pages/Dashboard.vue exists
        return Inertia::render('Dashboard');
    }

    public function profile()
    {
        // ✗ Will fail if resources/js/Pages/Profile/Edit.vue doesn't exist
        return Inertia::render('Profile/Edit');
    }
}

Page Directory Configuration

The extension looks for pages in these directories by default:

  • resources/js/Pages
  • resources/js/pages
  • resources/ts/Pages
  • resources/ts/pages
  • resources/vue/Pages
  • resources/vue/pages
  • resources/react/Pages
  • resources/react/pages

Supported File Extensions

  • .vue
  • .jsx
  • .tsx
  • .js
  • .ts

Example

See the examples/ directory for a sample controller and PHPStan configuration.

统计信息

  • 总下载量: 330
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固