Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there way to ignore built-in functions? #32

Closed
Soufraz opened this issue Mar 30, 2017 · 6 comments
Closed

Is there way to ignore built-in functions? #32

Soufraz opened this issue Mar 30, 2017 · 6 comments
Assignees
Labels

Comments

@Soufraz
Copy link

Soufraz commented Mar 30, 2017

No description provided.

@mamuz
Copy link
Owner

mamuz commented Mar 30, 2017

Can you give me an example?

@mamuz mamuz added the question label Mar 30, 2017
@mamuz
Copy link
Owner

mamuz commented Mar 30, 2017

When you are talking about PHP built-in functions, such as in_array(), you can use your own NamespaceFilter plugin to return an empty array in this case. Please check the manual https://github.com/mamuz/PhpDependencyAnalysis/wiki/5.-Plugins , the example https://github.com/mamuz/PhpDependencyAnalysis/wiki/4.-Examples#usage-graph-on-package-level-with-a-namespacefilter and the test stub https://github.com/mamuz/PhpDependencyAnalysis/blob/master/tests/_data/Plugin/NamespaceFilter.php

@mamuz mamuz self-assigned this Apr 2, 2017
@mamuz
Copy link
Owner

mamuz commented Apr 2, 2017

@Soufraz Did my answer help you?

@Soufraz
Copy link
Author

Soufraz commented May 2, 2017

Sorry, I did not test yet. So, if I remember the generator was getting all php functions in the classes. But I'll try the filter suggested above .. Thanks!

@Soufraz Soufraz closed this as completed May 2, 2017
@daudtacto
Copy link

@mamuz @Soufraz Can you please help me understand how should I remove the inbuilt PHP functions and dependencies? I tried performing NameSpaceFilter which suggested above but it didn't happen. I running PhpDA on docker with the following configuration. Really appreciated it if you can help me remove PHP global functions and inbuilt one.
mode: 'call'
source: '../src/Controller'
filePattern: 'ContactsController.php'
ignore: 'tests'
formatter: 'PhpDA\Writer\Strategy\Svg'
target: './namespace-filter.svg'
namespaceFilter: 'MyDomain\Plugin\NamespaceFilter'
visitor:

  • PhpDA\Parser\Visitor\TagCollector
  • PhpDA\Parser\Visitor\SuperglobalCollector
    visitorOptions:
    PhpDA\Parser\Visitor\TagCollector: {minDepth: 1, sliceLength: 1}
    classMap:
    MyDomain\Plugin\NamespaceFilter: './NamespaceFilter.php'

@FallDi
Copy link

FallDi commented Nov 24, 2020

+1
I believe that exclude built-in functions feature is highly demanded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants