PHPackages                             preneomit/scheduler - 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. preneomit/scheduler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

preneomit/scheduler
===================

Production-ready PHP scheduling package for resource-constrained project scheduling (RCPSP). Handles employees, machines, calendars, and complex dependency graphs.

v0.1(6mo ago)111MITPHPPHP ^8.2

Since Nov 18Pushed 5mo agoCompare

[ Source](https://github.com/preneomit/scheduler)[ Packagist](https://packagist.org/packages/preneomit/scheduler)[ Docs](https://github.com/preneomit/scheduler)[ RSS](/packages/preneomit-scheduler/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Scheduler
=========

[](#scheduler)

A production-ready PHP scheduling package for resource-constrained project scheduling (RCPSP). Designed for facilities with human resources and machines, particularly suited for manufacturing environments like dental labs.

[![Tests](https://camo.githubusercontent.com/d4dba66e58b9a19e8a95b81b6fce620d7739ca43326d87be85f56740223ef6bf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f74657374732d393525323070617373696e672d627269676874677265656e)](https://github.com/preneomit/scheduler)[![PHP Version](https://camo.githubusercontent.com/4f0ff8d47b7c73441eb92a1f49af61c2d6521b14113c8fd85fac4416c863e7cc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e322d626c7565)](https://www.php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Features
--------

[](#features)

- 🎯 **Resource-Constrained Scheduling** - Handles employees, machines, and calendar constraints
- 📊 **Precedence Management** - Supports complex dependency graphs (DAG)
- ⏱️ **Smart Duration Estimation** - 5-level fallback chain with calibration support
- 📅 **Flexible Calendars** - Weekly patterns with date-specific overrides
- 👥 **Experience Matching** - Matches employee skills to case difficulty
- 🔄 **Deterministic Algorithm** - Same inputs always produce identical outputs
- ⚡ **High Performance** - O(n log n) greedy heuristic algorithm
- ✅ **100% Test Coverage** - 95 comprehensive tests, all passing

Installation
------------

[](#installation)

```
composer require scheduler/scheduler
```

**Requirements:**

- PHP 8.2 or higher
- ext-json

Quick Start
-----------

[](#quick-start)

```
use Scheduler\GreedyScheduler;

$scheduler = new GreedyScheduler();

$input = [
    'timezone' => 'UTC',
    'startAt' => '2025-01-06T09:00:00Z',
    'cases' => [
        [
            'caseId' => 'case-1',
            'dueBy' => '2025-01-06T17:00:00Z',
            'restorations' => [
                [
                    'restorationId' => 'rest-1',
                    'productionLineId' => 'line-1',
                    'steps' => [
                        [
                            'stepId' => 'a1111111-1111-4111-8111-111111111111',
                            'restorationId' => 'rest-1',
                            'requiresRoleId' => 'b2222222-2222-4222-8222-222222222222',
                            'estimatedDuration' => 'PT2H',
                            'predecessors' => [],
                        ],
                    ],
                ],
            ],
        ],
    ],
    'employees' => [
        [
            'employeeId' => 'emp-1',
            'roles' => [['roleId' => 'b2222222-2222-4222-8222-222222222222']],
            'weeklyCalendar' => [
                ['day' => 'Mo', 'segments' => [['start' => '09:00', 'end' => '17:00']]],
            ],
        ],
    ],
    'machines' => [],
    'productionLineRoleEstimations' => [],
];

$result = $scheduler->schedule($input);

// Access assignments
foreach ($result['assignments'] as $assignment) {
    echo "Step {$assignment['stepId']} assigned to {$assignment['employeeId']}\n";
    echo "Start: {$assignment['startAt']->format('c')}\n";
    echo "End: {$assignment['endAt']->format('c')}\n";
}

// Check for delays
if (!empty($result['delayReport']['delayedCases'])) {
    foreach ($result['delayReport']['delayedCases'] as $delayed) {
        echo "Case {$delayed['caseId']} is late by {$delayed['lateness']}\n";
    }
}
```

Documentation
-------------

[](#documentation)

- [Quick Start Guide](docs/quickstart.md) - Get up and running in 5 minutes
- [API Reference](docs/api.md) - Complete API documentation
- [Architecture](docs/architecture.md) - System design and algorithms
- [Usage Examples](docs/usage.md) - Real-world scenarios
- [Advanced Features](docs/advanced.md) - Advanced customization and optimization
- [Error Codes](docs/error-codes.md) - Complete error reference
- [Test Strategy](docs/test-strategy.md) - Testing approach

Use Cases
---------

[](#use-cases)

- **Manufacturing Scheduling** - Dental labs, machine shops, assembly lines
- **Project Planning** - Multi-step workflows with resource constraints
- **Service Scheduling** - Technician dispatch, maintenance planning
- **Production Planning** - Job shop scheduling, batch processing

Key Concepts
------------

[](#key-concepts)

### Cases &amp; Restorations

[](#cases--restorations)

- **Case**: Top-level container with client-facing deadline
- **Restoration**: Belongs to a case, linked to production line version
- **Step**: Schedulable unit that completes a restoration

### Resources

[](#resources)

- **Employees**: Have roles and experience levels, work according to calendars
- **Machines**: Have capabilities, can be required for specific steps
- **Calendars**: Weekly patterns with date-specific overrides

### Scheduling

[](#scheduling)

- **Precedence Constraints**: Steps can depend on other steps
- **Experience Matching**: Employee experience must meet case difficulty
- **Duration Estimation**: 5-level fallback chain with calibration
- **Delay Analysis**: Automatic lateness detection and reporting

Testing
-------

[](#testing)

```
# Run all tests
./vendor/bin/phpunit

# Run specific test suite
./vendor/bin/phpunit tests/Unit/GreedySchedulerTest.php

# Run with coverage (requires xdebug)
./vendor/bin/phpunit --coverage-html coverage/
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](LICENSE).

Credits
-------

[](#credits)

Developed using strict Test-Driven Development (TDD) methodology with 100% test coverage.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance69

Regular maintenance activity

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

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

Unknown

Total

1

Last Release

181d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/680f920236abf16924081766a05930214f70d348b3f93c4463e4789f9d3ee36d?d=identicon)[preneom\_admin](/maintainers/preneom_admin)

---

Tags

schedulerworkflowcalendarschedulingDAGprecedencemanufacturingrcpspresource-constrainedproject-schedulingdental-lab

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/preneomit-scheduler/health.svg)

```
[![Health](https://phpackages.com/badges/preneomit-scheduler/health.svg)](https://phpackages.com/packages/preneomit-scheduler)
```

###  Alternatives

[symfony/workflow

Provides tools for managing a workflow or finite state machine

62942.3M170](/packages/symfony-workflow)[symfony/scheduler

Provides scheduling through Symfony Messenger

8910.8M52](/packages/symfony-scheduler)[edofre/yii2-fullcalendar-scheduler

Yii2 widget for fullcalendar scheduler module

2437.0k](/packages/edofre-yii2-fullcalendar-scheduler)[calendart/office365-adapter

Office365 Adapter for CalendArt

1213.8k](/packages/calendart-office365-adapter)[edofre/laravel-fullcalendar-scheduler

Laravel component for fullcalendar scheduler module

251.5k](/packages/edofre-laravel-fullcalendar-scheduler)[raoul2000/yii-simple-workflow

A simple workflow engine for Yii 1

278.2k](/packages/raoul2000-yii-simple-workflow)

PHPackages © 2026

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