empaphy/usephul

Provides useful classes and functions that extend the standard functionality of PHP.

v0.5.2 2025-05-14 11:01 UTC

This package is auto-updated.

Last update: 2025-05-14 11:02:23 UTC


README

Test Suite

Usephul is a PHP library that provides useful classes and functions that extend the standard functionality of PHP.

Functions

Array Functions

  • array_interchange() — Interchange the values of two elements of an array.
  • array_remap() — Applies a (generator) callback to the elements of a given array, allowing the remapping of its keys in the process.
  • array_zip() — Perform a zip operation on multiple arrays.

Filesystem Functions

  • filename() — Returns the name component of path without the extension.
  • extension() — Returns the extension component of path without the extension.

Generator Functions

Math Functions

  • greatest() — Finds the value that is greater than all the other values.
  • least() — Finds the value that is less than all the other values.
  • rank() — Returns the ordinal rank for a given value.

Variable handling Functions

Attribute Functions

  • applies() — Finds whether an attribute has been applied to a given object, class, interface, or trait.

Trait Functions

  • uses() — Checks whether an object or class uses a given trait.

SPL Functions

Classes

Filesystem

  • PathInfo — Provides information about a file path.

Traits

Enumerations

  • EnumDynamicity — Adds dynamicity of case names to PHP Enumerations.