<commit_before><?php

namespace SocialMedia\Core\Objects;

/*
 * This file is part of the Social Pushing from <NAME>.
 *
 * For the full copyright and license information, please view the license
 * file that was distributed with this source code.
 */

use SocialMedia\Core\Objects\TimelineResult as TimelineResult;

/**
 * Timeline we use to (un)publish messages to.
 *
 * @author <NAME> <<EMAIL>>
 */
class Timeline
{
    const ACTION_PUBLISH = 'Publish';
    const ACTION_UNPUBLISH = 'Unpublish';

    /**
     * Publish to social media service
     *
     * @param Service $service
     * @param Post $post
     * @return TimelineResult $result
     */
    public function publish(Service $service, Post $post)
    {
        return new TimelineResult()
            ->setServiceName($service->getName())
            ->setAction(self::ACTION_PUBLISH)
            ->setPost($post)
            ->execute($service)
        ;
    }

    /**
     * Unpublish from social media service
     *
     * @param Service $service
     * @param Post $post
     * @return TimelineResult $result
     */
    public function unpublish(Service $service, Post $post)
    {
        return new TimelineResult()
            ->setServiceName($service->getName())
            ->setAction(self::ACTION_UNPUBLISH)
            ->setPost($post)
            ->execute()
        ;
    }
}<commit_msg>Timeline uses new TimelineResult<commit_after><?php

namespace SocialMedia\Core\Objects;

/*
 * This file is part of the Social Pushing from <NAME>.
 *
 * For the full copyright and license information, please view the license
 * file that was distributed with this source code.
 */

use SocialMedia\Core\Objects\TimelineResult as TimelineResult;

/**
 * Timeline we use to (un)publish messages to.
 *
 * @author <NAME> <<EMAIL>>
 */
class Timeline
{
    const ACTION_PUBLISH = 'Publish';
    const ACTION_UNPUBLISH = 'Unpublish';

    /**
     * Publish to social media service
     *
     * @param Service $service
     * @param Post $post
     * @return TimelineResult $result
     */
    public function publish(Service $service, Post $post)
    {
        $item = new TimelineResult();
        $item->setServiceName($service->getName());
        $item->setActionName(self::ACTION_PUBLISH);
        $item->setPost($post);
        $item->execute($service);

        return $item;
    }

    /**
     * Unpublish from social media service
     *
     * @param Service $service
     * @param Post $post
     * @return TimelineResult $result
     */
    public function unpublish(Service $service, Post $post)
    {
        $item = new TimelineResult();
        $item->setServiceName($service->getName());
        $item->setActionName(self::ACTION_UNPUBLISH);
        $item->setPost($post);
        $item->execute($service);

        return $item;
    }
}
{'fraction_non_alphanumeric': 0.11779271312345242, 'fraction_numerical': 0.0, 'mean_word_length': 2.535, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, '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': '2453810', 'n_tokens_mistral': 811, 'n_tokens_neox': 791, 'n_words': 223}