Skip to content

Instantly share code, notes, and snippets.

@phmLabs
Created March 12, 2011 18:51
Show Gist options
  • Save phmLabs/867471 to your computer and use it in GitHub Desktop.
Save phmLabs/867471 to your computer and use it in GitHub Desktop.
Some Magic
<?php
$magic = new Autoloader();
$magic->registerNamespace('phmLabs', __DIR__, true);
$magic->register();
$dispatcher = new EventDispatcher();
$magic->registerAnnotation('Notify', 'phmLabs\Annotations\Notify', new \phmLabs\Modifier\Notify($dispatcher) );
$a = new A();
$a->b();
// ... another file
namespace phmLabs;
Class A
{
/**
* @Notify(before="AnEvent", after="AnotherEvent")
*/
public function b( )
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment