alexandresalome/sublime-alom — pull request #6 by florianeckerstorfer (2014-03-03 10:59:08+00:00)
Title: Adds support for PSR-4-style classes

This PR adds support for [PSR-4](http://www.php-fig.org/psr/psr-4/) iff the project uses [Composer](https://getcomposer.org/doc/04-schema.md#psr-4).

It is implemented in the following way:

1. Look if there is a `composer.json` in the "break word" directory
2. Parse the `composer.json`
3. Iterate through all items of `autoload.psr-4`
4. If the path of the item matches the current filename, this file is a PSR-4-style class.
5. If the file is in the break word directory,
- then replace class name by namespace prefix
- else add prefix in front of namespace

If `composer.json` doesn't exists, if the JSON cannot be parsed, if the `autoload.psr-4` key doesn't exist or if the filename matches none of the PSR-4 definitions the behaviour is as it is now.