salient / utils
The utils package of the Salient toolkit
Requires
- php: >=7.4
- composer-runtime-api: ^2.2
Suggests
- salient/iterators: Required by File::find() and File::pruneDir()
- dev-main
- v0.99.65
- v0.99.64
- v0.99.63
- v0.99.62
- v0.99.61
- v0.99.60
- v0.99.59
- v0.99.58
- v0.99.57
- v0.99.56
- v0.99.55
- v0.99.54
- v0.99.53
- v0.99.52
- v0.99.51
- v0.99.50
- v0.99.49
- v0.99.48
- v0.99.47
- v0.99.46
- v0.99.45
- v0.99.44
- v0.99.43
- v0.99.42
- v0.99.41
- v0.99.40
- v0.99.39
- v0.99.38
- v0.99.37
- v0.99.36
- v0.99.35
- v0.99.34
- v0.99.33
- v0.99.32
This package is auto-updated.
Last update: 2024-12-20 03:45:39 UTC
README
The utils component of the Salient toolkit
salient/utils
provides a suite of useful utility methods via stateless
classes.
-
Arr
works with arrays and iterables. -
Date
works with date and time values, timezones and intervals. -
Debug
gets caller information by normalising backtrace data. -
Env
retrieves environment variables, loads values from.env
files, and applies values from the environment to the script. -
File
provides methods for filesystem operations that throw exceptions on failure. -
Format
makes data human-readable. -
Get
extracts, converts and generates data. For example:Get::coalesce()
replicates the SQLCOALESCE()
functionGet::code()
improves uponvar_export()
Get::copy()
gets a deep copy of an objectGet::eol()
gets a string's end-of-line sequenceGet::uuid()
generates or converts a UUID
-
Inflect
converts English words to different forms, e.g. from singular to plural. -
Json
provides methods for encoding and decoding JSON data that throw exceptions on failure. -
Package
retrieves information from Composer's runtime API, e.g. the name of the root package. -
Reflect
works with PHP's reflection API. -
Regex
provides methods for working with regular expressions that throw exceptions on failure. -
Str
manipulates strings. For example:Str::expandLeadingTabs()
expands leading tabs to spacesStr::matchCase()
matches the case of one string to anotherStr::ngrams()
gets a string's n-gramsStr::snake()
converts a string to snake_caseStr::splitDelimited()
safely splits strings that contain delimiters
-
Sys
retrieves information about the runtime environment, and provides a handler for exit signals (SIGTERM
,SIGINT
andSIGHUP
). -
Test
performs tests on values.
Documentation
API documentation for salient/utils
tracks the main
branch of
the toolkit's GitHub repository, where further documentation can also
be found.