@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if ($this->dateParts->count() < 1 && in_array($form, self::$localizedDateFormats)) { |
| 143 | 143 | if ($this->hasDatePartsFromLocales($form)) { |
| 144 | 144 | $datePartsFromLocales = $this->getDatePartsFromLocales($form); |
| 145 | - array_filter($datePartsFromLocales, function (\SimpleXMLElement $item) use ($dateParts) { |
|
| 145 | + array_filter($datePartsFromLocales, function(\SimpleXMLElement $item) use ($dateParts) { |
|
| 146 | 146 | return in_array($item["name"], $dateParts); |
| 147 | 147 | }); |
| 148 | 148 | |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | $ret = $this->renderDateRange($toRender, $from, $to, $delim); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - if (isset($var->raw) && preg_match("/(\p{L}+)\s?([\-\-\&,])\s?(\p{L}+)/u", $var->raw, $matches)){ |
|
| 216 | - return $matches[1].$matches[2].$matches[3]; |
|
| 215 | + if (isset($var->raw) && preg_match("/(\p{L}+)\s?([\-\-\&,])\s?(\p{L}+)/u", $var->raw, $matches)) { |
|
| 216 | + return $matches[1] . $matches[2] . $matches[3]; |
|
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | // fallback: |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $data = []; |
| 243 | 243 | foreach ($dates as $date) { |
| 244 | 244 | if ($date[0] < 1000) { |
| 245 | - $dateTime = new DateTime(0,0,0); |
|
| 245 | + $dateTime = new DateTime(0, 0, 0); |
|
| 246 | 246 | $dateTime->setDay(0)->setMonth(0)->setYear(0); |
| 247 | 247 | $data[] = $dateTime; |
| 248 | 248 | } |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | $dp = $this->dateParts->toArray(); |
| 348 | 348 | $i = 0; |
| 349 | 349 | $dateParts_ = []; |
| 350 | - array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 350 | + array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 351 | 351 | if (strpos($key, "year") !== false || strpos($key, "month") !== false) { |
| 352 | 352 | $dateParts_["yearmonth"][] = $datePart; |
| 353 | 353 | } |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $dp = $this->dateParts->toArray(); |
| 361 | 361 | $i = 0; |
| 362 | 362 | $dateParts_ = []; |
| 363 | - array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 363 | + array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 364 | 364 | if (strpos($key, "year") !== false || strpos($key, "day") !== false) { |
| 365 | 365 | $dateParts_["yearday"][] = $datePart; |
| 366 | 366 | } |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | $dp = $this->dateParts->toArray(); |
| 374 | 374 | $i = 0; |
| 375 | 375 | $dateParts_ = []; |
| 376 | - array_walk($dp, function ($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 376 | + array_walk($dp, function($datePart, $key) use (&$i, &$dateParts_, $differentParts) { |
|
| 377 | 377 | //$bit = sprintf("%03d", decbin($differentParts)); |
| 378 | 378 | if (strpos($key, "month") !== false || strpos($key, "day") !== false) { |
| 379 | 379 | $dateParts_["monthday"][] = $datePart; |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | $from = $datePart->renderWithoutAffixes($from, $this); |
| 424 | 424 | $to = $datePart->renderWithoutAffixes($to, $this); |
| 425 | 425 | $suffix = !empty($to) ? $datePart->renderSuffix() : ""; |
| 426 | - return $prefix.$from.$delim.$to.$suffix; |
|
| 426 | + return $prefix . $from . $delim . $to . $suffix; |
|
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | /** |
@@ -448,9 +448,9 @@ discard block |
||
| 448 | 448 | // no custom date parts within the date element (this)? |
| 449 | 449 | if (!empty($dateFromLocale)) { |
| 450 | 450 | |
| 451 | - $dateForm = array_filter(is_array($dateFromLocale) ? $dateFromLocale : [$dateFromLocale], function ($element) use ($format) { |
|
| 451 | + $dateForm = array_filter(is_array($dateFromLocale) ? $dateFromLocale : [$dateFromLocale], function($element) use ($format) { |
|
| 452 | 452 | /** @var \SimpleXMLElement $element */ |
| 453 | - $dateForm = (string)$element->attributes()["form"]; |
|
| 453 | + $dateForm = (string) $element->attributes()["form"]; |
|
| 454 | 454 | return $dateForm === $format; |
| 455 | 455 | }); |
| 456 | 456 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | { |
| 65 | 65 | $wordArray = explode(" ", $text); |
| 66 | 66 | |
| 67 | - array_walk($wordArray, function (&$word) { |
|
| 67 | + array_walk($wordArray, function(&$word) { |
|
| 68 | 68 | $word = ucfirst($word); |
| 69 | 69 | }); |
| 70 | 70 | |
@@ -74,16 +74,16 @@ discard block |
||
| 74 | 74 | public static function capitalizeForTitle($titleString) |
| 75 | 75 | { |
| 76 | 76 | if (preg_match('/(.+[^\<\>][\.:\/;\?\!]\s?)([a-z])(.+)/', $titleString, $match)) { |
| 77 | - $titleString = $match[1].StringHelper::mb_ucfirst($match[2]).$match[3]; |
|
| 77 | + $titleString = $match[1] . StringHelper::mb_ucfirst($match[2]) . $match[3]; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $wordArray = explode(" ", $titleString); |
| 81 | 81 | |
| 82 | - array_walk($wordArray, function (&$word) { |
|
| 82 | + array_walk($wordArray, function(&$word) { |
|
| 83 | 83 | |
| 84 | 84 | $words = explode("-", $word); |
| 85 | 85 | if (count($words) > 1) { |
| 86 | - array_walk($words, function (&$w) { |
|
| 86 | + array_walk($words, function(&$w) { |
|
| 87 | 87 | $w = StringHelper::keepLowerCase($w) ? $w : StringHelper::mb_ucfirst($w); |
| 88 | 88 | }); |
| 89 | 89 | $word = implode("-", $words); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public static function keepLowerCase($word) |
| 98 | 98 | { |
| 99 | - $lowerCase = in_array($word, self::PREPOSITIONS) || |
|
| 99 | + $lowerCase = in_array($word, self::PREPOSITIONS) || |
|
| 100 | 100 | in_array($word, self::ARTICLES) || |
| 101 | 101 | in_array($word, self::CONJUNCTIONS) || |
| 102 | 102 | in_array($word, self::ADJECTIVES); |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | foreach ($node->attributes() as $name => $value) { |
| 49 | 49 | if ('match' !== $name) { |
| 50 | - $this->constraints->append(Factory::createConstraint((string)$name, (string)$value)); |
|
| 50 | + $this->constraints->append(Factory::createConstraint((string) $name, (string) $value)); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |