- How do I install irstea/phpstan-config in a Laravel project?
- Add it as a dev dependency with composer require --dev irstea/phpstan-config. Because the package is hosted on a private GitLab instance rather than Packagist, you must first add a repositories entry pointing at https://gitlab.irstea.fr/pole-is/tools/phpstan-config.git and provide SSH or token credentials on every developer machine and CI runner. If your environment cannot reach that host, clone the repository and copy the .neon files into your own project instead.
- Is this a Laravel package with a service provider?
- No. It contains no service provider, facade, Artisan command or publishable config; it is a set of PHPStan .neon configuration files distributed through Composer. That means it behaves the same in any PHP project, Laravel or not, and cannot affect runtime behaviour. Removing it is a single composer remove.
- How do I include the shared PHPStan ruleset in my phpstan.neon?
- Reference the package's neon file from the includes section of your project's phpstan.neon, for example includes: vendor/irstea/phpstan-config/phpstan.neon. Parameters, level and ignoreErrors that you declare afterwards take precedence over the included values. Verify the exact file name shipped by the package, since presets sometimes split a base ruleset from framework-specific settings.
- Can I override the rules or exclude paths per project?
- Yes. PHPStan merges included configuration, and values you declare in your own phpstan.neon after the include win. You can set your own level, paths, excludePaths, tmpDir and ignoreErrors without touching the package files. Never edit anything under vendor/, because Composer will overwrite it on the next install.
- Which PHPStan and PHP versions does irstea/phpstan-config require?
- That is not stated in the package overview, so inspect its composer.json for the phpstan/phpstan constraint and PHP version floor before adopting it. A narrow pin can block your own PHPStan upgrade cadence or force a downgrade, while a range constraint is safer for teams tracking new releases. Check that the ruleset survives the PHPStan 1.x to 2.x restructuring if you are on 2.x.
- Can I install irstea/phpstan-config from CI without Packagist?
- Only if your runners can reach gitlab.irstea.fr and authenticate against it. You need a repositories entry plus SSH keys or an access token configured as a Composer auth secret on each runner. If network policy or credential rotation makes that impractical, vendor the neon files into your own repository or maintain a first-party preset package.
- Does this package ship a baseline file, and should I use it?
- The overview does not say whether a baseline is included. If one is shipped, it may have been generated against the maintainers' own codebase and will silently suppress errors you actually care about. Read any baseline file before including it and prefer regenerating your own with phpstan --generate-baseline.
- Should I use this package together with Larastan?
- They solve overlapping problems. Larastan provides Laravel-aware type information and framework rules, while this package is a generic house-style preset, so combining them can create duplicated or conflicting configuration. It is usually better to build on Larastan and fold in only the level choice and ignore patterns you genuinely need.
- How does this package keep local and CI static analysis consistent?
- Because developers and pipelines include the same ruleset, everyone runs identical checks with the same level, ignores and cache settings. That reduces config drift and the familiar it-passes-locally CI failure. Run vendor/bin/phpstan analyse in your pipeline after composer install with dev dependencies so the shared config is present.
- Is irstea/phpstan-config actively maintained, and what are the alternatives?
- There is little public signal, since the repository lives on an internal GitLab and star counts, dependents and release cadence are not visible outside that organisation. Treat it as a reference artifact rather than a critical dependency, because silent rule changes propagate to every consumer at once. Alternatives include writing your own phpstan.neon, using phpstan/extension-installer with selected extensions, or Larastan for Laravel applications.