Merge pull request #24117 from civicrm/5.52
[civicrm-core.git] / CRM / Core / Resources.php
index 6945376e6120e76d07d63190ef7cbc3ca1b86ee1..cc47859bc58e1ab8efdce6184a787aef89e1fe77 100644 (file)
@@ -167,7 +167,7 @@ class CRM_Core_Resources implements CRM_Core_Resources_CollectionAdderInterface
    * @see CRM_Core_Resources_CollectionTrait::findCreateSettingSnippet()
    */
   public function &findCreateSettingSnippet($options = []): array {
-    $options = CRM_Core_Resources_CollectionAdderTrait::mergeSettingOptions($options, [
+    $options = self::mergeSettingOptions($options, [
       'region' => NULL,
     ]);
     return $this->getSettingRegion($options['region'])->findCreateSettingSnippet($options);
@@ -307,7 +307,7 @@ class CRM_Core_Resources implements CRM_Core_Resources_CollectionAdderInterface
    *   List of matching files, relative to the extension base dir.
    * @see glob()
    */
-  public function glob($ext, $patterns, $flags = NULL) {
+  public function glob($ext, $patterns, $flags = 0) {
     $path = $this->getPath($ext);
     $patterns = (array) $patterns;
     $files = [];
@@ -449,7 +449,7 @@ class CRM_Core_Resources implements CRM_Core_Resources_CollectionAdderInterface
     ) {
       return TRUE;
     }
-    list($arg0, $arg1) = array_pad(explode('/', CRM_Utils_System::currentPath()), 2, '');
+    list($arg0, $arg1) = array_pad(explode('/', (CRM_Utils_System::currentPath() ?? '')), 2, '');
     return ($arg0 === 'civicrm' && in_array($arg1, ['ajax', 'angularprofiles', 'asset']));
   }