Skip to content

Commit

Permalink
Merge pull request #21395 from eileenmcnaughton/mgd
Browse files Browse the repository at this point in the history
dev/core#2823 Make protected functions non-static
  • Loading branch information
eileenmcnaughton authored Sep 8, 2021
2 parents a1feba7 + 85917c3 commit 13b45ac
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions CRM/Core/ManagedEntities.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ function () {
* Per hook_civicrm_managed.
*/
public function __construct($modules, $declarations) {
$this->moduleIndex = self::createModuleIndex($modules);
$this->moduleIndex = $this->createModuleIndex($modules);

if ($declarations !== NULL) {
$this->declarations = self::cleanDeclarations($declarations);
$this->declarations = $this->cleanDeclarations($declarations);
}
else {
$this->declarations = NULL;
Expand Down Expand Up @@ -140,7 +140,7 @@ public function reconcileEnabledModules() {
// an active module -- because we got it from a hook!

// index by moduleName,name
$decls = self::createDeclarationIndex($this->moduleIndex, $this->getDeclarations());
$decls = $this->createDeclarationIndex($this->moduleIndex, $this->getDeclarations());
foreach ($decls as $moduleName => $todos) {
if (isset($this->moduleIndex[TRUE][$moduleName])) {
$this->reconcileEnabledModule($this->moduleIndex[TRUE][$moduleName], $todos);
Expand Down Expand Up @@ -392,7 +392,7 @@ public function getDeclarations() {
$this->declarations = array_merge($this->declarations, $component->getManagedEntities());
}
CRM_Utils_Hook::managed($this->declarations);
$this->declarations = self::cleanDeclarations($this->declarations);
$this->declarations = $this->cleanDeclarations($this->declarations);
}
return $this->declarations;
}
Expand All @@ -404,7 +404,7 @@ public function getDeclarations() {
* @return array
* indexed by is_active,name
*/
protected static function createModuleIndex($modules) {
protected function createModuleIndex($modules) {
$result = [];
foreach ($modules as $module) {
$result[$module->is_active][$module->name] = $module;
Expand All @@ -419,7 +419,7 @@ protected static function createModuleIndex($modules) {
* @return array
* indexed by module,name
*/
protected static function createDeclarationIndex($moduleIndex, $declarations) {
protected function createDeclarationIndex($moduleIndex, $declarations) {
$result = [];
if (!isset($moduleIndex[TRUE])) {
return $result;
Expand All @@ -442,7 +442,7 @@ protected static function createDeclarationIndex($moduleIndex, $declarations) {
* @return string|bool
* string on error, or FALSE
*/
protected static function validate($declarations) {
protected function validate($declarations) {
foreach ($declarations as $declare) {
foreach (['name', 'module', 'entity', 'params'] as $key) {
if (empty($declare[$key])) {
Expand All @@ -460,7 +460,7 @@ protected static function validate($declarations) {
*
* @return array
*/
protected static function cleanDeclarations($declarations) {
protected function cleanDeclarations(array $declarations): array {
foreach ($declarations as $name => &$declare) {
if (!array_key_exists('name', $declare)) {
$declare['name'] = $name;
Expand Down

0 comments on commit 13b45ac

Please sign in to comment.