Ejemplo n.º 1
0
 public function testGetTagFromProperty()
 {
     $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'tagwithoutvalue'));
     $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'notatag'));
     $this->assertEmpty(AnnotationReader::getPropertyValue($this->class, $this->prop, 'nonexisting'));
     $this->assertEquals(AnnotationReader::getPropertyValue($this->class, $this->prop, 'tagwithvalue'), 'value');
 }
Ejemplo n.º 2
0
 /**
  * @param FieldFilter[] $filters
  * @return \Micmod\Param\Field[]
  */
 private function getFields(array $filters = array())
 {
     $fields = array();
     $class = get_class($this);
     $refl = new ReflectionClass($class);
     foreach (array_keys($refl->getDefaultProperties()) as $property) {
         $column = AnnotationReader::getPropertyValue($class, $property, 'column');
         if (!$column) {
             continue;
         }
         foreach ($filters as $filter) {
             if (!$filter->isValid($class, $property)) {
                 continue 2;
             }
         }
         $fields[] = new Field($property, $column, $this->{$property});
     }
     return $fields;
 }