@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | public function testSubmitInvalidJsonShouldThrowException() |
54 | 54 | { |
55 | 55 | $this->setExpectedExceptionRegExp( |
56 | - 'InvalidArgumentException', |
|
57 | - '/^Invalid submitted json data, error (.*) : (.*), json : invalid json$/' |
|
56 | + 'InvalidArgumentException', |
|
57 | + '/^Invalid submitted json data, error (.*) : (.*), json : invalid json$/' |
|
58 | 58 | ); |
59 | 59 | $this->form->submit('invalid json'); |
60 | 60 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | public function testSubmitWithoutStringShouldThrowException() |
71 | 71 | { |
72 | 72 | $this->setExpectedExceptionRegExp( |
73 | - 'InvalidArgumentException', |
|
74 | - '/^Invalid argument: the submitted variable must be a string when you enable the json_format option.$/' |
|
73 | + 'InvalidArgumentException', |
|
74 | + '/^Invalid argument: the submitted variable must be a string when you enable the json_format option.$/' |
|
75 | 75 | ); |
76 | 76 | $this->form->submit(['invalid json']); |
77 | 77 | } |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | public function testRequestWithInvalidJsonShouldTHrowException() |
89 | 89 | { |
90 | 90 | $this->setExpectedExceptionRegExp( |
91 | - 'InvalidArgumentException', |
|
92 | - '/^Invalid submitted json data, error (.*) : (.*), json : invalid json$/' |
|
91 | + 'InvalidArgumentException', |
|
92 | + '/^Invalid submitted json data, error (.*) : (.*), json : invalid json$/' |
|
93 | 93 | ); |
94 | 94 | $request = $this->getRequest('invalid json'); |
95 | 95 | $this->form->handleRequest($request); |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | public function testRequestWithoutStringShouldThrowException() |
99 | 99 | { |
100 | 100 | $this->setExpectedExceptionRegExp( |
101 | - 'InvalidArgumentException', |
|
102 | - '/^Invalid argument: the submitted variable must be a string when you enable the json_format option.$/' |
|
101 | + 'InvalidArgumentException', |
|
102 | + '/^Invalid argument: the submitted variable must be a string when you enable the json_format option.$/' |
|
103 | 103 | ); |
104 | 104 | $request = $this->getRequest(['test']); |
105 | 105 | $this->form->handleRequest($request); |
@@ -94,14 +94,14 @@ discard block |
||
94 | 94 | return $this->apiCall( |
95 | 95 | 'cget', |
96 | 96 | $this->resolveFilters($filters), |
97 | - function (Response $response) { |
|
97 | + function(Response $response) { |
|
98 | 98 | return $this->serializer |
99 | 99 | ->deserialize( |
100 | 100 | (string) $response->getBody(), |
101 | 101 | $this->collectionClass, |
102 | 102 | 'json' |
103 | 103 | ) |
104 | - ->map(function ($entity) { |
|
104 | + ->map(function($entity) { |
|
105 | 105 | return $this->loadDelegates($entity); |
106 | 106 | }) |
107 | 107 | ; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function retrieve($id) |
125 | 125 | { |
126 | - return $this->apiCall('get', array('id' => $id), function (Response $response) { |
|
126 | + return $this->apiCall('get', array('id' => $id), function(Response $response) { |
|
127 | 127 | return $this->loadDelegates( |
128 | 128 | $this->serializer->deserialize( |
129 | 129 | (string) $response->getBody(), |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | protected function mock($date) |
22 | 22 | { |
23 | 23 | $this->mockedDate = $date instanceof \DateTime ? |
24 | - $date : |
|
25 | - date_create($date) |
|
24 | + $date : date_create($date) |
|
26 | 25 | ; |
27 | 26 | } |
28 | 27 | |
@@ -36,13 +35,11 @@ discard block |
||
36 | 35 | public function now($format = null) |
37 | 36 | { |
38 | 37 | $date = $this->mockedDate instanceof \DateTime ? |
39 | - $this->mockedDate : |
|
40 | - new \DateTime() |
|
38 | + $this->mockedDate : new \DateTime() |
|
41 | 39 | ; |
42 | 40 | |
43 | 41 | return empty($format) ? |
44 | - $date : |
|
45 | - $date->format($format) |
|
42 | + $date : $date->format($format) |
|
46 | 43 | ; |
47 | 44 | } |
48 | 45 | } |
@@ -46,8 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | return $this->container->get('security.authorization_checker')->isGranted( |
48 | 48 | (array) (empty($securityMapping[$intention]) ? |
49 | - $intention : |
|
50 | - $securityMapping[$intention] |
|
49 | + $intention : $securityMapping[$intention] |
|
51 | 50 | ), |
52 | 51 | $resource |
53 | 52 | ); |
@@ -63,8 +62,8 @@ discard block |
||
63 | 62 | protected function extractQueryFilter(Request $request) |
64 | 63 | { |
65 | 64 | return array_map( |
66 | - function ($value) { |
|
67 | - return array_filter(explode(',', trim($value, ',')), function ($var) { |
|
65 | + function($value) { |
|
66 | + return array_filter(explode(',', trim($value, ',')), function($var) { |
|
68 | 67 | return !empty($var); |
69 | 68 | }); |
70 | 69 | }, |
@@ -110,8 +109,7 @@ discard block |
||
110 | 109 | return new NotFoundHttpException(sprintf('Entity with id "%s" not found%s.', |
111 | 110 | $entityId, |
112 | 111 | $this->container->getParameter('kernel.debug') ? |
113 | - sprintf(' : (looked into "%s")', $loaderId) : |
|
114 | - '' |
|
112 | + sprintf(' : (looked into "%s")', $loaderId) : '' |
|
115 | 113 | )); |
116 | 114 | } |
117 | 115 | } |
@@ -35,8 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | if ($data !== null) { |
37 | 37 | $data = is_string($data) ? |
38 | - $data : |
|
39 | - $this->container->get('serializer')->serialize( |
|
38 | + $data : $this->container->get('serializer')->serialize( |
|
40 | 39 | $data, 'json', empty($scope) ? array() : array('scope' => $scope) |
41 | 40 | ) |
42 | 41 | ; |
@@ -127,9 +126,8 @@ discard block |
||
127 | 126 | } |
128 | 127 | |
129 | 128 | // data camel case normalization |
130 | - return $inflection && $this->container->has('majora.inflector')? |
|
131 | - $this->container->get('majora.inflector')->normalize($data, $inflection) : |
|
132 | - $data |
|
129 | + return $inflection && $this->container->has('majora.inflector') ? |
|
130 | + $this->container->get('majora.inflector')->normalize($data, $inflection) : $data |
|
133 | 131 | ; |
134 | 132 | } |
135 | 133 | |
@@ -210,8 +208,7 @@ discard block |
||
210 | 208 | $subRequest = $request->duplicate(); |
211 | 209 | $subRequest->attributes->set('_controller', $forwardOptions['controller']); |
212 | 210 | $subRequest->setMethod(isset($forwardOptions['method']) ? |
213 | - $forwardOptions['method'] : |
|
214 | - 'GET' |
|
211 | + $forwardOptions['method'] : 'GET' |
|
215 | 212 | ); |
216 | 213 | |
217 | 214 | return $this->container->get('http_kernel')->handle( |
@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | public function buildForm(FormBuilderInterface $builder, array $options) |
55 | 55 | { |
56 | 56 | $handledLocales = empty($options['locales']) ? |
57 | - $this->locales : |
|
58 | - array_intersect($this->locales, $options['locales']) |
|
57 | + $this->locales : array_intersect($this->locales, $options['locales']) |
|
59 | 58 | ; |
60 | 59 | if (empty($handledLocales)) { |
61 | 60 | return; |
@@ -66,7 +65,7 @@ discard block |
||
66 | 65 | $options['options'] |
67 | 66 | ); |
68 | 67 | |
69 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($builder, $handledLocales, $childrenOptions) { |
|
68 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($builder, $handledLocales, $childrenOptions) { |
|
70 | 69 | $form = $event->getForm(); |
71 | 70 | $data = $event->getData(); |
72 | 71 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $arguments = array( |
54 | 54 | $entityClass, |
55 | 55 | array_map( |
56 | - function ($property) { return $property->getName(); }, |
|
56 | + function($property) { return $property->getName(); }, |
|
57 | 57 | $entityReflection->getProperties() |
58 | 58 | ), |
59 | 59 | $collectionClass, |