private function parseFieldsProvided()
    {
        if (null === $this->fieldsProvided) {
            $fieldsProvided = [];
            foreach ($this->request->request->all() as $k => $v) {
                $k = trim($k);
                if ('' !== $k) {
                    $v = trim($v);
                    if ('' !== $v) {
                        $fieldsProvided[$k] = $v;
                    }
                }
            }
            // Some inputs do not pertain to contact fields.
            unset($fieldsProvided['token'], $fieldsProvided['sourceId'], $fieldsProvided['campaignId']);
            $this->fieldsProvided = $fieldsProvided;
        }
        if (!count($this->fieldsProvided)) {
            throw new ContactSourceException(
                'No fields were posted. Did you mean to do that?',
                Codes::HTTP_I_AM_A_TEAPOT,
                null,
                Stat::TYPE_INVALID
            );
        }

        return $this;
    }
private function parseFieldsProvided()
    {
        if (null === $this->fieldsProvided) {
            $fieldsProvided = [];
            foreach ($this->request->request->all() as $k => $v) {
                $k = trim($k);
                if ('' !== $k) {
                    $v = trim($v);
                    if ('' !== $v) {
                        $fieldsProvided[$k] = $v;
                    }
                }
            }
            // Some inputs do not pertain to contact fields.
            unset($fieldsProvided['token'], $fieldsProvided['sourceId'], $fieldsProvided['campaignId']);
            $this->fieldsProvided = $fieldsProvided;
        }
        if (!count($this->fieldsProvided)) {
            throw new ContactSourceException(
                'No fields were posted. Did you mean to do that?',
                Codes::HTTP_I_AM_A_TEAPOT,
                null,
                Stat::TYPE_INVALID
            );
        }

        return $this;
    }
private function parseFieldsProvided ( ) { if ( null === $ this -> fieldsProvided ) { $ fieldsProvided = [ ] ; foreach ( $ this -> request -> request -> all ( ) as $ k => $ v ) { $ k = trim ( $ k ) ; if ( '' !== $ k ) { $ v = trim ( $ v ) ; if ( '' !== $ v ) { $ fieldsProvided [ $ k ] = $ v ; } } } // Some inputs do not pertain to contact fields. unset ( $ fieldsProvided [ 'token' ] , $ fieldsProvided [ 'sourceId' ] , $ fieldsProvided [ 'campaignId' ] ) ; $ this -> fieldsProvided = $ fieldsProvided ; } if ( ! count ( $ this -> fieldsProvided ) ) { throw new ContactSourceException ( 'No fields were posted. Did you mean to do that?' , Codes :: HTTP_I_AM_A_TEAPOT , null , Stat :: TYPE_INVALID ) ; } return $ this ; }
Capture a clean array input trimming all keys and values, excluding empties.
Throw exception if no fields provided.

@return $this

@throws ContactSourceException
Capture a clean array input trimming all keys and values excluding empties . Throw exception if no fields provided .