@param string $fqcn
@return ProxyInterface

@throws MockNotCreatedException
@throws InvalidArgumentException
@throws \ReflectionException
331943
public function get(string $fqcn): ProxyInterface
    {
        $mock = $this->mockingStrategy->build($fqcn);
        $mockFQCN = \get_class($this->mockingStrategy->get($mock));
        $mockClass = new \ReflectionClass($mockFQCN);

        $proxyCode = ClassTemplate::generate($mockClass);
        $proxyFQCN = eval($proxyCode);

        return $this->getInstance($proxyFQCN)
            ->__moka_setMock($mock)
            ->__moka_setMockingStrategy($this->mockingStrategy);
    }
98491
public function getProxy(string $fqcnOrAlias, string $alias = null): ProxyInterface
    {
        if ($this->container->has($fqcnOrAlias)) {
            return $this->container->get($fqcnOrAlias);
        }

        if (null === $alias) {
            return $this->buildProxy($fqcnOrAlias);
        }

        if (!$this->container->has($alias)) {
            $this->container->set($alias, $this->buildProxy($fqcnOrAlias));
        }

        return $this->container->get($alias);
    }
9207
final public function instanceof(string $fqcn): InstanceofConfigurator
    {
        $this->instanceof[$fqcn] = $definition = new ChildDefinition('');

        return new InstanceofConfigurator($this, $definition, $fqcn, $this->path);
    }
1064844
private static function getProxy(string $name, array $arguments): ProxyInterface
    {
        self::ensurePluginLoad($name);

        $fqcnOrAlias = $arguments[0];
        $alias = $arguments[1] ?? null;

        return ProxyBuilderFactory::get(self::$mockingStrategies[$name])
            ->getProxy($fqcnOrAlias, $alias);
    }
1203014
public function makeFor(FqcnCollection $fqcnCollection, $classname)
    {
        $namespaceVisitor = new NamespaceVisitor($fqcnCollection);
        $forClassnameVisitor = new ForClassnameVisitor($fqcnCollection, $classname);
        $forParser = new Parser();
        $forParser->addVisitor($namespaceVisitor);
        $forParser->addVisitor($forClassnameVisitor);

        return $forParser;
    }
234791
private final static function getInstance($fqcn, $name)
    {
        $instances = self::getInstances($fqcn);

        if (!isset($instances[$name])) {
            return null;
        } else {
            return $instances[$name];
        }
    }
577241
public static function createFromIni(): CookieInterface
    {
        $params = session_get_cookie_params();

        return (new static())
            ->withLifetime($params["lifetime"])
            ->withPath($params["path"])
            ->withDomain($params["domain"])
            ->withSecure($params["secure"])
            ->withHttpOnly($params["httponly"]);
    }
468237
public function createUnsubscribeContext(
        $eventFqcn,
        UnsubscribeOptions $options,
        PipelineStageContext $parentContext
    ) {
        return new UnsubscribeContext($eventFqcn, $options, $parentContext);
    }
586002
protected function splitFullQualifyClassName($fqcn)
    {
        $parts = explode('\\', $fqcn);
        $classname = array_pop($parts);
        return [implode('\\', $parts), $classname];
    }
1008719
public function createFactoryForEntity(string $entityFqn)
    {
        $this->assertEntityManagerSet();
        $factoryFqn = $this->namespaceHelper->getFactoryFqnFromEntityFqn($entityFqn);

        return new $factoryFqn($this, $this->entityManager);
    }
274598
public static function prophecy(string $fqcnOrAlias, string $alias = null): ProxyInterface
    {
        /** @var ProxyInterface|ProxyTrait $proxy */
        $proxy = self::getProxy('prophecy', [$fqcnOrAlias, $alias]);

        if (null !== $testCase = self::getCurrentTestCase()) {
            $prophetProperty = new \ReflectionProperty(
                TestCase::class,
                'prophet'
            );

            $prophetProperty->setAccessible(true);
            if (null === $prophet = $prophetProperty->getValue($testCase)) {
                $prophet = new Prophet();
                $prophetProperty->setValue($testCase, $prophet);
            }

            $propheciesProperty = new \ReflectionProperty(
                Prophet::class,
                'prophecies'
            );
            $propheciesProperty->setAccessible(true);

            /** @var ObjectProphecy[] $prophecies */
            $prophecies = $propheciesProperty->getValue($prophet) ?: [];
            $prophecies[] = $proxy->__moka_getMock();

            $propheciesProperty->setValue($prophet, $prophecies);
        }

        return $proxy;
    }
