@@ -33,8 +33,8 @@ |
||
| 33 | 33 | public function equals(Label $label) |
| 34 | 34 | { |
| 35 | 35 | return strcmp( |
| 36 | - mb_strtolower((string) $this, 'UTF-8'), |
|
| 37 | - mb_strtolower((string) $label, 'UTF-8') |
|
| 36 | + mb_strtolower((string)$this, 'UTF-8'), |
|
| 37 | + mb_strtolower((string)$label, 'UTF-8') |
|
| 38 | 38 | ) == 0; |
| 39 | 39 | } |
| 40 | 40 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | array_walk( |
| 21 | 21 | $labels, |
| 22 | - function ($item) { |
|
| 22 | + function($item) { |
|
| 23 | 23 | if (!$item instanceof Label) { |
| 24 | 24 | throw new \InvalidArgumentException( |
| 25 | 25 | 'Argument $labels should only contain members of type Label' |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $labels = array_filter( |
| 56 | 56 | $this->labels, |
| 57 | - function (Label $existingLabel) use ($label) { |
|
| 57 | + function(Label $existingLabel) use ($label) { |
|
| 58 | 58 | return !$existingLabel->equals($label); |
| 59 | 59 | } |
| 60 | 60 | ); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $equalLabels = array_filter( |
| 80 | 80 | $this->labels, |
| 81 | - function (Label $existingLabel) use ($label) { |
|
| 81 | + function(Label $existingLabel) use ($label) { |
|
| 82 | 82 | return $label->equals($existingLabel); |
| 83 | 83 | } |
| 84 | 84 | ); |
@@ -139,8 +139,8 @@ discard block |
||
| 139 | 139 | public function toStrings() |
| 140 | 140 | { |
| 141 | 141 | $labels = array_map( |
| 142 | - function (Label $label) { |
|
| 143 | - return (string) $label; |
|
| 142 | + function(Label $label) { |
|
| 143 | + return (string)$label; |
|
| 144 | 144 | }, |
| 145 | 145 | $this->labels |
| 146 | 146 | ); |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | return parent::serialize() + array( |
| 91 | - 'title' => (string) $this->getTitle(), |
|
| 91 | + 'title' => (string)$this->getTitle(), |
|
| 92 | 92 | 'addresses' => $addresses, |
| 93 | 93 | 'phones' => $this->getPhones(), |
| 94 | 94 | 'emails' => $this->getEmails(), |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | $theme = $this->getTheme()->serialize(); |
| 114 | 114 | } |
| 115 | 115 | return parent::serialize() + array( |
| 116 | - 'title' => (string) $this->getTitle(), |
|
| 116 | + 'title' => (string)$this->getTitle(), |
|
| 117 | 117 | 'event_type' => $this->getEventType()->serialize(), |
| 118 | 118 | 'theme' => $theme, |
| 119 | 119 | 'address' => $this->getAddress()->serialize(), |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | if ($this->id) { |
| 51 | - $serializedSavedSearch['id'] = (string) $this->id; |
|
| 51 | + $serializedSavedSearch['id'] = (string)$this->id; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | return $serializedSavedSearch; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | $name = new String($savedSearch->name); |
| 78 | 78 | $query = QueryString::fromURLQueryString($savedSearch->query); |
| 79 | - $id = new String((string) $savedSearch->id); |
|
| 79 | + $id = new String((string)$savedSearch->id); |
|
| 80 | 80 | |
| 81 | 81 | return new SavedSearch($name, $query, $id); |
| 82 | 82 | } |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | public function write(String $userId, String $name, QueryString $queryString) |
| 88 | 88 | { |
| 89 | - $userId = (string) $userId; |
|
| 90 | - $name = (string) $name; |
|
| 89 | + $userId = (string)$userId; |
|
| 90 | + $name = (string)$name; |
|
| 91 | 91 | $query = $queryString->toURLQueryString(); |
| 92 | 92 | |
| 93 | 93 | $savedSearch = new \CultureFeed_SavedSearches_SavedSearch( |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | 'error' => $exception->getMessage(), |
| 108 | 108 | 'userId' => $userId, |
| 109 | 109 | 'name' => $name, |
| 110 | - 'query' => (string) $queryString, |
|
| 110 | + 'query' => (string)$queryString, |
|
| 111 | 111 | ] |
| 112 | 112 | ); |
| 113 | 113 | } |
@@ -119,8 +119,8 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function delete(String $userId, String $searchId) |
| 121 | 121 | { |
| 122 | - $userId = (string) $userId; |
|
| 123 | - $searchId = (string) $searchId; |
|
| 122 | + $userId = (string)$userId; |
|
| 123 | + $searchId = (string)$searchId; |
|
| 124 | 124 | |
| 125 | 125 | try { |
| 126 | 126 | $this->savedSearches->unsubscribe($searchId, $userId); |
@@ -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 | } |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | private function getErrorMessages($validationErrors) |
| 97 | 97 | { |
| 98 | 98 | $errorMessages = array_map( |
| 99 | - function ($error) { |
|
| 99 | + function($error) { |
|
| 100 | 100 | return $error['message']; |
| 101 | 101 | }, |
| 102 | 102 | $validationErrors |