Example #1
0
 /**
  * The magic sleep method is called by the PHP runtime environment before an
  * instance of this class gets serialized. It returns an array with the
  * names of all those properties that should be cached for this class or
  * interface instance.
  *
  * @return array
  */
 public function __sleep()
 {
     if (is_array($this->methods)) {
         $this->cache->type('methods')->store($this->uuid, $this->methods);
         $this->methods = null;
     }
     return array('cache', 'context', 'docComment', 'endLine', 'modifiers', 'name', 'nodes', 'packageName', 'startLine', 'userDefined', 'uuid');
 }
Example #2
0
 /**
  * Sets the tokens for this file.
  *
  * @param array(array) $tokens The generated tokens.
  *
  * @return void
  */
 public function setTokens(array $tokens)
 {
     return $this->cache->type('tokens')->store($this->getUUID(), $tokens);
 }
Example #3
0
 /**
  * Sets the tokens for this type.
  *
  * @param array(PHP_Depend_Token) $tokens The generated tokens.
  *
  * @return void
  */
 public function setTokens(array $tokens)
 {
     $this->startLine = reset($tokens)->startLine;
     $this->endLine = end($tokens)->endLine;
     $this->cache->type('tokens')->store($this->uuid, $tokens);
 }
 /**
  * Unloads the metrics cache and stores the current set of metrics in the
  * cache.
  *
  * @return void
  */
 protected function unloadCache()
 {
     $this->_cache->type('metrics')->store(get_class($this), $this->metrics);
     $this->_metricsCached = array();
 }