src/PhpPackages/Container/Container.php
public function inject($instance)
    {
        $reflector = new ReflectionClass($instance);

        foreach ($reflector->getProperties() as $property) {
            /**
             * @var \ReflectionProperty $property
             */
            $block = new DocBlock($property);

            if ( ! $block->hasFlag("shouldBeInjected")) {
                continue;
            }

            if ( ! is_null($class = $block->getValue("var"))) {
                $property->setAccessible(true);
                $property->setValue($instance, $this->make($class));
            }
        }

        return $instance;
    }
public function inject($instance)
    {
        $reflector = new ReflectionClass($instance);

        foreach ($reflector->getProperties() as $property) {
            /**
             * @var \ReflectionProperty $property
             */
            $block = new DocBlock($property);

            if ( ! $block->hasFlag("shouldBeInjected")) {
                continue;
            }

            if ( ! is_null($class = $block->getValue("var"))) {
                $property->setAccessible(true);
                $property->setValue($instance, $this->make($class));
            }
        }

        return $instance;
    }
Looks for @shouldBeInjected flags in properties' annotations and injects @var values.

@param object $instance
@return object