PHPackages                             simplecomplex/utils - 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. [CLI &amp; Console](/categories/cli)
4. /
5. simplecomplex/utils

ActiveLibrary[CLI &amp; Console](/categories/cli)

simplecomplex/utils
===================

Dependency injection container abstraction; PHP CLI made easy; various basic utilities.

2.3.1(5y ago)13645MITPHPPHP &gt;=7.0CI failing

Since Jul 12Pushed 5y ago2 watchersCompare

[ Source](https://github.com/simplecomplex/php-utils)[ Packagist](https://packagist.org/packages/simplecomplex/utils)[ Docs](https://github.com/simplecomplex/php-utils)[ RSS](/packages/simplecomplex-utils/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (40)Used By (5)

(PHP) Utils
-----------

[](#php-utils)

### Main features

[](#main-features)

#### Dependency injection container abstraction

[](#dependency-injection-container-abstraction)

As [Wikipedia](https://en.wikipedia.org/wiki/Dependency_injection#Disadvantages) sums it up:

> Ironically, dependency injection can encourage dependence on a dependency injection framework.

**`Dependency`** is a simple tool for mitigating dependency of a particular injection container.
Wraps a [PSR-11](https://github.com/container-interop/fig-standards/blob/container-configuration/proposed/container.md)or [Pimple](http://pimple.sensiolabs.org) container or creates it's own lightweight PSR-11 container.

#### PHP CLI (command line/console) made easy

[](#php-cli-command-lineconsole-made-easy)

**`CliCommand`** + **`CliCommandInterface`**
specify a simple way of defining PHP CLI commands, and auto-generate --help output.

**`CliEnvironment`**

- resolves CLI input arguments and options
- maps to a `CliCommand` and executes it
- lists --help of all defined commands
- finds document root

##### Utils' own CLI commands

[](#utils-own-cli-commands)

```
# List all commands in the system, and their providers.
php cli.php -h

# One command's help.
php cli.php utils-xxx -h

# (RISKY) Execute included PHP script.
php cli.php utils-execute include-file
```

#### Time

[](#time)

**`Time`** extends the native DateTime class to fix shortcomings and defects,
and provide more, simpler and safer getters and setters.

Features:

- is stringable (sic!), to ISO-8601
- JSON serializes to string ISO-8601 with timezone marker
- freezable
- enhanced timezone awareness
- diff (diffConstant, that is) works correctly across differing timezones
- simpler and safer getters and setters

It's inspired by Javascript's Date class, and secures better Javascript interoperability
by stresssing and facilitating timezone awareness, and by JSON serializing to ISO-8601 timestamp string;
*not* a phoney Javascript object representing a PHP DateTime's inner properties.

#### Explorable

[](#explorable)

The abstract **`Explorable`** class provides simple means for making protected members of an object readable,
and optionally mutable via dedicated methods.

#### Odds and ends

[](#odds-and-ends)

**`Unicode`** abstracts mbstring.

**`Sanitize`** delivers basic string sanitizers and converters.

**`PathList`** hides the complexity of using FilesystemIterators.

**`Utils`** parses ini strings/files, and delivers a range of other handy methods.

**`Bootstrap::prepareDependencies()`** for easy dependency setup.
NB: Bootstrap::prepareDependencies() requires packages not listed among composer requirements:
[Cache](https://github.com/simplecomplex/php-cache), [Config](https://github.com/simplecomplex/php-config), (optional) [JsonLog](https://github.com/simplecomplex/php-jsonlog), [Inspect](https://github.com/simplecomplex/inspect), [Locale](https://github.com/simplecomplex/php-locale), [Validate](https://github.com/simplecomplex/php-validate).

### Requirements

[](#requirements)

- PHP &gt;=7.0
- [PSR-11 Container](https://github.com/php-fig/container)
- [PSR-3 Log](https://github.com/php-fig/log)

#### Development requirements

[](#development-requirements)

- [PHPUnit](https://github.com/sebastianbergmann/phpunit)

#### Suggestions

[](#suggestions)

- PHP mbstring extension
- [SimpleComplex Inspect](https://github.com/simplecomplex/inspect)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity70

Established project with proven stability

 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 ~30 days

Recently: every ~91 days

Total

36

Last Release

2160d ago

Major Versions

1.14 → 2.02019-04-08

### Community

Maintainers

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

---

Top Contributors

[![jacobfriis](https://avatars.githubusercontent.com/u/3807905?v=4)](https://github.com/jacobfriis "jacobfriis (241 commits)")

---

Tags

clidependency-injection-containerphpphp7psrphputilsstrict types

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/simplecomplex-utils/health.svg)

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

###  Alternatives

[league/climate

PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.

1.9k14.0M272](/packages/league-climate)[nunomaduro/phpinsights

Instant PHP quality checks from your console.

5.6k10.8M424](/packages/nunomaduro-phpinsights)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[rubix/server

Deploy your Rubix ML models to production with scalable stand-alone inference servers.

632.3k](/packages/rubix-server)

PHPackages © 2026

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