<commit_before><?php
namespace OneSignal;

use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class Notifications
{
    /**
     * @var OneSignal
     */
    protected $api;

    /**
     * Constructor
     *
     * @param OneSignal $api
     */
    public function __construct(OneSignal $api)
    {
        $this->api = $api;
    }

    /**
     * Get information about notification with provided ID.
     *
     * Application authentication key and ID must be set.
     *
     * @param string $id Notification ID
     *
     * @return array
     */
    public function getOne($id)
    {
        $url = '/notifications/' . $id . '?app_id=' . $this->api->getConfig()->getApplicationId();

        return $this->api->request('GET', $url, [
            'headers' => [
                'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(),
            ],
        ]);
    }

    /**
     * Get information about all notifications.
     *
     * Application authentication key and ID must be set.
     *
     * @param int $limit How many notifications to return (max 50) 
     * @param int $offset Results offset (results are sorted by ID)
     * 
     *
     * @return array
     */
    public function getAll($limit = 50, $offset = null)
    {
        return $this->api->request('GET', '/notifications?' . http_build_query([
             'limit' => max(0, min(50, filter_var($limit, FILTER_VALIDATE_INT))),
             'offset' => max(0, min(50, filter_var($offset, FILTER_VALIDATE_INT))),
        ]), [
            'headers' => [
                'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(),
            ],
            'json' => [
                'app_id' => $this->api->getConfig()->getApplicationId(),
            ],<commit_msg>Setting offset to 0<commit_after><?php
namespace OneSignal;

use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class Notifications
{
    /**
     * @var OneSignal
     */
    protected $api;

    /**
     * Constructor
     *
     * @param OneSignal $api
     */
    public function __construct(OneSignal $api)
    {
        $this->api = $api;
    }

    /**
     * Get information about notification with provided ID.
     *
     * Application authentication key and ID must be set.
     *
     * @param string $id Notification ID
     *
     * @return array
     */
    public function getOne($id)
    {
        $url = '/notifications/' . $id . '?app_id=' . $this->api->getConfig()->getApplicationId();

        return $this->api->request('GET', $url, [
            'headers' => [
                'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(),
            ],
        ]);
    }

    /**
     * Get information about all notifications.
     *
     * Application authentication key and ID must be set.
     *
     * @param int $limit How many notifications to return (max 50) 
     * @param int $offset Results offset (results are sorted by ID)
     * 
     *
     * @return array
     */
    public function getAll($limit = 50, $offset = 0)
    {
        return $this->api->request('GET', '/notifications?' . http_build_query([
             'limit' => max(0, min(50, filter_var($limit, FILTER_VALIDATE_INT))),
             'offset' => max(0, min(50, filter_var($offset, FILTER_VALIDATE_INT))),
        ]), [
            'headers' => [
                'Authorization' => 'Basic ' . $this->api->getConfig()->getApplicationAuthKey(),
            ],
            'json' => [
                'app_id' => $this->api->getConfig()->getApplicationId(),
            ],
{'fraction_non_alphanumeric': 0.14444746130871572, 'fraction_numerical': 0.005973391257127342, 'mean_word_length': 2.0446280991735537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '6848726', 'n_tokens_mistral': 1080, 'n_tokens_neox': 1041, 'n_words': 247}