From 02c8469e0ce18f13e25c81e93ee7828f90a4c396 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Mon, 16 Dec 2024 02:27:15 -0600 Subject: [PATCH] Use Winter's Url facade instead of Laravel's --- modules/backend/helpers/Backend.php | 2 +- modules/backend/models/BrandSetting.php | 2 +- modules/cms/controllers/Index.php | 2 +- modules/cms/controllers/Themes.php | 2 +- modules/cms/helpers/Cms.php | 2 +- modules/cms/twig/FrameworkNode.php | 2 +- modules/cms/twig/SnowboardNode.php | 2 +- modules/cms/widgets/AssetList.php | 2 +- .../Phpcs/Tests/Sniffs/NoGlobalAliasesSniffUnitTest.fixed | 2 +- modules/system/aliases.php | 4 ++-- modules/system/classes/CombineAssets.php | 2 +- modules/system/classes/ImageResizer.php | 2 +- modules/system/classes/MediaLibrary.php | 2 +- modules/system/classes/UpdateManager.php | 2 +- modules/system/models/File.php | 2 +- modules/system/tests/classes/ImageResizerTest.php | 2 +- modules/system/twig/Extension.php | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/backend/helpers/Backend.php b/modules/backend/helpers/Backend.php index a22a5f5dd7..6ea2136f2f 100644 --- a/modules/backend/helpers/Backend.php +++ b/modules/backend/helpers/Backend.php @@ -7,12 +7,12 @@ use Exception; use Illuminate\Support\Facades\Redirect; use Illuminate\Support\Facades\Request; -use Illuminate\Support\Facades\URL; use System\Helpers\DateTime as DateTimeHelper; use Winter\Storm\Router\Helper as RouterHelper; use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\File; use Winter\Storm\Support\Facades\Html; +use Winter\Storm\Support\Facades\Url; /** * Backend Helper diff --git a/modules/backend/models/BrandSetting.php b/modules/backend/models/BrandSetting.php index abb5d103e8..8b060c6849 100644 --- a/modules/backend/models/BrandSetting.php +++ b/modules/backend/models/BrandSetting.php @@ -7,11 +7,11 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Lang; -use Illuminate\Support\Facades\URL; use Less_Parser; use Winter\Storm\Database\Model; use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\File; +use Winter\Storm\Support\Facades\Url; /** * Brand settings that affect all users diff --git a/modules/cms/controllers/Index.php b/modules/cms/controllers/Index.php index 8e98298b73..bc89e29860 100644 --- a/modules/cms/controllers/Index.php +++ b/modules/cms/controllers/Index.php @@ -22,13 +22,13 @@ use Exception; use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Request; -use Illuminate\Support\Facades\URL; use System\Helpers\DateTime; use Winter\Storm\Exception\ApplicationException; use Winter\Storm\Router\Router as StormRouter; use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\Event; use Winter\Storm\Support\Facades\Flash; +use Winter\Storm\Support\Facades\Url; /** * CMS index diff --git a/modules/cms/controllers/Themes.php b/modules/cms/controllers/Themes.php index 9ef451846c..1816cba600 100644 --- a/modules/cms/controllers/Themes.php +++ b/modules/cms/controllers/Themes.php @@ -16,12 +16,12 @@ use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Redirect; -use Illuminate\Support\Facades\URL; use System\Classes\SettingsManager; use Winter\Storm\Exception\ApplicationException; use Winter\Storm\Exception\ValidationException; use Winter\Storm\Support\Facades\File; use Winter\Storm\Support\Facades\Flash; +use Winter\Storm\Support\Facades\Url; use Winter\Storm\Support\Str; /** diff --git a/modules/cms/helpers/Cms.php b/modules/cms/helpers/Cms.php index 732248a265..d3cca8df7e 100644 --- a/modules/cms/helpers/Cms.php +++ b/modules/cms/helpers/Cms.php @@ -3,8 +3,8 @@ namespace Cms\Helpers; use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\URL; use Winter\Storm\Support\Facades\Config; +use Winter\Storm\Support\Facades\Url; /** * CMS Helper diff --git a/modules/cms/twig/FrameworkNode.php b/modules/cms/twig/FrameworkNode.php index 3b3c496b95..1da40feac0 100644 --- a/modules/cms/twig/FrameworkNode.php +++ b/modules/cms/twig/FrameworkNode.php @@ -2,11 +2,11 @@ namespace Cms\Twig; -use Illuminate\Support\Facades\URL; use System\Classes\CombineAssets; use System\Models\Parameter; use Twig\Compiler as TwigCompiler; use Twig\Node\Node as TwigNode; +use Winter\Storm\Support\Facades\Url; /** * Represents a "framework" node diff --git a/modules/cms/twig/SnowboardNode.php b/modules/cms/twig/SnowboardNode.php index f0b78913ea..f73277fc2a 100644 --- a/modules/cms/twig/SnowboardNode.php +++ b/modules/cms/twig/SnowboardNode.php @@ -2,12 +2,12 @@ namespace Cms\Twig; -use Illuminate\Support\Facades\URL; use System\Classes\CombineAssets; use System\Models\Parameter; use Twig\Compiler as TwigCompiler; use Twig\Node\Node as TwigNode; use Winter\Storm\Support\Facades\Config; +use Winter\Storm\Support\Facades\Url; /** * Represents a "snowboard" node diff --git a/modules/cms/widgets/AssetList.php b/modules/cms/widgets/AssetList.php index 94c519a406..a3f8ad170d 100644 --- a/modules/cms/widgets/AssetList.php +++ b/modules/cms/widgets/AssetList.php @@ -10,7 +10,6 @@ use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Response; -use Illuminate\Support\Facades\URL; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; use Symfony\Component\HttpFoundation\File\UploadedFile; @@ -18,6 +17,7 @@ use Winter\Storm\Filesystem\Definitions as FileDefinitions; use Winter\Storm\Support\Facades\File; use Winter\Storm\Support\Facades\Input; +use Winter\Storm\Support\Facades\Url; use Winter\Storm\Support\Str; /** diff --git a/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffUnitTest.fixed b/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffUnitTest.fixed index e78902f80c..71f5619b78 100644 --- a/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffUnitTest.fixed +++ b/modules/system/Phpcs/Tests/Sniffs/NoGlobalAliasesSniffUnitTest.fixed @@ -2,7 +2,7 @@ use Winter\Storm\Support\Facades\Config as MyConfig; use Illuminate\Support\Facades\Lang as MyLang; -use Winter\Storm\Support\Facades\URL; +use Winter\Storm\Support\Facades\Url; use Winter\Storm\Support\Arr; use Winter\Storm\Support\Facades\Yaml; diff --git a/modules/system/aliases.php b/modules/system/aliases.php index a9941b833b..af12794f3a 100644 --- a/modules/system/aliases.php +++ b/modules/system/aliases.php @@ -41,7 +41,7 @@ 'Session' => Illuminate\Support\Facades\Session::class, 'Storage' => Illuminate\Support\Facades\Storage::class, // 'Str' => Illuminate\Support\Str::class, // Replaced by Winter - // 'URL' => Illuminate\Support\Facades\URL::class, // Replaced by Winter + // 'URL' => Illuminate\Support\Facades\URL::class, // Replaced by Winter // 'Validator' => Illuminate\Support\Facades\Validator::class, // Replaced by Winter 'View' => Illuminate\Support\Facades\View::class, @@ -85,7 +85,7 @@ * Backwards compatibility aliases */ 'Db' => Winter\Storm\Support\Facades\DB::class, - 'Url' => Winter\Storm\Support\Facades\URL::class, + 'Url' => Winter\Storm\Support\Facades\Url::class, 'TestCase' => System\Tests\Bootstrap\TestCase::class, 'PluginTestCase' => System\Tests\Bootstrap\PluginTestCase::class, diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index b59b0e8223..bd37e1ce85 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -17,7 +17,6 @@ use Illuminate\Support\Facades\Request; use Illuminate\Support\Facades\Response; use Illuminate\Support\Facades\Route; -use Illuminate\Support\Facades\URL; use System\Helpers\Cache as CacheHelper; use Winter\Storm\Parse\Assetic\Cache\FilesystemCache; use Winter\Storm\Parse\Assetic\Filter\JavascriptImporter; @@ -26,6 +25,7 @@ use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\Event; use Winter\Storm\Support\Facades\File; +use Winter\Storm\Support\Facades\Url; /** * Combiner class used for combining JavaScript and StyleSheet files. diff --git a/modules/system/classes/ImageResizer.php b/modules/system/classes/ImageResizer.php index 007458fe4f..84b1ce7308 100644 --- a/modules/system/classes/ImageResizer.php +++ b/modules/system/classes/ImageResizer.php @@ -6,7 +6,6 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\URL; use System\Models\File as SystemFileModel; use Winter\Storm\Database\Attach\File as FileModel; use Winter\Storm\Database\Attach\Resizer as DefaultResizer; @@ -14,6 +13,7 @@ use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\Event; use Winter\Storm\Support\Facades\File as FileHelper; +use Winter\Storm\Support\Facades\Url; /** * Image Resizing class used for resizing any image resources accessible diff --git a/modules/system/classes/MediaLibrary.php b/modules/system/classes/MediaLibrary.php index 406983405e..2f6c0d4223 100644 --- a/modules/system/classes/MediaLibrary.php +++ b/modules/system/classes/MediaLibrary.php @@ -6,11 +6,11 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Lang; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\URL; use Winter\Storm\Exception\ApplicationException; use Winter\Storm\Exception\SystemException; use Winter\Storm\Filesystem\Definitions as FileDefinitions; use Winter\Storm\Support\Facades\Config; +use Winter\Storm\Support\Facades\Url; use Winter\Storm\Support\Str; use Winter\Storm\Support\Svg; diff --git a/modules/system/classes/UpdateManager.php b/modules/system/classes/UpdateManager.php index 7bbf4bb533..e4cae38617 100644 --- a/modules/system/classes/UpdateManager.php +++ b/modules/system/classes/UpdateManager.php @@ -10,7 +10,6 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Lang; -use Illuminate\Support\Facades\URL; use System\Helpers\Cache as CacheHelper; use System\Models\Parameter; use System\Models\PluginVersion; @@ -20,6 +19,7 @@ use Winter\Storm\Support\Facades\File; use Winter\Storm\Support\Facades\Http; use Winter\Storm\Support\Facades\Schema; +use Winter\Storm\Support\Facades\Url; /** * Update manager diff --git a/modules/system/models/File.php b/modules/system/models/File.php index d4c573f551..d150a54c5b 100644 --- a/modules/system/models/File.php +++ b/modules/system/models/File.php @@ -4,9 +4,9 @@ use Backend\Controllers\Files; use Illuminate\Support\Facades\Storage; -use Illuminate\Support\Facades\URL; use Winter\Storm\Database\Attach\File as FileBase; use Winter\Storm\Support\Facades\Config; +use Winter\Storm\Support\Facades\Url; /** * File attachment model diff --git a/modules/system/tests/classes/ImageResizerTest.php b/modules/system/tests/classes/ImageResizerTest.php index c0b5d13237..1f14ff139a 100644 --- a/modules/system/tests/classes/ImageResizerTest.php +++ b/modules/system/tests/classes/ImageResizerTest.php @@ -6,7 +6,6 @@ use Cms\Classes\Controller as CmsController; use Cms\Classes\Theme; use DMS\PHPUnitExtensions\ArraySubset\ArraySubsetAsserts; -use Illuminate\Support\Facades\URL; use System\Classes\ImageResizer; use System\Classes\MediaLibrary; use System\Models\File as FileModel; @@ -14,6 +13,7 @@ use Winter\Storm\Exception\SystemException; use Winter\Storm\Support\Facades\Config; use Winter\Storm\Support\Facades\Event; +use Winter\Storm\Support\Facades\Url; class ImageResizerTest extends PluginTestCase { diff --git a/modules/system/twig/Extension.php b/modules/system/twig/Extension.php index 1c5057889f..16afe909e5 100644 --- a/modules/system/twig/Extension.php +++ b/modules/system/twig/Extension.php @@ -2,13 +2,13 @@ namespace System\Twig; -use Illuminate\Support\Facades\URL; use System\Classes\ImageResizer; use System\Classes\MarkupManager; use System\Classes\MediaLibrary; use Twig\Extension\AbstractExtension as TwigExtension; use Twig\TwigFilter as TwigSimpleFilter; use Twig\TwigFunction as TwigSimpleFunction; +use Winter\Storm\Support\Facades\Url; /** * The System Twig extension class implements common Twig functions and filters.