getChecks() public method

public getChecks ( $property ) : array
$property
return array
コード例 #1
0
ファイル: ClassGenerator.php プロジェクト: garethp/php-ews
 protected function handleEnumeration(Generator\ClassGenerator $class, PHPClass $type)
 {
     if ($type->getChecks('__value') && isset($type->getChecks('__value')['enumeration'])) {
         $enums = $type->getChecks('__value')['enumeration'];
         foreach ($enums as $enum) {
             $name = $enum['value'];
             $name = preg_replace("~([a-z])([A-Z])~", "\$1_\$2", $name);
             $name = preg_replace("~([a-z])([0-9])~", "\$1_\$2", $name);
             $name = strtoupper($name);
             $name = str_replace(':', '_', $name);
             switch ($name) {
                 case "DEFAULT":
                 case "PRIVATE":
                 case "EMPTY":
                     $name .= "_CONSTANT";
                     break;
             }
             $value = $enum['value'];
             if (!$class->hasConstant($name)) {
                 $class->addConstant($name, $value);
             }
         }
     }
 }
コード例 #2
0
ファイル: ClassGenerator.php プロジェクト: jchoi926/php-ews
 protected function handleEnumeration(Generator\ClassGenerator $class, PHPClass $type)
 {
     if ($type->getChecks('__value') && isset($type->getChecks('__value')['enumeration'])) {
         $enums = $type->getChecks('__value')['enumeration'];
         foreach ($enums as $enum) {
             $name = strtoupper($enum['value']);
             $value = strtoupper($enum['value']);
             if (!$class->hasConstant($name)) {
                 $class->addConstant($name, $value);
             }
         }
     }
 }