PHPackages                             bluefission/develation - 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. [Framework](/categories/framework)
4. /
5. bluefission/develation

ActiveLibrary[Framework](/categories/framework)

bluefission/develation
======================

DevElation primitives, behaviors, data, service, and framework utilities for Blue Fission PHP projects

v1.3.39(1mo ago)048[1 issues](https://github.com/BlueFissionTech/develation/issues)4MITPHPPHP &gt;=8.2CI passing

Since Dec 29Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/BlueFissionTech/develation)[ Packagist](https://packagist.org/packages/bluefission/develation)[ Docs](https://github.com/BlueFissionTech/develation)[ RSS](/packages/bluefission-develation/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (10)Dependencies (28)Versions (167)Used By (4)

 [![DevElation logo](docs/assets/develation-circle-logo.png)](docs/assets/develation-circle-logo.png)

DevElation: A PHP Library for Graceful Development
==================================================

[](#develation-a-php-library-for-graceful-development)

[![Packagist Version](https://camo.githubusercontent.com/99ab984eb7f56e4b3f7ceb710117fcf02a075479b6a7269973aa6355408bc3a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c756566697373696f6e2f646576656c6174696f6e2e737667)](https://packagist.org/packages/bluefission/develation)[![Packagist Downloads](https://camo.githubusercontent.com/45512c59deee58edee70cb3fc286a85a6b5f7e026128f06cdecd3a7ed7e81515/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c756566697373696f6e2f646576656c6174696f6e2e737667)](https://packagist.org/packages/bluefission/develation)[![License](https://camo.githubusercontent.com/beb8543c0be8429cf8137151197438648ce76d62aa62327d4656a3b732636df9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626c756566697373696f6e2f646576656c6174696f6e2e737667)](https://packagist.org/packages/bluefission/develation)

Welcome to the central documentation of **DevElation**, a comprehensive PHP library designed to simplify the development of large and complex projects. This library addresses the intricacies of modern PHP development with a suite of tools that cater to a wide range of functionalities, from basic data type handling to advanced system management and beyond. It is a property of Blue Fission Technology and is currently available under the MIT license.

Philosophy
----------

[](#philosophy)

DevElation is built with the philosophy of reducing code complexity and promoting interconnectedness. It embraces the notion that robust application development can be made more approachable through a suite of well-organized, intuitive modules. The library is not just a bag of utility functions; it is a set of hookable value objects, data objects, behaviors, services, and helpers that are meant to participate in an application lifecycle.

Central to DevElation's design is the principle of rapid prototyping without throwing away architecture. Primitives such as `Val`, `Str`, `Arr`, `Num`, `Flag`, `Date`, `Func`, `Ref`, and `Obj` should be treated as first-class citizens when values are captured, mutated, validated, observed, or passed through more than a trivial boundary. Static helpers remain appropriate for one-off hookable operations, while fluent objects are preferred when a value has a lifecycle.

The library's dependency injection-friendly architecture means that scaling and enhancing functionality is often a matter of changing the injected class or storage backend. File, session, memory, SQL, Mongo, queue, schema, graph, service, connection, CLI, HTTP, HTML, and parsing classes are intentionally shaped around repeatable signatures so consumers can grow from simple scripts to structured systems without rewriting every call site.

The pervasive event-driven approach throughout DevElation, where even simple data types can participate in events, hooks, filters, constraints, snapshots, and dynamic slots, reflects the library's commitment to intricate yet manageable systems. Complexity should live with the object that owns the data or behavior, not in scattered procedural glue.

This granular empowerment leads to a development style where maintainability and readability are not at odds with power. DevElation code should prefer package-owned classes and interfaces when they already exist, keep features general and reusable, avoid consumer-specific coupling, and expose stable APIs that can be inherited, decorated, filtered, or composed.

In practice:

- Use DevElation objects for values and structures that will be worked with repeatedly.
- Use static helpers for single hookable operations.
- Use global helper functions as constructor/factory shortcuts only.
- Let returned objects own their fluent behavior.
- Prefer DevElation data, connection, service, CLI, HTML, parsing, security, and system utilities over ad-hoc raw PHP when the package already owns the capability.
- Keep public features package-owned and broadly useful; consuming projects should consume or extend DevElation, not define its internal concerns.

Features Overview
-----------------

[](#features-overview)

### Event Handling (`Behavior`)

[](#event-handling-behavior)

DevElation implements a behavior-driven event handling system, which includes `Event`, `State`, and `Action`. These behaviors allow for reactive and decoupled components, making your application more modular and maintainable.

- [Event Handling Documentation](behavior.md)
- [Behavior Lifecycle Patterns](parser-runtime-behaviors.md)
- [Hooks, Filters, And Events Reference](hooks_events.md)

### Data Types

[](#data-types)

A collection of wrapper classes around PHP's primitive data types that offer enhanced functionality and utility methods.

- [Data Types Documentation](datatypes.md)
- [Ref Primitive Documentation](ref.md)
- [DevElation Capability Surface](capability_surface.md)
- [Usage Readiness Checklist](usage_readiness_checklist.md)

Static helpers: most `Val`/`Obj`-based classes expose their underscored instance helpers as static shorthand. For example, `Str` has an internal `_pluralize()` instance method which can be invoked statically via `Str::pluralize('comment')` thanks to `Val::__callStatic`. This pattern is used throughout the library and examples.

Global helper functions: Composer autoloads `src/functions.php`, which provides short factory entrypoints for the highest-use object lifecycles. These helpers instantiate or factory-wrap objects; they do not replace object methods. Chain from the returned object for behavior.

```
use BlueFission\DataTypes;

$title = str(' release notes ')->trim()->capitalize()->val();
$items = arr(['first', 'second'])->reverse()->join(', ')->val();
$record = obj(['count' => 3], ['count' => DataTypes::NUMBER]);
$document = doc()->contents('Draft text');
$handle = ref(fopen('php://temp', 'r+'))->owned(true);
$handle->write('data');
```

Available helpers:

- `val(mixed $value = null): Val`
- `str(mixed $value = null): Str`
- `arr(mixed $value = null): Arr`
- `num(mixed $value = null): Num`
- `flag(mixed $value = null): Flag`
- `func(mixed $value = null): Func`
- `ref(mixed $value = null): Ref`
- `obj(array|object|null $data = null, array $types = []): Obj`
- `collect(mixed $value = null): Collection`
- `datetime(mixed $value = null): Date`
- `filesystem(mixed $config = null): FileSystem`
- `doc(): Data\File`
- `directory(?IData $storage = null): Data\Directory`

The names intentionally avoid PHP built-ins such as `file()` and `date()`. Use `doc()` for a DevElation file object and `datetime()` for a DevElation date object.

Helper API notes:

- Prefer an object lifecycle when a value is changed or inspected more than a couple of times. Prefer static helpers for one-off hookable operations.
- Use `Val::make($value)`, `Val::copy()`, `Val::as($target)`, `snapshot()`, `recall()`, `reset()`, and `if(...)->then(...)->otherwise(...)` when generic values need lifecycle, branching, or change tracking. Without an open `if()` chain, `and()`, `or()`, `xor()`, `nor()`, and `not()` apply native bitwise operations to the root value. After `if()` starts a conditional chain, those helpers mutate the temporary logical condition only; `then()` / `otherwise()` consume it, and `endif()` discards it explicitly.
- Use `Arr::has($array, $value)` for value checks. Use `Arr::hasKey($array, $key)` for key checks, and `Arr::hasValue($array, $value, true)` or `Arr::contains($array, $value, true)` when strict value matching matters.
- Use `Arr::merge($base, $next)` when associative keys should be replaced recursively and numeric list values should be appended when unique. Use `Arr::append($base, $next)` for append-only numeric list behavior.
- Use `Arr::filter($array, $callback)`, `Arr::map($array, $callback)`, `Arr::diff($left, $right)`, `Arr::intersect($left, $right)`, `Arr::slice($array, $offset, $length)`, `Arr::splice($array, $replacement, $offset, $length)`, `Arr::join($array, $separator)`, and `Arr::reverse($array, $preserveKeys)` for common array transforms that should stay on the DevElation helper surface.
- `Arr::map()` / `Arr::filter()` and `Collection::map()` / `Collection::filter()` share traversal semantics: callbacks may accept `value` or `value, key`, and retained or mapped values preserve their original keys.
- Use `Arr::values($array)` to reindex list values while preserving order. Use `BlueFission\Net\HTTP::pathSegment($segment)` to encode a single URL path segment; `HTTP::urlScheme()`, `HTTP::urlHost()`, `HTTP::urlPort()`, `HTTP::urlPath()`, or `HTTP::urlParts()` for normalized URL component parsing; `HTTP::jsonDecode()` for deterministic JSON fallback handling; and `HTTP::headerLine()`, `HTTP::statusText()`, or `HTTP::statusLine()` for side-effect-free HTTP metadata helpers.
- Use `Arr::mergeRecursive($base, $next)` when associative keys should be replaced recursively and numeric lists should append in order while preserving duplicates.
- Use `Str::repeat($value, $times)` or the explicit `Str::strRepeat($value, $times)` alias as the canonical static helper for `str_repeat`-style behavior. Repeat counts must be non-negative; existing instance usage such as `Str::make(' ')->repeat(4)->val()` remains supported.
- Use `Str::startsWith($value, $needle)`, `Str::endsWith($value, $needle)`, `Str::match($left, $right, Str::IGNORE_CASE)`, `Str::snake($value)`, `Str::pluralize($value)`, and `Str::size($value)` for string boundary, equality, casing, inflection, and length checks. Values are string-cast before comparison and whitespace remains significant.
- Use `Date::formatTimestamp($timestamp, 'Y-m-d')` as a concise replacement for `date($format, $timestamp)`.
- Use `Num::plus()`, `Num::minus()`, `Num::times()`, and `Num::by()` as readable aliases for fluent math. Math helpers unwrap `Val` objects when appropriate.
- Use `Num::isInt()`, `Num::isFloat()` / `Num::isDouble()`, and `Flag::isBool()` / `Flag::isBoolean()` when native scalar type checks must not coerce strings or numeric values.
- Use `Num::deg2rad($degrees)`, `Num::rad2deg($radians)`, `Num::sin($radians)`, `Num::cos($radians)`, and `Num::atan2($y, $x)` for hookable angle and trigonometry helpers. Angles passed to trigonometry helpers are radians.
- Use `Ref::is($value)` as the reference/resource predicate, `Ref::resource($handle, ['owned' => false])` for already-open caller-owned handles, `Ref::open($target, ['mode' => 'r'])` when the primitive should call `fopen()` and own the stream, `Ref::bind($value)` for PHP reference binding, and `ref($value)` / `Ref::make($value)` for generic wrapping. `Ref` supports cursor helpers such as `tell()`, `seek()`, `rewind()`, `eof()`, `truncate()`, and generator-based `chunks()` for streaming reads. Keep native handles where direct PHP interop is clearer.
- `BlueFission\Data\FileSystem::fileExists($path)` checks concrete file paths without initializing storage state. `BlueFission\Data\File::exists()` / `isReachable()` and `BlueFission\Data\Directory::exists()` / `isReachable()` can check explicit paths or hierarchy labels without creating missing paths.
- Use `BlueFission\Data\FileSystem::lines($eol)` for read-only file line values and `FileSystem::entries()` for sorted directory entry values. Missing targets return empty arrays and are not created.
- Use `BlueFission\Connections\Stdio::input()` or `Stdio::readInput()` to read request/body streams without interactive `stream_select()` polling. Empty or unreadable input returns an empty string.

### DateTime Handling

[](#datetime-handling)

Sophisticated date and time manipulation with object-oriented principles, extending PHP's native `DateTime` class.

- [DateTime Documentation](date.md)

### Complex Object Prototyping

[](#complex-object-prototyping)

An advanced object class, `Obj`, extends the capabilities of `Val` for managing complex data structures.

- [Object Prototyping Documentation](object.md)

### Collections

[](#collections)

Manage groups of items with powerful collection classes, providing utilities for array-like operations on objects.

- [Collections Documentation](collections.md)

### Connections

[](#connections)

Facilitate connectivity to various data sources and services, such as MySQL, cURL, and streams.

- [Connections Documentation](connections.md)

### Data Management

[](#data-management)

Handle queues, storage solutions, databases, Redis, MemQ, files, and logs with a unified approach to data manipulation and persistence.

- [Data Management Documentation](data_management.md)
- [SQLite Storage Contract](sqlite.md)
- [Schema Documentation](schema.md)
- [Graph Documentation](graph.md)
- [Prototypes Documentation](prototypes.md)

### HTML Building Tools

[](#html-building-tools)

Construct HTML elements for forms, tables, and templating with ease, improving the speed of frontend development.

- [HTML Tools Documentation](html_tools.md)

### Parsing &amp; Templating

[](#parsing--templating)

Parsing, tag execution, includes, template sections, and scoped loop helpers for declarative templating workflows.

- [Parsing &amp; Templating Documentation](parsing.md)

### Network Services

[](#network-services)

Tools for handling email, HTTP requests, and IP operations, essential for developing web services and networked applications.

- [Network Services Documentation](network_services.md)

### Application Framework

[](#application-framework)

Beginnings of an application framework, offering service and routing management to pave the way for complex application architectures.

- [Application Framework Documentation](app_framework.md)

### System Tools

[](#system-tools)

A suite of tools for interacting with the operating system, including CLI utilities, process control, machine details, statistics, and asynchronous operations.

- [System Tools Documentation](system_tools.md)

### Utilities

[](#utilities)

A set of utility functions and tools for administrative alerts, logging, IP blocking, and safeguards against runaway scripts.

- [Utilities Documentation](utilities.md)

### Security Tools

[](#security-tools)

Hashing helpers for checksums, content IDs, and signatures.

- [Security Documentation](security.md)

### Testing

[](#testing)

Guidance for running PHPUnit tests and enabling optional integration coverage.

- [Testing Documentation](tests.md)
- [Coding Standards](coding_standards.md)

### Examples

[](#examples)

Sample applications that demonstrate DevElation’s flexibility:

- Browse the hosted examples gallery: [GitHub Pages examples](https://bluefissiontech.github.io/develation/examples/)
- Run the examples online: [Open in GitHub Codespaces](https://codespaces.new/BlueFissionTech/develation)
- Session-backed todo list using `Arr`, `Date`, `Session` storage, HTML helpers, and templates: `examples/todo/index.php`
- Simple comment thread with voting using `Arr`, `Str`, `Session` storage, HTML helpers, and templates: `examples/comments/index.php`
- CLI territory game using the behavioral engine (`Behaves`) and an `Arr`-backed log: `examples/game/gangs.php`
- CLI status report using args, tables, and progress bars: `examples/cli/report.php`
- Helper workflow using global factory helpers plus primitive, file, HTTP, date, flag, and security objects: `examples/helpers/workflow.php`
- HTTP/API packet builder using request normalization, headers, JSON, and status helpers: `examples/http/api_packet.php`
- Additional walkthroughs live in `examples/README.md`

Codespaces runs `composer install` automatically through `.devcontainer/devcontainer.json`. Once it opens, try:

```
php examples/helpers/workflow.php
php examples/http/api_packet.php
php examples/cli/report.php --limit 3 --delay 0 --title "Codespaces Demo"
php examples/game/gangs.php script
```

Quick Start Examples
--------------------

[](#quick-start-examples)

### Fluent values and global helper entrypoints

[](#fluent-values-and-global-helper-entrypoints)

```
use BlueFission\DataTypes;

$names = arr(['Ada Lovelace', 'Grace Hopper'])
    ->map(fn (string $name): string => str($name)->trim()->val())
    ->reverse()
    ->join(', ')
    ->val();

$record = obj(['count' => 3], ['count' => DataTypes::NUMBER]);
$record->exposeValueObject();
$total = $record->field('count')->plus(num(2))->val();

$document = doc()->contents('Processed: ' . $names);
$timestamp = datetime('2026-07-04')->timestamp();
```

Global helpers are entrypoints into DevElation objects. They should create the object; the object should own the behavior.

### CLI utilities: args, tables, and progress

[](#cli-utilities-args-tables-and-progress)

```
use BlueFission\Cli\Args;
use BlueFission\Cli\Args\OptionDefinition;
use BlueFission\Cli\Console;

$args = (new Args())
    ->addOption(new OptionDefinition('limit', [
        'short' => 'l',
        'type' => 'int',
        'default' => 5,
        'description' => 'Number of rows to show.',
    ]))
    ->parse($argv);

$options = $args->options();
$limit = $options['limit'] ?? 5;

$console = new Console();
$console->writeln($console->color('Report', 'cyan', ['bold']));
$console->writeln($console->table(['Item', 'Count'], [
    ['alpha', $limit],
]));

for ($i = 1; $i rewriteLine($console->progress($limit, $i));
}
$console->writeln('');

$spinner = $console->spinner('Working');
for ($i = 0; $i < 12; $i++) {
    $console->rewriteLine($spinner->tick());
    usleep(120000);
}
$spinner->stop();
$console->writeln('');

$result = $console->working('Fetching', function () {
    usleep(250000);
    return 'ok';
});
$console->writeln('Result: ' . $result);
```

### Storage pipeline: session-backed data

[](#storage-pipeline-session-backed-data)

```
use BlueFission\Data\Storage\Session;

$store = new Session(['name' => 'todos']);
$store->activate()->read();

$todos = (array)($store->contents() ?? []);
$todos[] = ['task' => 'Ship docs', 'due' => '2026-01-10'];

$store->assign($todos);
$store->write();
```

### Template loops: scoped current items and nested partials

[](#template-loops-scoped-current-items-and-nested-partials)

```
use BlueFission\Parsing\Parser;
use BlueFission\Parsing\Registry\TagRegistry;
use BlueFission\Parsing\Registry\RendererRegistry;
use BlueFission\Parsing\Registry\ExecutorRegistry;
use BlueFission\Parsing\Registry\PreparerRegistry;

TagRegistry::registerDefaults();
RendererRegistry::registerDefaults();
ExecutorRegistry::registerDefaults();
PreparerRegistry::registerDefaults();

$parser = new Parser('{#each items=chapters glue="|"}{$current.title}:@include(\'sections.tpl\'){/each}');
$parser->setVariables([
    'chapters' => [
        [
            'title' => 'Chapter 1',
            'sections' => [
                ['title' => 'Section 1'],
                ['title' => 'Section 2'],
            ],
        ],
    ],
]);
$parser->setIncludePaths(['modules' => __DIR__ . '/templates']);

echo $parser->render();
```

Inside `#each`, the current item is available as a scoped `current` value, so `{$current.title}`, `items=current.sections`, `{@current}`, and the shorthand `{.title}` all resolve against the active loop item. Nested `#each` blocks in the same file are supported, and partial/include-based nesting remains the cleaner path when you want reusable template boundaries. Quoted attribute strings can also interpolate scoped values with `[[...]]`, for example `thread="book:[[book.slug|slug]]:chapter:[[chapter|pad:2]]"`.

Usage
-----

[](#usage)

Install DevElation with Composer:

```
composer require bluefission/develation
```

The canonical package source is [bluefission/develation on Packagist](https://packagist.org/packages/bluefission/develation). Packagist resolves the package to the canonical GitHub source repository and is the recommended install path for applications and libraries.

Composer autoload registers DevElation classes and the global helper function file. After requiring `vendor/autoload.php`, helpers such as `arr()`, `str()`, `obj()`, `collect()`, `datetime()`, `filesystem()`, `doc()`, and `directory()`are available.

The core package does not require the optional Ratchet websocket transport. If you use `BlueFission\Async\Sock`, install Ratchet in applications that can satisfy its dependency constraints:

```
composer require cboden/ratchet
```

The canonical source repository is [`BlueFissionTech/develation`](https://github.com/BlueFissionTech/develation) on GitHub.

```
git clone https://github.com/BlueFissionTech/develation.git
```

Contributions
-------------

[](#contributions)

DevElation welcomes contributions from the open-source community. Whether you're a seasoned developer or just starting, your input is valued. If you have ideas on how to expand the library's capabilities, especially in areas of automation, smart technologies, and AI, please consider contributing.

###  Health Score

51

—

FairBetter than 95% of packages

Maintenance91

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 98.3% 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 ~17 days

Recently: every ~3 days

Total

55

Last Release

42d ago

Major Versions

v0.4.0-alpha → v1.0.0-alpha2024-08-15

PHP version history (2 changes)v1.0.0-alphaPHP \*

v1.3.31-alphaPHP &gt;=8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7737659?v=4)[Devon Scott](/maintainers/bluefission)[@bluefission](https://github.com/bluefission)

---

Top Contributors

[![bluefission](https://avatars.githubusercontent.com/u/7737659?v=4)](https://github.com/bluefission "bluefission (519 commits)")[![aricwilliams](https://avatars.githubusercontent.com/u/28631952?v=4)](https://github.com/aricwilliams "aricwilliams (9 commits)")

---

Tags

phpframeworkdatabehaviorsservicesprimitivesmateriadevelationbluefission

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bluefission-develation/health.svg)

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

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

36826.2k2](/packages/telnyx-telnyx-php)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

86337.5k](/packages/flow-php-flow)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k29.9M347](/packages/openai-php-client)[cakephp/cakephp

The CakePHP framework

8.9k20.0M1.9k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k21](/packages/tempest-framework)[sylius/sylius

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

8.5k6.0M777](/packages/sylius-sylius)

PHPackages © 2026

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