Permalink
Browse files

Remove Request from Task Repo parameters

  • Loading branch information...
1 parent 96817fa commit 779eb8ad08e727092a7e652b0ddae2cadbd257ea @AlexKupreev committed Jun 9, 2014
Showing with 16 additions and 9 deletions.
  1. +7 −1 app/interactor/Task/Creation.php
  2. +3 −6 app/mock/repository/Task.php
  3. +6 −2 app/repository/TaskInterface.php
@@ -43,7 +43,13 @@ public function __construct(
public function execute(Request\Task\Creation $request)
{
$userId = $this->session->getLoggedInUserId();
- $this->taskRepo->create(null, $userId, $request);
+ $this->taskRepo->create(
+ null,
+ $userId,
+ $request->getTitle(),
+ $request->getDescription(),
+ $request->getNotes()
+ );
return true;
}
@@ -21,17 +21,14 @@ class Task implements Repo\TaskInterface
protected $taskIds = [];
/**
- * Creates Task entity from a data array
- * @param int $userId
- * @param Request\Task\Creation $request
- * @return Entity\Task
+ * {@inheritDoc}
*/
- public function create($id, $userId, Request\Task\Creation $request)
+ public function create($id, $userId, $title, $description, $notes)
{
if (empty($id) or ! $this->isFreeId($id)) {
$id = $this->getUniqId();
}
- $task = new Entity\Task($id, $userId, $request->getTitle(), $request->getDescription(), $request->getNotes());
+ $task = new Entity\Task($id, $userId, $title, $description, $notes);
$this->taskIds[] = $task->getId();
return $task;
@@ -10,7 +10,11 @@
* Creates a task from a data array
* @param int $id
* @param int $userId
- * @param Request\Task\Creation $request
+ * @param string $title
+ * @param string $description
+ * @param string $notes
+ *
+ * @return Entity\Task
*/
- public function create($id, $userId, Request\Task\Creation $request);
+ public function create($id, $userId, $title, $description, $notes);
}

0 comments on commit 779eb8a

Please sign in to comment.