[REF][php8-compat] Fix more instances of where there is a required parameter for...
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 4 Jun 2021 00:42:47 +0000 (00:42 +0000)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 4 Jun 2021 00:45:07 +0000 (00:45 +0000)
CRM/Core/Permission/UnitTests.php
CRM/Core/Reference/OptionValue.php
CRM/Utils/Pager.php
Civi/Payment/PropertyBag.php
tests/phpunit/CRM/Contact/BAO/RelationshipTest.php

index 24879ab5a343f67a2b989ab78e5e1e008831d274..0143bc352dcd268f1a0fd42909012e8c6e6ded2c 100644 (file)
@@ -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;
   }
 
   /**
index 9908be044b64f72c330acc07d159d247a9414cef..46413212392c93f1ba175eae9c06283a948ef5ba 100644 (file)
@@ -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;
   }
index 692daf8547c56606ff6ec9b9904877564a241d26..d0c7a1d557122ebe939fcf51c8771f4f3663d6d2 100644 (file)
@@ -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;
index 7a1119aea3e734d56c668ba0f2b533e75d1cfc17..1e9c5988de73f99a2f738513d630fabbb136bf88 100644 (file)
@@ -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;
   }
index a78e350c5b7e5181e6ef818edeef028d6d640103..fd8329c4a2d3881cff2a9c63c421870b6307b339 100644 (file)
@@ -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'");
   }