2017 © Pedro Peláez
 

library array

Autoloading, error and exception handler

image

eden/array

Autoloading, error and exception handler

  • Sunday, July 24, 2016
  • by cblanquera
  • Repository
  • 4 Watchers
  • 3 Stars
  • 41,107 Installations
  • PHP
  • 17 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 14 % Grown

The README.md

logo Eden Array

Build Status

====, (*1)

, (*2)

Install

composer install eden/array, (*3)

====, (*4)

Enable Eden

The following documentation uses eden() in its example reference. Enabling this function requires an extra step as descirbed in this section which is not required if you access this package using the following., (*5)

Eden_Array_Index::i();

When using composer, there is not an easy way to access functions from packages. As a workaround, adding this constant in your code will allow eden() to be available after., (*6)

Eden::DECORATOR;

For example:, (*7)

Eden::DECORATOR;

eden()->inspect('Hello World');

====, (*8)

, (*9)

Introduction

Chainable array methods. When using multiple PHP array functions in one line, it makes code harder to read. This is because a programmer needs to be trained to read code from inner to outer, rather than traditionally left to right (unless you live in Japan). Eden's data typing are objects that correct this readability problem., (*10)

array_keys(array_reverse(array_flip(array(4, 5, 6)))); // [6, 5, 4]

The above demonstrates that we must read this as array_flip(), then array_reverse(), followed by array_keys() which is inner function first going outwards. The example below shows how using types makes this line easier to read., (*11)

echo eden('array')->set(4, 5, 6)->flip()->reverse()->keys(); //--> [6, 5, 4]

When echoed the array object will automatically convert to a readable json. Eden covers most of the array functions provided by PHP. Below is a list of string methods you can linearly perform., (*12)

echo eden('array')
    ->set(4, 5, 6)
    ->flip()
    ->reverse()
    ->keys(); //--> [6, 5, 4]

Expressed vertically as above shows something more pleasing to a developer. Array objects, for the most part, can also be treated as regular arrays as implied below., (*13)

//instantiate
$array = eden('array')->set(1, 2, 3);

//push in a new value
$array[] = 4;

echo $array[1];  //--> 2

foreach($array as $key => $value) {} //loop through array

====, (*14)

, (*15)

API

====, (*16)

, (*17)

addslashes

Same as PHP: addslashes, (*18)

Usage

eden('string')->addslashes();

Example

eden('string')->set('Hello')->addslashes();

====, (*19)

, (*20)

bin2hex

Same as PHP: bin2hex, (*21)

Usage

eden('string')->bin2hex();

Example

eden('string')->set('Hello')->bin2hex();

====, (*22)

, (*23)

chunkSplit

Same as PHP: chunk_split, (*24)

Usage

eden('string')->chunkSplit();

Example

eden('string')->set('Hello')->chunkSplit();

====, (*25)

, (*26)

convertUudecode

Same as PHP: convert_uudecode, (*27)

Usage

eden('string')->convertUudecode();

Example

eden('string')->set('Hello')->convertUudecode();

====, (*28)

, (*29)

convertUuencode

Same as PHP: convert_uuencode, (*30)

Usage

eden('string')->convertUuencode();

Example

eden('string')->set('Hello')->convertUuencode();

====, (*31)

, (*32)

countChars

Same as PHP: count_chars, (*33)

Usage

eden('string')->countChars();

Example

eden('string')->set('Hello')->countChars();

====, (*34)

, (*35)

crypt

Same as PHP: crypt, (*36)

Usage

eden('string')->crypt();

Example

eden('string')->set('Hello')->crypt();

====, (*37)

, (*38)

explode

Same as PHP: explode, (*39)

Usage

eden('string')->explode();

Example

eden('string')->set('Hello')->explode();

====, (*40)

, (*41)

hex2bin

Same as PHP: hex2bin, (*42)

Usage

eden('string')->hex2bin();

Example

eden('string')->set('Hello')->hex2bin();

====, (*43)

, (*44)

htmlEntityDecode

Same as PHP: html_entity_decode, (*45)

Usage

eden('string')->htmlEntityDecode();

Example

eden('string')->set('Hello')->htmlEntityDecode();

====, (*46)

, (*47)

htmlentities

Same as PHP: htmlentities, (*48)

Usage

eden('string')->htmlentities();

Example

eden('string')->set('Hello')->htmlentities();

====, (*49)

, (*50)

htmlspecialchars

