library swaddle
Swaddle acts as a wrapper around unknown collections of key-value pairs.
liampm/swaddle
Swaddle acts as a wrapper around unknown collections of key-value pairs.
- Thursday, March 30, 2017
- by liampm
- Repository
- 2 Watchers
- 2 Stars
- 11 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 1 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
Swaddle
Swaddle allows you to wrap collections of key-value pairs such as associative arrays and \stdClass objects so that you can more easily access their properties and have more certainty of what properties do exist.
The aim of Swaddle is to reduce the amount of isset or property_exists checks., (*1)
Installation
$ composer require liampm/swaddle
Basic Usage
<?php
use liampm\Swaddle;
$configuration = json_decode(file_get_contents('config.json'));
$swaddle = Swaddle::wrapObject($configuration);
$swaddle->getProperty('count', 0);
dev-master
9999999-dev
Swaddle acts as a wrapper around unknown collections of key-value pairs.
Sources
Download
MIT
The Requires
The Development Requires
by
Liam Morriss
dev-add-support-for-deep-swaddle-of-arrays
dev-add-support-for-deep-swaddle-of-arrays
Swaddle acts as a wrapper around unknown collections of key-value pairs.
Sources
Download
MIT
The Requires
The Development Requires
by
Liam Morriss