Commit cb8100d7 by Carsten Brandt

improved apidoc property detection

do not allow empty property name fixes #3297
parent 353cf891
...@@ -192,7 +192,6 @@ class Context extends Component ...@@ -192,7 +192,6 @@ class Context extends Component
return $this->inheritMethodRecursive($method, $parent); return $this->inheritMethodRecursive($method, $parent);
} }
} }
return $method; return $method;
} }
...@@ -209,7 +208,7 @@ class Context extends Component ...@@ -209,7 +208,7 @@ class Context extends Component
if ($method->isStatic) { if ($method->isStatic) {
continue; continue;
} }
if (!strncmp($name, 'get', 3) && $this->paramsOptional($method)) { if (!strncmp($name, 'get', 3) && strlen($name) > 3 && $this->paramsOptional($method)) {
$propertyName = '$' . lcfirst(substr($method->name, 3)); $propertyName = '$' . lcfirst(substr($method->name, 3));
if (isset($class->properties[$propertyName])) { if (isset($class->properties[$propertyName])) {
$property = $class->properties[$propertyName]; $property = $class->properties[$propertyName];
...@@ -238,7 +237,7 @@ class Context extends Component ...@@ -238,7 +237,7 @@ class Context extends Component
]); ]);
} }
} }
if (!strncmp($name, 'set', 3) && $this->paramsOptional($method, 1)) { if (!strncmp($name, 'set', 3) && strlen($name) > 3 && $this->paramsOptional($method, 1)) {
$propertyName = '$' . lcfirst(substr($method->name, 3)); $propertyName = '$' . lcfirst(substr($method->name, 3));
if (isset($class->properties[$propertyName])) { if (isset($class->properties[$propertyName])) {
$property = $class->properties[$propertyName]; $property = $class->properties[$propertyName];
...@@ -282,7 +281,6 @@ class Context extends Component ...@@ -282,7 +281,6 @@ class Context extends Component
return false; return false;
} }
} }
return true; return true;
} }
...@@ -297,7 +295,6 @@ class Context extends Component ...@@ -297,7 +295,6 @@ class Context extends Component
return $param; return $param;
} }
} }
return null; return null;
} }
...@@ -320,7 +317,6 @@ class Context extends Component ...@@ -320,7 +317,6 @@ class Context extends Component
return true; return true;
} }
} }
return false; return false;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment