Skip to content

Commit cabe387

Browse files
committed
Some minor changes at TicketManager
1 parent 3c1270b commit cabe387

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Controller/TicketController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function indexAction(Request $request)
3333
$ticketState = $request->get('state', $this->get('translator')->trans('STATUS_OPEN', [], 'HackzillaTicketBundle'));
3434
$ticketPriority = $request->get('priority', null);
3535

36-
$query = $ticketManager->getTicketList(
36+
$query = $ticketManager->getTicketListQuery(
3737
$userManager,
3838
$ticketManager->getTicketStatus($ticketState),
3939
$ticketManager->getTicketPriority($ticketPriority)

Manager/TicketManager.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ public function createMessage(TicketInterface $ticket = null)
105105
*
106106
* @param TicketInterface $ticket
107107
* @param TicketMessageInterface $message
108-
*
109-
* @return TicketInterface
110108
*/
111109
public function updateTicket(TicketInterface $ticket, TicketMessageInterface $message = null)
112110
{
@@ -118,14 +116,12 @@ public function updateTicket(TicketInterface $ticket, TicketMessageInterface $me
118116
$this->objectManager->persist($message);
119117
}
120118
$this->objectManager->flush();
121-
122-
return $ticket;
123119
}
124120

125121
/**
126122
* Delete a ticket from the database.
127123
*
128-
* @param TicketInterface $ticket*
124+
* @param TicketInterface $ticket
129125
*/
130126
public function deleteTicket(TicketInterface $ticket)
131127
{
@@ -180,13 +176,9 @@ public function findTicketsBy(array $criteria)
180176
}
181177

182178
/**
183-
* @param UserManagerInterface $userManager
184-
* @param int $ticketStatus
185-
* @param int $ticketPriority
186-
*
187-
* @return mixed
179+
* {@inheritdoc}
188180
*/
189-
public function getTicketList(UserManagerInterface $userManager, $ticketStatus, $ticketPriority = null)
181+
public function getTicketListQuery(UserManagerInterface $userManager, $ticketStatus, $ticketPriority = null)
190182
{
191183
$query = $this->ticketRepository->createQueryBuilder('t')
192184
// ->select($this->ticketClass.' t')

Manager/TicketManagerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public function findTicketsBy(array $criteria);
3434
* @param int $ticketStatus
3535
* @param int $ticketPriority
3636
*
37-
* @return mixed
37+
* @return \Doctrine\ORM\QueryBuilder
3838
*/
39-
public function getTicketList(UserManagerInterface $userManager, $ticketStatus, $ticketPriority = null);
39+
public function getTicketListQuery(UserManagerInterface $userManager, $ticketStatus, $ticketPriority = null);
4040

4141
/**
4242
* @param int $days

UPGRADE-3.0.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ UPGRADE FROM 2.x to 3.0
44
* Translation catalogues were renamed from "messages" to "HackzillaTicketBundle"
55
in order to allow projects consuming this bundle to override them in a proper
66
way.
7+
8+
* Renamed method `TicketManagerInterface::getTicketList()` to `TicketManagerInterface::getTicketListQuery()`
9+
to clarify what it returns.
10+
11+
* `TicketManagerInterface::updateTicket()` now returns `void`, since the object
12+
(`TicketInterface`) it was returning before is the same as the provided in its
13+
argument 1.

0 commit comments

Comments
 (0)