/**
  * Get resource file.
  *
  * @param string $resource
  *
  * @return string
  */
 private function getResourceFile($resource)
 {
     $resource = $this->resolver->resolveString($resource);
     $resource = $this->getBundlePath($resource);
     if (file_exists($resource)) {
         return $resource;
     }
     return null;
 }
 /**
  * Compute value.
  *
  * @param string   $value
  * @param Resolver $resolver
  *
  * @return array|Reference|mixed
  */
 private function computeValue($value, Resolver $resolver)
 {
     if (is_string($value)) {
         if (0 === strrpos($value, '@')) {
             $value = new Reference(substr($value, 1));
         } else {
             $value = $resolver->unescapeValue($value);
         }
     } elseif (is_array($value)) {
         foreach ($value as $index => $val) {
             $value[$index] = $this->computeValue($val, $resolver);
         }
     }
     return $value;
 }
Ejemplo n.º 3
0
 /**
  * Set property to service.
  *
  * @param string $property
  * @param mixed  $value
  *
  * @return static
  */
 public function setProperty($property, $value)
 {
     $this->service->{$property} = $this->resolver->resolveValue($value);
     return $this;
 }