diff --git a/src/Diff.php b/src/Diff.php index 278b094..b6e40c1 100644 --- a/src/Diff.php +++ b/src/Diff.php @@ -47,11 +47,11 @@ protected function __construct(int $diffId) * @param int $projectId * @param int $screenshotId1 * @param int $screenshotId2 - * @param string $name + * @param array $options * @return mixed * @throws \Diffy\InvalidArgumentsException */ - public static function create(int $projectId, int $screenshotId1, int $screenshotId2, string $name = '') + public static function create(int $projectId, int $screenshotId1, int $screenshotId2, array $options = []) { if (empty($projectId)) { throw new InvalidArgumentsException('Project ID can not be empty'); @@ -68,7 +68,8 @@ public static function create(int $projectId, int $screenshotId1, int $screensho return Diffy::request('POST', 'projects/' . $projectId . '/diffs', [ 'snapshot1' => $screenshotId1, 'snapshot2' => $screenshotId2, - 'name' => $name, + 'name' => $options['name'] ?? null, + 'notifications' => $options['notifications'] ?? null, ]); } diff --git a/src/Project.php b/src/Project.php index e212c32..592aa5f 100644 --- a/src/Project.php +++ b/src/Project.php @@ -92,6 +92,10 @@ public static function compare(int $projectId, $params = []) $arguments['commitSha'] = $params['commitSha']; } + if (!empty($params['notifications'])) { + $arguments['notifications'] = $params['notifications']; + } + return Diffy::request('POST', 'projects/' . $projectId . '/compare', $arguments); }