Skip to content

Commit

Permalink
APIv4 - Rename 'ReadOnly' trait to 'ReadonlyEntity' to avoid PHP rese…
Browse files Browse the repository at this point in the history
…rved word

Fixes dev/core#3043
The word 'readonly' is reserved as of php 8.1
  • Loading branch information
colemanw committed Jan 26, 2022
1 parent e463176 commit 566d4a0
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Civi/Api4/EntityFinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
class EntityFinancialTrxn extends Generic\DAOEntity {
use Generic\Traits\EntityBridge;
use Generic\Traits\ReadOnly;
use Generic\Traits\ReadonlyEntity;

/**
* @return array
Expand Down
2 changes: 1 addition & 1 deletion Civi/Api4/FinancialItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
* @package Civi\Api4
*/
class FinancialItem extends Generic\DAOEntity {
use Generic\Traits\ReadOnly;
use Generic\Traits\ReadonlyEntity;

}
2 changes: 1 addition & 1 deletion Civi/Api4/FinancialTrxn.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
* @package Civi\Api4
*/
class FinancialTrxn extends Generic\DAOEntity {
use Generic\Traits\ReadOnly;
use Generic\Traits\ReadonlyEntity;

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Trait for Entities not intended to be publicly writable.
*/
trait ReadOnly {
trait ReadonlyEntity {

/**
* Not intended to be used outside CiviCRM core code.
Expand Down
2 changes: 1 addition & 1 deletion Civi/Api4/LineItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
* @package Civi\Api4
*/
class LineItem extends Generic\DAOEntity {
use Generic\Traits\ReadOnly;
use Generic\Traits\ReadonlyEntity;

}
2 changes: 1 addition & 1 deletion tests/phpunit/api/v4/Entity/ConformanceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ protected function toDataProviderArray($names) {
* @return bool
*/
protected function isReadOnly($entityClass) {
return in_array('ReadOnly', $entityClass::getInfo()['type'], TRUE);
return in_array('ReadonlyEntity', $entityClass::getInfo()['type'], TRUE);
}

/**
Expand Down

0 comments on commit 566d4a0

Please sign in to comment.