Skip to content

Instantly share code, notes, and snippets.

@shadowhand
Last active August 29, 2015 13:56
Show Gist options
  • Save shadowhand/9160928 to your computer and use it in GitHub Desktop.
Save shadowhand/9160928 to your computer and use it in GitHub Desktop.
Search for external static deps using git grep
# Git grep for external static deps (ignores static:: and self:: calls)
alias staticdeps="git grep -Pi '^(?!\s+[*\/]).+\b[a-z][a-z0-9_]++(?<!static|self)::'"
# can also be assigned as a git alias
# add --global if you want it everywhere
git config alias.extdeps "grep -Pi '^(?"'!'"\s+[*\/]).+\\b[a-z][a-z0-9_]++(?<"'!'"static|self)::'"
# usage, global search
git extdeps
# usage, specific path
git extdeps -- classes/foo.php
git extdeps -- vendor/zend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment