sherifsheremetaj/cars
最新稳定版本:v1.6
Composer 安装命令:
composer require sherifsheremetaj/cars
包简介
Cars information package
README 文档
README
A simple PHP package for managing car manufacturers' data in multiple formats (JSON, CSV, XML). Supports data retrieval, conversion, and validation with robust error handling.
📦 Installation
Install the package via Composer:
composer require sherifsheremetaj/cars
🚀 Usage
1️⃣ Retrieve Manufacturers
use SherifSheremetaj\Cars\Enums\DataTypes; use SherifSheremetaj\Cars\Manufactures; #JSON data $manufactures = new Manufactures(); $data = $manufactures->getManufactures(DataTypes::JSON); echo $data . PHP_EOL; #CSV data $manufactures = new Manufactures(); $data = $manufactures->getManufactures(DataTypes::CSV); echo $data . PHP_EOL; #XML data $manufactures = new Manufactures(); $data = $manufactures->getManufactures(DataTypes::XML); echo $data . PHP_EOL;
1️⃣ Retrieve CarTypes
use SherifSheremetaj\Cars\CarTypes; use SherifSheremetaj\Cars\Enums\DataTypes; #JSON data $carTypes = new CarTypes(); $data = $carTypes->getTypes(DataTypes::JSON); echo $data; #CSV data $carTypes = new CarTypes(); $data = $carTypes->getTypes(DataTypes::CSV); echo $data; #XML data $carTypes = new CarTypes(); $data = $carTypes->getTypes(DataTypes::XML); echo $data;
🛠 Configuration
By default, data is loaded from:
__DIR__ . '/data/....';
✅ Running Tests
To run the PHPUnit test suite, use:
composer install vendor/bin/phpunit
To run lint (Laravel pint), use
composer pint
🔍 Data Source
Logo images are crawled from Carlogos.org and processed for optimal usage.
📝 Contributing
Pull requests are welcome! To contribute:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m "Added feature X"). - Push to the branch (
git push origin feature-name). - Open a pull request.
📜 License
This package is licensed under the MIT License.
⭐ Support & Feedback
If you find this package helpful, please ⭐ star the repository! For suggestions or issues, open an issue.
Made with ❤️ by Sherif Sheremetaj
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-18