src/Forms/Fields/FieldsRepository.php
public function getField(string $name = '', string $group = 'default')
    {
        /** @var SectionInterface $section */
        $section = $this->groups[$group];

        $foundItems = array_filter($section->getItems(), function (FieldTypeInterface $item) use ($name) {
            return $name === $item->getBaseName();
        });

        return ! empty($foundItems) ? array_shift($foundItems) : [];
    }
public function getField(string $name = '', string $group = 'default')
    {
        /** @var SectionInterface $section */
        $section = $this->groups[$group];

        $foundItems = array_filter($section->getItems(), function (FieldTypeInterface $item) use ($name) {
            return $name === $item->getBaseName();
        });

        return ! empty($foundItems) ? array_shift($foundItems) : [];
    }
public function getField ( string $ name = '' , string $ group = 'default' ) { /** @var SectionInterface $section */ $ section = $ this -> groups [ $ group ] ; $ foundItems = array_filter ( $ section -> getItems ( ) , function ( FieldTypeInterface $ item ) use ( $ name ) { return $ name === $ item -> getBaseName ( ) ; } ) ; return ! empty ( $ foundItems ) ? array_shift ( $ foundItems ) : [ ] ; }
Return the defined field instance based on its basename property.
If not set, return all fields from the "default" group.

@param string $name
@param string $group

@return FieldTypeInterface|FieldTypeInterface[]|array
Return the defined field instance based on its basename property . If not set return all fields from the default group .