<commit_before><?php

namespace Rhubarb\Scaffolds\Communications\EmailProviders;

use Rhubarb\Crown\Sendables\Email\Email;
use Rhubarb\Crown\Sendables\Email\EmailProvider;
use Rhubarb\Crown\Sendables\Sendable;
use Rhubarb\Scaffolds\Communications\CaptureToCommunciationsProcessorInterface;
use Rhubarb\Scaffolds\Communications\CommunicationPackages\CommunicationPackage;

class CommunicationEmailProvider extends EmailProvider implements CaptureToCommunciationsProcessorInterface
{
    public function send(Sendable $email)
    {
        /**
         * @var Email $email
         */
        $package = new CommunicationPackage();
        $package->addSendable($email);
        $package->title = $email->getSubject();
        $package->send();
    }
}<commit_msg>CommunicationEmailProvider::send() now returns the communication created.<commit_after><?php

namespace Rhubarb\Scaffolds\Communications\EmailProviders;

use Rhubarb\Crown\Sendables\Email\Email;
use Rhubarb\Crown\Sendables\Email\EmailProvider;
use Rhubarb\Crown\Sendables\Sendable;
use Rhubarb\Scaffolds\Communications\CaptureToCommunciationsProcessorInterface;
use Rhubarb\Scaffolds\Communications\CommunicationPackages\CommunicationPackage;

class CommunicationEmailProvider extends EmailProvider implements CaptureToCommunciationsProcessorInterface
{
    public function send(Sendable $email)
    {
        /**
         * @var Email $email
         */
        $package = new CommunicationPackage();
        $package->addSendable($email);
        $package->title = $email->getSubject();

        return $package->send();
    }
}
{'fraction_non_alphanumeric': 0.09736180904522614, 'fraction_numerical': 0.0, 'mean_word_length': 4.474226804123711, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '523214', 'n_tokens_mistral': 453, 'n_tokens_neox': 437, 'n_words': 72}