diff --git a/.gitignore b/.gitignore index ecdf2d7..ca03603 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ vendor .idea +cghooks.lock + diff --git a/src/DeepLTranslator.php b/src/DeepLTranslator.php index 8b159e3..785d98f 100644 --- a/src/DeepLTranslator.php +++ b/src/DeepLTranslator.php @@ -54,14 +54,11 @@ public function __construct(int $timeout = 5) $this->timeout = $timeout; } - /** - * @return DeepLTranslator - */ public static function withoutVerifying(): DeepLTranslator { - self::$verify = false; + static::$verify = false; - return new self; + return new static; } /** @@ -116,7 +113,7 @@ public function translate(string $query, string $to, string $from = 'auto'): Dee } /** - * @param int $type 0:format 1:json string 2:array + * @param int $type 0:format 1:json string 2:array * @return array|string */ public function result(int $type = self::TYPE_FORMAT) @@ -206,7 +203,7 @@ private function postData(string $url, string $data) CURLOPT_RETURNTRANSFER => true, ]; - if (self::$verify == false) { + if (! static::$verify) { $opt[CURLOPT_SSL_VERIFYPEER] = false; $opt[CURLOPT_SSL_VERIFYHOST] = false; }