Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mago.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: ./.github/actions/setup-php

- name: Install Mago
run: composer config --no-plugins allow-plugins.carthage-software/mago true; composer require --dev carthage-software/mago:1.9.1
run: composer config --no-plugins allow-plugins.carthage-software/mago true; composer require --dev carthage-software/mago:1.42.0

- name: Run Mago
run: ./vendor/bin/mago --config .mago/mago.toml analyze
3 changes: 2 additions & 1 deletion src/Supporting/CommunicationProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -800,11 +800,11 @@
$request = $this->justifyRequest($request);
}
$ch = $this->_createCurlHandle($url);
curl_setopt($ch, CURLOPT_VERBOSE, 0);

Check failure on line 803 in src/Supporting/CommunicationProvider.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (5)

Parameter #3 $value of function curl_setopt expects bool, int given.
curl_setopt($ch, CURLOPT_HEADER, 1);

Check failure on line 804 in src/Supporting/CommunicationProvider.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (5)

Parameter #3 $value of function curl_setopt expects bool, int given.
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
if ($methodLower == 'post') {
curl_setopt($ch, CURLOPT_POST, 1);

Check failure on line 807 in src/Supporting/CommunicationProvider.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (5)

Parameter #3 $value of function curl_setopt expects bool, int given.
} elseif (in_array($methodLower, ['put', 'patch', 'delete', 'get'], true)) {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($methodLower));
}
Expand Down Expand Up @@ -1109,18 +1109,19 @@
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_DEFAULT);
if ($this->isCertValidating) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);

Check failure on line 1112 in src/Supporting/CommunicationProvider.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (5)

Parameter #3 $value of function curl_setopt expects bool, int given.
/* Use the OS native certificate authorities, if possible.
This fixes SSL validation errors if `php.ini` doesn't have [curl] `curl.cainfo`,
set properly of if this PEM file isn't up to date.
Better rely on the OS certificate authorities, which is maintained automatically. */
$curlVersion = curl_version();
if (defined('CURLSSLOPT_NATIVE_CA')
&& version_compare(curl_version()['version'], '7.71', '>=')) {
&& is_array($curlVersion) && version_compare($curlVersion['version'], '7.71', '>=')) {
curl_setopt($ch, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
}
} else {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

Check failure on line 1124 in src/Supporting/CommunicationProvider.php

View workflow job for this annotation

GitHub Actions / Run PHPStan (5)

Parameter #3 $value of function curl_setopt expects bool, int given.
}
if (!is_null($this->timeout)) {
curl_setopt($ch, CURLOPT_TIMEOUT, $this->timeout);
Expand Down
12 changes: 7 additions & 5 deletions src/Supporting/FileMakerRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FileMakerRelation implements Iterator
/**
* FileMakerRelation constructor.
*
* @param array<object> $responseData
* @param array|object $responseData
* @param object|array|null $infoData
* @param string $result
* @param int $errorCode
Expand Down Expand Up @@ -263,15 +263,16 @@ public function getFieldNames(): array
private function getNumberedRecord(int $num): ?FileMakerRelation
{
$value = null;
if (isset($this->data[$num])) {
$data = $this->data;
if (is_array($data) && isset($data[$num])) {
$tmpInfo = $this->getDataInfo();
$dataInfo = null;
if (is_object($tmpInfo)) {
$dataInfo = clone $tmpInfo;
$dataInfo->returnedCount = 1;
}
$value = new FileMakerRelation(
$this->data[$num], $dataInfo, ($this->result == "PORTAL") ? "PORTALRECORD" : "RECORD",
$data[$num], $dataInfo, ($this->result == "PORTAL") ? "PORTALRECORD" : "RECORD",
$this->errorCode, $this->portalName, $this->restAPI);
}
return $value;
Expand Down Expand Up @@ -542,7 +543,8 @@ public function current(): ?FileMakerRelation
switch ($this->result) {
case "OK":
case "PORTAL":
if (isset($this->data[$this->pointer])) {
$data = $this->data;
if (is_array($data) && isset($data[$this->pointer])) {
$tmpInfo = $this->getDataInfo();
$dataInfo = null;
if (is_object($tmpInfo)) {
Expand All @@ -551,7 +553,7 @@ public function current(): ?FileMakerRelation
}
$result = ($this->result == "PORTAL") ? "PORTALRECORD" : "RECORD";
$portalName = $this->portalName;
$value = new FileMakerRelation($this->data[$this->pointer], $dataInfo, $result,
$value = new FileMakerRelation($data[$this->pointer], $dataInfo, $result,
$this->errorCode, $portalName, $this->restAPI);
}
break;
Expand Down
Loading