- What is hoa/json used for in PHP applications?
- hoa/json is a standalone, framework-agnostic PHP library for parsing, encoding, validating, and manipulating JSON documents through an object-oriented API. It is not a Laravel package and does not provide a service provider, facade, or config file. Most Laravel apps only need native json_encode and json_decode unless they specifically require hoa/json's AST-style behavior.
- Does hoa/json integrate with Laravel?
- No, hoa/json has no Laravel-native integration. It is a low-level utility library that would need to be called directly or wrapped in your own adapter. Laravel's native JSON functions and supported validators cover most common JSON needs.
- How do I install hoa/json with Composer in a Laravel project?
- You can require it with Composer, but installation may pull legacy Hoa transitive dependencies and conflict with modern PHP or Laravel constraints. Do not use --ignore-platform-reqs as a production strategy. For a greenfield Laravel app, avoid adding hoa/json unless a documented legacy constraint requires it.
- Is hoa/json compatible with PHP 8 and Laravel 9, 10, or 11?
- hoa/json is archived and was last released in 2017, so it predates modern PHP 8.x compatibility practices. Expect friction with Laravel 9, 10, and 11 and with PHP 8.1 through 8.3. Validate with composer why-not and a PHP version matrix in CI before relying on it.
- How do I configure hoa/json in Laravel?
- There is no Laravel configuration for hoa/json because it is not a Laravel package. Any setup is done in plain PHP by instantiating the library's classes directly. Keep that code behind an application-owned adapter so Hoa types do not leak into controllers, jobs, or domain services.
- Can hoa/json be used for JSON Schema validation in Laravel?
- hoa/json is not the right choice for a Laravel JSON Schema validation strategy. For schema validation, prefer maintained packages such as opis/json-schema or justinrainbow/json-schema. If you only need to decode and inspect JSON, Laravel's native JSON handling is usually sufficient.
- How should I test a hoa/json integration in Laravel?
- Start with characterization tests that capture the current behavior of every hoa/json call site. Wrap the dependency in an adapter and test the adapter contract rather than letting Hoa types spread through your code. Add CI coverage across your supported PHP and Laravel versions, plus checks for autoloading and any Hoa stream-wrapper or global-state side effects.
- Is hoa/json safe for production Laravel applications?
- hoa/json carries high technical risk for production: it is archived, unmaintained, and has no security patch process. It also has very low community validation, with 13 stars and zero dependents noted in its assessment. For new Laravel work, reject adoption; for legacy use, isolate and plan replacement.
- What are the best alternatives to hoa/json for Laravel?
- Use native json_encode and json_decode for ordinary JSON handling, and Symfony Serializer when you need structured serialization. For schema validation, evaluate opis/json-schema or justinrainbow/json-schema; for streaming large JSON, evaluate halaxa/json-machine; for JSONPath, choose a maintained JSONPath package.
- How do I migrate away from hoa/json in a Laravel codebase?
- Inventory every call site, write characterization tests around current behavior, and wrap hoa/json behind an application-owned adapter. Replace the adapter implementation in non-critical paths first, validate in production, and then remove the Composer dependency. If short-term retention is unavoidable, fork or vendor the package, pin the exact version, and add CI coverage.