krubio/perfect-autowire
Composer 安装命令:
composer require krubio/perfect-autowire
包简介
Perfect-Autowire is a PHP-based project that focuses on autowiring and routing.
README 文档
README
Description
Perfect-Autowire is a PHP-based project that focuses on autowiring and routing. It is designed to offer a highly decoupled architecture, employing SOLID Principles and best practices for scalable and maintainable code. It uses native PHP features and incorporates a custom-built router and dependency injection container.
Installation
- Clone this repository.
- Navigate to the project folder and run
composer installto install dependencies. - Configure your web server to point to the
publicdirectory. - Start your web server and navigate to the project URL.
Features
- Autowiring: Automatic resolution of dependencies for controllers and services.
- Routing: A simple yet powerful custom router, supporting multiple HTTP methods and dynamic parameters.
- SOLID Compliant: The architecture is built on SOLID principles for maintainability and scalability.
Usage
After setting up the project, routes can be defined by annotating controller methods. The router will automatically register routes from controllers in the specified directory.
Example Route Definition
#[Route('/person/([1-9][0-9]*)', ['GET', 'POST'])] public function show(string $id): void { // Implementation }
Route Handling
Routes are dispatched by the Router class, which can be extended to add custom behavior or middleware.
Testing
Run `phpunit` to execute the test suite, which aims for 100% coverage.
Check code quality metrics and adhere to coding standards.
Dependencies
PHP 8.0 or higher
PHPUnit for testing
Contributions
Pull requests are welcome, following the project's coding standards and passing all existing tests.
License
This project is licensed under the MIT License.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-09-25