Download the PHP package xenokore/utility without Composer
On this page you can find all versions of the php package xenokore/utility. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xenokore/utility
More information about xenokore/utility
Files in xenokore/utility
Package utility
Short Description General utility helpers
License MIT
Homepage https://xenokore.com
Informations about the package utility
Xeno Utility Library
A library filled with utility functions.
ArrayHelper
Set an array item to a given value using "dot" notation.
If the given key is null, the entire array will be replaced.
Returns the new array.
Get an item from an array using "dot" notation.
If the $throw
argument is set to true an ArrayKeyNotFoundException
is
thrown instead of returning the default value.
Determine whether a given value is array accessible.
Checks if the value is an instance of \ArrayAccess
.
Determine if a given key exists in the provided array.
Creates a multidimensional array based on an array of dotnotation keys.
Useful for configuration arrays.
Example:
Turns into
Convert multidimensional array to 2D array with dotnotation keys.
https://stackoverflow.com/a/10424516/5865844
Useful for configuration arrays.
Example:
Turns into
Move an array item to the start of the array.
Move an array item to the end of the array.
Merge 2 arrays recursively and replaces distinct non-array values.
Get a checksum of the given array.
Gets a value from an array based on the current day.
Each day the value shifts to the next one.
Maximum array size is around 20 million. (Ymd
as an int).
ClassHelper
Get the name of a constant based on value.
Can be given a prefix to narrow the search.
Get the info of a class by filepath.
Returns an array with the class name and the full namespace.
Does not use reflection and does not initiate the class.
Get the class name from a file containing a class.
The namespace is not included.
Get the namespace from a file containing a class.
Get the full class name from a file containing a class. The returned string contains the namespace and class name.
Get the raw code from a method of a class.
Call a private method of a class.
Useful for unit testing internal workings.