2017 © Pedro Peláez
 

library dot-notation

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

image

dschoenbauer/dot-notation

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  • Wednesday, May 3, 2017
  • by dschoenbauer
  • Repository
  • 1 Watchers
  • 0 Stars
  • 470 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 10 Versions
  • 2 % Grown

The README.md

Dot Notation

Build Status Coverage Status License Downloads Version, (*1)

License Downloads Version, (*2)

Purpose

Simplifies access to large array structures, (*3)

Installation

    composer require dschoenbauer/dot-notation

Testing

    ./vendor/bin/phpunit tests

Example

use DSchoenbauer\DotNotation\ArrayDotNotation;

$mongoConnection = [ 
    'mongo' => [ 
        'default' => [  'user' => 'username', 'password' => 's3cr3t' ]
    ]
];
$config = new ArrayDotNotation($mongoConnection);
        --- or ---
$config = ArrayDotNotation::with($mongoConnection);

GET

// Get plain value
$user = $config->get('mongo.default.user');
/*
    $user = 'username';
*/ 

// Get array value
$mongoDefault = $config->get('mongo.default'); 
/* 
    $mongoDefault = ['user' => 'username', 'password' => 's3cr3t'];
*/

SET

$configDump = $config->set('mongo.numbers', [2, 3, 5, 7, 11])->getData();
/*
    $configDump = [
        'mongo' => [
            'default' => [  'user' => 'username', 'password' => 's3cr3t' ],
            'numbers' => [2, 3, 5, 7, 11]
        ],
        'title' => 'Dot Notation'
    ];
*/

MERGE

$configDump = $config->merge('mongo.default', ['user' => 'otherUser','active' => true])->getData();
/*
    $configDump = [
        'mongo' => [
           'default' => [  'user' => 'otherUser', 'password' => 's3cr3t','active' => true ]
        ],
        'title' => 'Dot Notation'
    ];
*/

REMOVE

$configDump = $config->remove('mongo.default.user')->getData();
/*
    $configDump = [
        'mongo' => [
           'default' => [  'password' => 's3cr3t' ]
        ],
        'title' => 'Dot Notation'
    ];
*/

NOTATION TYPE

// Tired of dots? Change it.
$user = $config->setNotationType(',')->get('mongo,default,user');
/*
    $user = 'username';
*/ 

WITH

//Functional fluent fun
$user = ArrayDotNotation::with($mongoConnection)->get('mongo.default.user');
/*
    $user = 'username';
*/ 

HAS

// Validates that the dot notation path is present in the data.
$isPresent = $config->has('mongo,default,user');
/*
    $isPresent = true;
*/ 

The Versions

03/05 2017

dev-master

9999999-dev

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

03/05 2017

1.2.1

1.2.1.0

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

03/05 2017

dev-develop

dev-develop

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

21/12 2016

dev-add-wild-cards

dev-add-wild-cards

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

21/12 2016

dev-update-to-fascade

dev-update-to-fascade

Given a complicated data structure, this library allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

02/12 2016

1.2.0

1.2.0.0

Given a complicated data structure, allows easy and safe access to data via dot notation. This library is a compilation of other Dot Notation libraries, taking the best feature from each and incorpating them here.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

dot array access data notation

02/12 2016

1.1.1

1.1.1.0

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

01/12 2016

1.1.0

1.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

26/11 2016

1.0.1

1.0.1.0

  Sources   Download

Private

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer

26/11 2016

1.0.0

1.0.0.0

  Sources   Download

Private

The Requires

  • php >=5.6.0

 

The Development Requires

by David Schoenbauer