Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 1.1 KB

File metadata and controls

27 lines (22 loc) · 1.1 KB

php-pipe-utils

Project

Pipe-friendly curried utility functions for PHP 8.5's |> operator. Zero dependencies.

Structure

  • src/Str.php — String utilities in PipeUtils\Str namespace
  • src/Arr.php — Array utilities in PipeUtils\Arr namespace
  • src/Type.php — Type coercers in PipeUtils\Type namespace
  • src/Re.php — Regex utilities in PipeUtils\Re namespace
  • src/Fn.php — Composition helpers in PipeUtils\Fn namespace
  • tests/ — Pest test files

Conventions

  • Data-last: Every function takes the subject as its last argument
  • Auto-currying: Called without the data argument → returns a Closure
  • Strict types: declare(strict_types=1) in every file
  • Namespaced functions: No classes, only functions in namespaces
  • Commit format: type: description (feat, fix, test, docs, refactor, chore)

Commands

  • ./vendor/bin/pest — Run tests
  • ./vendor/bin/phpstan analyse — Static analysis (level 9)

Notes

  • Re\find() / Re\findAll() instead of match/matchAll (reserved keyword)
  • PHP 8.4+ required (8.5+ for actual pipe operator usage)