8000 Merge pull request #4 from loekiedepo/analysis-zd92wZ · Lucky-Loek/Symfony-API-Example@ab4256c · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 17, 2019. It is now read-only.

Commit ab4256c

Browse files
author
Loek van der Linde
authored
Merge pull request #4 from loekiedepo/analysis-zd92wZ
Apply fixes from StyleCI
2 parents b8aa724 + 57e1e99 commit ab4256c

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

src/AppBundle/Controller/CarController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ public function getCarAction($id)
5151
* Add a car.
5252
*
5353
* @Rest\Post("/car")
54+
*
5455
* @param Request $request
56+
*
5557
* @throws InvalidRequestArgumentException
58+
*
5659
* @return \FOS\RestBundle\View\View
5760
*/
5861
public function postCarAction(Request $request)
@@ -76,8 +79,11 @@ public function postCarAction(Request $request)
7679
* Update a car.
7780
*
7881
* @Rest\Patch("/car/{id}")
82+
*
7983
* @param Request $request
84+
*
8085
* @throws InvalidRequestArgumentException
86+
*
8187
* @return \FOS\RestBundle\View\View
8288
*/
8389
public function patchCarAction($id, Request $request)
@@ -120,7 +126,9 @@ public function deleteCarAction($id)
120126

121127
/**
122128
* @param Request $request
129+
*
123130
* @throws InvalidRequestArgumentException
131+
*
124132
* @return \stdClass
125133
*/
126134
private function requestBodyToObject(Request $request)
@@ -152,7 +160,9 @@ private function saveCarToDatabase(Car $car)
152160

153161
/**
154162
* @param mixed $id
163+
*
155164
* @throws InvalidRequestArgumentException
165+
*
156166
* @return int
157167
*/
158168
private function checkId($id)
@@ -168,7 +178,9 @@ private function checkId($id)
168178

169179
/**
170180
* @param $id
181+
*
171182
* @throws InvalidRequestArgumentException
183+
*
172184
* @return Car
173185
*/
174186
private function retrieveCarFromDb($id)

src/AppBundle/Dto/CarDtoAssembler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
class CarDtoAssembler
88
{
99
/**
10-
* @return CarDto
11-
*/
10+
* @return CarDto
11+
*/
1212
public static function createFromEntity(Car $car)
1313
{
1414
$dto = new CarDto();

src/AppBundle/Entity/Car.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($brand, $name, $year)
5656
}
5757

5858
/**
59-
* Returns the properties of this object
59+
* Returns the properties of this object.
6060
*
6161
* @return array
6262
*/
@@ -66,16 +66,17 @@ public function getProperties()
6666
}
6767

6868
/**
69-
* Set the properties of this object
69+
* Set the properties of this object.
7070
*
7171
* @param array $properties
72+
*
7273
* @return Car $this
7374
*/
7475
public function setProperties(array $properties)
7576
{
7677
foreach ($properties as $key => $property) {
7778
if (is_null($property)) {
78-
throw new InvalidArgumentException('Property ' . $key . ' can not be null');
79+
throw new InvalidArgumentException('Property '.$key.' can not be null');
7980
}
8081
}
8182

0 commit comments

Comments
 (0)
0