Skip to content

Instantly share code, notes, and snippets.

@munro
Created January 16, 2012 20:19
Show Gist options
  • Save munro/1622768 to your computer and use it in GitHub Desktop.
Save munro/1622768 to your computer and use it in GitHub Desktop.
PHP Class DSL
<?php
$MyClass = $createClass(function () {
inherit($BaseClass);
mixin($OtherClass);
$this->my_var = 123;
decorate($someFunction);
$this->__construct = function ($self) {
$MyClass->$parent->__construct->call($self);
$createClass->super($MyClass, $self)->__construct('a', 'b', 'c');
};
decorate($someFunction);
function somevar($self) {
}
decorate($someFunction);
function hello($self) {
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment