Esempio n. 1
0
 /** I'm just a annotation without something useful */
 function testNoContent()
 {
     $arr = getReflection(__METHOD__)->getAnnotations();
     $this->assertEquals($arr->toCache(), array());
     $raw = getReflection(__METHOD__)->getDocComment();
     Notoj::parseDocComment($raw, $isCached);
     $this->assertTrue($isCached);
 }
Esempio n. 2
0
 protected function __construct(TBase $object)
 {
     if (empty($object->annotations)) {
         $object->annotations = Notoj::parseDocComment($object->GetPHPDoc());
     }
     $this->object = $object;
     $this->annotations = $object->annotations;
     $this->annotations->setObject($this);
 }
Esempio n. 3
0
 public function defineProperty($annotation, $name)
 {
     $ann = Notoj::parseDocComment($annotation);
     $name = $name[0] == '$' ? $name : '$' . $name;
     $prop = new \crodas\ClassInfo\Definition\TProperty($name);
     $prop = \Notoj\Object\Base::create($prop, NULL);
     $this->properties[] = (new Property($this, $prop, true))->setParent($this);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function setCacheDir($cacheDir)
 {
     parent::setCacheDir($cacheDir);
     \Notoj\Notoj::enableCache($cacheDir . DIRECTORY_SEPARATOR . "_annotations.php");
 }
Esempio n. 5
0
 protected function generateIfNeeded()
 {
     if ($this->devel || !is_file($this->loader)) {
         Notoj::enableCache($this->loader . ".tmp");
         $watcher = new Watch($this->loader . ".lock");
         if ($watcher->hasChanged()) {
             new Generate($this, $watcher);
             $this->generate = true;
         }
     }
 }
Esempio n. 6
0
 protected function __construct(TBase $object, $localCache)
 {
     $this->object = $object;
     $this->annotations = Notoj::parseDocComment($object->GetPHPDoc(), $foo, $localCache);
     $this->annotations->setObject($this);
 }