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

dev/core#2823 Make protected functions non-static #21395

Merged
merged 1 commit into from
Sep 8, 2021
Merged
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
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