mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-30 04:01:47 +00:00
Merge pull request #793 from RobinvanderVliet/use-short-array-syntax
Use short array syntax
This commit is contained in:
@@ -9,7 +9,7 @@ $tags_to_urls = [
|
||||
'tag5' => 'https://httpbin.org/status/503',
|
||||
];
|
||||
|
||||
$ids_to_tags = array();
|
||||
$ids_to_tags = [];
|
||||
|
||||
$multi_curl = new MultiCurl();
|
||||
|
||||
|
||||
+2
-2
@@ -1321,7 +1321,7 @@ class Curl extends BaseCurl
|
||||
if ($this->attempts === 0) {
|
||||
echo 'No HTTP requests have been made.' . "\n";
|
||||
} else {
|
||||
$request_types = array(
|
||||
$request_types = [
|
||||
'DELETE' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'DELETE',
|
||||
'GET' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'GET' || $this->getOpt(CURLOPT_HTTPGET),
|
||||
'HEAD' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'HEAD',
|
||||
@@ -1330,7 +1330,7 @@ class Curl extends BaseCurl
|
||||
'POST' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'POST' || $this->getOpt(CURLOPT_POST),
|
||||
'PUT' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'PUT',
|
||||
'SEARCH' => $this->getOpt(CURLOPT_CUSTOMREQUEST) === 'SEARCH',
|
||||
);
|
||||
];
|
||||
$request_method = '';
|
||||
foreach ($request_types as $http_method_name => $http_method_used) {
|
||||
if ($http_method_used) {
|
||||
|
||||
@@ -33,7 +33,7 @@ class ArrayUtilTest extends \PHPUnit\Framework\TestCase
|
||||
|
||||
public function testArrayFlattenMultidimArray()
|
||||
{
|
||||
$data = array(
|
||||
$data = [
|
||||
'key-1' => 'value-1',
|
||||
'key-2' => 'value-2',
|
||||
'key-3' => [
|
||||
@@ -44,7 +44,7 @@ class ArrayUtilTest extends \PHPUnit\Framework\TestCase
|
||||
'nested-more-key-2' => 'nested-more-value-2',
|
||||
],
|
||||
],
|
||||
);
|
||||
];
|
||||
|
||||
$this->assertEquals([
|
||||
'key-1' => 'value-1',
|
||||
|
||||
Reference in New Issue
Block a user