private function getFieldInfo($key, $value): array
    {
        $name = null;
        $options = [];
        if (is_numeric($key) && is_string($value)) {
            $name = $value;
        } else if (is_numeric($key) && is_array($value)) {
            $name = array_shift($value);
            $options = $value;
        } else if (is_string($key)) {
            $name = $key;
            $options = $value;
        }
        return ['name' => $name, 'options' => $options];
    }
private function getFieldInfo($key, $value): array
    {
        $name = null;
        $options = [];
        if (is_numeric($key) && is_string($value)) {
            $name = $value;
        } else if (is_numeric($key) && is_array($value)) {
            $name = array_shift($value);
            $options = $value;
        } else if (is_string($key)) {
            $name = $key;
            $options = $value;
        }
        return ['name' => $name, 'options' => $options];
    }
private function getFieldInfo ( $ key , $ value ) : array { $ name = null ; $ options = [ ] ; if ( is_numeric ( $ key ) && is_string ( $ value ) ) { $ name = $ value ; } else if ( is_numeric ( $ key ) && is_array ( $ value ) ) { $ name = array_shift ( $ value ) ; $ options = $ value ; } else if ( is_string ( $ key ) ) { $ name = $ key ; $ options = $ value ; } return [ 'name' => $ name , 'options' => $ options ] ; }
Build a uniform field info array for various types of validations.

@param mixed $key
@param mixed $value
@return array
Build a uniform field info array for various types of validations .