Пример #1
0
 public function refinePropertyType(PhpClass $class, PhpProperty $property)
 {
     $name = $class->getName() . '::' . $property->getName();
     if (!isset(self::$refinedElements[$name]['type'])) {
         if ($this->shouldBeRefined($propertyType = $property->getAttributeOrElse('type', null))) {
             $this->nonRefinedElements[$name]['type'] = $propertyType;
             $this->logger->info(sprintf('The property "%s" is not refined, and has type "%s".', $name, $propertyType));
         }
     } else {
         $property->setAttribute('type', self::$refinedElements[$name]['type']);
     }
 }
Пример #2
0
 public function setProperty(PhpProperty $property)
 {
     $this->properties[$property->getName()] = $property;
     return $this;
 }