mia3/koseki

There is no license information available for the latest version (1.3.0) of this package.

Library to quickly find classes that implement specific interfaces

Maintainers

Details

github.com/mia3/koseki

Source

Issues

Installs: 48

Dependents: 0

Suggesters: 0

Security: 0

Stars: 6

Watchers: 4

Forks: 1

Open Issues: 0

Type:composer-plugin

1.3.0 2015-12-18 23:49 UTC

This package is auto-updated.

Last update: 2024-11-05 18:39:10 UTC


README

This library helps you to quickly and easily find classes that implement an interface or extend from a base class. It uses the registered interfaces of composer to find/build the registry. The registry itself is cached in the temporary directory returned by "sys_get_temp_dir()". The cache entry will automatically be recached if the the composer autoload_file changes. But it can does not pick up new/changes files, for development you should use the parameter "forceRecache". it's still wicked fast.

Usage cached

$implementations = ClassRegister::getImplementations('Acme\Package\MyCoolInterface');

Usage with forceRecache

$implementations = ClassRegister::getImplementations('Acme\Package\MyCoolInterface', TRUE);

That's it :)

Installation

composer require mia3/koseki

Ignoring incompatible/failing files

There are 2 choices where you can specify files that should be ignored by the ClassRegistry.

  • .koseki-ignore
  • .gitattributes

The syntax is based on the common .gitignore format: https://git-scm.com/docs/gitignore#_pattern_format

The ClassRegister will automatically add a file to the root .koseki-ignore file if it encounters a fatal error while including a class file.