diff --git a/src/Curl/ArrayUtil.php b/src/Curl/ArrayUtil.php index f11f135..4805837 100644 --- a/src/Curl/ArrayUtil.php +++ b/src/Curl/ArrayUtil.php @@ -7,10 +7,8 @@ class ArrayUtil /** * Is Array Assoc * - * @access public - * @param $array - * - * @return boolean + * @param $array + * @return bool */ public static function isArrayAssoc($array) { @@ -24,10 +22,8 @@ class ArrayUtil * Is Array Assoc * * @deprecated Use ArrayUtil::isArrayAssoc(). - * @access public - * @param $array - * - * @return boolean + * @param $array + * @return bool */ public static function is_array_assoc($array) { @@ -37,10 +33,8 @@ class ArrayUtil /** * Is Array Multidim * - * @access public - * @param $array - * - * @return boolean + * @param $array + * @return bool */ public static function isArrayMultidim($array) { @@ -55,10 +49,8 @@ class ArrayUtil * Is Array Multidim * * @deprecated Use ArrayUtil::isArrayMultidim(). - * @access public - * @param $array - * - * @return boolean + * @param $array + * @return bool */ public static function is_array_multidim($array) { @@ -68,10 +60,8 @@ class ArrayUtil /** * Array Flatten Multidim * - * @access public - * @param $array - * @param $prefix - * + * @param $array + * @param $prefix * @return array */ public static function arrayFlattenMultidim($array, $prefix = false) @@ -122,10 +112,8 @@ class ArrayUtil * Array Flatten Multidim * * @deprecated Use ArrayUtil::arrayFlattenMultidim(). - * @access public - * @param $array - * @param $prefix - * + * @param $array + * @param $prefix * @return array */ public static function array_flatten_multidim($array, $prefix = false) @@ -136,9 +124,7 @@ class ArrayUtil /** * Array Random * - * @access public - * @param $array - * + * @param $array * @return mixed */ public static function arrayRandom($array) @@ -149,10 +135,8 @@ class ArrayUtil /** * Array Random Index * - * @access public - * @param $array - * - * @return integer + * @param $array + * @return int */ public static function arrayRandomIndex($array) { @@ -163,9 +147,7 @@ class ArrayUtil * Array Random * * @deprecated Use ArrayUtil::arrayRandom(). - * @access public - * @param $array - * + * @param $array * @return mixed */ public static function array_random($array) diff --git a/src/Curl/BaseCurl.php b/src/Curl/BaseCurl.php index 5b22ac2..86edf11 100644 --- a/src/Curl/BaseCurl.php +++ b/src/Curl/BaseCurl.php @@ -15,8 +15,7 @@ abstract class BaseCurl /** * Before Send * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function beforeSend($callback) { @@ -28,8 +27,7 @@ abstract class BaseCurl /** * Complete * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function complete($callback) { @@ -38,8 +36,6 @@ abstract class BaseCurl /** * Disable Timeout - * - * @access public */ public function disableTimeout() { @@ -49,8 +45,7 @@ abstract class BaseCurl /** * Error * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function error($callback) { @@ -60,9 +55,7 @@ abstract class BaseCurl /** * Get Opt * - * @access public - * @param $option - * + * @param $option * @return mixed */ public function getOpt($option) @@ -76,8 +69,7 @@ abstract class BaseCurl * Remove an internal header from the request. * Using `curl -H "Host:" ...' is equivalent to $curl->removeHeader('Host');. * - * @access public - * @param $key + * @param $key */ public function removeHeader($key) { @@ -87,7 +79,7 @@ abstract class BaseCurl /** * Set auto referer * - * @access public + * @param mixed $auto_referer */ public function setAutoReferer($auto_referer = true) { @@ -97,7 +89,7 @@ abstract class BaseCurl /** * Set auto referrer * - * @access public + * @param mixed $auto_referrer */ public function setAutoReferrer($auto_referrer = true) { @@ -107,9 +99,8 @@ abstract class BaseCurl /** * Set Basic Authentication * - * @access public - * @param $username - * @param $password + * @param $username + * @param $password */ public function setBasicAuthentication($username, $password = '') { @@ -120,8 +111,7 @@ abstract class BaseCurl /** * Set Connect Timeout * - * @access public - * @param $seconds + * @param $seconds */ public function setConnectTimeout($seconds) { @@ -137,9 +127,8 @@ abstract class BaseCurl /** * Set Digest Authentication * - * @access public - * @param $username - * @param $password + * @param $username + * @param $password */ public function setDigestAuthentication($username, $password = '') { @@ -150,8 +139,7 @@ abstract class BaseCurl /** * Set File * - * @access public - * @param $file + * @param $file */ public function setFile($file) { @@ -166,7 +154,7 @@ abstract class BaseCurl /** * Set follow location * - * @access public + * @param mixed $follow_location * @see Curl::setMaximumRedirects() */ public function setFollowLocation($follow_location = true) @@ -177,7 +165,7 @@ abstract class BaseCurl /** * Set forbid reuse * - * @access public + * @param mixed $forbid_reuse */ public function setForbidReuse($forbid_reuse = true) { @@ -193,8 +181,7 @@ abstract class BaseCurl * The name of the outgoing network interface to use. * This can be an interface name, an IP address or a host name. * - * @access public - * @param $interface + * @param $interface */ public function setInterface($interface) { @@ -206,7 +193,7 @@ abstract class BaseCurl /** * Set maximum redirects * - * @access public + * @param mixed $maximum_redirects * @see Curl::setFollowLocation() */ public function setMaximumRedirects($maximum_redirects) @@ -225,8 +212,7 @@ abstract class BaseCurl /** * Set Port * - * @access public - * @param $port + * @param $port */ public function setPort($port) { @@ -238,11 +224,10 @@ abstract class BaseCurl * * Set an HTTP proxy to tunnel requests through. * - * @access public - * @param $proxy - The HTTP proxy to tunnel requests through. May include port number. - * @param $port - The port number of the proxy to connect to. This port number can also be set in $proxy. - * @param $username - The username to use for the connection to the proxy. - * @param $password - The password to use for the connection to the proxy. + * @param $proxy - The HTTP proxy to tunnel requests through. May include port number. + * @param $port - The port number of the proxy to connect to. This port number can also be set in $proxy. + * @param $username - The username to use for the connection to the proxy. + * @param $password - The password to use for the connection to the proxy. */ public function setProxy($proxy, $port = null, $username = null, $password = null) { @@ -260,8 +245,7 @@ abstract class BaseCurl * * Set the HTTP authentication method(s) to use for the proxy connection. * - * @access public - * @param $auth + * @param $auth */ public function setProxyAuth($auth) { @@ -273,8 +257,7 @@ abstract class BaseCurl * * Set the proxy to tunnel through HTTP proxy. * - * @access public - * @param $tunnel boolean + * @param $tunnel boolean */ public function setProxyTunnel($tunnel = true) { @@ -286,8 +269,7 @@ abstract class BaseCurl * * Set the proxy protocol type. * - * @access public - * @param $type + * @param $type */ public function setProxyType($type) { @@ -297,8 +279,7 @@ abstract class BaseCurl /** * Set Range * - * @access public - * @param $range + * @param $range */ public function setRange($range) { @@ -313,8 +294,7 @@ abstract class BaseCurl /** * Set Referer * - * @access public - * @param $referer + * @param $referer */ public function setReferer($referer) { @@ -324,8 +304,7 @@ abstract class BaseCurl /** * Set Referrer * - * @access public - * @param $referrer + * @param $referrer */ public function setReferrer($referrer) { @@ -337,8 +316,7 @@ abstract class BaseCurl /** * Set Timeout * - * @access public - * @param $seconds + * @param $seconds */ public function setTimeout($seconds) { @@ -355,8 +333,7 @@ abstract class BaseCurl /** * Set User Agent * - * @access public - * @param $user_agent + * @param $user_agent */ public function setUserAgent($user_agent) { @@ -374,8 +351,7 @@ abstract class BaseCurl /** * Success * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function success($callback) { @@ -388,8 +364,6 @@ abstract class BaseCurl * Unset Proxy * * Disable use of the proxy. - * - * @access public */ public function unsetProxy() { @@ -399,9 +373,8 @@ abstract class BaseCurl /** * Verbose * - * @access public - * @param bool $on - * @param resource|string $output + * @param bool $on + * @param resource|string $output */ public function verbose($on = true, $output = 'STDERR') { diff --git a/src/Curl/CaseInsensitiveArray.php b/src/Curl/CaseInsensitiveArray.php index 13fb015..ba4717e 100644 --- a/src/Curl/CaseInsensitiveArray.php +++ b/src/Curl/CaseInsensitiveArray.php @@ -10,6 +10,7 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * @var mixed[] Data storage with lowercase keys. + * * @see offsetSet() * @see offsetExists() * @see offsetUnset() @@ -23,6 +24,7 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * @var string[] Case-sensitive keys. + * * @see offsetSet() * @see offsetUnset() * @see key() @@ -36,11 +38,8 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator * case-insensitive array. Caution: Data may be lost when converting * case-sensitive arrays to case-insensitive arrays. * - * @param mixed[] $initial (optional) Existing array to convert. - * + * @param mixed[] $initial (optional) Existing array to convert. * @return CaseInsensitiveArray - * - * @access public */ public function __construct(array $initial = null) { @@ -58,14 +57,10 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator * stores the case-sensitive offset and the data at the lowercase indexes in * $this->keys and @this->data. * - * @see https://secure.php.net/manual/en/arrayaccess.offsetset.php - * - * @param string $offset The offset to store the data at (case-insensitive). - * @param mixed $value The data to store at the specified offset. - * + * @param string $offset The offset to store the data at (case-insensitive). + * @param mixed $value The data to store at the specified offset. * @return void - * - * @access public + * @see https://secure.php.net/manual/en/arrayaccess.offsetset.php */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) @@ -85,13 +80,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator * Checks if the offset exists in data storage. The index is looked up with * the lowercase version of the provided offset. * + * @param string $offset Offset to check + * @return bool If the offset exists. * @see https://secure.php.net/manual/en/arrayaccess.offsetexists.php - * - * @param string $offset Offset to check - * - * @return bool If the offset exists. - * - * @access public */ #[\ReturnTypeWillChange] public function offsetExists($offset) @@ -105,13 +96,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator * Unsets the specified offset. Converts the provided offset to lowercase, * and unsets the case-sensitive key, as well as the stored data. * - * @see https://secure.php.net/manual/en/arrayaccess.offsetunset.php - * - * @param string $offset The offset to unset. - * + * @param string $offset The offset to unset. * @return void - * - * @access public + * @see https://secure.php.net/manual/en/arrayaccess.offsetunset.php */ #[\ReturnTypeWillChange] public function offsetUnset($offset) @@ -127,13 +114,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator * Return the stored data at the provided offset. The offset is converted to * lowercase and the lookup is done on the data store directly. * + * @param string $offset Offset to lookup. + * @return mixed The data stored at the offset. * @see https://secure.php.net/manual/en/arrayaccess.offsetget.php - * - * @param string $offset Offset to lookup. - * - * @return mixed The data stored at the offset. - * - * @access public */ #[\ReturnTypeWillChange] public function offsetGet($offset) @@ -145,13 +128,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Count * - * @see https://secure.php.net/manual/en/countable.count.php - * * @param void - * - * @return integer The number of elements stored in the array. - * - * @access public + * @return int The number of elements stored in the array. + * @see https://secure.php.net/manual/en/countable.count.php */ #[\ReturnTypeWillChange] public function count() @@ -162,13 +141,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Current * - * @see https://secure.php.net/manual/en/iterator.current.php - * * @param void - * * @return mixed Data at the current position. - * - * @access public + * @see https://secure.php.net/manual/en/iterator.current.php */ #[\ReturnTypeWillChange] public function current() @@ -179,13 +154,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Next * - * @see https://secure.php.net/manual/en/iterator.next.php - * * @param void - * * @return void - * - * @access public + * @see https://secure.php.net/manual/en/iterator.next.php */ #[\ReturnTypeWillChange] public function next() @@ -196,13 +167,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Key * - * @see https://secure.php.net/manual/en/iterator.key.php - * * @param void - * * @return mixed Case-sensitive key at current position. - * - * @access public + * @see https://secure.php.net/manual/en/iterator.key.php */ #[\ReturnTypeWillChange] public function key() @@ -214,11 +181,8 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Valid * - * @see https://secure.php.net/manual/en/iterator.valid.php - * * @return bool If the current position is valid. - * - * @access public + * @see https://secure.php.net/manual/en/iterator.valid.php */ #[\ReturnTypeWillChange] public function valid() @@ -229,13 +193,9 @@ class CaseInsensitiveArray implements \ArrayAccess, \Countable, \Iterator /** * Rewind * - * @see https://secure.php.net/manual/en/iterator.rewind.php - * * @param void - * * @return void - * - * @access public + * @see https://secure.php.net/manual/en/iterator.rewind.php */ #[\ReturnTypeWillChange] public function rewind() diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 6f4c18d..b37ff56 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -108,8 +108,8 @@ class Curl extends BaseCurl /** * Construct * - * @access public - * @param $base_url + * @param $base_url + * @param mixed $options * @throws \ErrorException */ public function __construct($base_url = null, $options = []) @@ -133,9 +133,7 @@ class Curl extends BaseCurl /** * Build Post Data * - * @access public - * @param $data - * + * @param $data * @return array|string * @throws \ErrorException */ @@ -218,8 +216,6 @@ class Curl extends BaseCurl /** * Call - * - * @access public */ public function call() { @@ -233,8 +229,6 @@ class Curl extends BaseCurl /** * Close - * - * @access public */ public function close() { @@ -255,8 +249,7 @@ class Curl extends BaseCurl /** * Progress * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function progress($callback) { @@ -273,11 +266,9 @@ class Curl extends BaseCurl /** * Delete * - * @access public - * @param $url - * @param $query_parameters - * @param $data - * + * @param $url + * @param $query_parameters + * @param $data * @return mixed Returns the value provided by exec. */ public function delete($url, $query_parameters = [], $data = []) @@ -307,11 +298,9 @@ class Curl extends BaseCurl /** * Download * - * @access public - * @param $url - * @param $mixed_filename - * - * @return boolean + * @param $url + * @param $mixed_filename + * @return bool */ public function download($url, $mixed_filename) { @@ -360,12 +349,10 @@ class Curl extends BaseCurl /** * Fast download * - * @access public - * @param $url - * @param $filename - * @param $connections - * - * @return boolean + * @param $url + * @param $filename + * @param $connections + * @return bool */ public function fastDownload($url, $filename, $connections = 4) { @@ -478,9 +465,7 @@ class Curl extends BaseCurl /** * Exec * - * @access public - * @param $ch - * + * @param $ch * @return mixed Returns the value provided by parseResponse. */ public function exec($ch = null) @@ -601,10 +586,8 @@ class Curl extends BaseCurl /** * Get * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function get($url, $data = []) @@ -622,9 +605,7 @@ class Curl extends BaseCurl /** * Get Info * - * @access public - * @param $opt - * + * @param $opt * @return mixed */ public function getInfo($opt = null) @@ -642,10 +623,8 @@ class Curl extends BaseCurl /** * Head * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function head($url, $data = []) @@ -663,10 +642,8 @@ class Curl extends BaseCurl /** * Options * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function options($url, $data = []) @@ -683,10 +660,8 @@ class Curl extends BaseCurl /** * Patch * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function patch($url, $data = []) @@ -709,22 +684,23 @@ class Curl extends BaseCurl /** * Post * - * @access public - * @param $url - * @param $data - * @param $follow_303_with_post - * If true, will cause 303 redirections to be followed using a POST request (default: false). - * Notes: - * - Redirections are only followed if the CURLOPT_FOLLOWLOCATION option is set to true. - * - According to the HTTP specs (see [1]), a 303 redirection should be followed using - * the GET method. 301 and 302 must not. - * - In order to force a 303 redirection to be performed using the same method, the - * underlying cURL object must be set in a special state (the CURLOPT_CUSTOMREQUEST - * option must be set to the method to use after the redirection). Due to a limitation - * of the cURL extension of PHP < 5.5.11 ([2], [3]), it is not possible to reset this - * option. Using these PHP engines, it is therefore impossible to restore this behavior - * on an existing php-curl-class Curl object. - * + * @param $url + * @param $data + * @param $follow_303_with_post + * If true, will cause 303 redirections to be followed using a POST request + * (default: false). + * Notes: + * - Redirections are only followed if the CURLOPT_FOLLOWLOCATION option is set + * to true. + * - According to the HTTP specs (see [1]), a 303 redirection should be followed + * using the GET method. 301 and 302 must not. + * - In order to force a 303 redirection to be performed using the same method, + * the underlying cURL object must be set in a special state (the + * CURLOPT_CUSTOMREQUEST option must be set to the method to use after the + * redirection). Due to a limitation of the cURL extension of PHP < 5.5.11 ([2], + * [3]), it is not possible to reset this option. Using these PHP engines, it is + * therefore impossible to restore this behavior on an existing php-curl-class + * Curl object. * @return mixed Returns the value provided by exec. * * [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 @@ -762,10 +738,8 @@ class Curl extends BaseCurl /** * Put * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function put($url, $data = []) @@ -791,10 +765,8 @@ class Curl extends BaseCurl /** * Search * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return mixed Returns the value provided by exec. */ public function search($url, $data = []) @@ -820,9 +792,8 @@ class Curl extends BaseCurl /** * Set Cookie * - * @access public - * @param $key - * @param $value + * @param $key + * @param $value */ public function setCookie($key, $value) { @@ -833,8 +804,7 @@ class Curl extends BaseCurl /** * Set Cookies * - * @access public - * @param $cookies + * @param $cookies */ public function setCookies($cookies) { @@ -847,9 +817,7 @@ class Curl extends BaseCurl /** * Get Cookie * - * @access public - * @param $key - * + * @param $key * @return mixed */ public function getCookie($key) @@ -860,9 +828,7 @@ class Curl extends BaseCurl /** * Get Response Cookie * - * @access public - * @param $key - * + * @param $key * @return mixed */ public function getResponseCookie($key) @@ -873,8 +839,7 @@ class Curl extends BaseCurl /** * Set Max Filesize * - * @access public - * @param $bytes + * @param $bytes */ public function setMaxFilesize($bytes) { @@ -888,9 +853,7 @@ class Curl extends BaseCurl /** * Set Cookie String * - * @access public - * @param $string - * + * @param $string * @return bool */ public function setCookieString($string) @@ -901,10 +864,8 @@ class Curl extends BaseCurl /** * Set Cookie File * - * @access public - * @param $cookie_file - * - * @return boolean + * @param $cookie_file + * @return bool */ public function setCookieFile($cookie_file) { @@ -914,10 +875,8 @@ class Curl extends BaseCurl /** * Set Cookie Jar * - * @access public - * @param $cookie_jar - * - * @return boolean + * @param $cookie_jar + * @return bool */ public function setCookieJar($cookie_jar) { @@ -927,10 +886,9 @@ class Curl extends BaseCurl /** * Set Default JSON Decoder * - * @access public - * @param $assoc - * @param $depth - * @param $options + * @param $assoc + * @param $depth + * @param $options */ public function setDefaultJsonDecoder() { @@ -941,11 +899,10 @@ class Curl extends BaseCurl /** * Set Default XML Decoder * - * @access public - * @param $class_name - * @param $options - * @param $ns - * @param $is_prefix + * @param $class_name + * @param $options + * @param $ns + * @param $is_prefix */ public function setDefaultXmlDecoder() { @@ -956,8 +913,7 @@ class Curl extends BaseCurl /** * Set Default Decoder * - * @access public - * @param $mixed boolean|callable|string + * @param $mixed boolean|callable|string */ public function setDefaultDecoder($mixed = 'json') { @@ -974,8 +930,6 @@ class Curl extends BaseCurl /** * Set Default Header Out - * - * @access public */ public function setDefaultHeaderOut() { @@ -989,8 +943,6 @@ class Curl extends BaseCurl /** * Set Default Timeout - * - * @access public */ public function setDefaultTimeout() { @@ -1004,8 +956,6 @@ class Curl extends BaseCurl /** * Set Default User Agent - * - * @access public */ public function setDefaultUserAgent() { @@ -1031,9 +981,8 @@ class Curl extends BaseCurl * * Add extra header to include in the request. * - * @access public - * @param $key - * @param $value + * @param $key + * @param $value */ public function setHeader($key, $value) { @@ -1050,8 +999,7 @@ class Curl extends BaseCurl * * Add extra headers to include in the request. * - * @access public - * @param $headers + * @param $headers */ public function setHeaders($headers) { @@ -1081,8 +1029,7 @@ class Curl extends BaseCurl /** * Set JSON Decoder * - * @access public - * @param $mixed boolean|callable + * @param $mixed boolean|callable */ public function setJsonDecoder($mixed) { @@ -1095,8 +1042,7 @@ class Curl extends BaseCurl /** * Set XML Decoder * - * @access public - * @param $mixed boolean|callable + * @param $mixed boolean|callable */ public function setXmlDecoder($mixed) { @@ -1109,11 +1055,9 @@ class Curl extends BaseCurl /** * Set Opt * - * @access public - * @param $option - * @param $value - * - * @return boolean + * @param $option + * @param $value + * @return bool */ public function setOpt($option, $value) { @@ -1136,11 +1080,9 @@ class Curl extends BaseCurl /** * Set Opt Internal * - * @access protected - * @param $option - * @param $value - * - * @return boolean + * @param $option + * @param $value + * @return bool */ protected function setOptInternal($option, $value) { @@ -1154,12 +1096,12 @@ class Curl extends BaseCurl /** * Set Opts * - * @access public - * @param $options - * - * @return boolean - * Returns true if all options were successfully set. If an option could not be successfully set, false is - * immediately returned, ignoring any future options in the options array. Similar to curl_setopt_array(). + * @param $options + * @return bool + * Returns true if all options were successfully set. If an + * option could not be successfully set, false is immediately + * returned, ignoring any future options in the options array. + * Similar to curl_setopt_array(). */ public function setOpts($options) { @@ -1179,8 +1121,7 @@ class Curl extends BaseCurl * * Limit what protocols libcurl will accept for a request. * - * @access public - * @param $protocols + * @param $protocols * @see Curl::setRedirectProtocols() */ public function setProtocols($protocols) @@ -1204,8 +1145,7 @@ class Curl extends BaseCurl * When using a callable decider, the request will be retried until the * function returns a value which evaluates to false. * - * @access public - * @param $mixed + * @param $mixed */ public function setRetry($mixed) { @@ -1222,8 +1162,7 @@ class Curl extends BaseCurl * * Limit what protocols libcurl will accept when following a redirect. * - * @access public - * @param $redirect_protocols + * @param $redirect_protocols * @see Curl::setProtocols() */ public function setRedirectProtocols($redirect_protocols) @@ -1239,9 +1178,8 @@ class Curl extends BaseCurl /** * Set Url * - * @access public - * @param $url - * @param $mixed_data + * @param $url + * @param $mixed_data */ public function setUrl($url, $mixed_data = '') { @@ -1258,8 +1196,6 @@ class Curl extends BaseCurl /** * Attempt Retry - * - * @access public */ public function attemptRetry() { @@ -1285,8 +1221,7 @@ class Curl extends BaseCurl * * Remove extra header previously set using Curl::setHeader(). * - * @access public - * @param $key + * @param $key */ public function unsetHeader($key) { @@ -1301,8 +1236,7 @@ class Curl extends BaseCurl /** * Diagnose * - * @access public - * @param bool $return + * @param bool $return */ public function diagnose($return = false) { @@ -1486,8 +1420,6 @@ class Curl extends BaseCurl /** * Reset - * - * @access public */ public function reset() { @@ -1676,8 +1608,6 @@ class Curl extends BaseCurl /** * Destruct - * - * @access public */ public function __destruct() { @@ -1696,8 +1626,6 @@ class Curl extends BaseCurl /** * Get Curl Error Code Constants - * - * @access private */ private function getCurlErrorCodeConstants() { @@ -1715,8 +1643,6 @@ class Curl extends BaseCurl /** * Get Curl Error Code Constant - * - * @access private */ private function getCurlErrorCodeConstant() { @@ -1729,8 +1655,6 @@ class Curl extends BaseCurl /** * Get Curl Option Code Constants - * - * @access private */ private function getCurlOptionCodeConstants() { @@ -1775,7 +1699,7 @@ class Curl extends BaseCurl ]; if (isset($this->curlOptionCodeConstants[$option])) { $option_name = $this->curlOptionCodeConstants[$option]; - if (in_array($option_name, array_keys($bit_flag_lookups))) { + if (in_array($option_name, array_keys($bit_flag_lookups), true)) { $curl_const_prefix = $bit_flag_lookups[$option_name]; $constants = get_defined_constants(true); $curl_constants = array_filter( @@ -1822,8 +1746,6 @@ class Curl extends BaseCurl /** * Get Effective Url - * - * @access private */ private function getEffectiveUrl() { @@ -1832,8 +1754,6 @@ class Curl extends BaseCurl /** * Get RFC 2616 - * - * @access private */ private function getRfc2616() { @@ -1842,8 +1762,6 @@ class Curl extends BaseCurl /** * Get RFC 6265 - * - * @access private */ private function getRfc6265() { @@ -1852,8 +1770,6 @@ class Curl extends BaseCurl /** * Get Total Time - * - * @access private */ private function getTotalTime() { @@ -1862,8 +1778,6 @@ class Curl extends BaseCurl /** * Build Cookies - * - * @access private */ private function buildCookies() { @@ -1880,8 +1794,7 @@ class Curl extends BaseCurl /** * Download Complete * - * @access private - * @param $fh + * @param $fh */ private function downloadComplete($fh) { @@ -1917,9 +1830,7 @@ class Curl extends BaseCurl /** * Parse Headers * - * @access private - * @param $raw_headers - * + * @param $raw_headers * @return array */ private function parseHeaders($raw_headers) @@ -1948,9 +1859,7 @@ class Curl extends BaseCurl /** * Parse Request Headers * - * @access private - * @param $raw_headers - * + * @param $raw_headers * @return \Curl\CaseInsensitiveArray */ private function parseRequestHeaders($raw_headers) @@ -1967,21 +1876,21 @@ class Curl extends BaseCurl /** * Parse Response * - * @access private - * @param $response_headers - * @param $raw_response - * + * @param $response_headers + * @param $raw_response * @return mixed - * If the response content-type is json: - * Returns the json decoder's return value: A stdClass object when the default json decoder is used. - * If the response content-type is xml: - * Returns the xml decoder's return value: A SimpleXMLElement object when the default xml decoder is used. - * If the response content-type is something else: - * Returns the original raw response unless a default decoder has been set. - * If the response content-type cannot be determined: - * Returns the original raw response. - * If the response content-encoding is gzip: - * Returns the response gzip-decoded. + * If the response content-type is json: Returns the json decoder's return value: A stdClass object + * when the default json decoder is used. + * + * If the response content-type is xml: Returns the xml decoder's return value: A SimpleXMLElement + * object when the default xml decoder is used. + * + * If the response content-type is something else: Returns the original raw response unless a default + * decoder has been set. + * + * If the response content-type cannot be determined: Returns the original raw response. + * + * If the response content-encoding is gzip: Returns the response gzip-decoded. */ private function parseResponse($response_headers, $raw_response) { @@ -2021,9 +1930,7 @@ class Curl extends BaseCurl /** * Parse Response Headers * - * @access private - * @param $raw_response_headers - * + * @param $raw_response_headers * @return \Curl\CaseInsensitiveArray */ private function parseResponseHeaders($raw_response_headers) @@ -2049,9 +1956,8 @@ class Curl extends BaseCurl /** * Set Encoded Cookie * - * @access private - * @param $key - * @param $value + * @param $key + * @param $value */ private function setEncodedCookie($key, $value) { @@ -2079,8 +1985,8 @@ class Curl extends BaseCurl /** * Initialize * - * @access private - * @param $base_url + * @param $base_url + * @param mixed $options */ private function initialize($base_url = null, $options = []) { @@ -2142,8 +2048,7 @@ class Curl extends BaseCurl * callback and instead just check the value of stopRequest for attempting * to stop the request as used by Curl::stop(). * - * @access public - * @param $callback callable|null + * @param $callback callable|null */ public function setStop($callback = null) { @@ -2169,8 +2074,6 @@ class Curl extends BaseCurl * Attempt to stop request. * * Used by MultiCurl::stop() when making multiple parallel requests. - * - * @access public */ public function stop() { @@ -2185,8 +2088,7 @@ class Curl extends BaseCurl * unset($curl) automatically calls __destruct() as expected. Otherwise, manually calling $curl->close() will be * necessary to prevent a memory leak. * - * @param $header_callback_data - * + * @param $header_callback_data * @return callable */ function createHeaderCallback($header_callback_data) @@ -2215,8 +2117,7 @@ function createHeaderCallback($header_callback_data) * stopRequest flag is on. Keep this function separate from the class to prevent * a memory leak. * - * @param $header_callback_data - * + * @param $header_callback_data * @return callable */ function createStopRequestFunction($header_callback_data) diff --git a/src/Curl/Decoder.php b/src/Curl/Decoder.php index 603f4c3..d52d44c 100644 --- a/src/Curl/Decoder.php +++ b/src/Curl/Decoder.php @@ -7,11 +7,10 @@ class Decoder /** * Decode JSON * - * @access public - * @param $json - * @param $assoc - * @param $depth - * @param $options + * @param $json + * @param $assoc + * @param $depth + * @param $options */ public static function decodeJson() { @@ -26,12 +25,11 @@ class Decoder /** * Decode XML * - * @access public - * @param $data - * @param $class_name - * @param $options - * @param $ns - * @param $is_prefix + * @param $data + * @param $class_name + * @param $options + * @param $ns + * @param $is_prefix */ public static function decodeXml() { diff --git a/src/Curl/Encoder.php b/src/Curl/Encoder.php index d999521..6d7359d 100644 --- a/src/Curl/Encoder.php +++ b/src/Curl/Encoder.php @@ -9,11 +9,9 @@ class Encoder * * Wrap json_encode() to throw error when the value being encoded fails. * - * @access public - * @param $value - * @param $options - * @param $depth - * + * @param $value + * @param $options + * @param $depth * @return string * @throws \ErrorException */ diff --git a/src/Curl/MultiCurl.php b/src/Curl/MultiCurl.php index 5ca1437..964259a 100755 --- a/src/Curl/MultiCurl.php +++ b/src/Curl/MultiCurl.php @@ -40,8 +40,7 @@ class MultiCurl extends BaseCurl /** * Construct * - * @access public - * @param $base_url + * @param $base_url */ public function __construct($base_url = null) { @@ -56,11 +55,9 @@ class MultiCurl extends BaseCurl /** * Add Delete * - * @access public - * @param $url - * @param $query_parameters - * @param $data - * + * @param $url + * @param $query_parameters + * @param $data * @return object */ public function addDelete($url, $query_parameters = [], $data = []) @@ -83,10 +80,8 @@ class MultiCurl extends BaseCurl /** * Add Download * - * @access public - * @param $url - * @param $mixed_filename - * + * @param $url + * @param $mixed_filename * @return object */ public function addDownload($url, $mixed_filename) @@ -144,10 +139,8 @@ class MultiCurl extends BaseCurl /** * Add Get * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addGet($url, $data = []) @@ -169,10 +162,8 @@ class MultiCurl extends BaseCurl /** * Add Head * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addHead($url, $data = []) @@ -194,10 +185,8 @@ class MultiCurl extends BaseCurl /** * Add Options * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addOptions($url, $data = []) @@ -219,10 +208,8 @@ class MultiCurl extends BaseCurl /** * Add Patch * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addPatch($url, $data = []) @@ -249,13 +236,12 @@ class MultiCurl extends BaseCurl /** * Add Post * - * @access public - * @param $url - * @param $data - * @param $follow_303_with_post - * If true, will cause 303 redirections to be followed using a POST request (default: false). - * Note: Redirections are only followed if the CURLOPT_FOLLOWLOCATION option is set to true. - * + * @param $url + * @param $data + * @param $follow_303_with_post + * If true, will cause 303 redirections to be followed using a POST request + * (default: false). Note: Redirections are only followed if the + * CURLOPT_FOLLOWLOCATION option is set to true. * @return object */ public function addPost($url, $data = '', $follow_303_with_post = false) @@ -292,10 +278,8 @@ class MultiCurl extends BaseCurl /** * Add Put * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addPut($url, $data = []) @@ -321,10 +305,8 @@ class MultiCurl extends BaseCurl /** * Add Search * - * @access public - * @param $url - * @param $data - * + * @param $url + * @param $data * @return object */ public function addSearch($url, $data = []) @@ -352,9 +334,7 @@ class MultiCurl extends BaseCurl * * Add a Curl instance to the handle queue. * - * @access public - * @param $curl - * + * @param $curl * @return object */ public function addCurl(Curl $curl) @@ -365,8 +345,6 @@ class MultiCurl extends BaseCurl /** * Close - * - * @access public */ public function close() { @@ -383,8 +361,7 @@ class MultiCurl extends BaseCurl /** * Set Concurrency * - * @access public - * @param $concurrency + * @param $concurrency */ public function setConcurrency($concurrency) { @@ -394,9 +371,8 @@ class MultiCurl extends BaseCurl /** * Set Cookie * - * @access public - * @param $key - * @param $value + * @param $key + * @param $value */ public function setCookie($key, $value) { @@ -406,8 +382,7 @@ class MultiCurl extends BaseCurl /** * Set Cookies * - * @access public - * @param $cookies + * @param $cookies */ public function setCookies($cookies) { @@ -419,8 +394,7 @@ class MultiCurl extends BaseCurl /** * Set Cookie String * - * @access public - * @param $string + * @param $string */ public function setCookieString($string) { @@ -430,8 +404,7 @@ class MultiCurl extends BaseCurl /** * Set Cookie File * - * @access public - * @param $cookie_file + * @param $cookie_file */ public function setCookieFile($cookie_file) { @@ -441,8 +414,7 @@ class MultiCurl extends BaseCurl /** * Set Cookie Jar * - * @access public - * @param $cookie_jar + * @param $cookie_jar */ public function setCookieJar($cookie_jar) { @@ -454,9 +426,8 @@ class MultiCurl extends BaseCurl * * Add extra header to include in the request. * - * @access public - * @param $key - * @param $value + * @param $key + * @param $value */ public function setHeader($key, $value) { @@ -469,8 +440,7 @@ class MultiCurl extends BaseCurl * * Add extra headers to include in the request. * - * @access public - * @param $headers + * @param $headers */ public function setHeaders($headers) { @@ -495,8 +465,7 @@ class MultiCurl extends BaseCurl /** * Set JSON Decoder * - * @access public - * @param $mixed boolean|callable + * @param $mixed boolean|callable */ public function setJsonDecoder($mixed) { @@ -510,8 +479,7 @@ class MultiCurl extends BaseCurl /** * Set XML Decoder * - * @access public - * @param $mixed boolean|callable + * @param $mixed boolean|callable */ public function setXmlDecoder($mixed) { @@ -528,9 +496,8 @@ class MultiCurl extends BaseCurl * Set proxies to tunnel requests through. When set, a random proxy will be * used for the request. * - * @access public - * @param $proxies array - A list of HTTP proxies to tunnel requests - * through. May include port number. + * @param $proxies array - A list of HTTP proxies to tunnel requests + * through. May include port number. */ public function setProxies($proxies) { @@ -540,9 +507,8 @@ class MultiCurl extends BaseCurl /** * Set Opt * - * @access public - * @param $option - * @param $value + * @param $option + * @param $value */ public function setOpt($option, $value) { @@ -564,8 +530,7 @@ class MultiCurl extends BaseCurl /** * Set Opts * - * @access public - * @param $options + * @param $options */ public function setOpts($options) { @@ -577,8 +542,7 @@ class MultiCurl extends BaseCurl /** * Set Rate Limit * - * @access public - * @param $rate_limit string (e.g. "60/1m"). + * @param $rate_limit string (e.g. "60/1m"). * @throws \UnexpectedValueException */ public function setRateLimit($rate_limit) @@ -637,8 +601,7 @@ class MultiCurl extends BaseCurl * When using a callable decider, the request will be retried until the * function returns a value which evaluates to false. * - * @access public - * @param $mixed + * @param $mixed */ public function setRetry($mixed) { @@ -648,9 +611,8 @@ class MultiCurl extends BaseCurl /** * Set Url * - * @access public - * @param $url - * @param $mixed_data + * @param $url + * @param $mixed_data */ public function setUrl($url, $mixed_data = '') { @@ -668,7 +630,6 @@ class MultiCurl extends BaseCurl /** * Start * - * @access public * @throws \ErrorException */ public function start() @@ -778,8 +739,6 @@ class MultiCurl extends BaseCurl /** * Stop - * - * @access public */ public function stop() { @@ -806,8 +765,7 @@ class MultiCurl extends BaseCurl * * Remove extra header previously set using Curl::setHeader(). * - * @access public - * @param $key + * @param $key */ public function unsetHeader($key) { @@ -816,8 +774,6 @@ class MultiCurl extends BaseCurl /** * Set request time accuracy - * - * @access public */ public function setRequestTimeAccuracy() { @@ -826,8 +782,6 @@ class MultiCurl extends BaseCurl /** * Destruct - * - * @access public */ public function __destruct() { @@ -836,8 +790,6 @@ class MultiCurl extends BaseCurl /** * Update Headers - * - * @access private */ private function updateHeaders() { @@ -849,8 +801,7 @@ class MultiCurl extends BaseCurl /** * Queue Handle * - * @access private - * @param $curl + * @param $curl */ private function queueHandle($curl) { @@ -868,8 +819,7 @@ class MultiCurl extends BaseCurl /** * Init Handle * - * @access private - * @param $curl + * @param $curl * @throws \ErrorException */ private function initHandle() @@ -933,8 +883,6 @@ class MultiCurl extends BaseCurl * * Checks if there is any available quota to make additional requests while * rate limiting is enabled. - * - * @access private */ private function hasRequestQuota() { @@ -964,8 +912,6 @@ class MultiCurl extends BaseCurl * Wait Until Request Quota Available * * Waits until there is available request quota available based on the rate limit. - * - * @access private */ private function waitUntilRequestQuotaAvailable() { diff --git a/src/Curl/StringUtil.php b/src/Curl/StringUtil.php index 86341f9..a2cf6d8 100644 --- a/src/Curl/StringUtil.php +++ b/src/Curl/StringUtil.php @@ -43,10 +43,8 @@ class StringUtil /** * Return true when $haystack starts with $needle. * - * @access public - * @param $haystack - * @param $needle - * + * @param $haystack + * @param $needle * @return bool */ public static function startsWith($haystack, $needle) diff --git a/src/Curl/Url.php b/src/Curl/Url.php index 901e7ce..da03cb8 100644 --- a/src/Curl/Url.php +++ b/src/Curl/Url.php @@ -22,6 +22,8 @@ class Url * Remove dot segments. * * Interpret and remove the special "." and ".." path segments from a referenced path. + * + * @param mixed $input */ public static function removeDotSegments($input) { @@ -85,10 +87,8 @@ class Url /** * Build Url * - * @access public - * @param $url - * @param $mixed_data - * + * @param $url + * @param $mixed_data * @return string */ public static function buildUrl($url, $mixed_data = '') @@ -175,6 +175,8 @@ class Url * Parse url. * * Parse url into components of a URI as specified by RFC 3986. + * + * @param mixed $url */ public static function parseUrl($url) { @@ -190,6 +192,8 @@ class Url * * Percent-encode characters to represent a data octet in a component when * that octet's corresponding character is outside the allowed set. + * + * @param mixed $chars */ private static function percentEncodeChars($chars) { @@ -227,6 +231,8 @@ class Url * Unparse url. * * Combine url components into a url. + * + * @param mixed $parsed_url */ private function unparseUrl($parsed_url) { diff --git a/tests/.php-cs-fixer.php b/tests/.php-cs-fixer.php index 37cc54b..42db366 100644 --- a/tests/.php-cs-fixer.php +++ b/tests/.php-cs-fixer.php @@ -5,9 +5,82 @@ $finder = PhpCsFixer\Finder::create() $config = new PhpCsFixer\Config(); $config + ->setRiskyAllowed(true) ->setRules([ - 'array_syntax' => ['syntax' => 'short'], + 'array_syntax' => [ + 'syntax' => 'short', + ], + 'constant_case' => [ + 'case' => 'lower', + ], + 'elseif' => true, + 'encoding' => true, + 'general_phpdoc_annotation_remove' => [ + 'annotations' => [ + 'access', + 'author', + ], + 'case_sensitive' => false, + ], + 'is_null' => true, + 'no_blank_lines_after_phpdoc' => true, + 'no_leading_import_slash' => true, 'no_unused_imports' => true, + 'ordered_imports' => [ + 'sort_algorithm' => 'alpha', + ], + 'phpdoc_add_missing_param_annotation' => [ + 'only_untyped' => false, + ], + 'phpdoc_align' => [ + 'align' => 'vertical', + ], + 'phpdoc_indent' => true, + 'phpdoc_line_span' => [ + 'const' => 'multi', + 'method' => 'multi', + 'property' => 'multi', + ], + 'phpdoc_order' => [ + 'order' => [ + 'param', + 'return', + 'throws', + 'see', + ], + ], + 'phpdoc_param_order' => true, + 'phpdoc_scalar' => true, + 'phpdoc_separation' => [ + 'groups' => [ + [ + 'deprecated', + 'expectedException', + 'param', + 'requires', + 'return', + 'see', + 'throws', + ], + ], + 'skip_unlisted_annotations' => false, + ], + 'phpdoc_trim' => true, + 'phpdoc_trim_consecutive_blank_line_separation' => true, + 'phpdoc_types' => true, + 'phpdoc_types_order' => [ + 'null_adjustment' => 'always_last', + 'sort_algorithm' => 'alpha', + ], + 'short_scalar_cast' => true, + 'strict_comparison' => true, + 'strict_param' => true, + 'trailing_comma_in_multiline' => true, + 'yoda_style' => [ + 'equal' => false, + 'identical' => false, + 'less_and_greater' => false, + ], ]) ->setFinder($finder); diff --git a/tests/PHPCurlClass/PHPCurlClassTest.php b/tests/PHPCurlClass/PHPCurlClassTest.php index 02f03da..c061845 100644 --- a/tests/PHPCurlClass/PHPCurlClassTest.php +++ b/tests/PHPCurlClass/PHPCurlClassTest.php @@ -14,7 +14,7 @@ class PHPCurlClassTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->skip_slow_tests = in_array(getenv('PHP_CURL_CLASS_SKIP_SLOW_TESTS'), ['1', 'y', 'Y']); + $this->skip_slow_tests = in_array(getenv('PHP_CURL_CLASS_SKIP_SLOW_TESTS'), ['1', 'y', 'Y'], true); } public function testExtensionsLoaded() @@ -3546,7 +3546,7 @@ class PHPCurlClassTest extends \PHPUnit\Framework\TestCase [ 'args' => [ 'url' => 'https://www.example.com/?a=base', - 'mixed_data' => 'b=2&c=3' + 'mixed_data' => 'b=2&c=3', ], 'expected' => 'https://www.example.com/?a=base&b=2&c=3', ], @@ -4523,7 +4523,7 @@ class PHPCurlClassTest extends \PHPUnit\Framework\TestCase 'message' => 'The service is currently unavailable.', 'domain' => 'global', 'reason' => 'backendError', - ] + ], ], 'status' => 'UNAVAILABLE', ], diff --git a/tests/PHPCurlClass/PHPMultiCurlClassTest.php b/tests/PHPCurlClass/PHPMultiCurlClassTest.php index 134b47a..dfbf391 100644 --- a/tests/PHPCurlClass/PHPMultiCurlClassTest.php +++ b/tests/PHPCurlClass/PHPMultiCurlClassTest.php @@ -12,7 +12,7 @@ class PHPMultiCurlClassTest extends \PHPUnit\Framework\TestCase protected function setUp(): void { - $this->skip_slow_tests = in_array(getenv('PHP_CURL_CLASS_SKIP_SLOW_TESTS'), ['1', 'y', 'Y']); + $this->skip_slow_tests = in_array(getenv('PHP_CURL_CLASS_SKIP_SLOW_TESTS'), ['1', 'y', 'Y'], true); } public function testMultiCurlCallback() diff --git a/tests/check_coding_standards.sh b/tests/check_coding_standards.sh index 3a8346b..3b81fbc 100755 --- a/tests/check_coding_standards.sh +++ b/tests/check_coding_standards.sh @@ -84,22 +84,6 @@ if [[ ! -z "${long_lines}" ]]; then errors+=("${result}") fi -# Prohibit @author in php files. -at_author=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --extended-regexp --line-number -H "@author" {} \;) -if [[ ! -z "${at_author}" ]]; then - result="$(echo -e "${at_author}" | perl -pe 's/^(.*)$/\@author found in \1/')" - echo "${result}" - errors+=("${result}") -fi - -# Prohibit screaming caps notation in php files. -caps=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --extended-regexp --line-number -H -e "FALSE[^']" -e "NULL" -e "TRUE" {} \;) -if [[ ! -z "${caps}" ]]; then - result="$(echo -e "${caps}" | perl -pe 's/^(.*)$/All caps found in \1/')" - echo "${result}" - errors+=("${result}") -fi - # Require identical comparison operators (===, not ==) in php files. equal=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --extended-regexp --line-number -H "[^!=]==[^=]" {} \;) if [[ ! -z "${equal}" ]]; then @@ -108,14 +92,6 @@ if [[ ! -z "${equal}" ]]; then errors+=("${result}") fi -# Require keyword "elseif" to be used instead of "else if" so that all control keywords look like single words. -elseif=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --extended-regexp --line-number -H "else\s+if" {} \;) -if [[ ! -z "${elseif}" ]]; then - result="$(echo -e "${elseif}" | perl -pe 's/^(.*)$/Found "else if" instead of "elseif" in \1/')" - echo "${result}" - errors+=("${result}") -fi - # Require both braces on else statement line; "} else {" and not "}\nelse {". elses=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --line-number -H --perl-regexp '^(\s+)?else(\s+)?{' {} \;) if [[ ! -z "${elses}" ]]; then @@ -124,14 +100,6 @@ if [[ ! -z "${elses}" ]]; then errors+=("${result}") fi -# Prohibit use of "is_null" and suggest using the strict comparison operator. -is_null=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --line-number -H -e "is_null" {} \;) -if [[ ! -z "${is_null}" ]]; then - result="$(echo -e "${is_null}" | perl -pe 's/^(.*)$/is_null found in \1. Replace with strict comparison (e.g. "\$x === null")./')" - echo "${result}" - errors+=("${result}") -fi - # Run PHP_CodeSniffer. if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then : elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : @@ -162,6 +130,9 @@ fi # Run PHP-CS-Fixer. if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then : +elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then : +elif [[ "${CI_PHP_VERSION}" == "7.2" ]]; then : +elif [[ "${CI_PHP_VERSION}" == "7.3" ]]; then : else vendor/bin/php-cs-fixer --version vendor/bin/php-cs-fixer fix --ansi --config="tests/.php-cs-fixer.php" --diff --dry-run