2017 © Pedro Peláez
 

library universal-access

This package includes PHP wrapper for arrays and objects, which simplifies access to nested properties/keys.

image

jvmanji/universal-access

This package includes PHP wrapper for arrays and objects, which simplifies access to nested properties/keys.

  • Tuesday, August 29, 2017
  • by jvmanji
  • Repository
  • 1 Watchers
  • 0 Stars
  • 230 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

UniversalAccess

This package includes PHP wrapper for arrays and objects. When you get data from 3rd party API's you offten get into an "isset hell":, (*1)

    if (isset($result->profile) && 
        isset($result->profile->map_data) && 
        isset($result->profile->map_data->work_places)) {
      // do sth with: $result->profile->map_data->work_places
    }

By using this class you can do just:, (*2)

    use UniversalAccess\Wrapper as W;

    $data = W::wrap($result);

    if (isset($data->profile->map_data->work_places)) {
      $work_places = $data->profile->map_data->work_places->raw();
    }

Examples

More examples are in examples directory., (*3)

The Versions

29/08 2017

dev-master

9999999-dev

This package includes PHP wrapper for arrays and objects, which simplifies access to nested properties/keys.

  Sources   Download

MIT

by Rafał Toboła