Search by

vosiz / php-utils

vosiz

A PHP utilities library

Package info

github.com/vosiz/php-utils

pkg:composer/vosiz/php-utils

Statistics

Installs: 162

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v1.12.0 2026-10-10 00:14 UTC

README

PHP utilities and commons - C# like classes (if you are to it), more OOP and useful functions.

Motivation

I write PHP the same way I write C#, so I keep the things I miss in one place instead of copying them from project to project. It is the base of my other packages (php-enum, va-tools) and of everything I build on them. Made by personal need, so feel free to use it if it fits yours. MIT - use it however you like.

Requirements

  • PHP 7.4 or newer
  • Composer

Bug tracker

No tracked

Features

Everything checked in the Roadmap.

Roadmap

  • Collection, Dictionary, KeyValuePair
  • Exceptionf - formatted exceptions with inner chain
  • SmartObject, Singleton
  • Is - type and emptiness checks
  • Conversions and string helpers (tostr, camel, snake, ...)
  • Crypto - PasswordHasher
  • TimeFormat
  • Io - Path, File, Dir, Inc
  • Tests

Setup

composer require vosiz/php-utils

Namespaced classes go through an alias, the rest (functions, Exceptionf, Is, ...) is global.

use Vosiz\Utils\Collections\Collection;
use Vosiz\Utils\Io;

$user = new Collection(['name' => 'Joe']);
echo $user->Name;

$path = Io\Path::Combine('/var/www', 'app', 'index.php');

Tests

Docker is all you need, the suite runs on every supported PHP version.

./tests.sh