PHP code example of kilahm / hack-class-scanner

1. Go to this page and download the library: Download kilahm/hack-class-scanner 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/ */

    

kilahm / hack-class-scanner example snippets


use kilahm\Scanner\ClassScanner;

$scanner = new ClassScanner(
  Set{‘directory/to/scan’, ‘other/directory’},
  Set{‘other/directory/to/ignore’}
);
$classMap = $scanner->mapClassToFile();
$classAndInterfaceMap = $scanner->mapClassOrInterfaceToFile();

$$excludes = Set{...};
$scanner = new ClassScanner($n/’, $className);
$fileFilter = $fileName ==> preg_match(‘/pattern/’, $fileName);
$scanner->addClassNameFilter($classFilter);
$scanner->addFileNameFilter($fileFilter);
$classMap = $scanner->mapClassToFile();