Remove blacklisted methods
authorTomas Mysik <tmysik@netbeans.org>
Fri, 09 Jun 2017 09:16:56 +0200
changeset 639073661dbdafd6
parent 6389 8b57d477a2db
child 6391 640ddcff4333
Remove blacklisted methods

We now have context-sensitive lexer.
php/sigfiles/generate.php
     1.1 --- a/php/sigfiles/generate.php	Thu Jun 08 06:53:53 2017 +0200
     1.2 +++ b/php/sigfiles/generate.php	Fri Jun 09 09:16:56 2017 +0200
     1.3 @@ -133,13 +133,6 @@
     1.4      'oci_collection_trim' => 1,
     1.5      'oci_collection_assign' => 1,
     1.6  );
     1.7 -$methodBlackList = array(
     1.8 -    'clone',
     1.9 -    'throw',
    1.10 -    'isset',
    1.11 -    'echo',
    1.12 -    'eval',
    1.13 -);
    1.14  $preferHtmlProperties = array(
    1.15      'mysqli',
    1.16  );
    1.17 @@ -633,7 +626,7 @@
    1.18   * @param tabs integer[optional] number of tabs for indentation
    1.19   */
    1.20  function print_class (ReflectionClass $classRef, $tabs = 0) {
    1.21 -	global $processedClasses, $preferHtmlProperties, $methodBlackList;
    1.22 +	global $processedClasses, $preferHtmlProperties;
    1.23  	$processedClasses [strtolower($classRef->getName())] = true;
    1.24  
    1.25  	print "\n";
    1.26 @@ -715,10 +708,6 @@
    1.27  	$methodsRef = $classRef->getMethods();
    1.28  	if (count ($methodsRef) > 0) {
    1.29  		foreach ($methodsRef as $methodRef) {
    1.30 -            /* @var $methodRef ReflectionMethod */
    1.31 -            if (in_array(strtolower($methodRef->getName()), $methodBlackList)) {
    1.32 -                continue;
    1.33 -            }
    1.34  			print_method($classRef, $methodRef, $tabs + 1);
    1.35  		}
    1.36  		print "\n";
    1.37 @@ -1056,7 +1045,6 @@
    1.38  	global $functionsDoc;
    1.39  	global $classesDoc;
    1.40          global $fieldsDoc;
    1.41 -        global $methodBlackList;
    1.42  
    1.43  	$docComment = $ref->getDocComment();
    1.44  	if ($docComment) {
    1.45 @@ -1076,9 +1064,7 @@
    1.46  			}
    1.47                          // @method
    1.48                          foreach ($ref->getMethods() as $method) {
    1.49 -                            if (in_array(strtolower($method->getName()), $methodBlackList)) {
    1.50 -                                print_magic_method($ref, $method, $tabs);
    1.51 -                            }
    1.52 +                            print_magic_method($ref, $method, $tabs);
    1.53                          }
    1.54  			if (@$classesDoc[$refname]['id']) {
    1.55  				print_Tabs ($tabs);