PHPackages                             tourze/stock-manage-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/stock-manage-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/stock-manage-bundle
==========================

专注于库存数量管理（Stock Management）

1.0.4(6mo ago)03413MITPHPCI failing

Since Nov 4Pushed 4mo agoCompare

[ Source](https://github.com/tourze/stock-manage-bundle)[ Packagist](https://packagist.org/packages/tourze/stock-manage-bundle)[ RSS](/packages/tourze-stock-manage-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (45)Versions (6)Used By (3)

Stock Manage Bundle
===================

[](#stock-manage-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/341ca03ddd71ee8342a38969ea532693003c85f028f76c96b50a92c39d62e9b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f73746f636b2d6d616e6167652d62756e646c652e737667)](https://packagist.org/packages/tourze/stock-manage-bundle)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/962aced9b09d89716dbebf186ff899754a096ff1068b6b7988675c2d9fab9331/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c75652e737667)](https://php.net)

`tourze/stock-manage-bundle` 只保留“核心库存 + 聚合入口”：

- 核心库存：批次、库存日志、虚拟库存、分配策略、基础查询
- 聚合入口：检测到对应模块已安装时自动启用各 `stock-*` 扩展 Bundle（可插拔）

核心内容
----

[](#核心内容)

- 核心实体：`Tourze\StockManageBundle\Entity\StockBatch` / `StockLog` / `VirtualStock`
- 核心服务：`Tourze\StockManageBundle\Service\StockServiceInterface`、`BatchQueryServiceInterface`
- 分配策略：FIFO/LIFO/FEFO（见 `Tourze\StockManageBundle\Service\AllocationStrategy\*`）

扩展模块（按需安装）
----------

[](#扩展模块按需安装)

- 入库：`tourze/stock-inbound-bundle`
- 出库：`tourze/stock-outbound-bundle`
- 预占：`tourze/stock-reservation-bundle`
- 调拨：`tourze/stock-transfer-bundle`
- 组合商品库存（`BundleItem` / `BundleStock`）：`tourze/stock-bundle-bundle`
- 库存调整：`tourze/stock-adjustment-bundle`
- 库存锁定：`tourze/stock-lock-bundle`
- 预警：`tourze/stock-alert-bundle`
- 快照：`tourze/stock-snapshot-bundle`
- 成本：`tourze/stock-cost-bundle`

安装
--

[](#安装)

```
composer require tourze/stock-manage-bundle
```

在 `config/bundles.php` 中注册：

```
return [
    // ...
    Tourze\StockManageBundle\StockManageBundle::class => ['all' => true],
];
```

如果项目启用了 `tourze/bundle-dependency`，在安装上述扩展 Bundle 后会被自动启用（见 `Tourze\StockManageBundle\StockManageBundle::getBundleDependencies()`）。

使用建议
----

[](#使用建议)

- 业务侧优先注入接口：`InboundServiceInterface` / `OutboundServiceInterface` / `ReservationServiceInterface`
- 实现与服务别名由各自扩展 Bundle 提供；未安装模块时不要注入对应接口

快速开始（核心库存）
----------

[](#快速开始核心库存)

```
use Tourze\ProductServiceContracts\SKU;
use Tourze\StockManageBundle\Service\StockServiceInterface;

$stockService = $container->get(StockServiceInterface::class);

$sku = new SKU('PROD001');
$batch = $stockService->createBatch([
    'sku' => $sku,
    'batch_no' => 'BATCH20240101001',
    'quantity' => 100,
]);
```

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance72

Regular maintenance activity

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

5

Last Release

180d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-stock-manage-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-stock-manage-bundle/health.svg)](https://phpackages.com/packages/tourze-stock-manage-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
