/**
  * Return custom value.
  *
  * @return mixed
  */
 public function getValue()
 {
     $value = array_shift($this->stack);
     if ($value instanceof ReturnInterface) {
         return MethodManifest::extractValue($value, $this->arguments, $this->scope);
     } else {
         return $value;
     }
 }
示例#2
0
文件: Map.php 项目: komex/influence
 /**
  * Return custom value.
  *
  * @return mixed
  */
 public function getValue()
 {
     foreach ($this->map as $map) {
         if (!is_array($map) or $this->argumentsCount !== count($map) - 1) {
             continue;
         }
         $value = array_pop($map);
         if ($this->arguments === $map) {
             if ($value instanceof ReturnInterface) {
                 return MethodManifest::extractValue($value, $this->arguments, $this->scope);
             } else {
                 return $value;
             }
         }
     }
     return null;
 }
示例#3
0
 /**
  * Test reset method intercept with reset custom value in manifest.
  */
 public function testUseDefaultValue()
 {
     $manifest = new MethodManifest();
     $manifest->setValue();
     $this->assertFalse($manifest->hasValue());
     $this->assertNull($manifest->getValue([], null));
 }