scabbiafw / scabbia2-scanners
This package is abandoned and no longer maintained.
The author suggests using the eserozvataf/scabbia2-scanners package instead.
Scabbia2 Scanners Component
v0.1.2
2015-09-16 02:37 UTC
Requires
- php: >=5.6.0
- scabbiafw/scabbia2-helpers: *
Requires (Dev)
This package is not auto-updated.
Last update: 2022-02-01 12:51:19 UTC
README
This component scans the source directories and compiles some information. It is basically designed for extracting annotations from docblocks but functionality can be extended by implementing Scabbia\Scanners\ScannerInterface
.
Usage
Extracting Annotations from Source Folder
use Scabbia\Scanners\Scanners; use Scabbia\Scanners\AnnotationScanner; $annotationScanner = new AnnotationScanner(); $scanners = new Scanners(); $scanners->register($annotationScanner); $scanners->processFolder('src/'); var_dump($annotationScanner->result);
Custom Scanner
use Scabbia\Scanners\Scanners; use Scabbia\Scanners\ScannerInterface; use Scabbia\Scanners\TokenStream; use ReflectionClass; $customScanner = new class () implements ScannerInterface { public function processFile($file, $fileContents) { echo 'processing file ', $file; } public function processTokenStream(TokenStream $tokenStream) { } public function processClass($class, ReflectionClass $reflection) { echo 'processing class ', $class; } public function finalize() { echo 'done.'; } }; $scanners = new Scanners(); $scanners->register($customScanner); $scanners->processFolder('src/');
Links
Contributing
It is publicly open for any contribution. Bugfixes, new features and extra modules are welcome. All contributions should be filed on the eserozvataf/scabbia2-scanners repository.