qlimix / http-cors-middleware
PSR15 CORS middleware implementation
2.0.0
2020-11-21 16:07 UTC
Requires
- php: >7.4
- neomerx/cors-psr7: ^2.0
- psr/http-factory: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- qlimix/code-standard: ^3.0
This package is auto-updated.
Last update: 2024-11-22 00:57:49 UTC
README
PSR15 cors middleware implementation
Install
Using Composer:
$ composer require qlimix/http-cors-middleware
usage
<?php use Neomerx\Cors\Analyzer; use Neomerx\Cors\Strategies\Settings; use Neomerx\Cors\Factory\Factory; use Qlimix\HttpMiddleware\CorsMiddleware; $analyzer = new Analyzer(new Settings(), new Factory()); $responseFactory = new ResponseFactoryImplementation(); $corsMiddleware = new CorsMiddleware($analyzer, $responseFactory); // add to middleware request handler
Testing
To run all unit tests locally with PHPUnit:
$ vendor/bin/phpunit
Quality
To ensure code quality run grumphp which will run all tools:
$ vendor/bin/grumphp run
Contributing
Please see CONTRIBUTING for details.