original_string: public function scanParents(string $sourceDir): array
      {
          $locales = $this->scanLocales($sourceDir);
          $fallbacks = [];
  
          foreach ($locales as $locale) {
              $content = \file_get_contents($sourceDir.'/'.$locale.'.txt');
  
              // Aliases contain the text "%%PARENT" followed by the aliased locale
              if (\preg_match('/%%Parent{"([^"]+)"}/', $content, $matches)) {
                  $fallbacks[$locale] = $matches[1];
              }
          }
  
          return $fallbacks;
      }
code: public function scanParents(string $sourceDir): array
      {
          $locales = $this->scanLocales($sourceDir);
          $fallbacks = [];
  
          foreach ($locales as $locale) {
              $content = \file_get_contents($sourceDir.'/'.$locale.'.txt');
  
              // Aliases contain the text "%%PARENT" followed by the aliased locale
              if (\preg_match('/%%Parent{"([^"]+)"}/', $content, $matches)) {
                  $fallbacks[$locale] = $matches[1];
              }
          }
  
          return $fallbacks;
      }
code_tokens: public function scanParents ( string $ sourceDir ) : array { $ locales = $ this -> scanLocales ( $ sourceDir ) ; $ fallbacks = [ ] ; foreach ( $ locales as $ locale ) { $ content = \ file_get_contents ( $ sourceDir . '/' . $ locale . '.txt' ) ; // Aliases contain the text "%%PARENT" followed by the aliased locale if ( \ preg_match ( '/%%Parent{"([^"]+)"}/' , $ content , $ matches ) ) { $ fallbacks [ $ locale ] = $ matches [ 1 ] ; } } return $ fallbacks ; }
docstring: Returns all locale parents found in the given directory.
docstring_tokens: Returns all locale parents found in the given directory .