You are here

private static function crumbs_Container_ContainerUtil::extractProperties in Crumbs, the Breadcrumbs suite 7.2

Parameters

string $classDocComment:

Return value

array

1 call to crumbs_Container_ContainerUtil::extractProperties()
crumbs_Container_ContainerUtil::getAllProperties in lib/Container/ContainerUtil.php
Initializes all lazy properties from the container and returns the array.

File

lib/Container/ContainerUtil.php, line 29

Class

crumbs_Container_ContainerUtil

Code

private static function extractProperties($classDocComment) {
  $identifier = '[a-zA-Z_][a-zA-Z0-9_]*';
  $namespaceFragment = '\\\\' . $identifier;
  $type = "{$identifier}({$namespaceFragment})*";
  $type = "({$type}|\\\\{$type})";
  $propertyNames = array();
  foreach (explode("\n", $classDocComment) as $docLine) {
    if (preg_match("#@property +{$type} +(\\\$|)({$identifier}) *\$#", $docLine, $m)) {
      $propertyNames[] = $m[5];
    }
  }
  return $propertyNames;
}