Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnugat/nomo-spaco
Finds the available Fully Qualified ClassNames (fqcn) in a project.
https://github.com/gnugat/nomo-spaco
Last synced: 8 days ago
JSON representation
Finds the available Fully Qualified ClassNames (fqcn) in a project.
- Host: GitHub
- URL: https://github.com/gnugat/nomo-spaco
- Owner: gnugat
- License: mit
- Created: 2014-11-26T08:05:46.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-20T12:52:02.000Z (over 6 years ago)
- Last Synced: 2024-09-28T13:46:38.819Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 22.5 KB
- Stars: 25
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Nomo Spaco
Finds available Fully Qualified ClassNames (fqcn) in a project.
> **Caution**: this is a prototype, the work is still in progress.
> **Note**: a Fully Qualified ClassName (fqcn) is a classname with its complete
> namespace (e.g. `Symfony\Component\HttpFoundation\Request`).## Installation
Use [Composer](https://getcomposer.org) to install this library in your projects:
composer require "gnugat/nomo-spaco:~0.4"
## Features
### Find in path
In order to find all available fully qualified classnames of a PHP project,
you need to provide the path to its root:```php
findIn(__DIR__);
```> **Caution**: the `make_fqcn_repository` function is only available for
> demonstration purpose. Please use a proper Dependency Injection Container.### Find in path for classname
In order to find all possible fully qualified classnames for a given class,
you need to provide the path to the project's root and the classname:```php
findInFor(__DIR__, 'Classname');
```## How does this work?
Nowdays PHP projects are powered by [Composer](https://getcomposer.org), a
package manager that installs an autoloads them. This breaks native functions
like [get_declared_classes](http://php.net/get_declared_classes).**Nomo Spaco** tries to fix this issue in an old fashion way:
* find all PHP files in a project
* for each file, find the namespace using PHP tokens
* for each file, find class names using PHP tokens## Demonstration
You can display the list of all fully qualified classnames of a project using:
php ./test/findAll.php
You can display the list of all fully qualified classnames of a project's class
using:php ./test/findOne.php