for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helix\Asana\Event;
use Helix\Asana\Base\Data;
use Helix\Asana\Event;
use Helix\Asana\Project;
use Helix\Asana\Project\Section;
use Helix\Asana\Task;
use Helix\Asana\Task\Attachment;
use Helix\Asana\Task\FieldEntry;
use Helix\Asana\Task\Like;
use Helix\Asana\Task\Story;
use Helix\Asana\User;
/**
* The change on the event's resource.
*
* @method string getAction () The change's action-verb.
* @method string getField ()
*/
class Change extends Data {
protected const MAP = [
'added_value' => '*',
'added_value*' => Event::GRAPH,
'removed_value' => '*',
'removed_value*' => Event::GRAPH,
'new_value' => '*',
'new_value*' => Event::GRAPH
];
protected function _setMapped (string $field, $value): void {
if (!is_array($value)) {
$this->data[$field] = $value;
}
else {
parent::_setMapped($field, $value);
* @return null|number|string|User|Project|Section|Task|FieldEntry|Attachment|Story|Like
public function getValue () {
$key = [
'added' => 'added_value',
'removed' => 'removed_value',
'changed' => 'new_value'
][$this->data['action']];
return $this->data[$key] ?? null;