@@ -13,11 +13,11 @@ |
||
| 13 | 13 | interface SluggerInterface |
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | - * Returns the slug for a given string |
|
| 17 | - * |
|
| 18 | - * @param string $string |
|
| 19 | - * |
|
| 20 | - * @return string |
|
| 21 | - **/ |
|
| 16 | + * Returns the slug for a given string |
|
| 17 | + * |
|
| 18 | + * @param string $string |
|
| 19 | + * |
|
| 20 | + * @return string |
|
| 21 | + **/ |
|
| 22 | 22 | public function slug($string); |
| 23 | 23 | } |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | // Loop over all matching tags from the string. |
| 76 | - return preg_replace_callback($pattern, function ($match) use ($newlines) { |
|
| 76 | + return preg_replace_callback($pattern, function($match) use ($newlines) { |
|
| 77 | 77 | // Return the tag appended by the specified amount of newlines. Note that $match[0] is the full captured |
| 78 | 78 | // match, so it also includes the newlines after the tag. $match[1] is just the tag itself, and $match[2] |
| 79 | 79 | // are the newlines following it (if any). |
@@ -96,18 +96,18 @@ discard block |
||
| 96 | 96 | // If the ellipsis is longer or equal to the maximum length, simply truncate the ellipsis so it fits in |
| 97 | 97 | // the maximum length and return it. |
| 98 | 98 | if ($suffix->length() >= $maxLength) { |
| 99 | - return (string) $suffix->truncate($maxLength); |
|
| 99 | + return (string)$suffix->truncate($maxLength); |
|
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $stringy = Stringy::create($string, 'UTF-8'); |
| 104 | 104 | |
| 105 | 105 | $sentencePattern = '/(.*[.!?])(?:\\s|\\h|$|\\\u00a0).*/su'; |
| 106 | - $trunc = (string) $stringy->first($maxLength); |
|
| 106 | + $trunc = (string)$stringy->first($maxLength); |
|
| 107 | 107 | $hasEndingSymbolInRange = preg_match($sentencePattern, $trunc); |
| 108 | 108 | |
| 109 | 109 | if ($this->sentenceFriendly && $hasEndingSymbolInRange === 1) { |
| 110 | - $sentenceTruncated = preg_replace($sentencePattern, "$1".$suffix, $trunc); |
|
| 110 | + $sentenceTruncated = preg_replace($sentencePattern, "$1" . $suffix, $trunc); |
|
| 111 | 111 | $truncated = Stringy::create($sentenceTruncated, 'UTF-8'); |
| 112 | 112 | } else if ($wordSafe) { |
| 113 | 113 | $truncated = $stringy->safeTruncate($maxLength, $suffix); |
@@ -122,6 +122,6 @@ discard block |
||
| 122 | 122 | $truncated = $truncated->regexReplace($pattern, $suffix); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - return (string) $truncated; |
|
| 125 | + return (string)$truncated; |
|
| 126 | 126 | } |
| 127 | 127 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - */ |
|
| 3 | + * @file |
|
| 4 | + */ |
|
| 5 | 5 | |
| 6 | 6 | namespace CultuurNet\UDB3\Variations; |
| 7 | 7 | |
@@ -1,10 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Created by PhpStorm. |
|
| 4 | - * User: nicolas |
|
| 5 | - * Date: 09/11/15 |
|
| 6 | - * Time: 14:31 |
|
| 7 | - */ |
|
| 3 | + * Created by PhpStorm. |
|
| 4 | + * User: nicolas |
|
| 5 | + * Date: 09/11/15 |
|
| 6 | + * Time: 14:31 |
|
| 7 | + */ |
|
| 8 | 8 | |
| 9 | 9 | namespace CultuurNet\UDB3; |
| 10 | 10 | |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | /** |
| 37 | 37 | * Translation constructor. |
| 38 | 38 | * @param Language $language |
| 39 | - * @param String|null $title |
|
| 40 | - * @param String|null $shortDescription |
|
| 41 | - * @param String|null $longDescription |
|
| 39 | + * @param null|string $title |
|
| 40 | + * @param null|string $shortDescription |
|
| 41 | + * @param null|string $longDescription |
|
| 42 | 42 | */ |
| 43 | 43 | public function __construct( |
| 44 | 44 | Language $language, |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | public function serialize() |
| 34 | 34 | { |
| 35 | 35 | return parent::serialize() + array( |
| 36 | - 'typicalAgeRange' => $this->typicalAgeRange, |
|
| 36 | + 'typicalAgeRange' => $this->typicalAgeRange, |
|
| 37 | 37 | ); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $this->logger->info( |
| 57 | 57 | 'job_info', |
| 58 | 58 | [ |
| 59 | - 'event_variation_id' => (string) $editDescription->getId(), |
|
| 59 | + 'event_variation_id' => (string)$editDescription->getId(), |
|
| 60 | 60 | ] |
| 61 | 61 | ); |
| 62 | 62 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $this->logger->info( |
| 71 | 71 | 'job_info', |
| 72 | 72 | [ |
| 73 | - 'event_variation_id' => (string) $deleteEventVariation->getId() |
|
| 73 | + 'event_variation_id' => (string)$deleteEventVariation->getId() |
|
| 74 | 74 | ] |
| 75 | 75 | ); |
| 76 | 76 | } |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - */ |
|
| 3 | + * @file |
|
| 4 | + */ |
|
| 5 | 5 | |
| 6 | 6 | namespace CultuurNet\UDB3\Variations; |
| 7 | 7 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | public function editDescription(Id $id, Description $description) |
| 70 | 70 | { |
| 71 | 71 | /** @var EventVariation $variation */ |
| 72 | - $variation = $this->eventVariationRepository->load((string) $id); |
|
| 72 | + $variation = $this->eventVariationRepository->load((string)$id); |
|
| 73 | 73 | |
| 74 | 74 | $variation->editDescription($description); |
| 75 | 75 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | public function deleteEventVariation(Id $id) |
| 83 | 83 | { |
| 84 | 84 | /** @var EventVariation $variation */ |
| 85 | - $variation = $this->eventVariationRepository->load((string) $id); |
|
| 85 | + $variation = $this->eventVariationRepository->load((string)$id); |
|
| 86 | 86 | |
| 87 | 87 | $variation->markDeleted(); |
| 88 | 88 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | private function guardNotDeleted() |
| 123 | 123 | { |
| 124 | 124 | if ($this->isDeleted()) { |
| 125 | - throw new AggregateDeletedException((string) $this->id); |
|
| 125 | + throw new AggregateDeletedException((string)$this->id); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public function getAggregateRootId() |
| 150 | 150 | { |
| 151 | - return (string) $this->id; |
|
| 151 | + return (string)$this->id; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | /** |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - */ |
|
| 3 | + * @file |
|
| 4 | + */ |
|
| 5 | 5 | |
| 6 | 6 | namespace CultuurNet\UDB3\Variations; |
| 7 | 7 | |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | public function serialize() |
| 40 | 40 | { |
| 41 | 41 | return parent::serialize() + array( |
| 42 | - 'description' => (string) $this->description, |
|
| 42 | + 'description' => (string)$this->description, |
|
| 43 | 43 | ); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * @file |
|
| 4 | - */ |
|
| 3 | + * @file |
|
| 4 | + */ |
|
| 5 | 5 | |
| 6 | 6 | namespace CultuurNet\UDB3\Variations; |
| 7 | 7 | |