-
-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix PHP8 Deprecated: Required parameter $A follows optional parameter #1392
Merged
Flyingmana
merged 2 commits into
OpenMage:1.9.4.x
from
sreichel:php8/optional-parameter
May 23, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,11 +131,11 @@ public function removeButton($id) | |
* Update specified button property | ||
* | ||
* @param string $id | ||
* @param string|null $key | ||
* @param string $key | ||
* @param mixed $data | ||
* @return $this | ||
*/ | ||
protected function _updateButton($id, $key=null, $data) | ||
protected function _updateButton($id, $key, $data) | ||
{ | ||
foreach ($this->_buttons as $level => $buttons) { | ||
if (isset($buttons[$id])) { | ||
|
@@ -162,11 +162,11 @@ protected function _updateButton($id, $key=null, $data) | |
* Public wrapper for protected _updateButton method | ||
* | ||
* @param string $id | ||
* @param string|null $key | ||
* @param string $key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it still accepts null as a param here |
||
* @param mixed $data | ||
* @return $this | ||
*/ | ||
public function updateButton($id, $key=null, $data) | ||
public function updateButton($id, $key, $data) | ||
{ | ||
return $this->_updateButton($id, $key, $data); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,61 +48,63 @@ function getValue($name) { | |
} | ||
|
||
|
||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Function getRequestXml(name) | ||
// | ||
// Serialize all elements of the request collection into a XML message, and format the required | ||
// form payload according to the Centinel XML Message APIs. The form payload is returned from | ||
// the function. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Function getRequestXml(name) | ||
// | ||
// Serialize all elements of the request collection into a XML message, and format the required | ||
// form payload according to the Centinel XML Message APIs. The form payload is returned from | ||
// the function. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
|
||
function getRequestXml(){ | ||
$queryString = "<CardinalMPI>"; | ||
foreach ($this->request as $name => $value) { | ||
$queryString = $queryString."<".($name).">".($value)."</".($name).">" ; | ||
} | ||
$queryString = $queryString."</CardinalMPI>"; | ||
return "cmpi_msg=".urlencode($queryString); | ||
} | ||
function getRequestXml() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unrelated style change |
||
{ | ||
$queryString = "<CardinalMPI>"; | ||
foreach ($this->request as $name => $value) { | ||
$queryString = $queryString . "<" . ($name) . ">" . ($value) . "</" . ($name) . ">"; | ||
} | ||
$queryString = $queryString . "</CardinalMPI>"; | ||
return "cmpi_msg=" . urlencode($queryString); | ||
} | ||
|
||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Function sendHttp(url, "", $timeout) | ||
// | ||
// HTTP POST the form payload to the url using cURL. | ||
// form payload according to the Centinel XML Message APIs. The form payload is returned from | ||
// the function. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
// Function sendHttp(url, "", $timeout) | ||
// | ||
// HTTP POST the form payload to the url using cURL. | ||
// form payload according to the Centinel XML Message APIs. The form payload is returned from | ||
// the function. | ||
///////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
function sendHttp($url, $connectTimeout="", $timeout) { | ||
function sendHttp($url, $connectTimeout, $timeout) | ||
{ | ||
|
||
// verify that the URL uses a supported protocol. | ||
// verify that the URL uses a supported protocol. | ||
|
||
if( (strpos($url, "http://")=== 0) || (strpos($url, "https://")=== 0) ) { | ||
if ((strpos($url, "http://") === 0) || (strpos($url, "https://") === 0)) { | ||
|
||
//Construct the payload to POST to the url. | ||
//Construct the payload to POST to the url. | ||
|
||
$data = $this->getRequestXml(); | ||
// create a new cURL resource | ||
$data = $this->getRequestXml(); | ||
// create a new cURL resource | ||
|
||
$ch = curl_init($url); | ||
$ch = curl_init($url); | ||
|
||
// set URL and other appropriate options | ||
curl_setopt($ch, CURLOPT_POST,1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | ||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); | ||
// set URL and other appropriate options | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | ||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | ||
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); | ||
|
||
// Execute the request. | ||
// Execute the request. | ||
|
||
$result = curl_exec($ch); | ||
$succeeded = curl_errno($ch) == 0 ? true : false; | ||
$result = curl_exec($ch); | ||
$succeeded = curl_errno($ch) == 0 ? true : false; | ||
|
||
// close cURL resource, and free up system resources | ||
// close cURL resource, and free up system resources | ||
|
||
curl_close($ch); | ||
curl_close($ch); | ||
|
||
// If Communication was not successful set error result, otherwise | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it still accepts null as a param for this