Use:
find ./name-of-dir '*.php' | xargs wc -l
OR
( find ./
name-of-dir
-print0 | xargs -0 cat ) | wc -l
ref: link