-name matches the file name only, so it cannot say anything about the folder that holds the file.
find . -type f -name '*.php' -not -path '*/vendor/*' -not -path './.git/*'
-path matches the whole path with shell patterns, and the star also matches slashes. That lets you drop whole subtrees from the result. It still walks those folders, so for large trees -prune is faster. A slash in a -name pattern never matches anything, and GNU find warns about it. Quote the pattern, otherwise the shell expands the star before find sees it. Put -not -path before the expensive tests, and remember to add a leading ./ if the starting point is a dot.
Further reading: find manual page