sherifsheremetaj/cars 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sherifsheremetaj/cars

最新稳定版本:v1.6

Composer 安装命令:

composer require sherifsheremetaj/cars

包简介

Cars information package

README 文档

README

GitHub Repo Size GitHub License GitHub Stars GitHub Issues

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:

  1. Fork the repository.
  2. Create a new feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -m "Added feature X").
  4. Push to the branch (git push origin feature-name).
  5. 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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-18