Author: ralfbecker
New Revision: 55472
URL: http://svn.stylite.de/viewvc/egroupware?rev=55472&view=rev
Log:
detect (multiple) classes definde in a file
Modified:
trunk/egroupware/doc/check_namespace.php
— trunk/egroupware/doc/check_namespace.php (original)
+++ trunk/egroupware/doc/check_namespace.php Mon Mar 21 22:22:09 2016
@@ -34,6 +34,16 @@
return str_repeat("\n", substr_count($matches[0], “\n”));
}, $content);
- // find classes declared in file itself, in case they are used
- $declared = array();
- foreach(explode("\n", $lines) as $num => $line)
- {
-
$matches = null;
-
if (preg_match('/class\s+([^ ]+)/', $line, $matches))
-
{
-
$declared[] = $matches[1];
-
}
- }
$namespace = ‘’;
$use = array();
$allways = array(‘self’, ‘parent’, ‘static’);
@@ -69,7 +79,7 @@
{
$parts = explode(’\’, $class);
$first_part = array_shift($parts);
-
if (in_array($class, $allways) || in_array($class, $declared) || $class[0] == '\\' || in_array($first_part, $use))
{
unset($all_matches[$c]);
continue;
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs