salient / utils
The utilities component of the Salient toolkit
v0.99.74
2025-01-29 00:18 UTC
Requires
- php: >=7.4
- composer-runtime-api: ^2.2
Suggests
- salient/iterators: Required by File::find() and File::pruneDir()
- dev-main
- v0.99.74
- v0.99.73
- v0.99.72
- v0.99.71
- v0.99.70
- v0.99.69
- v0.99.68
- v0.99.67
- v0.99.66
- 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: 2025-01-30 13:12:48 UTC
README
The utilities component of the Salient toolkit
salient/utils
provides utility methods via the stateless classes below.
If your project uses
File::find()
orFile::pruneDir()
, salient/iterators must also be installed.
Arr
works with arrays and other iterables.Date
works with date and time values, timezones and intervals.Debug
gets data from the call stack.Env
manipulates environment variables, loads values from.env
files, and applies values from the environment to the script.File
works with files, streams and paths, and provides filesystem function wrappers that throw an exception on failure.Format
makes data human-readable.Get
extracts, converts and generates data. For example:Get::coalesce()
is similar to 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 JSON function wrappers that throw an exception 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
providespreg_*()
function wrappers that throw an exception 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.