<commit_before><?php

namespace AppBundle\Request;

use GuzzleHttp\Psr7\Request;
use Schema\City\City;
use Schema\Note\Note;

class NotifierRequest
{
    protected $client;
    protected $url;

    /**
     * TomitaRequest constructor.
     * @param Client $client
     * @param string $url
     */
    public function __construct(Client $client, string $url)
    {
        $this->client = $client;
        $this->url    = $url;
    }

    /**
     * @param Note $note
     * @return mixed|\Psr\Http\Message\ResponseInterface
     */
    public function notify(City $city, Note $note)
    {
        $photos = [];
        foreach ($note->getPhotos() as $photo) {
            $photos[] = $photo->getHigh();
        }

        $body = [
            'description' => $note->getDescription(),
            'subways'     => $note->getSubways(),
            'price'       => $note->getPrice(),
            'type'        => $note->getType(),
            'link'        => $note->getLink(),
            'photos'      => $photos,
            'city'        => $city->getId(),
            'contact'     => $note->getContact(),
        ];

        return $this->client->send(new Request('POST', $this->url . '/notify'), ['body' => json_encode($body)]);
    }
}<commit_msg>notification strong type<commit_after><?php

namespace AppBundle\Request;

use GuzzleHttp\Psr7\Request;
use Schema\City\City;
use Schema\Note\Note;

class NotifierRequest
{
    protected $client;
    protected $url;

    /**
     * TomitaRequest constructor.
     * @param Client $client
     * @param string $url
     */
    public function __construct(Client $client, string $url)
    {
        $this->client = $client;
        $this->url    = $url;
    }

    /**
     * @param Note $note
     * @return mixed|\Psr\Http\Message\ResponseInterface
     */
    public function notify(City $city, Note $note)
    {
        $photos = [];
        foreach ($note->getPhotos() as $photo) {
            $photos[] = $photo->getHigh();
        }

        $subways = [];
        foreach ($note->getSubways() as $subway) {
            $subways[] = (int)$subway;
        }

        $body = [
            'description' => $note->getDescription(),
            'subways'     => $subways,
            'price'       => (int)$note->getPrice(),
            'type'        => (int)$note->getType(),
            'link'        => $note->getLink(),
            'photos'      => $photos,
            'city'        => (int)$city->getId(),
            'contact'     => $note->getContact(),
        ];

        return $this->client->send(new Request('POST', $this->url . '/notify'), ['body' => json_encode($body)]);
    }
}
{'fraction_non_alphanumeric': 0.1692423671315492, 'fraction_numerical': 0.0007538635506973238, 'mean_word_length': 1.8599137931034482, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, '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': '120309', 'n_tokens_mistral': 802, 'n_tokens_neox': 787, 'n_words': 159}