+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* CiviCRM components
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
* $Id$
*
*/
*/
const COMPONENT_INFO_CLASS = 'Info';
- static $_contactSubTypes = NULL;
+ /**
+ * @var array
+ */
+ public static $_contactSubTypes = NULL;
/**
* @param bool $force
*/
private static function &_info($force = FALSE) {
if (!isset(Civi::$statics[__CLASS__]['info'])|| $force) {
- Civi::$statics[__CLASS__]['info'] = array();
- $c = array();
+ Civi::$statics[__CLASS__]['info'] = [];
+ $c = [];
$config = CRM_Core_Config::singleton();
$c = self::getComponents();
*/
public static function &getComponents($force = FALSE) {
if (!isset(Civi::$statics[__CLASS__]['all']) || $force) {
- Civi::$statics[__CLASS__]['all'] = array();
+ Civi::$statics[__CLASS__]['all'] = [];
$cr = new CRM_Core_DAO_Component();
$cr->find(FALSE);
* Array(string $name => int $id).
*/
public static function &getComponentIDs() {
- $componentIDs = array();
+ $componentIDs = [];
$cr = new CRM_Core_DAO_Component();
$cr->find(FALSE);
return $componentIDs;
}
-
/**
* @param bool $force
*
* @return CRM_Core_Component_Info[]
*/
- static public function &getEnabledComponents($force = FALSE) {
+ public static function &getEnabledComponents($force = FALSE) {
return self::_info($force);
}
- static public function flushEnabledComponents() {
+ public static function flushEnabledComponents() {
unset(Civi::$statics[__CLASS__]);
}
public static function &getNames($translated = FALSE) {
$allComponents = self::getComponents();
- $names = array();
+ $names = [];
foreach ($allComponents as $name => $comp) {
if ($translated) {
$names[$comp->componentID] = $comp->info['translatedName'];
// lets build the menu for all components
$info = self::getComponents(TRUE);
- $files = array();
+ $files = [];
foreach ($info as $name => $comp) {
$files = array_merge($files,
$comp->menuFiles()
*/
public static function &menu() {
$info = self::_info();
- $items = array();
+ $items = [];
foreach ($info as $name => $comp) {
$mnu = $comp->getMenuObject();
*/
public static function &getQueryFields($checkPermission = TRUE) {
$info = self::_info();
- $fields = array();
+ $fields = [];
foreach ($info as $name => $comp) {
if ($comp->usesSearch()) {
$bqr = $comp->getBAOQueryObject();
*/
public static function &contactSubTypes() {
if (self::$_contactSubTypes == NULL) {
- self::$_contactSubTypes = array();
+ self::$_contactSubTypes = [];
}
return self::$_contactSubTypes;
}
-
/**
* @param $subType
* @param $op
* @return array
*/
public static function getComponentsFromFile($crmFolderDir) {
- $components = array();
+ $components = [];
//traverse CRM folder and check for Info file
if (is_dir($crmFolderDir) && $dir = opendir($crmFolderDir)) {
while ($subDir = readdir($dir)) {