*/
const COMPONENT_INFO_CLASS = 'Info';
- /**
- * @var array
- */
- public static $_contactSubTypes = NULL;
-
/**
* @param bool $force
*
}
/**
+ * Unused function.
+ *
* @return array|null
+ *
+ * @deprecated
*/
- public static function &contactSubTypes() {
- if (self::$_contactSubTypes == NULL) {
- self::$_contactSubTypes = [];
- }
- return self::$_contactSubTypes;
+ public static function contactSubTypes() {
+ CRM_Core_Error::deprecatedWarning('unused');
+ return [];
}
/**
- * @param $subType
- * @param $op
+ * Unused function.
*
- * @return null
+ * @param string $subType
+ * @param string $op
+ *
+ * @return null|string
+ *
+ * @deprecated
*/
- public static function &contactSubTypeProperties($subType, $op) {
+ public static function contactSubTypeProperties($subType, $op): ?string {
+ CRM_Core_Error::deprecatedWarning('unused');
$properties = self::contactSubTypes();
if (array_key_exists($subType, $properties) &&
array_key_exists($op, $properties[$subType])
) {
return $properties[$subType][$op];
}
- return CRM_Core_DAO::$_nullObject;
+ return NULL;
}
/**
if (is_dir($crmFolderDir) && $dir = opendir($crmFolderDir)) {
while ($subDir = readdir($dir)) {
// skip the extensions diretory since it has an Info.php file also
- if ($subDir == 'Extension') {
+ if ($subDir === 'Extension') {
continue;
}
$infoFile = $crmFolderDir . "/{$subDir}/" . self::COMPONENT_INFO_CLASS . '.php';
if (file_exists($infoFile)) {
$infoClass = 'CRM_' . $subDir . '_' . self::COMPONENT_INFO_CLASS;
- require_once str_replace('_', DIRECTORY_SEPARATOR, $infoClass) . '.php';
$infoObject = new $infoClass(NULL, NULL, NULL);
$components[$infoObject->info['name']] = $infoObject;
unset($infoObject);