PHP code example of eserozvataf / scabbia2-scanners

1. Go to this page and download the library: Download eserozvataf/scabbia2-scanners library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

eserozvataf / scabbia2-scanners example snippets


use Scabbia\Scanners\Scanners;
use Scabbia\Scanners\AnnotationScanner;

$annotationScanner = new AnnotationScanner();

$scanners = new Scanners();
$scanners->register($annotationScanner);
$scanners->processFolder('src/');

var_dump($annotationScanner->result);

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/');