<commit_before><?php
/*
 * This file is part of the AlphaTraderApiBundle package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Alphatrader\ApiBundle\Api\Methods;

use Alphatrader\ApiBundle\Api\ApiClient;

/**
 * Class PostController
 *
 * @package AlphaTrader\API\Controller
 * @author  ljbergmann <<EMAIL>>
 */
class PostController extends ApiClient
{
    /**
     * @param $postId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function getPost($postId)
    {
        $data = $this->get('v2/posts/'.$postId);
        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function newPost($title, $content, $locale = null, $companyId = null)
    {
        $data = $this->post('v2/posts', [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function editPost($postId, $title, $content, $locale = null, $companyId = null)
    {
        $data = $this->put('v2/posts/'.$postId, [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\MessagePrototype
     */
    public function deletePost($postId)
    {
        $data = $this->delete('v2/posts/'.$postId);
        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\MessagePrototype');
    }

    /**
     * @param $postId
     * @param $page
     * @param $size
     * @param $sort
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function getPostComment($postId, $page, $size, $sort)
    {
        $data = $this->post('v2/posts/'.$postId.'/comments', [
            'page' => $page,
            'size' => $size,
            'sort' => $sort
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function newPostComment($postId, $title, $content, $locale = null, $companyId = null)
    {
        $data = $this->post('v2/posts/'.$postId.'/comments', [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

}
<commit_msg>psr 2<commit_after><?php
/*
 * This file is part of the AlphaTraderApiBundle package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace Alphatrader\ApiBundle\Api\Methods;

use Alphatrader\ApiBundle\Api\ApiClient;

/**
 * Class PostController
 *
 * @package AlphaTrader\API\Controller
 * @author  ljbergmann <<EMAIL>>
 */
class PostController extends ApiClient
{
    /**
     * @param $postId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function getPost($postId)
    {
        $data = $this->get('v2/posts/'.$postId);
        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function newPost($title, $content, $locale = null, $companyId = null)
    {
        $data = $this->post('v2/posts', [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function editPost($postId, $title, $content, $locale = null, $companyId = null)
    {
        $data = $this->put('v2/posts/'.$postId, [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\MessagePrototype
     */
    public function deletePost($postId)
    {
        $data = $this->delete('v2/posts/'.$postId);
        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\MessagePrototype');
    }

    /**
     * @param $postId
     * @param $page
     * @param $size
     * @param $sort
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function getPostComment($postId, $page, $size, $sort)
    {
        $data = $this->post('v2/posts/'.$postId.'/comments', [
            'page' => $page,
            'size' => $size,
            'sort' => $sort
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }

    /**
     * @param $postId
     * @param $title
     * @param $content
     * @param null $locale
     * @param null $companyId
     * @return \Alphatrader\ApiBundle\Model\Error|\Alphatrader\ApiBundle\Model\Posts
     */
    public function newPostComment($postId, $title, $content, $locale = null, $companyId = null)
    {
        $data = $this->post('v2/posts/'.$postId.'/comments', [
            'title' => $title,
            'content' => $content,
            'locale' => $locale,
            'companyId' => $companyId
        ]);

        return $this->parseResponse($data, 'Alphatrader\ApiBundle\Model\Posts');
    }
}

{'fraction_non_alphanumeric': 0.15504331228894436, 'fraction_numerical': 0.0019086771399207164, 'mean_word_length': 2.3739474987617633, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 61, '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': '7039518', 'n_tokens_mistral': 2215, 'n_tokens_neox': 2191, 'n_words': 399}