codesinging / support
Awesome support helpers for PHP web development.
2.0.0
2020-05-06 11:56 UTC
Requires
- php: >=7.1
- ext-json: *
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ^7
README
Awesome support helpers for PHP web development.
Thanking
Installing
$ composer require codesinging/support -vvv
Usage
helpers
load_config($file)
Arr
accessible($value)
add($array, $key, $value)
divide($array)
dot($array, $prepend = '')
except($array, $keys)
exists($array, $key)
first($array, callable $callback = null, $default = null)
last($array, callable $callback = null, $default = null)
flatten($array, $depth = INF)
forget(&$array, $keys)
get($array, $key, $default = null)
has($array, $keys)
isAssoc(array $array)
only($array, $keys)
prepend($array, $value, $key = null)
pull(&$array, $key, $default = null)
query($array)
random($array, $number = null)
set(&$array, $key, $value)
shuffle($array, $seed = null)
where($array, callable $callback)
wrap($value)
Str
after($subject, $search)
afterLast($subject, $search)
before($subject, $search)
beforeLast($subject, $search)
camel($value)
contains($haystack, $needles)
containsAll($haystack, array $needles)
endsWith($haystack, $needles)
finish($value, $cap)
kebab($value)
length($value, $encoding = null)
limit($value, $limit = 100, $end = '...')
lower($value)
random($length = 16)
replaceArray($search, array $replace, $subject)
replaceFirst($search, $replace, $subject)
replaceLast($search, $replace, $subject)
snake($value, $delimiter = '_')
start($value, $prefix)
startsWith($haystack, $needles)
studly($value)
substr($string, $start, $length = null)
title($value)
ucfirst($string)
upper($value)
words($value, $words = 100, $end = '...')
Repository
has(string $key)
get($key, $default = null)
getMany(array $keys)
set($key, $value = null)
prepend(string $key, $value)
push(string $key, $value)
all()
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT