original_string: public function scanAliases($sourceDir)
      {
          $locales = $this->scanLocales($sourceDir);
          $aliases = [];
  
          // Delete locales that are no aliases
          foreach ($locales as $locale) {
              $content = file_get_contents($sourceDir.'/'.$locale.'.txt');
  
              // Aliases contain the text "%%ALIAS" followed by the aliased locale
              if (preg_match('/"%%ALIAS"\{"([^"]+)"\}/', $content, $matches)) {
                  $aliases[$locale] = $matches[1];
              }
          }
  
          return $aliases;
      }
code: public function scanAliases($sourceDir)
      {
          $locales = $this->scanLocales($sourceDir);
          $aliases = [];
  
          // Delete locales that are no aliases
          foreach ($locales as $locale) {
              $content = file_get_contents($sourceDir.'/'.$locale.'.txt');
  
              // Aliases contain the text "%%ALIAS" followed by the aliased locale
              if (preg_match('/"%%ALIAS"\{"([^"]+)"\}/', $content, $matches)) {
                  $aliases[$locale] = $matches[1];
              }
          }
  
          return $aliases;
      }
code_tokens: public function scanAliases ( $ sourceDir ) { $ locales = $ this -> scanLocales ( $ sourceDir ) ; $ aliases = [ ] ; // Delete locales that are no aliases foreach ( $ locales as $ locale ) { $ content = file_get_contents ( $ sourceDir . '/' . $ locale . '.txt' ) ; // Aliases contain the text "%%ALIAS" followed by the aliased locale if ( preg_match ( '/"%%ALIAS"\{"([^"]+)"\}/' , $ content , $ matches ) ) { $ aliases [ $ locale ] = $ matches [ 1 ] ; } } return $ aliases ; }
docstring: Returns all locale aliases found in the given directory.
  
  @param string $sourceDir The directory with ICU files
  
  @return array An array with the locale aliases as keys and the aliased
  locales as values
docstring_tokens: Returns all locale aliases found in the given directory .