https://github.com/eser/scabbia2-scanners
Scabbia2 Scanners Component
https://github.com/eser/scabbia2-scanners
Last synced: 6 months ago
JSON representation
Scabbia2 Scanners Component
- Host: GitHub
- URL: https://github.com/eser/scabbia2-scanners
- Owner: eser
- License: other
- Archived: true
- Created: 2015-09-16T00:17:29.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-03T14:55:49.000Z (over 10 years ago)
- Last Synced: 2025-11-27T14:56:37.933Z (8 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Scabbia2 Scanners Component
[This component](https://github.com/eserozvataf/scabbia2-scanners) 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`.
[](https://travis-ci.org/eserozvataf/scabbia2-scanners)
[](https://scrutinizer-ci.com/g/eserozvataf/scabbia2-scanners/?branch=master)
[](https://packagist.org/packages/eserozvataf/scabbia2-scanners)
[](https://packagist.org/packages/eserozvataf/scabbia2-scanners)
[](https://packagist.org/packages/eserozvataf/scabbia2-scanners)
[](https://readthedocs.org/projects/scabbia2-documentation)
## Usage
### Extracting Annotations from Source Folder
```php
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
```php
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
- [List of All Scabbia2 Components](https://github.com/eserozvataf/scabbia2)
- [Documentation](https://readthedocs.org/projects/scabbia2-documentation)
- [Twitter](https://twitter.com/eserozvataf)
- [Contributor List](contributors.md)
- [License Information](LICENSE)
## 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](https://github.com/eserozvataf/scabbia2-scanners) repository.
* To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.
* To report a bug: If something does not work, please report it using GitHub issues.
* To support: [](https://gratipay.com/eserozvataf/)