Exemplo n.º 1
0
 function testNameCanBeCaseInsensitiveQueried()
 {
     $tag = new T_Code_DocBlockTag('author', 'Rob');
     $this->assertTrue($tag->is('author'));
     $this->assertTrue($tag->is('AuThoR'));
     $this->assertFalse($tag->is('param'));
 }
Exemplo n.º 2
0
 /**
  * Create tag.
  *
  * @param string $name
  * @param string $type e.g. string, string[] is an array of strings
  * @param string $desc
  */
 function __construct($name, $type, $desc)
 {
     parent::__construct($name, $desc);
     $this->is_array = substr($type, strlen($type) - 2) === '[]';
     if ($this->is_array) {
         $this->type = substr($type, 0, strlen($type) - 2);
     } else {
         if ($type === 'array') {
             $this->is_array = true;
             $this->type = null;
         } else {
             $this->type = $type;
         }
     }
 }