Create swift message when Email is not found.

@param string $reference
@return ReferenceNotFoundMessage
170238
protected function generateExceptionMessage($reference)
    {
        $traces = debug_backtrace(false);

        $file = null;
        $line = null;

        foreach ($traces as $trace) {
            if (isset($trace['function']) && $trace['function'] == 'get' && isset($trace['class']) && $trace['class'] == __CLASS__) {
                $file = $trace['file'];
                $line = $trace['line'];
                break;
            }
        }

        $message = new ReferenceNotFoundMessage($reference, $file, $line);
        $message->setFrom($this->options['admin_email']);
        $message->setTo($this->options['admin_email']);

        return $message;
    }
805952
private function resolveSchema($reference)
    {
        $schema = $reference;
        if (property_exists($reference, '$ref')) {
            $schemaResolver = $this->document->getSchemaResolver();
            $ref = new Reference($reference);
            $schema = $schemaResolver->resolveReference($ref)->getDocument();
        } elseif ($reference->type === 'array' && !empty($reference->items)) {
            $schema->items = $this->resolveSchema($reference->items);
        }

        // resolve properties
        if (!empty($schema->properties)) {
            $properties = (array) $schema->properties;
            foreach ($properties as $name => $property) {
                if (isset($property->type)
                    && $property->type === 'array'
                    && isset($property->items)
                    && property_exists($property->items, '$ref')
                    && !isset($schema->properties->$name->items)) {
                    $schema->properties->$name->items = $this->resolveSchema($property->items);
                } elseif (property_exists($property, '$ref') && !isset($schema->properties->$name)) {
                    $schema->properties->$name = $this->resolveSchema($property);
                }
            }
        }

        return $schema;
    }
410091
protected function createNotFoundException(string $message = 'Not Found', \Exception $previous = null): NotFoundHttpException
    {
        return new NotFoundHttpException($message, $previous);
    }
1109731
public function findByReference($reference)
    {
        $qb = $this
            ->createQueryBuilder('e')
            ->where('e.reference = :reference')
            ->setParameter('reference', $reference);

        return $qb
            ->getQuery()
            ->getArrayResult();
    }
303192
protected function renderReference($reference)
    {
        if (!isset($this->settings['commandReferences'][$reference])) {
            $this->outputLine('Command reference "%s" is not configured', [$reference]);
            $this->quit(1);
        }
        $referenceConfiguration = $this->settings['commandReferences'][$reference];
        $packageKeysToRender = $referenceConfiguration['packageKeys'];
        array_walk($packageKeysToRender, function (&$packageKey) {
            $packageKey = strtolower($packageKey);
        });

        $availableCommands = $this->commandManager->getAvailableCommands();
        $commandsByPackagesAndControllers = $this->buildCommandsIndex($availableCommands);

        $allCommandsByPackageKey = [];
        foreach ($commandsByPackagesAndControllers as $packageKey => $commandControllers) {
            if (!in_array($packageKey, $packageKeysToRender)) {
                $this->outputLine('Skipping package "%s"', [$packageKey]);
                continue;
            }
            $allCommands = [];
            foreach ($commandControllers as $commands) {
                foreach ($commands as $command) {

                    $argumentDescriptions = [];
                    $optionDescriptions = [];

                    foreach ($command->getArgumentDefinitions() as $commandArgumentDefinition) {
                        $argumentDescription = $commandArgumentDefinition->getDescription();
                        if ($commandArgumentDefinition->isRequired()) {
                            $argumentDescriptions[$commandArgumentDefinition->getDashedName()] = $argumentDescription;
                        } else {
                            $optionDescriptions[$commandArgumentDefinition->getDashedName()] = $argumentDescription;
                        }
                    }

                    $relatedCommands = [];
                    $relatedCommandIdentifiers = $command->getRelatedCommandIdentifiers();
                    foreach ($relatedCommandIdentifiers as $relatedCommandIdentifier) {
                        try {
                            $relatedCommand = $this->commandManager->getCommandByIdentifier($relatedCommandIdentifier);
                            $relatedCommands[$relatedCommandIdentifier] = $relatedCommand->getShortDescription();
                        } catch (\Neos\Flow\Mvc\Exception\CommandException $exception) {
                            $relatedCommands[$relatedCommandIdentifier] = '*Command not available*';
                        }
                    }

                    $allCommands[$command->getCommandIdentifier()] = [
                        'identifier' => $command->getCommandIdentifier(),
                        'shortDescription' => $command->getShortDescription(),
                        'description' => $this->transformMarkup($command->getDescription()),
                        'options' => $optionDescriptions,
                        'arguments' => $argumentDescriptions,
                        'relatedCommands' => $relatedCommands
                    ];
                }
            }
            ksort($allCommands);
            $allCommandsByPackageKey[strtoupper($packageKey)] = $allCommands;
        }
        ksort($allCommandsByPackageKey);

        $standaloneView = new \Neos\FluidAdaptor\View\StandaloneView();
        $templatePathAndFilename = isset($settings['templatePathAndFilename']) ? $this->settings['commandReference']['templatePathAndFilename'] : 'resource://Neos.DocTools/Private/Templates/CommandReferenceTemplate.txt';
        $standaloneView->setTemplatePathAndFilename($templatePathAndFilename);
        $standaloneView->assign('title', isset($referenceConfiguration['title']) ? $referenceConfiguration['title'] : $reference);
        $standaloneView->assign('allCommandsByPackageKey', $allCommandsByPackageKey);
        file_put_contents($referenceConfiguration['savePathAndFilename'], $standaloneView->render());
        $this->outputLine('DONE.');
    }
