2017 © Pedro PelĆ”ez
 

project nomo-spaco

Displays the declared fully qualified classnames of a project

image

gnugat/nomo-spaco

Displays the declared fully qualified classnames of a project

  • Friday, July 20, 2018
  • by gnupat
  • Repository
  • 2 Watchers
  • 18 Stars
  • 17,358 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 8 Versions
  • 22 % Grown

The README.md

Nomo Spaco

Finds available Fully Qualified ClassNames (fqcn) in a project., (*1)

Caution: this is a prototype, the work is still in progress., (*2)

Note: a Fully Qualified ClassName (fqcn) is a classname with its complete namespace (e.g. Symfony\Component\HttpFoundation\Request)., (*3)

Installation

Use Composer to install this library in your projects:, (*4)

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:, (*5)

<?php

require __DIR__.'/vendor/autoload.php';

$fqcnRepository = \test\Gnugat\NomoSpaco\make_fqcn_repository();
$allFqcns = $fqcnRepository->findIn(__DIR__);

Caution: the make_fqcn_repository function is only available for demonstration purpose. Please use a proper Dependency Injection Container., (*6)

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:, (*7)

<?php

require __DIR__.'/vendor/autoload.php';

$fqcnRepository = \test\Gnugat\NomoSpaco\make_fqcn_repository();
$possibleFqcns = $fqcnRepository->findInFor(__DIR__, 'Classname');

How does this work?

Nowdays PHP projects are powered by Composer, a package manager that installs an autoloads them. This breaks native functions like get_declared_classes., (*8)

Nomo Spaco tries to fix this issue in an old fashion way:, (*9)

  • 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:, (*10)

php ./test/findAll.php <projectRoot>

You can display the list of all fully qualified classnames of a project's class using:, (*11)

php ./test/findOne.php <projectRoot> <classname>

The Versions

20/07 2018

dev-master

9999999-dev

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

detect available fully qualified classname

20/07 2018

v0.4.3

0.4.3.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

detect available fully qualified classname

16/01 2017

v0.4.2

0.4.2.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

detect available fully qualified classname

12/12 2016

v0.4.1

0.4.1.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

detect available fully qualified classname

07/12 2014

v0.4.0

0.4.0.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

  • php ~5.3

 

The Development Requires

detect available fully qualified classname

26/11 2014

v0.3.0

0.3.0.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

 

The Development Requires

detect available fully qualified classname

26/11 2014

v0.2.0

0.2.0.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

 

The Development Requires

detect available fully qualified classname

25/11 2014

v0.1.0

0.1.0.0

Displays the declared fully qualified classnames of a project

  Sources   Download

MIT

The Requires

 

The Development Requires

detect available fully qualified classname