- What is sharpapi/php-core and what problem does it solve?
- sharpapi/php-core is the framework-agnostic foundation for SharpAPI PHP integrations. It centralizes shared configuration, HTTP request and response handling, typed DTOs, and exception handling so Laravel and plain PHP applications do not duplicate core integration logic. Use it when you want a consistent base for connecting an application to SharpAPI services.
- How do I install sharpapi/php-core with Composer?
- Install it as a Composer dependency with composer require sharpapi/php-core. In plain PHP, require Composer's autoloader and use the core classes directly. In Laravel, follow the package's documented integration steps and check the README for any PHP version or extension requirements before installing.
- Does sharpapi/php-core work with Laravel?
- Yes, sharpapi/php-core is designed for Laravel as well as plain PHP. The core itself stays framework-independent, so Laravel applications can use it as the shared foundation while keeping framework-specific wiring in the app or in a Laravel integration layer. Check the package documentation for the recommended Laravel setup.
- Can I use sharpapi/php-core in plain PHP without Laravel?
- Yes, sharpapi/php-core is deliberately framework-agnostic and supports standalone PHP applications. You can install it with Composer, load the autoloader, and use its configuration, HTTP, and DTO primitives directly in plain PHP. No Laravel application bootstrapping is required for the core itself.
- Which Laravel and PHP versions does sharpapi/php-core support?
- The package is described as designed for Laravel, but the exact Laravel and PHP version ranges should be confirmed in its composer.json and README. Because the core is framework-agnostic, compatibility is often driven by PHP version and the consuming Laravel integration. Review the release notes before upgrading Laravel or PHP.
- How do I configure sharpapi/php-core for a SharpAPI integration?
- Configuration is centralized in the core through reusable configuration primitives. In Laravel you will typically define or publish package configuration and supply environment-specific values; in plain PHP you load or pass the same configuration through the core's config objects. The README should list the exact keys and required values for your SharpAPI integration.
- What typed request, response, and DTO structures does sharpapi/php-core provide?
- sharpapi/php-core includes typed request and response plus DTO support as part of its shared foundation. These structures help keep data consistent between Laravel and standalone PHP integrations and reduce ad hoc array handling. Refer to the package source or README for the specific DTO classes and fields available in your installed version.
- How does sharpapi/php-core handle exceptions and errors?
- It provides consistent exception and error handling as part of the core integration layer. HTTP and configuration failures can be surfaced through shared exception types instead of being handled differently in every application. Consult the package documentation for the exact exception hierarchy and recommended catch patterns.
- How do I test an application that uses sharpapi/php-core?
- Unit test your configuration mapping and DTO transformations directly because they are plain PHP structures. For HTTP behavior, mock or fake the transport layer in integration tests so you do not call live SharpAPI services. Add a small number of contract tests against a sandbox or test endpoint if one is available.
- Is sharpapi/php-core production-ready and how is it maintained?
- sharpapi/php-core is positioned as a lightweight shared foundation for production SharpAPI integrations in Laravel and plain PHP. Before deploying, pin a stable Composer version, review the changelog and compatibility constraints, and test the integration in your own environment. For current maintenance status, check the package's release history and repository activity.