Mock post adapter.

@param array $parameters

@return \Assely\Adapter\Post
420556
public function mockAdapterPost(array $parameters)
    {
        $post = $this->plugAdapter(Post::class, new \WP_Post(new \StdClass))->first();

        foreach ($parameters as $key => $value) {
            $post->{$key} = $value;
        }

        return $post;
    }
222597
public function setParameters(array $parameters)
    {
        $this->storage = new \ArrayObject();
        foreach ($parameters as $parameterName => $parameterValue) {
            $this->setParameter($parameterName, $parameterValue);
        }

        return $this;
    }
77377
public function setParameters(array $parameters)
    {
        foreach ($parameters as $iteration => $value) {
            // Trim whitespaces
            $value = trim($value);

            switch ($iteration) {
                case 0: // Debug mode
                    $this->debug = ($value == 'debug') ? true : false;
                    break;
                case 1: // Platform name and version
                    $this->platform = $value;
                    break;
                case 2: // Device name
                    $this->device = $value;
                    break;
            }
        }

        return $this;
    }
261700
public function withParameters(array $parameters): self
    {
        $this->parameters = [];
        foreach ($parameters as $name => $value) {
            $this->withParameter($name, $value);
        }

        return $this;
    }
974348
public function set(array $parameters)
	{
		foreach ($parameters as $name => $value) 
		{
			$this->group_for_name($name)->set($name, $value);
		}
		return $this;
	}
1304657
public function parameters(array $parameters)
    {
        foreach ($parameters as $parameter => $value) {
            if (property_exists($this->parameters, $parameter)) {
                $this->parameters->{$parameter} = $value;
            }
        }

        return $this;
    }
532733
final public function validateParameters(array $parameters)
    {
        $parameters = array_map(function ($rules) {
            if (is_bool($rules) and $rules === true) {
                return 'required';
            }

            return $rules;

        }, $parameters);

        $validator = Validator::make(Request::all(), $parameters);

        if ($validator->fails()) {
            throw new MissingParameterException(
                $validator->errors()->getMessages()
            );
        }

        return true;
    }
333017
protected function assertParametersAreValid(array $parameters, array $requiredParameters)
    {
        foreach ($requiredParameters as $parameter) {
            if (empty($parameters[$parameter])) {
                throw RequiredParameterMissingException::withParameter($parameter);
            }
        }
    }
913867
public function request($method, $uri, array $parameters = [])
    {
        return $this->container->get(AdapterInterface::class)
            ->request($method, $uri, $parameters);
    }
648941
protected function passGetScope(array $parameters): ?array
    {
        $scope = $this->passReadStringValue($parameters, 'scope');

        return empty($scope) === false ? explode(' ', $scope) : null;
    }
547920
public function get(array $parameters = array())
    {
        $response = $this->ontraport->get(
            $this->getNamespace(), $this->toArray($parameters)
        );

        return $this->ontraport->collection($this, $response);
    }
182929
protected function registerPostAdapter()
    {
        $this->app->bind('adapter.post', function ($app) {
            return new Post($app['config']);
        });

        $this->app->alias('adapter.post', Post::class);
    }
1122269
public function addParameter($parameters): self
    {
        $this->parameters = array_merge($this->parameters, (array) $parameters);

        return $this;
    }
720353
public function httpPostRequest($url, $parameters)
    {
        if (empty($this->client)) {
            $this->client = new Client(['verify' => false]);
        }

        $this->response = $this->client->request(
            'POST',
            $url,
            [
                'headers' => $this->getHeaders(),
                'json' => $parameters
            ]
        );
        $response = json_decode($this->response->getBody());

        return $response;
    }
878874
public static function resolve(\stdClass $parameters): PostbackImportModel
    {
        $model = new PostbackImportModel();

        $id = PostbackImportRepository::FIELD_ID;
        $externalId = PostbackImportRepository::FIELD_EXTERNAL_ID;
        $userId = PostbackImportRepository::FIELD_USER_ID;
        $createdAt = PostbackImportRepository::FIELD_CREATED_AT;
        $action = PostbackImportRepository::FIELD_ACTION;
        $type = PostbackImportRepository::FIELD_TYPE;
        $inStockDaysAgo = PostbackImportRepository::FIELD_IN_STOCK_DAYS_AGO;
        $filters = PostbackImportRepository::FIELD_FILTERS;
        $insertCount = PostbackImportRepository::FIELD_INSERT_COUNT;
        $updateCount = PostbackImportRepository::FIELD_UPDATE_COUNT;
        $totalCount = PostbackImportRepository::FIELD_TOTAL_COUNT;
        $doneCount = PostbackImportRepository::FIELD_DONE_COUNT;
        $status = PostbackImportRepository::FIELD_STATUS;
        $description = PostbackImportRepository::FIELD_DESCRIPTION;

        $model
            ->setId($parameters->$id)
            ->setUserId($parameters->$userId)
            ->setExternalId($parameters->$externalId)
            ->setCreatedAt(new \DateTime($parameters->$createdAt))
            ->setAction($parameters->$action)
            ->setType($parameters->$type)
            ->setInStockDaysAgo($parameters->$inStockDaysAgo)
            ->setFilters(json_decode($parameters->$filters, true))
            ->setInsertCount($parameters->$insertCount)
            ->setUpdateCount($parameters->$updateCount)
            ->setTotalCount($parameters->$totalCount)
            ->setDoneCount($parameters->$doneCount)
            ->setStatus($parameters->$status)
            ->setDescription($parameters->$description)
        ;

        return $model;
    }
771956
public function create(array $parameters) {
        $toolbarItem = new ButtonToolbarItem($parameters['label'], $parameters['action']);
        unset($parameters['label'], $parameters['action']);
        foreach($parameters as $key => $value) {
            $toolbarItem->$key = $value;
        }
        return $toolbarItem;
    }
471132
public function withPost(array $params)
    {
        $request = $this;
        if ($this->isJson()) {
            $body = json_encode($params);
        } else {
            $body = http_build_query($params);
            if (!$this->hasHeader('Content-Type')) {
                $request = $this->withHeader('Content-Type', 'application/x-www-form-urlencoded');
            }
        }

        return new self(
            $request->getMethod(),
            $request->getUri(),
            $request->getHeaders(),
            $body,
            $request->getProtocolVersion(),
            $request->getRetries(),
            $request->getOptions(),
            $this->getServiceKey(),
            $this->getRequestKey()
        );
    }