original_string: public function getSources(string $fieldType, $sources, string $indexFrom, string $indexTo)
      {
          $mappedSources = $sources;
          if (is_array($sources)) {
              $mappedSources = [];
              $sources = array_filter($sources);
              foreach ($sources as $source) {
                  $mappedSources[] = $this->getSource($fieldType, $source, $indexFrom, $indexTo);
              }
          }
  
          return $mappedSources;
      }
code: public function getSources(string $fieldType, $sources, string $indexFrom, string $indexTo)
      {
          $mappedSources = $sources;
          if (is_array($sources)) {
              $mappedSources = [];
              $sources = array_filter($sources);
              foreach ($sources as $source) {
                  $mappedSources[] = $this->getSource($fieldType, $source, $indexFrom, $indexTo);
              }
          }
  
          return $mappedSources;
      }
code_tokens: public function getSources ( string $ fieldType , $ sources , string $ indexFrom , string $ indexTo ) { $ mappedSources = $ sources ; if ( is_array ( $ sources ) ) { $ mappedSources = [ ] ; $ sources = array_filter ( $ sources ) ; foreach ( $ sources as $ source ) { $ mappedSources [ ] = $ this -> getSource ( $ fieldType , $ source , $ indexFrom , $ indexTo ) ; } } return $ mappedSources ; }
docstring: Get sources based on the indexFrom attribute and return them with the indexTo attribute.
  
  @param string       $fieldType
  @param string|array $sources
  @param string       $indexFrom
  @param string       $indexTo
  
  @return array|string
docstring_tokens: Get sources based on the indexFrom attribute and return them with the indexTo attribute .