for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: Matthew
* Date: 21/04/2016
* Time: 9:10 AM
*/
namespace Freshdesk\Resources\Traits;
trait UpdateTrait
{
* @param null $end string
* @return string
abstract public function endpoint($end = null);
*
* Update a resource for the given $id with the supplied array.
* @param int $id
* @param array $data
* @return array|null
* @throws \Freshdesk\Exceptions\AccessDeniedException
* @throws \Freshdesk\Exceptions\ApiException
* @throws \Freshdesk\Exceptions\AuthenticationException
* @throws \Freshdesk\Exceptions\ConflictingStateException
* @throws \Freshdesk\Exceptions\NotFoundException
* @throws \Freshdesk\Exceptions\RateLimitExceededException
* @throws \Freshdesk\Exceptions\UnsupportedContentTypeException
* @throws \Freshdesk\Exceptions\MethodNotAllowedException
* @throws \Freshdesk\Exceptions\UnsupportedAcceptHeaderException
* @throws \Freshdesk\Exceptions\ValidationException
public function update($id, array $data)
return $this->api->request('PUT', $this->endpoint($id), $data);
api
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: