src/cli/class-papi-cli-command.php
protected function get_format_args( $assoc_args ) {
		$format_args = [
			'fields' => $this->get_default_format_fields(),
			'field'  => null,
			'format' => 'table',
		];

		if ( isset( $assoc_args['fields'] ) ) {
			$format_args['fields'] = $assoc_args['fields'];
		}

		if ( isset( $assoc_args['field'] ) ) {
			$format_args['field'] = $assoc_args['field'];
		}

		if ( ! empty( $assoc_args['format'] ) && in_array( $assoc_args['format'], ['count', 'ids', 'table', 'csv', 'json'], true ) ) {
			$format_args['format'] = $assoc_args['format'];
		}

		return $format_args;
	}
protected function get_format_args( $assoc_args ) {
		$format_args = [
			'fields' => $this->get_default_format_fields(),
			'field'  => null,
			'format' => 'table',
		];

		if ( isset( $assoc_args['fields'] ) ) {
			$format_args['fields'] = $assoc_args['fields'];
		}

		if ( isset( $assoc_args['field'] ) ) {
			$format_args['field'] = $assoc_args['field'];
		}

		if ( ! empty( $assoc_args['format'] ) && in_array( $assoc_args['format'], ['count', 'ids', 'table', 'csv', 'json'], true ) ) {
			$format_args['format'] = $assoc_args['format'];
		}

		return $format_args;
	}
Get format args that will be passed into CLI Formatter.

@param  array $assoc_args Associative args from CLI

@return array Formatter args