1 | <?php |
||
31 | class Collector extends NodeVisitorAbstract |
||
32 | { |
||
33 | /** @var array */ |
||
34 | private $classMap = array(); |
||
35 | |||
36 | /** @var array */ |
||
37 | private $dependencies = array(); |
||
38 | |||
39 | /** @var Node\Stmt\ClassLike[] */ |
||
40 | private $foundClasses = array(); |
||
41 | |||
42 | /** @var bool */ |
||
43 | private $hasFoundInvalidStmt = false; |
||
44 | |||
45 | private $invalidFunctions = array( |
||
46 | 'basename', |
||
47 | 'chgrp', |
||
48 | 'chmod', |
||
49 | 'chown', |
||
50 | 'clearstatcache', |
||
51 | 'copy', |
||
52 | 'delete', |
||
53 | 'dirname', |
||
54 | 'disk_free_space', |
||
55 | 'disk_total_space', |
||
56 | 'diskfreespace', |
||
57 | 'file_exists', |
||
58 | 'file_get_contents', |
||
59 | 'file_put_contents', |
||
60 | 'file', |
||
61 | 'fileatime', |
||
62 | 'filectime', |
||
63 | 'filegroup', |
||
64 | 'fileinode', |
||
65 | 'filemtime', |
||
66 | 'fileowner', |
||
67 | 'fileperms', |
||
68 | 'filesize', |
||
69 | 'filetype', |
||
70 | 'fnmatch', |
||
71 | 'fopen', |
||
72 | 'glob', |
||
73 | 'is_dir', |
||
74 | 'is_executable', |
||
75 | 'is_file', |
||
76 | 'is_link', |
||
77 | 'is_readable', |
||
78 | 'is_uploaded_file', |
||
79 | 'is_writable', |
||
80 | 'is_writeable', |
||
81 | 'lchgrp', |
||
82 | 'lchown', |
||
83 | 'link', |
||
84 | 'linkinfo', |
||
85 | 'lstat', |
||
86 | 'mkdir', |
||
87 | 'move_uploaded_file', |
||
88 | 'parse_ini_file', |
||
89 | 'parse_ini_string', |
||
90 | 'pathinfo', |
||
91 | 'readfile', |
||
92 | 'readlink', |
||
93 | 'realpath', |
||
94 | 'rename', |
||
95 | 'rmdir', |
||
96 | 'stat', |
||
97 | 'symlink', |
||
98 | 'tempnam', |
||
99 | 'touch', |
||
100 | 'unlink', |
||
101 | 'stream_resolve_include_path', |
||
102 | 'stream_is_local', |
||
103 | ); |
||
104 | |||
105 | public function leaveNode(Node $node) |
||
131 | |||
132 | /** |
||
133 | * @param Node\Name[]|null $names |
||
134 | */ |
||
135 | private function collect($names) |
||
151 | |||
152 | public function reset() |
||
169 | |||
170 | /** |
||
171 | * @return array |
||
172 | */ |
||
173 | public function getClassMap() |
||
177 | } |
||
178 |