2017 © Pedro Peláez
 

library inheritance-finder

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

image

synga/inheritance-finder

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  • Sunday, May 8, 2016
  • by Synga
  • Repository
  • 1 Watchers
  • 0 Stars
  • 837 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 15 Versions
  • 0 % Grown

The README.md

Inheritance Finder

This package can find classes which are extended, implemented or is using a certain trait. It builds a cache and uses it to find the desired files., (*1)

Usage

$config = new \Synga\InheritanceFinder\File\FileConfig();
$config->setApplicationRoot(__DIR__);
$config->setCacheDirectory(__DIR__);

$inheritanceFinder = Synga\InheritanceFinder\InheritanceFinderFactory::getInheritanceFinder($config);
$inheritanceFinder->findExtends('SomeNamespace\OtherNamespacePath\Class');

It will now find all classes which inherit from class SomeNamespace\OtherNamespacePath\Class whithin your ApplicationRoot directory, (*2)

Possible options:

  • findClass('full qualified namespace') - Can locate a file with the given namespace in the given directory
  • findExtends('full qualified namespace') - Can locate multiple classes which inherit from the given class in the given directory
  • findImplements('full qualified namespace') - Can locate multiple classes which implement or inherit from the given interface in the given directory
  • findTraitUse('full qualified namespace') - Can locate multiple classes which uses the given trait in the given directory
  • findMultiple('Classes [string or array of strings]', 'Interfaces [string or array of strings]', 'Traits [string or array of strings]') - Can locate multiple classes at once, it uses the methods discribed above.

Acknowledgements:

  • Right now this package cannot handle multiple classes in one file. I will try to fix this in the near future.
  • The first run will be slow, because it is indexing all the files in your project root. I'm thinking off a manner to make it faster. I am planning of using react php for this so we can use multiple processes.
  • Don't use this code in production (you can use it FOR production, to build a cache of files). The performance results are strongly depending your hardware.

The Versions

08/05 2016

dev-master

9999999-dev

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

08/05 2016

1.0.9

1.0.9.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

01/05 2016

1.0.8

1.0.8.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

23/03 2016

1.0.7

1.0.7.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/02 2016

1.0.6

1.0.6.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/02 2016

1.0.5

1.0.5.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

07/02 2016

1.0.4

1.0.4.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/02 2016

1.0.3

1.0.3.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

05/02 2016

1.0.2

1.0.2.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/02 2016

1.0.1

1.0.1.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/02 2016

1.0.0

1.0.0.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

02/02 2016

0.2.2

0.2.2.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

02/02 2016

0.2.1

0.2.1.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

02/02 2016

0.2.0

0.2.0.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires

19/01 2016

0.0.1

0.0.1.0

This package can find classes which are extended, implemented by a certain class or is using a certain trait.

  Sources   Download

MIT

The Requires

 

The Development Requires