abbassmortazavi / inventory-library
一个简单的库存管理库。
1.0
2024-06-21 14:09 UTC
Requires
- php: >=8.3
Requires (Dev)
- phpunit/phpunit: ^11.2
README
包说明
安装
# Inventory Library A simple PHP library for managing an inventory of items. ## Installation Install via Composer: composer require abbassmortazavi/inventory-library
项目中使用示例代码
use InventoryLibrary\Inventory; require 'vendor/autoload.php'; $inventory = new Inventory(); // Add items $inventory->addItem('orange', 20); $inventory->addItem('peach', 5); // Remove items $inventory->removeItem('orange', 5); // Get stock echo $inventory->getStock('orange'); // Output: 15 echo $inventory->getStock('peach'); // Output: 5
运行单元测试
run this command in your command line : vendor/bin/phpunit