Same as PHP: htmlspecialchars, (*51)

Usage

eden('string')->htmlspecialchars();

Example

eden('string')->set('Hello')->htmlspecialchars();

====, (*52)

, (*53)

htmlspecialcharsDecode

Same as PHP: htmlspecialchars_decode, (*54)

Usage

eden('string')->htmlspecialcharsDecode();

Example

eden('string')->set('Hello')->htmlspecialcharsDecode();

====, (*55)

, (*56)

ipTags

Same as PHP: strip_tags, (*57)

Usage

eden('string')->ipTags();

Example

eden('string')->set('Hello')->ipTags();

====, (*58)

, (*59)

ipcslashes

Same as PHP: stripcslashes, (*60)

Usage

eden('string')->ipcslashes();

Example

eden('string')->set('Hello')->ipcslashes();

====, (*61)

, (*62)

ipslashes

Same as PHP: stripslashes, (*63)

Usage

eden('string')->ipslashes();

Example

eden('string')->set('Hello')->ipslashes();

====, (*64)

, (*65)

ireplace

Same as PHP: str_ireplace, (*66)

Usage

eden('string')->ireplace();

Example

eden('string')->set('Hello')->ireplace();

====, (*67)

, (*68)

istr

Same as PHP: stristr, (*69)

Usage

eden('string')->istr();

Example

eden('string')->set('Hello')->istr();

====, (*70)

, (*71)

lcfirst

Same as PHP: lcfirst, (*72)

Usage

eden('string')->lcfirst();

Example

eden('string')->set('Hello')->lcfirst();

====, (*73)

, (*74)

len

Same as PHP: strlen, (*75)

Usage

eden('string')->len();

Example

eden('string')->set('Hello')->len();

====, (*76)

, (*77)

ltrim

Same as PHP: ltrim, (*78)

Usage

eden('string')->ltrim();

Example

eden('string')->set('Hello')->ltrim();

====, (*79)

, (*80)

md5

Same as PHP: md5, (*81)

Usage

eden('string')->md5();

Example

eden('string')->set('Hello')->md5();

====, (*82)

, (*83)

nl2br

Same as PHP: nl2br, (*84)

Usage

eden('string')->nl2br();

Example

eden('string')->set('Hello')->nl2br();

====, (*85)

, (*86)

pad

Same as PHP: str_pad, (*87)

Usage

eden('string')->pad();

Example

eden('string')->set('Hello')->pad();

====, (*88)

, (*89)

pbrk

Same as PHP: strpbrk, (*90)

Usage

eden('string')->pbrk();

Example

eden('string')->set('Hello')->pbrk();

====, (*91)

, (*92)

pos

Same as PHP: strpos, (*93)

Usage

eden('string')->pos();

Example

eden('string')->set('Hello')->pos();

====, (*94)

, (*95)

pregReplace

Same as PHP: preg_replace, (*96)

Usage

eden('string')->pregReplace();

Example

eden('string')->set('Hello')->pregReplace();

====, (*97)

, (*98)

quotedPrintableDecode

Same as PHP: quoted_printable_decode, (*99)

Usage

eden('string')->quotedPrintableDecode();

Example

eden('string')->set('Hello')->quotedPrintableDecode();

====, (*100)

, (*101)

quotedPrintableEncode

Same as PHP: quoted_printable_encode, (*102)

Usage

eden('string')->quotedPrintableEncode();

Example

eden('string')->set('Hello')->quotedPrintableEncode();

====, (*103)

, (*104)

quotemeta

Same as PHP: quotemeta, (*105)

Usage

eden('string')->quotemeta();

Example

eden('string')->set('Hello')->quotemeta();

====, (*106)

, (*107)

repeat

Same as PHP: str_repeat, (*108)

Usage

eden('string')->repeat();

Example

eden('string')->set('Hello')->repeat();

====, (*109)

, (*110)

replace

Same as PHP: str_replace, (*111)

Usage

eden('string')->replace();

Example

eden('string')->set('Hello')->replace();

====, (*112)

, (*113)

rev

Same as PHP: strrev, (*114)

Usage

eden('string')->rev();

Example

eden('string')->set('Hello')->rev();

====, (*115)

, (*116)

rot13

Same as PHP: str_rot13, (*117)

Usage

eden('string')->rot13();

Example

eden('string')->set('Hello')->rot13();

====, (*118)

, (*119)

rtrim

