<commit_before><?php

namespace WonderPush\Api;
use WonderPush\Obj\ApplicationCollection;
use WonderPush\Params\CollectionParams;

/**
 * Applications API.
 */
class Applications {

  /**
   * Instance of the library whose credentials are to be used.
   * @var \WonderPush\WonderPush
   */
  private $wp;

  public function __construct(\WonderPush\WonderPush $wp) {
    $this->wp = $wp;
  }

  /**
   * List applications associated with the access token used to initialize the WonderPush object.
   * @param CollectionParams $collectionParams
   * @return ApplicationCollection
   * @throws \WonderPush\Errors\Net
   */
  public function all($collectionParams = null) {
    $response = $this->wp->rest()->get('/applications', $collectionParams ? $collectionParams->toArray() : array());
    return $response->checkedResult(ApplicationCollection::class);
  }<commit_msg>Accepting plain arrays<commit_after><?php

namespace WonderPush\Api;
use WonderPush\Obj\ApplicationCollection;
use WonderPush\Params\CollectionParams;

/**
 * Applications API.
 */
class Applications {

  /**
   * Instance of the library whose credentials are to be used.
   * @var \WonderPush\WonderPush
   */
  private $wp;

  public function __construct(\WonderPush\WonderPush $wp) {
    $this->wp = $wp;
  }

  /**
   * List applications associated with the access token used to initialize the WonderPush object.
   * @param array|CollectionParams $collectionParams
   * @return ApplicationCollection
   * @throws \WonderPush\Errors\Net
   */
  public function all($collectionParams = array()) {
    $response = $this->wp->rest()->get('/applications', is_array($collectionParams) ? $collectionParams : $collectionParams->toArray());
    return $response->checkedResult(ApplicationCollection::class);
  }
{'fraction_non_alphanumeric': 0.12162162162162163, 'fraction_numerical': 0.0, 'mean_word_length': 4.211143695014663, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '3915789', 'n_tokens_mistral': 491, 'n_tokens_neox': 483, 'n_words': 126}