Fix phpdoc and function scope

Fix phpdoc and function scope

Fix phpdoc