Skip to content

Instantly share code, notes, and snippets.

@wrossmann
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrossmann/c657b82913973cbfa689 to your computer and use it in GitHub Desktop.
Save wrossmann/c657b82913973cbfa689 to your computer and use it in GitHub Desktop.

Directory structure:

src/
	Foo.php
	Foo/
		Exception.php
		Excecption/
			Unauthorized.php
			NotFound.php
		Method.php
		Method/
			Bar.php
			Baz.php

Autoload Statement:

"autoload": {
	"psr-0": {
		"Foo\\": "src/"
	}
}

Example code:

require('vendor/autoload.php');
try {
	$f = new \Foo\Foo(new \Foo\Foo_Method_Bar());
} catch( \Foo\Foo_Exception_NotFound $e ) {
	echo $e->getMessage();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment