-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilters.php
36 lines (32 loc) · 1.2 KB
/
Filters.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?hh // strict
namespace HackPack\Scanner\Filter;
use FredEmmott\DefinitionFinder\ScannedBasicClass;
use FredEmmott\DefinitionFinder\ScannedConstant;
use FredEmmott\DefinitionFinder\ScannedEnum;
use FredEmmott\DefinitionFinder\ScannedFunction;
use FredEmmott\DefinitionFinder\ScannedBase;
use FredEmmott\DefinitionFinder\ScannedInterface;
use FredEmmott\DefinitionFinder\ScannedNewtype;
use FredEmmott\DefinitionFinder\ScannedTrait;
use FredEmmott\DefinitionFinder\ScannedType;
type Filter<-T> = (function(T):bool);
type ClassFilter = Filter<ScannedBasicClass>;
type ConstantFilter = Filter<ScannedConstant>;
type EnumFilter = Filter<ScannedEnum>;
type FilenameFilter = Filter<string>;
type FilterSet = shape(
'class' => ClassFilter,
'constant' => ConstantFilter,
'enum' => EnumFilter,
'function' => FunctionFilter,
'interface' => InterfaceFilter,
'newtype' => NewtypeFilter,
'trait' => TraitFilter,
'type' => TypeFilter,
);
type FunctionFilter = Filter<ScannedFunction>;
type GenericFilter = Filter<ScannedBase>;
type InterfaceFilter = Filter<ScannedInterface>;
type NewtypeFilter = Filter<ScannedNewtype>;
type TraitFilter = Filter<ScannedTrait>;
type TypeFilter = Filter<ScannedType>;