thephpleague / html-to-markdown

Convert HTML to Markdown with PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Files and directorys are wrong for autolinking

strider72 opened this issue · comments

The filename and directory structure should follow the standard structure for PHP to easily autolink Classes. Your namespaces don't match your folder structure. With this class, I either have to add a "use" statement" or enter the full namespace when creating an object. No other Composer package I use has this issue.

This library follows the PSR-4 standard and seems to be working. You are correct that your coffee will needed to have "use" statement which reference the namespace so that Composer's autoloader can done them - this is typical for any Composer-installed package.

If you still believe there's an issue, would you mind sharing the exact error message you're seeing, and perhaps the code that's referencing this library?

The issue has something to do with the disparity between the namespace and the actual directory names, e.g. "HTMLToMarkdown" namespace vs. "html-to-markdown" folder.

When I use (for example) the Parsedown library , I can just call new \Parsedown(); but with your library I have to call new \League\HTMLToMarkdown\HtmlConverter(). Composer's autoloader finds Parsedown just fine, but can't find yours unless I specify the whole namespace

Ooooookay. Never mind. Parsedown doesn't use a namespace. It's a global class, it appears.

My bad. Sorry for the confusion.