- What is shieldci/analyzers-core used for?
- It is the core analyzer engine behind ShieldCI's Laravel code-quality tooling. It provides shared contracts, result objects, and orchestration for running analyzers and collecting structured findings. Use it to build custom analyzers or integrate consistent checks into Laravel and PHP projects.
- How do I install shieldci/analyzers-core in a Laravel project?
- Install it with Composer as a dependency, typically alongside ShieldCI's Laravel integration or tooling. Because the core is framework-agnostic, it can also be required in non-Laravel PHP projects. Check the package's Composer constraints for PHP and Laravel compatibility before installing.
- Do I need Laravel to use shieldci/analyzers-core?
- No. The package describes a framework-agnostic core that can be used in any PHP project. Laravel-specific value comes from built-in checks and integrations for scanning Laravel codebases. You can use the contracts and orchestration independently.
- How do I create a custom analyzer with shieldci/analyzers-core?
- Implement the analyzer contract defined by the package and return the standardized result objects it provides. Register or run your analyzer through the orchestration layer so findings are aggregated consistently. This keeps custom checks compatible with the same reporting flow as built-in analyzers.
- What Laravel versions does shieldci/analyzers-core support?
- The provided overview does not list specific Laravel version constraints. The core is framework-agnostic, while Laravel-facing checks depend on the surrounding ShieldCI integration. Check the package's composer.json or Packagist metadata for exact PHP and Laravel support.
- How are analyzer results structured?
- The package defines standardized result objects for consistent reporting. Analyzers return findings through those objects, and the orchestration layer aggregates them. This makes it easier to render reports or fail CI jobs based on structured output.
- Can I use shieldci/analyzers-core in CI/CD?
- Yes, it is designed for running consistent checks across a codebase and collecting actionable findings. You can invoke analyzers in a CI pipeline and use the structured results to report or enforce quality gates. Runtime depends on the analyzers and codebase size.
- Is shieldci/analyzers-core a replacement for PHPStan or Larastan?
- Not exactly. It is an analyzer infrastructure and orchestration layer, not just a single static-analysis tool. It can complement tools like PHPStan or Larastan by providing a consistent API for custom and built-in checks. Evaluate overlap based on the specific analyzers you enable.
- How do I test analyzers built on shieldci/analyzers-core?
- The clean, testable architecture and standardized result objects make unit testing straightforward. Write tests that run an analyzer against sample code and assert on the returned findings. You can use PHPUnit or your preferred PHP testing framework.
- Is shieldci/analyzers-core maintained and safe for production?
- The package is intended for production use in code-quality tooling, but you should verify current maintenance status on Packagist or the repository. Review release history, issue activity, and version constraints before adopting it. Run it in CI first to validate behavior and performance for your codebase.