2017 © Pedro Peláez
 

library commons-descendable

A property accessor helper capable of using dot notation for a mix of arrays and objects

image

bcismariu/commons-descendable

A property accessor helper capable of using dot notation for a mix of arrays and objects

  • Friday, July 21, 2017
  • by bcismariu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 73 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Dot notation descendable

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

A generic dot notation accessor, able to handle a mix of arrays and objects, (*2)

Installation

composer require bcismariu/commons-descendable:^0.1, (*3)

Usage

<?php

use Bcismariu\Commons\Descendable\Descendable;

$array = [
    'eyes'  => 'blue',
    'age'   => '27',
    'parents' => [
        'mother'    => 'Jane',
        'father'    => 'Jack'
    ]
];

$descendable = new Descendable($array);

$descendable->get('parents.father', 'John');    // returns 'Jack'
$descendable->get('sister', 'Kate');            // returns 'Kate'

Testing

php vendor/bin/phpunit

The Versions

21/07 2017

dev-master

9999999-dev

A property accessor helper capable of using dot notation for a mix of arrays and objects

  Sources   Download

The Development Requires

by Bogdan Cismariu

21/07 2017

v0.1

0.1.0.0

A property accessor helper capable of using dot notation for a mix of arrays and objects

  Sources   Download

The Development Requires

by Bogdan Cismariu