No description, website, or topics provided.
PHP
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
Bootstrap.php
README.md
composer.json
composer.lock
phpunit.xml.dist

README.md

Guard

Simplly cleaning up resources with RAII pattern.

Synopsis

unset()

$guard = new Guard(function () { echo "unset!\n"; });
unset($guard); //=> unset!

Function Scope

function foo()
{
    $guard = new Guard(function () { echo "destructed!\n"; });
    // ... do something ...
}

foo(); //=> echoed "destructed!" after function called

Run Tests Using Composer

$ curl -s https://getcomposer.org/installer | php
$ php composer.phar install
$ bin/phpunit

LICENSE

Copyright

Copyright Kentaro Kuribayashi

LICENSE

MIT LICENSE