Skip to content
Snippets Groups Projects
Commit 47eea6b6 authored by Seamus Lee's avatar Seamus Lee
Browse files

[REF][php8-compat] Fix more instances of where there is a required parameter...

[REF][php8-compat] Fix more instances of where there is a required parameter for a function after an optional one and fix an issue where by a NULL function property is treated as not exisiting in php8
parent 72c28dd4
No related branches found
No related tags found
No related merge requests found
......@@ -43,9 +43,8 @@ class CRM_Core_Permission_UnitTests extends CRM_Core_Permission_Base {
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;
}
/**
......
......@@ -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;
}
......
......@@ -177,7 +177,7 @@ class CRM_Utils_Pager extends Pager_Sliding {
* @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;
......
......@@ -296,7 +296,7 @@ class PropertyBag implements \ArrayAccess {
*
* @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;
}
......
......@@ -139,7 +139,7 @@ class CRM_Contact_BAO_RelationshipTest extends CiviUnitTestCase {
*
* @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'");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment