Merge pull request #793 from RobinvanderVliet/use-short-array-syntax

Use short array syntax
This commit is contained in:
Zach Borboa
2023-06-26 04:08:25 -07:00
committed by GitHub
3 changed files with 5 additions and 5 deletions
@@ -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
View File
@@ -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) {
+2 -2
View File
@@ -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',