723672
private function classExists( $fqcn )
	{
		if ( isset( $this->classExists[$fqcn] ) )
			return $this->classExists[$fqcn];

		// first check if the class already exists, maybe loaded through another AnnotationReader
		if ( class_exists( $fqcn ) )
			return $this->classExists[$fqcn] = true;

		return false;
	}
1047144
public function createQueue(AMQPChannel $channel, RabbitMqOptionTransfer $queueOptionTransfer)
    {
        $queueParams = $this->convertTransferToArray($queueOptionTransfer);

        $channel
            ->queue_declare(
                $queueParams['queue_name'],
                $queueParams['passive'],
                $queueParams['durable'],
                $queueParams['exclusive'],
                $queueParams['auto_delete'],
                $queueParams['no_wait'],
                new AMQPTable($queueParams['arguments'])
            );

        return $queueParams;
    }
1178831
public function createDefinitionFromNode(Node $node, string $fqn = null): Definition
    {
        $def = new Definition;
        $def->fqn = $fqn;

        // Determines whether the suggestion will show after "new"
        $def->canBeInstantiated = (
            $node instanceof Node\Statement\ClassDeclaration &&
            // check whether it is not an abstract class
            ($node->abstractOrFinalModifier === null || $node->abstractOrFinalModifier->kind !== PhpParser\TokenKind::AbstractKeyword)
        );

        // Interfaces, classes, traits, namespaces, functions, and global const elements
        $def->isMember = !(
            $node instanceof PhpParser\ClassLike ||

            ($node instanceof Node\Statement\NamespaceDefinition && $node->name !== null) ||

            $node instanceof Node\Statement\FunctionDeclaration ||

            ($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
        );

        // Definition is affected by global namespace fallback if it is a global constant or a global function
        $def->roamed = (
            $fqn !== null
            && strpos($fqn, '\\') === false
            && (
                ($node instanceof Node\ConstElement && $node->parent->parent instanceof Node\Statement\ConstDeclaration)
                || $node instanceof Node\Statement\FunctionDeclaration
            )
        );

        // Static methods and static property declarations
        $def->isStatic = (
            ($node instanceof Node\MethodDeclaration && $node->isStatic()) ||

            (($propertyDeclaration = ParserHelpers\tryGetPropertyDeclaration($node)) !== null
            && $propertyDeclaration->isStatic())
        );

        if ($node instanceof Node\Statement\ClassDeclaration &&
            // TODO - this should be better represented in the parser API
            $node->classBaseClause !== null && $node->classBaseClause->baseClass !== null) {
            $def->extends = [(string)$node->classBaseClause->baseClass->getResolvedName()];
        } elseif (
            $node instanceof Node\Statement\InterfaceDeclaration &&
            // TODO - this should be better represented in the parser API
            $node->interfaceBaseClause !== null && $node->interfaceBaseClause->interfaceNameList !== null
        ) {
            $def->extends = [];
            foreach ($node->interfaceBaseClause->interfaceNameList->getValues() as $n) {
                $def->extends[] = (string)$n->getResolvedName();
            }
        }

        $def->symbolInformation = SymbolInformationFactory::fromNode($node, $fqn);

        if ($def->symbolInformation !== null) {
            $def->type = $this->getTypeFromNode($node);
            $def->declarationLine = $this->getDeclarationLineFromNode($node);
            $def->documentation = $this->getDocumentationFromNode($node);
        }

        if ($node instanceof FunctionLike) {
            $def->signatureInformation = $this->signatureInformationFactory->create($node);
        }

        return $def;
    }
659652
public function build(string $fqcn)
    {
        try {
            return $this->doBuild($fqcn);
        } catch (\Throwable $exception) {
            throw new MockNotCreatedException(
                sprintf(
                    'Cannot create mock object for FQCN "%s": %s',
                    $fqcn,
                    $exception->getMessage()
                )
            );
        }
    }
1001836
public function createSubscribeContext($eventFqcn, SubscribeOptions $options, PipelineStageContext $parentContext)
    {
        return new SubscribeContext($eventFqcn, $options, $parentContext);
    }
1263718
private function produceQueueInstance($queueName)
    {
        if (isset($this->declaredQueueInstances[$queueName])) {
            return $this->declaredQueueInstances[$queueName];
        }

        if (isset($this->usedQueueInstances[$queueName])) {
            return $this->usedQueueInstances[$queueName];
        }

        $this->ensureChannel();
        $queue = new AMQPQueue($this->channel);
        $queue->setName($queueName);
        $this->usedQueueInstances[$queueName] = $queue;
        return $queue;
    }