<commit_before><?php
/**
  * This class allows the user to easily consume MailChimp's Mandrill services
  * @package Mandrill
  *
  * @author  <NAME> <<EMAIL>>
  *
  * @version 1.0
  *
  * @method string getVersion() Retrieve the Mandrill PHP library's current version
  * @method string getApiKey() Retrieve the API key that is currently set
  * @method mixed call() call(mixed $data) Call Mandril service using an associative array containing the parameters Mandrill for the given type of service and specific call
  * @link http://mandrillapp.com/api/docs/index.html Official documentation for Mandrill API call types and calls
  * @link ../../examples/user_info.php Example: Calling User/Info per http://mandrillapp.com/api/docs/users.html#method=info
  *
  */
abstract class Mandrill {
    /**
     * Stores the operating enviroment state. Null means the state has not been evaluated yet.
     * @since 1.0
     * @static
     * @ignore
     */
    private static $is_cli         = null;

    /**
     * The current Mandrill PHP lib version
     * @since 1.0
     * @static
     * @ignore
     */
    private static $version        = '1.0';

    /**
     * The Mandrill service URL
     * @since 1.0
     * @static
     * @ignore
     */    
    private static $api_url        = 'https://mandrillapp.com/api/1.0/%s/%s.json';
    
    /**
     * The user's API key
     * @since 1.0
     * @static
     * @ignore
     */
    private static $api_key        = null;
    
    /**
     * Holds known Mandrill API call array. Used to validate user requests
     * @since 1.0
     * @static
     * @ignore
     */
    private static $api_calls      = null;
    
    /**
     * Whether or not to send additional information to error_log
     * @since 1.0
     * @static
     * @ignore
     */
    private static $verbose        = false;
    
    /**
     * Shorthand for the key property which is required for all Mandrill requests
     * @since 1.0
     * @static
     * @ignore
     */
    private static $required_key   = array('key');
    
    /**
     * Stores last validation error message
     * @since 1.0
     * @static
     * @ignore
     */
    private static $last_error     = null;
    
    /**
     * Returns true if the class is being run from the command line, caches result
     * @since 1.0
     * @static
     * @ignore
     * @return bool True if the script is being run from a CLI or false if its being run from a webserver
     */
    private static function _is_cli() {
        if(is_null(self::$is_cli)) self::$is_cli = !isset($_SERVER['HTTP_USER_AGENT']);
        return self::$is_cli;
    }
    
    /**
     * Generates a structured array of valid Mandrill API calls
     * @since 1.0
     * @static
     * @ignore<commit_msg>Checking if script is executed under the CLI environment  changed from isset($_SERVER['HTTP_USER_AGENT']) to php_sapi_name() function.<commit_after><?php
/**
  * This class allows the user to easily consume MailChimp's Mandrill services
  * @package Mandrill
  *
  * @author  <NAME> <<EMAIL>>
  *
  * @version 1.0
  *
  * @method string getVersion() Retrieve the Mandrill PHP library's current version
  * @method string getApiKey() Retrieve the API key that is currently set
  * @method mixed call() call(mixed $data) Call Mandril service using an associative array containing the parameters Mandrill for the given type of service and specific call
  * @link http://mandrillapp.com/api/docs/index.html Official documentation for Mandrill API call types and calls
  * @link ../../examples/user_info.php Example: Calling User/Info per http://mandrillapp.com/api/docs/users.html#method=info
  *
  */
abstract class Mandrill {
    /**
     * Stores the operating enviroment state. Null means the state has not been evaluated yet.
     * @since 1.0
     * @static
     * @ignore
     */
    private static $is_cli         = null;

    /**
     * The current Mandrill PHP lib version
     * @since 1.0
     * @static
     * @ignore
     */
    private static $version        = '1.0';

    /**
     * The Mandrill service URL
     * @since 1.0
     * @static
     * @ignore
     */    
    private static $api_url        = 'https://mandrillapp.com/api/1.0/%s/%s.json';
    
    /**
     * The user's API key
     * @since 1.0
     * @static
     * @ignore
     */
    private static $api_key        = null;
    
    /**
     * Holds known Mandrill API call array. Used to validate user requests
     * @since 1.0
     * @static
     * @ignore
     */
    private static $api_calls      = null;
    
    /**
     * Whether or not to send additional information to error_log
     * @since 1.0
     * @static
     * @ignore
     */
    private static $verbose        = false;
    
    /**
     * Shorthand for the key property which is required for all Mandrill requests
     * @since 1.0
     * @static
     * @ignore
     */
    private static $required_key   = array('key');
    
    /**
     * Stores last validation error message
     * @since 1.0
     * @static
     * @ignore
     */
    private static $last_error     = null;
    
    /**
     * Returns true if the class is being run from the command line, caches result
     * @since 1.0
     * @static
     * @ignore
     * @return bool True if the script is being run from a CLI or false if its being run from a webserver
     */
    private static function _is_cli() {
        if(is_null(self::$is_cli)) self::$is_cli = php_sapi_name() == 'cli';
        return self::$is_cli;
    }
    
    /**
     * Generates a structured array of valid Mandrill API calls
     * @since 1.0
     * @static
     * @ignore
{'fraction_non_alphanumeric': 0.10338680926916222, 'fraction_numerical': 0.009269162210338681, 'mean_word_length': 2.1085872576177285, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '1487370', 'n_tokens_mistral': 1725, 'n_tokens_neox': 1660, 'n_words': 566}