Skip to content
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

[REF][php8-compat] Fix more instances of where there is a required pa… #20497

Merged
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
3 changes: 1 addition & 2 deletions CRM/Core/Permission/UnitTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ public function check($str, $userId = NULL) {
if ($str == CRM_Core_Permission::ALWAYS_ALLOW_PERMISSION) {
return TRUE;
}

// return the stubbed permission (defaulting to true if the array is missing)
return is_array($this->permissions) ? in_array($str, $this->permissions) : TRUE;
return isset($this->permissions) && is_array($this->permissions) ? in_array($str, $this->permissions) : TRUE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My personal pref is to clarify the groupings with brackets and it's not unheard of for php to change the order between versions (in fact in looks like there's a minor change for . in 8 - not relevant here), but ok this looks right.

}

/**
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Reference/OptionValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CRM_Core_Reference_OptionValue extends CRM_Core_Reference_Basic {
* @param string $targetKey
* @param null $optionGroupName
*/
public function __construct($refTable, $refKey, $targetTable = NULL, $targetKey = 'id', $optionGroupName) {
public function __construct($refTable, $refKey, $targetTable, $targetKey, $optionGroupName) {
parent::__construct($refTable, $refKey, $targetTable, $targetKey, NULL);
$this->targetOptionGroupName = $optionGroupName;
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Utils/Pager.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function initialize(&$params) {
* @return int
* new pageId to display to the user
*/
public function getPageID($defaultPageId = 1, &$params) {
public function getPageID($defaultPageId, &$params) {
// POST has higher priority than GET vars
// else if a value is set that has higher priority and finally the GET var
$currentPage = $defaultPageId;
Expand Down
2 changes: 1 addition & 1 deletion Civi/Payment/PropertyBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ protected function get($prop, $label) {
*
* @return PropertyBag $this object so you can chain set setters.
*/
protected function set($prop, $label = 'default', $value) {
protected function set($prop, $label, $value) {
$this->props[$label][$prop] = $value;
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/CRM/Contact/BAO/RelationshipTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function testContactIdAndRelationshipIdWillBeUsedInFilter() {
*
* @dataProvider getRelationshipTypeDuplicates
*/
public function testRemoveRelationshipTypeDuplicates($relationshipTypeList, $suffix = NULL, $expected, $description) {
public function testRemoveRelationshipTypeDuplicates($relationshipTypeList, $suffix, $expected, $description) {
$result = CRM_Contact_BAO_Relationship::removeRelationshipTypeDuplicates($relationshipTypeList, $suffix);
$this->assertEquals($expected, $result, "Failure on set '$description'");
}
Expand Down