2017 © Pedro PelĂĄez
 

library chain-php

image

masnathan/chain-php

  • Friday, September 29, 2017
  • by MASNathan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

chain-php

Chainable native functions and more, (*1)

Usage

$domain = explode('@', 'andre.r.flip@gmail.com');
$domain = end($domain);
$domain = trim($domain);

$domain = with('andre.r.flip@gmail.com')->explode('@', '$$')->end()->trim()->get();
// 'gmail.com'

or, (*2)

$key = with('some.service.3rdparty.integration')
    ->explode('.', '!!')
    ->array_map(function ($value) {
        return $value == '3rdparty' ? 'local' : $value;
    }, '!!')
    ->implode('.', '!!')
    ->get();
// 'some.service.local.integration'

Inspired by Sebastiaan Luca Pipe item, (*3)

The Versions

29/09 2017

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php ^5.6

 

The Development Requires