abbassmortazavi/inventory-library

A simple inventory management library.

1.0 2024-06-21 14:09 UTC

This package is auto-updated.

Last update: 2025-04-24 20:01:38 UTC


README

Package Instruction

Installation

# Inventory Library

A simple PHP library for managing an inventory of items.

## Installation

Install via Composer:

composer require abbassmortazavi/inventory-library

Sample Code For Use it In Your Project

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 Unit Tests

run this command in your command line :
vendor/bin/phpunit