/**
  * 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;
     }
 }
Beispiel #2
0
 /**
  * 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;
 }
Beispiel #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));
 }