Symfony\Component\DependencyInjection\Definition::setSynthetic PHP Method

setSynthetic() public method

Sets whether this definition is synthetic, that is not constructed by the container, but dynamically injected.
public setSynthetic ( boolean $boolean ) : Definition
$boolean boolean
return Definition the current instance
    public function setSynthetic($boolean)
    {
        $this->synthetic = (bool) $boolean;

        return $this;
    }

Usage Example

 /**
  * Ensures that the creator returns null if a synthetic service is requested.
  */
 public function testCreatorReturnsNullIfSyntheticServiceIsRequested()
 {
     $definition = new Definition();
     $definition->setSynthetic(true);
     $this->container->setDefinition('my.service', $definition);
     $this->assertNull($this->creator->create('my.service'));
 }
All Usage Examples Of Symfony\Component\DependencyInjection\Definition::setSynthetic