public function findSources(string $fieldType, array $attributes, string $indexFrom, string $indexTo): array
    {
        foreach ($attributes as $key => $attribute) {
            if ($key === 'source') {
                $attributes[$key] = $this->getSource($fieldType, $attribute, $indexFrom, $indexTo);
            } elseif ($key === 'sources') {
                $attributes[$key] = $this->getSources($fieldType, $attribute, $indexFrom, $indexTo);
            } elseif (is_array($attribute)) {
                $attributes[$key] = $this->findSources($fieldType, $attribute, $indexFrom, $indexTo);
            }
        }

        return $attributes;
    }
public function findSources(string $fieldType, array $attributes, string $indexFrom, string $indexTo): array
    {
        foreach ($attributes as $key => $attribute) {
            if ($key === 'source') {
                $attributes[$key] = $this->getSource($fieldType, $attribute, $indexFrom, $indexTo);
            } elseif ($key === 'sources') {
                $attributes[$key] = $this->getSources($fieldType, $attribute, $indexFrom, $indexTo);
            } elseif (is_array($attribute)) {
                $attributes[$key] = $this->findSources($fieldType, $attribute, $indexFrom, $indexTo);
            }
        }

        return $attributes;
    }
public function findSources ( string $ fieldType , array $ attributes , string $ indexFrom , string $ indexTo ) : array { foreach ( $ attributes as $ key => $ attribute ) { if ( $ key === 'source' ) { $ attributes [ $ key ] = $ this -> getSource ( $ fieldType , $ attribute , $ indexFrom , $ indexTo ) ; } elseif ( $ key === 'sources' ) { $ attributes [ $ key ] = $ this -> getSources ( $ fieldType , $ attribute , $ indexFrom , $ indexTo ) ; } elseif ( is_array ( $ attribute ) ) { $ attributes [ $ key ] = $ this -> findSources ( $ fieldType , $ attribute , $ indexFrom , $ indexTo ) ; } } return $ attributes ; }
Recursively find sources in definition attributes.

@param string $fieldType
@param array  $attributes
@param string $indexFrom
@param string $indexTo

@return array
Recursively find sources in definition attributes .