@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | **/ |
| 18 | 18 | public function clickElement($name, $element, $nbr = 1, $filterCallback = null) |
| 19 | 19 | { |
| 20 | - $this->elementAction($name, $element, $nbr, function ($e) { $e->click(); }, $filterCallback); |
|
| 20 | + $this->elementAction($name, $element, $nbr, function($e) { $e->click(); }, $filterCallback); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -31,8 +31,8 @@ discard block |
||
| 31 | 31 | $name, |
| 32 | 32 | 'field', |
| 33 | 33 | $nbr, |
| 34 | - function ($e) use ($state) { if ('check' === $state) { $e->check(); } else { $e->uncheck(); } }, |
|
| 35 | - function ($e) { return 'checkbox' === $e->getAttribute('type'); } |
|
| 34 | + function($e) use ($state) { if ('check' === $state) { $e->check(); } else { $e->uncheck(); } }, |
|
| 35 | + function($e) { return 'checkbox' === $e->getAttribute('type'); } |
|
| 36 | 36 | ); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | $name, |
| 48 | 48 | 'field', |
| 49 | 49 | $nbr, |
| 50 | - function ($e) { $this->getSession()->getDriver()->click($e->getXPath()); }, |
|
| 51 | - function ($e) { return 'radio' === $e->getAttribute('type'); } |
|
| 50 | + function($e) { $this->getSession()->getDriver()->click($e->getXPath()); }, |
|
| 51 | + function($e) { return 'radio' === $e->getAttribute('type'); } |
|
| 52 | 52 | ); |
| 53 | 53 | } |
| 54 | 54 | |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | **/ |
| 59 | 59 | public function nbrElement($should, $nbr, $name, $element) |
| 60 | 60 | { |
| 61 | - $type = in_array($element, [ 'checkbox', 'radio' ]) ? 'field' : $element; |
|
| 61 | + $type = in_array($element, ['checkbox', 'radio']) ? 'field' : $element; |
|
| 62 | 62 | $filterCallback = null; |
| 63 | 63 | |
| 64 | 64 | if ('field' === $type) { |
| 65 | - $filterCallback = function ($e) use ($element) { return $element === $e->getAttribute('type'); }; |
|
| 65 | + $filterCallback = function($e) use ($element) { return $element === $e->getAttribute('type'); }; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | $elements = $this->searchElement($name, $type, $filterCallback); |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | **/ |
| 82 | 82 | public function seeElement($should, $name, $element) |
| 83 | 83 | { |
| 84 | - $type = in_array($element, [ 'checkbox', 'radio' ]) ? 'field' : $element; |
|
| 84 | + $type = in_array($element, ['checkbox', 'radio']) ? 'field' : $element; |
|
| 85 | 85 | $filterCallback = null; |
| 86 | 86 | |
| 87 | 87 | if ('field' === $type) { |
| 88 | - $filterCallback = function ($e) use ($element) { return $element === $e->getAttribute('type'); }; |
|
| 88 | + $filterCallback = function($e) use ($element) { return $element === $e->getAttribute('type'); }; |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | $elements = $this->searchElement($name, $type, $filterCallback); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | public function clickLink($link) |
| 119 | 119 | { |
| 120 | - $this->clickElement($link, 'link', 1, function ($e) use ($link) { return $link === $e->getText(); }); |
|
| 120 | + $this->clickElement($link, 'link', 1, function($e) use ($link) { return $link === $e->getText(); }); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -133,8 +133,8 @@ discard block |
||
| 133 | 133 | $field, |
| 134 | 134 | 'field', |
| 135 | 135 | $nbr, |
| 136 | - function ($e) use ($value) { $e->setValue($value); }, |
|
| 137 | - function ($e) { |
|
| 136 | + function($e) use ($value) { $e->setValue($value); }, |
|
| 137 | + function($e) { |
|
| 138 | 138 | return in_array($e->getAttribute('type'), array( |
| 139 | 139 | 'text', 'password', 'color', 'date', 'datetime', |
| 140 | 140 | 'datetime-local', 'email', 'month', 'number', 'range', |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function getMinkParameter($offset) |
| 30 | 30 | { |
| 31 | - if (!isset($this->minkParameters[$offset])) { |
|
| 31 | + if (!isset($this->minkParameters[$offset])) { |
|
| 32 | 32 | throw new \Exception(sprintf( |
| 33 | 33 | 'Invalid mink parameter "%s".', |
| 34 | 34 | $offset |
@@ -50,8 +50,8 @@ |
||
| 50 | 50 | |
| 51 | 51 | public function locatePath($path) |
| 52 | 52 | { |
| 53 | - $startUrl = rtrim($this->getMinkParameter('base_url'), '/') . '/'; |
|
| 53 | + $startUrl = rtrim($this->getMinkParameter('base_url'), '/').'/'; |
|
| 54 | 54 | |
| 55 | - return 0 !== strpos($path, 'http') ? $startUrl . ltrim($path, '/') : $path; |
|
| 55 | + return 0 !== strpos($path, 'http') ? $startUrl.ltrim($path, '/') : $path; |
|
| 56 | 56 | } |
| 57 | 57 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - $message = implode("\n", array_map(function ($e) { return $e->getMessage(); }, $exceptions)); |
|
| 51 | + $message = implode("\n", array_map(function($e) { return $e->getMessage(); }, $exceptions)); |
|
| 52 | 52 | |
| 53 | 53 | throw new \Exception($message); |
| 54 | 54 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - $message = implode("\n", array_map(function ($e) { return $e->getMessage(); }, $exceptions)); |
|
| 85 | + $message = implode("\n", array_map(function($e) { return $e->getMessage(); }, $exceptions)); |
|
| 86 | 86 | |
| 87 | 87 | throw new \Exception($message); |
| 88 | 88 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | public function iShouldSeeATableWithRows($nbr) |
| 95 | 95 | { |
| 96 | - $nbr = (int) $nbr; |
|
| 96 | + $nbr = (int)$nbr; |
|
| 97 | 97 | |
| 98 | 98 | $this->iShouldSeeATable(); |
| 99 | 99 | $exceptions = array(); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - $message = implode("\n", array_map(function ($e) { return $e->getMessage(); }, $exceptions)); |
|
| 115 | + $message = implode("\n", array_map(function($e) { return $e->getMessage(); }, $exceptions)); |
|
| 116 | 116 | |
| 117 | 117 | throw new \Exception($message); |
| 118 | 118 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function entitiesShouldHaveBeen($expected, $entity, $state) |
| 107 | 107 | { |
| 108 | - $expected = (int) $expected; |
|
| 108 | + $expected = (int)$expected; |
|
| 109 | 109 | |
| 110 | 110 | $entityName = $this->resolveEntity($entity)->getName(); |
| 111 | 111 | $collection = $this |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | ->getCollection($entityName) |
| 114 | 114 | ; |
| 115 | 115 | |
| 116 | - $records = array_map(function ($e) { return $e->getEntity(); }, $collection->all()); |
|
| 116 | + $records = array_map(function($e) { return $e->getEntity(); }, $collection->all()); |
|
| 117 | 117 | $entities = $this |
| 118 | 118 | ->getEntityManager() |
| 119 | 119 | ->getRepository($entityName) |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | $this->storeTags($event); |
| 179 | 179 | |
| 180 | - if ($this->hasTags([ 'reset-schema', '~not-reset-schema' ])) { |
|
| 180 | + if ($this->hasTags(['reset-schema', '~not-reset-schema'])) { |
|
| 181 | 181 | foreach ($this->getEntityManagers() as $entityManager) { |
| 182 | 182 | $metadata = $this->getMetadata($entityManager); |
| 183 | 183 | |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | 'Failed to find a unique model from the name "%s", "%s" found', |
| 150 | 150 | $name, |
| 151 | 151 | implode('" and "', array_map( |
| 152 | - function ($rfl) { |
|
| 152 | + function($rfl) { |
|
| 153 | 153 | return $rfl->getName(); |
| 154 | 154 | }, |
| 155 | 155 | $entities |
@@ -184,7 +184,7 @@ |
||
| 184 | 184 | $this |
| 185 | 185 | ->getAsserter() |
| 186 | 186 | ->assertEquals($contentType, $formatedContentType) |
| 187 | - ; |
|
| 187 | + ; |
|
| 188 | 188 | return; |
| 189 | 189 | } catch (\Exception $e) { |
| 190 | 190 | continue; |
@@ -17,8 +17,7 @@ |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $resource = $queries ? |
| 20 | - sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : |
|
| 21 | - $uri |
|
| 20 | + sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : $uri |
|
| 22 | 21 | ; |
| 23 | 22 | |
| 24 | 23 | return $this->getClient()->delete($resource, $headers, $body, $options); |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | parent::build($uri, $queries, $headers, $postBody, $body, $options); |
| 10 | 10 | |
| 11 | 11 | $resource = $queries ? |
| 12 | - sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : |
|
| 13 | - $uri |
|
| 12 | + sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : $uri |
|
| 14 | 13 | ; |
| 15 | 14 | |
| 16 | 15 | return $this->getClient()->head($resource, $headers, $options); |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | parent::build($uri, $queries, $headers, $postBody, $body, $options); |
| 11 | 11 | |
| 12 | 12 | $resource = $queries ? |
| 13 | - sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : |
|
| 14 | - $uri |
|
| 13 | + sprintf('%s?%s', $uri, $this->formatQueryString($queries)) : $uri |
|
| 15 | 14 | ; |
| 16 | 15 | |
| 17 | 16 | return $this->getClient()->get($resource, $headers, $options); |