Same as PHP: rtrim, (*120)

Usage

eden('string')->rtrim();

Example

eden('string')->set('Hello')->rtrim();

====, (*121)

, (*122)

sha1

Same as PHP: sha1, (*123)

Usage

eden('string')->sha1();

Example

eden('string')->set('Hello')->sha1();

====, (*124)

, (*125)

shuffle

Same as PHP: str_shuffle, (*126)

Usage

eden('string')->shuffle();

Example

eden('string')->set('Hello')->shuffle();

====, (*127)

, (*128)

sprintf

Same as PHP: sprintf, (*129)

Usage

eden('string')->sprintf();

Example

eden('string')->set('Hello')->sprintf();

====, (*130)

, (*131)

str

Same as PHP: strstr, (*132)

Usage

eden('string')->str();

Example

eden('string')->set('Hello')->str();

====, (*133)

, (*134)

substr

Same as PHP: substr, (*135)

Usage

eden('string')->substr();

Example

eden('string')->set('Hello')->substr();

====, (*136)

, (*137)

substrCompare

Same as PHP: substr_compare, (*138)

Usage

eden('string')->substrCompare();

Example

eden('string')->set('Hello')->substrCompare();

====, (*139)

, (*140)

substrCount

Same as PHP: substr_count, (*141)

Usage

eden('string')->substrCount();

Example

eden('string')->set('Hello')->substrCount();

====, (*142)

, (*143)

substrReplace

Same as PHP: substr_replace, (*144)

Usage

eden('string')->substrReplace();

Example

eden('string')->set('Hello')->substrReplace();

====, (*145)

, (*146)

tok

Same as PHP: strtok, (*147)

Usage

eden('string')->tok();

Example

eden('string')->set('Hello')->tok();

====, (*148)

, (*149)

tolower

Same as PHP: strtolower, (*150)

Usage

eden('string')->tolower();

Example

eden('string')->set('Hello')->tolower();

====, (*151)

, (*152)

toupper

Same as PHP: strtoupper, (*153)

Usage

eden('string')->toupper();

Example

eden('string')->set('Hello')->toupper();

====, (*154)

, (*155)

tr

Same as PHP: strtr, (*156)

Usage

eden('string')->tr();

Example

eden('string')->set('Hello')->tr();

====, (*157)

, (*158)

trim

Same as PHP: trim, (*159)

Usage

eden('string')->trim();

Example

eden('string')->set('Hello')->trim();

====, (*160)

, (*161)

ucfirst

Same as PHP: ucfirst, (*162)

Usage

eden('string')->ucfirst();

Example

eden('string')->set('Hello')->ucfirst();

====, (*163)

, (*164)

ucwords

Same as PHP: ucwords, (*165)

Usage

eden('string')->ucwords();

Example

eden('string')->set('Hello')->ucwords();

====, (*166)

, (*167)

vsprintf

Same as PHP: vsprintf, (*168)

Usage

eden('string')->vsprintf();

Example

eden('string')->set('Hello')->vsprintf();

====, (*169)

, (*170)

wordwrap

Same as PHP: wordwrap, (*171)

Usage

eden('string')->wordwrap();

Example

eden('string')->set('Hello')->wordwrap();

====, (*172)

, (*173)

Contributing to Eden

Contributions to Eden are following the Github work flow. Please read up before contributing., (*174)

Setting up your machine with the Eden repository and your fork

  1. Fork the repository
  2. Fire up your local terminal create a new branch from the v4 branch of your fork with a branch name describing what your changes are. Possible branch name types:
    • bugfix
    • feature
    • improvement
  3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

Making pull requests

  1. Please ensure to run phpunit before making a pull request.
  2. Push your code to your remote forked version.
  3. Go back to your forked version on GitHub and submit a pull request.
  4. An Eden developer will review your code and merge it in when it has been classified as suitable.

The Versions

24/07 2016

v4.x-dev

4.9999999.9999999.9999999-dev http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/07 2016

dev-master

9999999-dev http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

24/07 2016

4.0.3

4.0.3.0 http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

09/11 2015

4.0.2

4.0.2.0 http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

13/10 2015

4.0.1

4.0.1.0 http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

07/10 2015

v4

4.0.0.0 http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden

06/10 2015

v3

3.0.0.0 http://eden-php.com

Autoloading, error and exception handler

  Sources   Download

MIT

The Requires

 

by Christian Blanquera

library eden