Add interface for Markdown class #97

merged 1 commit into from Nov 29, 2013


None yet

5 participants


This is a small change that adds a MarkdownInterface to codify the public API and aid with decoupling and dependency injection for consuming projects.

michelf commented May 11, 2013

Hum, this increases the dependency on PSR-0 autoloading (currently if someone doesn't want to bother with autoloading he can just include Markdown.php and have it work). I can see the usefulness though. I think I'll probably merge this.


I like the idea, but I don't think the static method belongs in the interface.

jjok commented Jul 4, 2013

@michelf The README already says, "this library package is meant to be used with class autoloading. For autoloading to work, your project needs have setup a PSR-0-compatible autoloader."

michelf commented Jul 4, 2013

@jjok "Meant to be used with" doesn't necessarily mean "must absolutely be used with". If someone just want to use the parser in his project and it works to just include the file, I'm not going to force him to setup autoloading. Anyway, as I said I intend to merge this. There's a Readme.php example file for a reason.

@davidwindell Why don't you like the static method?


I really like this pull request. @michelf, any idea when this pull request will be merged?

michelf commented Nov 21, 2013

I thought about it some more. The only "problem" I see is that it makes things more complicated to those who don't want to use autoloading. But that's simple to fix: I'll add a "master" file to include that'll include all the others; those who don't want to mess with autoloading can include that file instead.

So I'll merge this as soon as I've some time to put into PHP Markdown, probably next week.

@michelf michelf merged commit b2dd8b4 into michelf:lib Nov 29, 2013
@itafroma itafroma deleted the itafroma:interface branch Nov 29, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment