Converts a FQCN to a exchange name.
Eg. \Some\Namespaced\Class -> Some.Namespaced:Class

@param string $messageFqcn

@return string
555034
private function getEventExchangeName($messageFqcn)
    {
        $messageFqcn = trim($messageFqcn, '\\');
        $pos = strrpos($messageFqcn, '\\');
        if ($pos !== false) {
            $messageFqcn = substr_replace($messageFqcn, ':', $pos, 1);
        }
        return str_replace('\\', '.', $messageFqcn);
    }
510923
private function produceExchangeInstance($exchangeName)
    {
        if (isset($this->declaredExchangeInstances[$exchangeName])) {
            return $this->declaredExchangeInstances[$exchangeName];
        }

        if (isset($this->usedExchangeInstances[$exchangeName])) {
            return $this->usedExchangeInstances[$exchangeName];
        }

        $this->ensureChannel();
        $exchange = new AMQPExchange($this->channel);
        $exchange->setName($exchangeName);
        $this->usedExchangeInstances[$exchangeName] = $exchange;
        return $exchange;
    }
983527
function contractQname($qname){
		// get element namespace
		//$this->xdebug("Contract $qname");
		if (strrpos($qname, ':')) {
			// get unqualified name
			$name = substr($qname, strrpos($qname, ':') + 1);
			// get ns
			$ns = substr($qname, 0, strrpos($qname, ':'));
			$p = $this->getPrefixFromNamespace($ns);
			if ($p) {
				return $p . ':' . $name;
			}
			return $qname;
		} else {
			return $qname;
		}
	}
58113
public function getHasPluralInterfaceFqnForEntity(
        string $entityFqn
    ): string {
        $interfaceNamespace = $this->getInterfacesNamespaceForEntity($entityFqn);

        return $interfaceNamespace . '\\Has' . ucfirst($entityFqn::getDoctrineStaticMeta()->getPlural()) . 'Interface';
    }
638537
public function getChainFor($fqcn)
    {
        if (!isset($this->chains[$fqcn])) {
            $this->chains[$fqcn] = new FilterChain();
        }

        return $this->chains[$fqcn];
    }
545608
public function getReciprocatedHasName(
        string $ownedEntityFqn,
        string $srcOrTestSubFolder,
        string $projectRootNamespace
    ): string {
        $parsedFqn = $this->parseFullyQualifiedName(
            $ownedEntityFqn,
            $srcOrTestSubFolder,
            $projectRootNamespace
        );

        $subDirectories = $parsedFqn[2];

        return $this->getSingularNamespacedName($ownedEntityFqn, $subDirectories);
    }
557475
public function getName()
    {
        $fqdnClassName = get_class($this);
        $className = substr($fqdnClassName, strrpos($fqdnClassName, '\\') + 1);
        return str_replace("Service", "", $className);
    }
1183209
function getNamespace() {
    if (FALSE === $pos = strrpos($this->fqcnStr, '\\')) {
      return NULL;
    }
    $namespaceFqcnStr = substr($this->fqcnStr, 0, $pos);
    return self::createFromValidFqcnString($namespaceFqcnStr);
  }
1022068
private function getMessage(string $message): string
    {
        /** @var FormatterFactoryInterface $factory */
        $factory   = $this->getContainer()->get(FormatterFactoryInterface::class);
        $formatter = $factory->createFormatter(Messages::NAMESPACE_NAME);
        $result    = $formatter->formatMessage($message);

        return $result;
    }
375070
public function validateReflectionMethod($classFQN, $method)
    {
        if (null === $classFQN || null === $method) {
            return false;
        }

        try {
            $reflectionMethod = new \ReflectionMethod($classFQN, $method);
        } catch (\ReflectionException $re) {
            return new CoverFishMessageError(CoverFishMessageError::PHPUNIT_REFLECTION_METHOD_NOT_FOUND, $method);
        }

        return $reflectionMethod;
    }
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;
    }
987487
private final static function loadClass($fqcn)
    {
        $reflectionClass = new ReflectionClass($fqcn);
        $constants       = $reflectionClass->getConstants();

        foreach ($constants as $name => $value) {
            $instance = new $fqcn($fqcn, $name, $value);

            /* @var $instance Enum */
            if (is_callable([$instance, '__initEnum'])) {
                $instance->__initEnum();
            }

            $instanceConstructorName = '__' . $name;
            if (is_callable([$instance, $instanceConstructorName])) {
                $instance->$instanceConstructorName();
            }

            if (!isset(self::$instances[$fqcn])) {
                self::$instances[$fqcn] = [];
            }

            self::$instances[$fqcn][$name] = $instance;
        }
    }
232808
public function getEntity($fqcn)
    {
        $class = trim($fqcn, '.');

        if ( ! isset($this->entities[$class])) {
            throw new \LogicException("Unable to find class : $class");
        }

        return $this->entities[$class];
    }
95006
public function getTraitsNamespaceForEntity(
        string $entityFqn
    ): string {
        $traitsNamespace = $this->getProjectNamespaceRootFromEntityFqn($entityFqn)
                           . AbstractGenerator::ENTITY_RELATIONS_NAMESPACE
                           . '\\' . $this->getEntitySubNamespace($entityFqn)
                           . '\\Traits';

        return $traitsNamespace;
    }
43812
public function getFullName($className)
    {
        $isFunction = $this->currentMethod && $this->currentMethod instanceof FunctionDefinition;
        $namespace = $isFunction ? $this->currentMethod->getNamespace() : $this->classDefinition->getNamespace();

        return fqcn($className, $namespace, $this->aliasManager);
    }
363446
public static function fromQName( $qn )
	{
		$qname = new QNameValue();
		$qname->LocalName = $qn->localName;
		$qname->Prefix = $qn->prefix;
		$qname->NamespaceUri = $qn->namespaceURI;

		if ( strlen( $qn->localName ) == 0 ||
			 ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->localName ) ||
			 ( strlen( $qn->prefix ) != 0 && ! preg_match( "/^" . NameValue::$ncName . "$/u", $qn->prefix ) )
		)
		{
			throw XPath2Exception::withErrorCodeAndParam( "FOCA0002", Resources::FOCA0002, $qn->__toString() );
		}

		return $qname;
	}
1106106
public function getCompiledFilenameFromClassname($fqcn)
    {
        $filename = $this->templateCompileDirectory.'/'.$fqcn.'.php';
        $filename = str_replace('\\', '/', $filename);

        return $filename;
    }