2017 © Pedro PelĂĄez
 

library support

Utility classes meant to facilitate object manipulation.

image

anekdotes/support

Utility classes meant to facilitate object manipulation.

  • Thursday, January 19, 2017
  • by anekdotes
  • Repository
  • 2 Watchers
  • 0 Stars
  • 500 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 15 Versions
  • 1 % Grown

The README.md

Anekdotes Support

Latest Stable Version Build Status License Total Downloads, (*1)

Utility classes meant to facilitate object manipulation, (*2)

Installation

Install via composer into your project:, (*3)

composer require anekdotes/support

Usage

Use the class where ever you need it:, (*4)

use Anekdotes\Support\Arr;

or, (*5)

use Anekdotes\Support\Str;

or, (*6)

use Anekdotes\Support\UUID;

or, (*7)

use Anekdotes\Support\I18n;

Arr

Helper class which facilitates array manipulation., (*8)

Method sortByKey (*_array_, *_string_, _enum_), (*9)

Arr::sortByKey([['id' => 2],['id' => 1],['id' => 3]], 'id');
// [['id' => 1],['id' => 2],['id' => 3]]

Arr::sortByKey([['id' => 2],['id' => 1],['id' => 3]], 'id', SORT_DESC);
// [['id' => 3],['id' => 2],['id' => 1]]

Method get (*_array_, *_string_, _string_), (*10)

Arr::get(['id'=>1, 'title'=>'foo'], 'title');
// foo

//With default param if non is found
Arr::get(['id'=>1, 'title'=>'foo'], 'bar', 'toaster');
// toaster

Method getWhere (*_array_, *_string_, *_string_, _string_), (*11)

$dummy = [
    ['id' => 1, 'name' => 'Bell'],
    ['id' => 2, 'name' => 'Lani']
];
Arr::getWhere($dummy, 'name', 'Lani');
// ['id' => 2, 'name' => 'Lani']

Method exists (*_string_, *_array_), (*12)

Arr::exists('title', ['id'=>1, 'title'=>'foo']);
// true

Arr::exists('bar', ['id'=>1, 'title'=>'foo']);
// false

Method remove (*_string_, *_array_), (*13)

$dummy = ['id'=>1, 'title'=>'foo'];
Arr::remove('title', $dummy);
$dummy // ['id'=>1]

$dummy = ['id'=>1, 'title'=>'foo'];
Arr::remove('foo', $dummy);
$dummy // ['id'=>1, 'title'=>'foo']

Str

Contains helper functions used to manipulate strings., (*14)

Method startsWith (*_string_, *_string_), (*15)

Str::startsWith('foo', 'f');
// true

Method endsWith (*_string_, *_string_), (*16)

Str::endsWith('foo', 'o');
// true

Method split (*_string_, *_string_), (*17)

Str::split(',', '1,2,3,4,5');
// [1, 2, 3, 4, 5]

Method capitalize (*_string_), (*18)

Str::capitalize('foo');
// Foo

Method upper (*_string_), (*19)

Str::upper('foo');
// FOO

Method lower (*_string_), (*20)

Str::lower('FOO');
// foo

Method snakeCase (*_string_), (*21)

Str::snakeCase('étoile filante');
// etoile_filante

Method camelCase (*_string_), (*22)

Str::camelCase('foo bar');
// fooBar

Method contains (*_string_, *_string_), (*23)

Str::contains('foo', 'oo');
// true

Method studly (*_string_), (*24)

Str::studly('foo bar');
// FooBar

Method ascii (*_string_), (*25)

Str::ascii('étoile');
// etoile

Method slug (*_string_, _string_), (*26)

Str::slug('foo bar');
// foo-bar

Method random (*_integer_), (*27)

Str::random();
// random 16 characters string

Str::random(20);
// random 20 characters string

Method quickRandom (*_integer_), (*28)

Str::quickRandom();
// random quick 16 characters string

Str::quickRandom(20);
// random quick 20 characters string

Method replace (*_string_, *_string_, *_string_), (*29)

Str::replace('foo', 'oo', 'yy');
// fyy

Method regexResult (), (*30)

Str::regexResult('/([\w]+)/', 'foo bar', 0);
// ['foo', 'bar']

The Versions

19/01 2017

dev-master

9999999-dev https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

19/01 2017

1.0.13

1.0.13.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

01/12 2016

1.0.12

1.0.12.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

12/10 2016

1.0.11

1.0.11.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

18/05 2016

1.0.10

1.0.10.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

18/05 2016

1.0.9

1.0.9.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

10/05 2016

1.0.8

1.0.8.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

09/05 2016

1.0.7

1.0.7.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

09/05 2016

1.0.6

1.0.6.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

03/05 2016

1.0.5

1.0.5.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

03/05 2016

1.0.4

1.0.4.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

03/05 2016

1.0.3

1.0.3.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

The Development Requires

helpers auth uuid array arr string str

03/05 2016

1.0.2

1.0.2.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

 

helpers auth uuid array arr string str

02/05 2016

1.0.1

1.0.1.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

helpers auth uuid array arr string str

02/05 2016

1.0.0

1.0.0.0 https://github.com/anekdotes/support

Utility classes meant to facilitate object manipulation.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

helpers auth uuid array arr string str