@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if (null !== $relative && null !== ($url = $this->aliasing->hasPublicAlias($relative))) { |
| 91 | - $rewrite = $absolutePrefix . $url . $suffix; |
|
| 91 | + $rewrite = $absolutePrefix.$url.$suffix; |
|
| 92 | 92 | $response->headers->set('location', $rewrite); |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $request->query->add($parser->parseUri(join('/', array_reverse($params)))); |
| 178 | 178 | |
| 179 | 179 | if (!$this->aliasing->hasInternalAlias($publicUrl, false)) { |
| 180 | - $this->rewriteRequest($event, $publicUrl . $queryString); |
|
| 180 | + $this->rewriteRequest($event, $publicUrl.$queryString); |
|
| 181 | 181 | |
| 182 | 182 | return; |
| 183 | 183 | } |
@@ -23,21 +23,21 @@ discard block |
||
| 23 | 23 | * |
| 24 | 24 | * @see addAlias |
| 25 | 25 | */ |
| 26 | - const STRATEGY_OVERWRITE = 'overwrite'; |
|
| 26 | + const STRATEGY_OVERWRITE = 'overwrite'; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Keep existing aliases and do nothing |
| 30 | 30 | * |
| 31 | 31 | * @see addAlias |
| 32 | 32 | */ |
| 33 | - const STRATEGY_KEEP = 'keep'; |
|
| 33 | + const STRATEGY_KEEP = 'keep'; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * Suffix existing aliases. |
| 37 | 37 | * |
| 38 | 38 | * @see addAlias |
| 39 | 39 | */ |
| 40 | - const STRATEGY_SUFFIX = 'suffix'; |
|
| 40 | + const STRATEGY_SUFFIX = 'suffix'; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * @see AddAlias |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | $original = $publicUrl; |
| 278 | 278 | $i = 1; |
| 279 | 279 | do { |
| 280 | - $publicUrl = $original . '-' . ($i++); |
|
| 280 | + $publicUrl = $original.'-'.($i++); |
|
| 281 | 281 | } while ($this->hasInternalAlias($publicUrl)); |
| 282 | 282 | |
| 283 | 283 | $alias = new UrlAlias($publicUrl, $internalUrl, $type); |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $this->isBatch = $isBatch; |
| 356 | 356 | $mgr = $this->manager; |
| 357 | 357 | $self = $this; |
| 358 | - return function () use ($mgr, $self) { |
|
| 358 | + return function() use ($mgr, $self) { |
|
| 359 | 359 | $mgr->flush(); |
| 360 | 360 | $self->setIsBatch(true); |
| 361 | 361 | }; |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $this->manager->persist($alias); |
| 374 | 374 | |
| 375 | 375 | if ($this->isBatch) { |
| 376 | - $this->batch[$alias->getPublicUrl()]= $alias; |
|
| 376 | + $this->batch[$alias->getPublicUrl()] = $alias; |
|
| 377 | 377 | } else { |
| 378 | 378 | $this->manager->flush($alias); |
| 379 | 379 | } |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | join( |
| 449 | 449 | ', ', |
| 450 | 450 | array_map( |
| 451 | - function ($v) use ($connection) { |
|
| 451 | + function($v) use ($connection) { |
|
| 452 | 452 | return $connection->quote($v, \PDO::PARAM_STR); |
| 453 | 453 | }, |
| 454 | 454 | $urls |
@@ -347,7 +347,7 @@ |
||
| 347 | 347 | * This method returns a callback that needs to be executed after the batch is done; this is up to the caller. |
| 348 | 348 | * |
| 349 | 349 | * @param bool $isBatch |
| 350 | - * @return callable |
|
| 350 | + * @return \Closure |
|
| 351 | 351 | */ |
| 352 | 352 | public function setIsBatch($isBatch) |
| 353 | 353 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use Doctrine\ORM\EntityManager; |
| 9 | 9 | use Symfony\Component\HttpFoundation\Request; |
| 10 | 10 | use Symfony\Component\HttpFoundation\RequestStack; |
| 11 | -use Symfony\Component\Routing\RouterInterface; |
|
| 12 | 11 | use Zicht\Bundle\UrlBundle\Entity\StaticReference; |
| 13 | 12 | |
| 14 | 13 | /** |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | $url = $this->refs[$object][$this->getLocale()]; |
| 93 | 93 | |
| 94 | 94 | if (!preg_match('/^(http|https)/', $url) && (null !== ($request = $this->getMasterRequest()))) { |
| 95 | - $url = $request->getBaseUrl() . '/' . ltrim($url, '/'); |
|
| 95 | + $url = $request->getBaseUrl().'/'.ltrim($url, '/'); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | return $url; |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function transform($data) |
| 48 | 48 | { |
| 49 | - if (self::MODE_TO_PUBLIC === (self::MODE_TO_PUBLIC & $this->mode)) { |
|
| 49 | + if (self::MODE_TO_PUBLIC === (self::MODE_TO_PUBLIC&$this->mode)) { |
|
| 50 | 50 | return $this->map($data, UrlMapperInterface::MODE_INTERNAL_TO_PUBLIC); |
| 51 | 51 | } else { |
| 52 | 52 | return $data; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function reverseTransform($data) |
| 63 | 63 | { |
| 64 | - if (self::MODE_TO_INTERNAL === (self::MODE_TO_INTERNAL & $this->mode)) { |
|
| 64 | + if (self::MODE_TO_INTERNAL === (self::MODE_TO_INTERNAL&$this->mode)) { |
|
| 65 | 65 | return $this->map($data, UrlMapperInterface::MODE_PUBLIC_TO_INTERNAL); |
| 66 | 66 | } else { |
| 67 | 67 | return $data; |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | * @param string $url |
| 71 | 71 | * @param Constraint $constraint |
| 72 | 72 | */ |
| 73 | - public function addViolation($url, Constraint $constraint) |
|
| 73 | + public function addViolation($url, Constraint $constraint) |
|
| 74 | 74 | { |
| 75 | 75 | $this->context->addViolation($constraint->message, ['%url%' => $url]); |
| 76 | 76 | } |