<commit_before><?php

namespace Byron;

/**
 * \Byron\Client extends \Zend_Http_Client, and behaves like it in most respects.
 * However, there are two crucial differences: (1) the constructor takes a "key", which
 * will generally be an API key, or a datastructure representing an API key; and (2)
 * the return value of an actual request can be configured to be just the body of the 
 * response, and not the response object itself.  (This is useful if the service
 * you're talking to isn't very RESTful, and pretty much always returns a 200, embedding
 * the real status in the body of the response.)
 */

abstract class Client extends \Zend_Http_Client {

    /**
     *
     * @var array
     */
    
    protected $key = null;

    /**
     * Whether to return a response object, or the raw response body.  The value you
     * want more or less depends on how RESTful the service you're talking to is.  If
     * it's very RESTful (e.g. 404 indicates something is missing, rather than an
     * error), then you probably want the response object.  On the other hand, if the
     * server pretty much always returns a 200 response, and embeds error messages
     * in the content itself, then you probably want the raw response body.
     *
     * @var boolean
     */

    protected $returnResponseObject = false;
    
    public function __construct($key)
    {
        $this->setKey($key);
    }

    public function setKey($key) {
        return $this->key = $key;<commit_msg>Make concrete class; make constructor param optional.<commit_after><?php

namespace Byron;

/**
 * \Byron\Client extends \Zend_Http_Client, and behaves like it in most respects.
 * However, there are two crucial differences: (1) the constructor takes a "key", which
 * will generally be an API key, or a datastructure representing an API key; and (2)
 * the return value of an actual request can be configured to be just the body of the 
 * response, and not the response object itself.  (This is useful if the service
 * you're talking to isn't very RESTful, and pretty much always returns a 200, embedding
 * the real status in the body of the response.)
 */

class Client extends \Zend_Http_Client {

    /**
     *
     * @var array
     */
    
    protected $key = null;

    /**
     * Whether to return a response object, or the raw response body.  The value you
     * want more or less depends on how RESTful the service you're talking to is.  If
     * it's very RESTful (e.g. 404 indicates something is missing, rather than an
     * error), then you probably want the response object.  On the other hand, if the
     * server pretty much always returns a 200 response, and embeds error messages
     * in the content itself, then you probably want the raw response body.
     *
     * @var boolean
     */

    protected $returnResponseObject = false;
    
    public function __construct($key = null)
    {
        $this->setKey($key);
    }

    public function setKey($key) {
        return $this->key = $key;
{'fraction_non_alphanumeric': 0.07470119521912351, 'fraction_numerical': 0.0073041168658698535, 'mean_word_length': 2.8578745198463507, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2523636', 'n_tokens_mistral': 835, 'n_tokens_neox': 787, 'n_words': 401}