@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | if (!empty($string)) { |
| 45 | 45 | $string = strip_tags($string); |
| 46 | - $result = (string)Stringy::create($string)->truncate($length, $substring); |
|
| 46 | + $result = (string) Stringy::create($string)->truncate($length, $substring); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $result; |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | if (!empty($string)) { |
| 69 | 69 | $string = strip_tags($string); |
| 70 | - $result = (string)Stringy::create($string)->safeTruncate($length, $substring); |
|
| 70 | + $result = (string) Stringy::create($string)->safeTruncate($length, $substring); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | return $result; |
@@ -5,12 +5,12 @@ |
||
| 5 | 5 | ini_set('date.timezone', 'UTC'); |
| 6 | 6 | |
| 7 | 7 | // Use the current installation of Craft |
| 8 | -define('CRAFT_STORAGE_PATH', __DIR__ . '/_craft/storage'); |
|
| 9 | -define('CRAFT_TEMPLATES_PATH', __DIR__ . '/_craft/templates'); |
|
| 10 | -define('CRAFT_CONFIG_PATH', __DIR__ . '/_craft/config'); |
|
| 11 | -define('CRAFT_MIGRATIONS_PATH', __DIR__ . '/_craft/migrations'); |
|
| 12 | -define('CRAFT_TRANSLATIONS_PATH', __DIR__ . '/_craft/translations'); |
|
| 13 | -define('CRAFT_VENDOR_PATH', dirname(__DIR__) . '/vendor'); |
|
| 8 | +define('CRAFT_STORAGE_PATH', __DIR__.'/_craft/storage'); |
|
| 9 | +define('CRAFT_TEMPLATES_PATH', __DIR__.'/_craft/templates'); |
|
| 10 | +define('CRAFT_CONFIG_PATH', __DIR__.'/_craft/config'); |
|
| 11 | +define('CRAFT_MIGRATIONS_PATH', __DIR__.'/_craft/migrations'); |
|
| 12 | +define('CRAFT_TRANSLATIONS_PATH', __DIR__.'/_craft/translations'); |
|
| 13 | +define('CRAFT_VENDOR_PATH', dirname(__DIR__).'/vendor'); |
|
| 14 | 14 | define('CRAFT_TESTS_PATH', __DIR__); |
| 15 | 15 | |
| 16 | 16 | $devMode = true; |
@@ -102,14 +102,14 @@ discard block |
||
| 102 | 102 | if (strcmp($oldUri, $newUri) !== 0) { |
| 103 | 103 | // Handle trailing slash config setting |
| 104 | 104 | if (Craft::$app->config->general->addTrailingSlashesToUrls) { |
| 105 | - $oldUri = rtrim($oldUri, '/') . '/'; |
|
| 106 | - $newUri = rtrim($newUri, '/') . '/'; |
|
| 105 | + $oldUri = rtrim($oldUri, '/').'/'; |
|
| 106 | + $newUri = rtrim($newUri, '/').'/'; |
|
| 107 | 107 | } |
| 108 | 108 | // Handle the URL match type |
| 109 | 109 | if (Retour::$settings->uriChangeRedirectSrcMatch === 'fullurl') { |
| 110 | 110 | try { |
| 111 | 111 | if ($redirectSiteId !== null) { |
| 112 | - $redirectSiteId = (int)$redirectSiteId; |
|
| 112 | + $redirectSiteId = (int) $redirectSiteId; |
|
| 113 | 113 | } |
| 114 | 114 | $oldUri = \craft\helpers\UrlHelper::siteUrl($oldUri, null, null, $redirectSiteId); |
| 115 | 115 | $newUri = UrlHelper::siteUrl($newUri, null, null, $redirectSiteId); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | 'siteId' => $redirectSiteId, |
| 128 | 128 | ]; |
| 129 | 129 | // Trigger a 'beforeSaveEntryRedirect' event |
| 130 | - $isNew = (int)$redirectConfig['id'] === 0; |
|
| 130 | + $isNew = (int) $redirectConfig['id'] === 0; |
|
| 131 | 131 | $event = new RedirectEvent([ |
| 132 | 132 | 'isNew' => $isNew, |
| 133 | 133 | 'legacyUrl' => $redirectConfig['redirectSrcUrl'], |
@@ -41,17 +41,17 @@ |
||
| 41 | 41 | $retourType = GqlEntityRegistry::getEntity($typeName) |
| 42 | 42 | ?: GqlEntityRegistry::createEntity($typeName, new RetourType([ |
| 43 | 43 | 'name' => $typeName, |
| 44 | - 'args' => function () use ($retourArgs) { |
|
| 44 | + 'args' => function() use ($retourArgs) { |
|
| 45 | 45 | return $retourArgs; |
| 46 | 46 | }, |
| 47 | - 'fields' => function () use ($retourFields) { |
|
| 47 | + 'fields' => function() use ($retourFields) { |
|
| 48 | 48 | return $retourFields; |
| 49 | 49 | }, |
| 50 | 50 | 'description' => 'This entity has all the Retour fields', |
| 51 | 51 | ])); |
| 52 | 52 | |
| 53 | 53 | $gqlTypes[$typeName] = $retourType; |
| 54 | - TypeLoader::registerType($typeName, function () use ($retourType) { |
|
| 54 | + TypeLoader::registerType($typeName, function() use ($retourType) { |
|
| 55 | 55 | return $retourType; |
| 56 | 56 | }); |
| 57 | 57 | |
@@ -41,14 +41,14 @@ discard block |
||
| 41 | 41 | 'retour' => [ |
| 42 | 42 | 'type' => RetourInterface::getType(), |
| 43 | 43 | 'args' => RetourArguments::getArguments(), |
| 44 | - 'resolve' => RetourResolver::class . '::resolve', |
|
| 44 | + 'resolve' => RetourResolver::class.'::resolve', |
|
| 45 | 45 | 'description' => 'This query is used to query for Retour redirects.', |
| 46 | 46 | 'deprecationReason' => 'This query is deprecated and will be removed in the future. You should use `retourResolveRedirect` instead.', |
| 47 | 47 | ], |
| 48 | 48 | 'retourResolveRedirect' => [ |
| 49 | 49 | 'type' => RetourInterface::getType(), |
| 50 | 50 | 'args' => RetourArguments::getArguments(), |
| 51 | - 'resolve' => RetourResolver::class . '::resolve', |
|
| 51 | + 'resolve' => RetourResolver::class.'::resolve', |
|
| 52 | 52 | 'description' => 'This query is used to query for Retour redirects.', |
| 53 | 53 | ], |
| 54 | 54 | 'retourRedirects' => [ |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | 'description' => 'The siteId to list all redirects for.' |
| 66 | 66 | ], |
| 67 | 67 | ], |
| 68 | - 'resolve' => RetourResolver::class . '::resolveAll', |
|
| 68 | + 'resolve' => RetourResolver::class.'::resolveAll', |
|
| 69 | 69 | 'description' => 'This query is used to query for all Retour redirects for a site.', |
| 70 | 70 | ], |
| 71 | 71 | ]; |
@@ -64,8 +64,8 @@ |
||
| 64 | 64 | if ($redirect === null && Craft::$app->getElements()->getElementByUri(trim($uri, '/'), $siteId) === null) { |
| 65 | 65 | // Set the `site` virtual field |
| 66 | 66 | $redirect['site'] = null; |
| 67 | - if (isset($redirect['siteId']) && (int)$redirect['siteId'] !== 0) { |
|
| 68 | - $site = Craft::$app->getSites()->getSiteById((int)$redirect['siteId']); |
|
| 67 | + if (isset($redirect['siteId']) && (int) $redirect['siteId'] !== 0) { |
|
| 68 | + $site = Craft::$app->getSites()->getSiteById((int) $redirect['siteId']); |
|
| 69 | 69 | if ($site !== null) { |
| 70 | 70 | $redirect['site'] = $site->handle; |
| 71 | 71 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | /** @noinspection CallableParameterUseCaseInTypeContextInspection */ |
| 62 | 62 | $url = preg_replace('/{.*}/', '', $url); |
| 63 | 63 | // Remove any linebreaks that may be errantly in the URL |
| 64 | - $url = (string)str_replace([ |
|
| 64 | + $url = (string) str_replace([ |
|
| 65 | 65 | PHP_EOL, |
| 66 | 66 | "\r", |
| 67 | 67 | "\n", |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $siteId = reset($variables['enabledSiteIds']); |
| 90 | 90 | } |
| 91 | 91 | } else { |
| 92 | - self::requirePermission('editSite:' . $siteId); |
|
| 92 | + self::requirePermission('editSite:'.$siteId); |
|
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } else { |
| 115 | 115 | $variables['sitesMenuLabel'] = Craft::t( |
| 116 | 116 | 'site', |
| 117 | - $sites->getSiteById((int)$variables['currentSiteId'])->name |
|
| 117 | + $sites->getSiteById((int) $variables['currentSiteId'])->name |
|
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | } else { |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if ($siteHandle !== null) { |
| 138 | 138 | $site = Craft::$app->getSites()->getSiteByHandle($siteHandle); |
| 139 | 139 | if (!$site) { |
| 140 | - throw new NotFoundHttpException('Invalid site handle: ' . $siteHandle); |
|
| 140 | + throw new NotFoundHttpException('Invalid site handle: '.$siteHandle); |
|
| 141 | 141 | } |
| 142 | 142 | $siteId = $site->id; |
| 143 | 143 | } else { |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | return; |
| 61 | 61 | } |
| 62 | 62 | // Make sure there is a leading / |
| 63 | - $value = '/' . ltrim($value, '/'); |
|
| 63 | + $value = '/'.ltrim($value, '/'); |
|
| 64 | 64 | $model->$attribute = $value; |
| 65 | 65 | } |
| 66 | 66 | } |