Demo for SymbolNameParser with NodeSymbolCollector
#151
Closed
llaville
started this conversation in
Show and tell
Replies: 1 comment
-
|
Closing this discussion for the same reason. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
With commit llaville@3b61764 I've added a
demofolder to give a try to see what we can do withNodeSymbolCollector.For example :
php demo/playground.php demo/fixtures/class_constants_2.php --strategy '*' --debug=strategies --json-dump --node-attribute nodeTypeYou can limit strategy to use with
--strategyoption.See
playground.phpscript at https://github.com/llaville/symbol-parser/blob/contribs/demo/playground.php#L46-L101Symbols found : (10)
With
--debug=strategiesoptionStrategies used : (15)
With
--json-dumpoptionNodes dump : (19)
[ { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain" ], "nodeAttributes": { "nodeType": "Stmt_Namespace" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain\\Some_Class" ], "nodeAttributes": { "nodeType": "Stmt_Class" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain\\Some_Class\\CONSTANT_ONE", "App\\Domain\\Some_Class\\CONSTANT_TWO", "App\\Domain\\Some_Class\\CONSTANT_THREE" ], "nodeAttributes": { "nodeType": "Stmt_ClassConst" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain\\Status" ], "nodeAttributes": { "nodeType": "Stmt_Class" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ExtendsParseStrategy", "symbols": [ "App\\Domain\\Some_Class" ], "nodeAttributes": { "nodeType": "Stmt_Class" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain\\Some_Class\\DELETED" ], "nodeAttributes": { "nodeType": "Stmt_ClassConst" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\DefineStrategy", "symbols": [ "App\\Domain\\Some_Class\\CONSTANT_ONE", "App\\Domain\\Some_Class\\CONSTANT_TWO", "App\\Domain\\Some_Class\\CONSTANT_THREE" ], "nodeAttributes": { "nodeType": "Stmt_ClassConst" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ClassConstStrategy", "symbols": [ "App\\Domain\\Some_Class\\DELETED" ], "nodeAttributes": { "nodeType": "Expr_ClassConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ClassConstStrategy", "symbols": [ "App\\Domain\\Status\\DELETED" ], "nodeAttributes": { "nodeType": "Expr_ClassConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ConstStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\PhpExtensionStrategy", "symbols": [ "ext-core" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\UsedExtensionSymbolStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\NewStrategy", "symbols": [ "App\\Domain\\Status" ], "nodeAttributes": { "nodeType": "Expr_New" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ConstStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\PhpExtensionStrategy", "symbols": [ "ext-core" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\UsedExtensionSymbolStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\ConstStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\PhpExtensionStrategy", "symbols": [ "ext-core" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } }, { "strategy": "ComposerUnused\\SymbolParser\\Parser\\PHP\\Strategy\\UsedExtensionSymbolStrategy", "symbols": [ "PHP_EOL" ], "nodeAttributes": { "nodeType": "Expr_ConstFetch" } } ]Beta Was this translation helpful? Give feedback.
All reactions