455949
public static function factoryReference($reference) {
    $className = $reference[2];
    if (!class_exists($className)) {
      throw new Exceptions\EntityClassNotFoundException(
          "factoryReference called for a class that can't be found, $className."
      );
    }
    $entity = call_user_func([$className, 'factory']);
    $entity->referenceSleep($reference);
    return $entity;
  }
345602
public function createMessage() {
		$prefs = $this->getPreferenceLoader()->getSystemPreferences();

		$message = new Swift_Message();
		$sender = $prefs->getPlattformEmail();
		if (!empty($sender)) {
			$message->setFrom($prefs->getPlattformEmail(), $prefs->getPlattformName());
		}

		return $message;
	}
347997
public function getMessage($key) {
        return $this->cache([__METHOD__, $key], function(GettextTranslator $translator) use ($key) {
            list($domain, $catalog, $id) = $translator->parseKey($key);

            $translator->bindDomains($domain, $catalog);

            textdomain($catalog);

            $message = gettext($id);

            if ($message !== $id) {
                return $message;
            }

            throw new MissingMessageException(sprintf('Message key %s does not exist in %s', $key, Locale::DEFAULT_LOCALE));
        });
    }
733185
protected function generateKey($reference)/*# : string */
    {
        if (is_array($reference)) {
            $reference = $this->flatReference($reference);
        }
        $md5 = md5(serialize($reference));
        return sprintf("/%s/%s/%s", $md5[0], $md5[1], $md5);
    }
1064970
protected function createMessageInstance()
    {
        $hasSigner = $this->signer->hasSigner();
        $class     = $hasSigner ? '\Swift_SignedMessage' : '\Swift_Message';

        $message = new $class();

        if ($hasSigner) {
            $message->attachSigner($this->signer->createSigner());
        }

        return $message;
    }
1060618
public function cancel($reference = null, $subscriptionId = null)
    {
        if ($reference) {
          $this->setParameter('REFERENCE', $reference);
        }

        if ($subscriptionId) {
          $this->setParameter('ABONNEMENT', $subscriptionId);
        }

        $this->transport->setEndpoint($this->getUrl());

        return $this->transport->call($this);
    }
772688
function it_should_replace_input_message_references_by_reference_html_link($reference1, $reference2) {
        $reference1->getStartIndice()->willReturn(5);
        $reference1->getEndIndice()->willReturn(10);
        $reference1->getType()->willReturn(ReferenceType::USER);
        $reference1->getData()->willReturn(array(
            "id"          => 6844292,
            "name"        => "John Doe",
            "type"        => "user",
            "offset"      => 5,
            "length"      => 5
        ));

        $reference2->getStartIndice()->willReturn(12);
        $reference2->getEndIndice()->willReturn(17);
        $reference2->getType()->willReturn(ReferenceType::PAGE);
        $reference2->getData()->willReturn(array(
            "id"          => 32425,
            "name"        => "test",
            "type"        => "page",
            "offset"      => 5,
            "length"      => 5
        ));

        $this->format('test @jdoe, @test bar', [$reference2, $reference1])
            ->shouldReturn('test <a href="https://www.facebook.com/6844292" target="_blank">@jdoe</a>, <a href="https://www.facebook.com/32425" target="_blank">@test</a> bar');

        $this->format('foo #média bar', [])
            ->shouldReturn('foo <a href="https://www.facebook.com/hashtag/média" target="_blank">#média</a> bar');

        $this->format('foo http://test.com bar', [])
            ->shouldReturn('foo <a href="http://test.com" target="_blank">http://test.com</a> bar');
    }
503522
protected function flatReference(array $reference)/*# : array */
    {
        reset($reference);
        foreach ($reference as $key => $value) {
            if (is_object($value)) {
                $reference[$key] = get_class($value);
            } elseif (is_array($value)) {
                $reference[$key] = $this->flatReference($value);
            }
        }
        ksort($reference);
        return $reference;
    }
412557
private function parseRefAsTag($reference): ?string
    {
        if (preg_match(self::REGEX_TAG, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[1];
    }
736925
function reportReference(reference) {
            const name = reference.identifier.name,
                customMessage = restrictedGlobalMessages[name],
                message = customMessage
                    ? CUSTOM_MESSAGE_TEMPLATE
                    : DEFAULT_MESSAGE_TEMPLATE;

            context.report({
                node: reference.identifier,
                message,
                data: {
                    name,
                    customMessage
                }
            });
        }
1043289
public function describeMachineReference($reference, $field = null)
	{
		if ($field === null) {
			return @ $this->references[$reference];
		} else {
			return @ $this->references[$reference][$field];
		}
	}
802916
private function convertObjectReference($reference)
    {
        if ($reference instanceof AbstractTable) {
            return $reference->getAliasOrName();
        } elseif ($reference instanceof BuilderInterface) {
            return $reference->buildSQL();
        } elseif ($reference instanceof RelativeClause) {
            $table = $this->convertObjectReference($reference->getRelatedTable());
            $clause = $this->convertObjectReference($reference->getClause());

            return str_replace($reference->getDirective(), $table . '.', $clause);
        }

        return $reference;
    }