@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | parent::__construct(); |
| 24 | 24 | |
| 25 | 25 | $this->baseUrl = $request->getBaseUrl(); |
| 26 | - $this->prefix = $request->getSchemeAndHttpHost() . $this->baseUrl; |
|
| 26 | + $this->prefix = $request->getSchemeAndHttpHost().$this->baseUrl; |
|
| 27 | 27 | $this->baseUrlLen = strlen($this->baseUrl); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | $ret = ltrim($ret, '/'); |
| 41 | 41 | if (!empty($options['absolute'])) { |
| 42 | - $ret = $this->prefix . '/' . $ret; |
|
| 42 | + $ret = $this->prefix.'/'.$ret; |
|
| 43 | 43 | } |
| 44 | 44 | return $ret; |
| 45 | 45 | } |
@@ -43,11 +43,11 @@ |
||
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | if (!is_string($subject)) { |
| 46 | - throw new \InvalidArgumentException("Expected a string or object as subject, got " . gettype($subject)); |
|
| 46 | + throw new \InvalidArgumentException("Expected a string or object as subject, got ".gettype($subject)); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if ($alias = $this->toAlias($subject)) { |
| 50 | - return $this->basePath . $alias; |
|
| 50 | + return $this->basePath.$alias; |
|
| 51 | 51 | } |
| 52 | 52 | return null; |
| 53 | 53 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | $pattern = sprintf('!(<%s\b[^>]+\b(?:%s)=")([^"]+)(")!', $tagName, join('|', $attributes)); |
| 62 | 62 | if (preg_match_all($pattern, $html, $matches, PREG_SET_ORDER)) { |
| 63 | 63 | foreach ($matches as $match) { |
| 64 | - $map[$match[2]][]= $match; |
|
| 64 | + $map[$match[2]][] = $match; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function processAliasing($content, $mode, Rewriter $rewriter) |
| 33 | 33 | { |
| 34 | - $options = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT; |
|
| 34 | + $options = JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_AMP|JSON_HEX_QUOT; |
|
| 35 | 35 | |
| 36 | 36 | // Json is escaped by default we remove the escaping to replace the url. The escaping is added after |
| 37 | 37 | $content = json_encode(json_decode($content, false, 512, $options), JSON_UNESCAPED_SLASHES); |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | } |
| 60 | 60 | $groups = []; |
| 61 | 61 | foreach ($matches as $match) { |
| 62 | - $groups[$match[2]][]= $match; |
|
| 62 | + $groups[$match[2]][] = $match; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | return $rewriter->rewriteMatches($content, $mode, $groups); |
@@ -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 |
@@ -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 | } |
@@ -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; |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | $where = ['public_url' => $publicUrl]; |
| 23 | 23 | if (null !== $mode) { |
| 24 | - $where['mode']= $mode; |
|
| 24 | + $where['mode'] = $mode; |
|
| 25 | 25 | } |
| 26 | 26 | return $this->findOneBy($where, ['id' => 'ASC']); |
| 27 | 27 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $where = ['internal_url' => $internalUrl]; |
| 35 | 35 | if (null !== $mode) { |
| 36 | - $where['mode']= $mode; |
|
| 36 | + $where['mode'] = $mode; |
|
| 37 | 37 | } |
| 38 | 38 | return $this->findOneBy($where, ['id' => 'ASC']); |
| 39 | 39 | } |