isholao/container

1.0 2017-11-21 04:50 UTC

This package is not auto-updated.

Last update: 2024-04-28 03:03:41 UTC


README

Build Status

Install

To install with composer:

composer require isholao/container

Requires PHP 7.1 or newer.

Usage

Here's a basic usage example:

<?php

require '/path/to/vendor/autoload.php';

$c = new \Isholao\Container\Container();
$c->set('name','ishola'); // $c->name = 'ishola';

if($c->has('name'))
{
    echo $c->get('name'); // $c->name;
}

$c->protected('response', function (){});

$c->response();

Protecting an item. Define it will the protect method

<?php

require '/path/to/vendor/autoload.php';

$c = new \Isholao\Container\Container();
$c->protect('name','ishola');

$c->name = 'ishola'; // throw error