laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Error preg_replace(): Argument #3 ($subject) must be of type array|string, false given

Open agustinzamar opened this issue 6 months ago • 0 comments

Versions:

  • ide-helper Version: 3.1.0
  • Laravel Version: 11.20.0
  • PHP Version: 8.3.3

Description:

The command ide-helper:generate throws the error: preg_replace(): Argument #3 ($subject) must be of type array|string, false given

image

Steps To Reproduce:

  1. Run composer require --dev barryvdh/laravel-ide-helper
  2. Run php artisan ide-helper:generate
  3. Same issue when running composer update with the scripts.post-update-cmd configured as the docs recommend

Here is my complete composer.json

{
  "name": "laravel/laravel",
  "type": "project",
  "description": "The skeleton application for the Laravel framework.",
  "keywords": ["laravel", "framework"],
  "license": "MIT",
  "require": {
    "php": "^8.3",
    "inertiajs/inertia-laravel": "v1.3.0",
    "laravel/framework": "v11.20.0",
    "laravel/sanctum": "v4.0.2",
    "laravel/socialite": "v5.15.1",
    "laravel/tinker": "v2.9.0",
    "mercadopago/dx-php": "3.0.7",
    "santigarcor/laratrust": "8.3.1",
    "tightenco/ziggy": "v2.3.0"
  },
  "require-dev": {
    "barryvdh/laravel-ide-helper": "v3.1.0",
    "fakerphp/faker": "v1.23.1",
    "laravel-lang/common": "^6.4.0",
    "laravel/breeze": "v2.1.3",
    "laravel/pint": "v1.17.2",
    "mockery/mockery": "1.6.12",
    "nunomaduro/collision": "v8.4.0",
    "pestphp/pest": "v2.35.0",
    "pestphp/pest-plugin-laravel": "v2.4.0"
  },
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "Database\\Factories\\": "database/factories/",
      "Database\\Seeders\\": "database/seeders/"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "Tests\\": "tests/"
    }
  },
  "scripts": {
    "post-autoload-dump": [
      "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
      "@php artisan package:discover --ansi"
    ],
    "post-update-cmd": [
      "Illuminate\\Foundation\\ComposerScripts::postUpdate",
      "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
      "@php artisan lang:update",
      "@php artisan ide-helper:generate",
      "@php artisan ide-helper:meta"
    ],
    "post-root-package-install": ["@php -r \"file_exists('.env') || copy('.env.example', '.env');\""],
    "post-create-project-cmd": [
      "@php artisan key:generate --ansi",
      "@php -r \"file_exists('database/database.sqlite') || touch('database/database.sqlite');\"",
      "@php artisan migrate --graceful --ansi"
    ]
  },
  "extra": {
    "laravel": {
      "dont-discover": []
    }
  },
  "config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true,
    "allow-plugins": {
      "pestphp/pest-plugin": true,
      "php-http/discovery": true
    }
  },
  "minimum-stability": "stable",
  "prefer-stable": true
}

agustinzamar avatar Aug 09 '24 20:08 agustinzamar