salient / utils
The utilities component of the Salient toolkit
Installs: 41 204
Dependents: 16
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/salient/utils
Requires
- php: >=7.4
- composer-runtime-api: ^2.2
Suggests
- salient/iterators: Required by File::find() and File::pruneDir()
- dev-main
- v0.99.80
- v0.99.79
- v0.99.78
- v0.99.77
- v0.99.76
- v0.99.75
- 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-10-05 09:06:12 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.
Arrworks with arrays and other iterables.Dateworks with date and time values, timezones and intervals.Debuggets data from the call stack.Envmanipulates environment variables, loads values from.envfiles, and applies values from the environment to the script.Fileworks with files, streams and paths, and provides filesystem function wrappers that throw an exception on failure.Formatmakes data human-readable.Getextracts, 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
Inflectconverts English words to different forms, e.g. from singular to plural.Jsonprovides JSON function wrappers that throw an exception on failure.Packageretrieves information from Composer's runtime API, e.g. the name of the root package.Reflectworks with PHP's reflection API.Regexprovidespreg_*()function wrappers that throw an exception on failure.Strmanipulates 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
Sysretrieves information about the runtime environment, and provides a handler for exit signals (SIGTERM,SIGINTandSIGHUP).Testperforms 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.