<commit_before><?php
namespace LarsNieuwenhuizen\Trustpilot\Service;

use Psr\Http\Message\ResponseInterface;

final class BusinessUnitDataService extends AbstractDataService
{

    /**
     * @const string
     */
    const TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_SINGLE = 'business-units/{businessUnitId}';

    /**
     * @param string $id
     * @param bool $returnResponse
     * @return ResponseInterface|string
     */
    public function getBusinessUnitById($id, $returnResponse = false)
    {
        $replacements = ['{businessUnitId}' => $id];
        $endPoint = $this->endPointVariableReplacement(
            self::TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_SINGLE,
            $replacements
        );

        if ($returnResponse === true) {
            return $this->get($endPoint);
        }

        return $this->get($endPoint)->getBody()->getContents();
    }
}<commit_msg>TASK: Add method to retrieve public reviews<commit_after><?php
namespace LarsNieuwenhuizen\Trustpilot\Service;

use Psr\Http\Message\ResponseInterface;

final class BusinessUnitDataService extends AbstractDataService
{

    /**
     * @const string
     */
    const TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_SINGLE = 'business-units/{businessUnitId}';

    /**
     * @const string
     */
    const TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_REVIEWS = 'business-units/{businessUnitId}/reviews';

    /**
     * @param string $id
     * @param array $options
     * @param bool $returnResponse
     * @return ResponseInterface|string
     */
    public function getBusinessUnitById(string $id, array $options = [], bool $returnResponse = false)
    {
        $replacements = ['{businessUnitId}' => $id];
        $endPoint = $this->endPointVariableReplacement(
            self::TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_SINGLE,
            $replacements
        );

        if ($returnResponse === true) {
            return $this->get($endPoint, $options);
        }

        return $this->get($endPoint, $options)->getBody()->getContents();
    }

    /**
     * @param string $id
     * @param array $options
     * @param bool $returnResponse
     * @return ResponseInterface|string
     */
    public function getBusinessUnitReviewsByBusinessUnitId(string $id, array $options = [], bool $returnResponse = false)
    {
        $replacements = ['{businessUnitId}' => $id];
        $endPoint = $this->endPointVariableReplacement(
            self::TRUSTPILOT_ENDPOINTS_BUSINESS_UNIT_GET_REVIEWS,
            $replacements
        );

        if ($returnResponse === true) {
            return $this->get($endPoint, $options);
        }

        return $this->get($endPoint, $options)->getBody()->getContents();
    }
}
{'fraction_non_alphanumeric': 0.12111111111111111, 'fraction_numerical': 0.0, 'mean_word_length': 2.9144927536231884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '1872177', 'n_tokens_mistral': 804, 'n_tokens_neox': 794, 'n_words': 140}