From 81f9391dee08d55f03be51d9b3f88effc6003a38 Mon Sep 17 00:00:00 2001 From: Cameron Bryers <12287346+Cambis@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:23:49 +1200 Subject: [PATCH] :fire: feat: remove silverstripe/cms from dependencies - Removed as silverstripe/cms is not required by all silverstripe modules. This will make it easier to use this library with other modules --- composer.json | 6 +++--- stubs/Page.php | 4 ++++ stubs/PageController.php | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 7aa66c8..8c2f727 100644 --- a/composer.json +++ b/composer.json @@ -25,13 +25,13 @@ "php": "~8.0", "silverstripe/framework": "~5.0", "phpstan/phpstan": "^1.5", - "silverstripe/versioned": "^2.0", - "silverstripe/cms": "^5.0" + "silverstripe/versioned": "^2.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.0", "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^9.4" + "phpunit/phpunit": "^9.4", + "silverstripe/cms": "^5.0" }, "scripts": { "phpcs": "phpcs -n -l src/ src/Reflection/ src/Rule/ src/Type tests/ tests/Reflection/ tests/Rule/ tests/Type/", diff --git a/stubs/Page.php b/stubs/Page.php index 790c27d..d2ebde7 100644 --- a/stubs/Page.php +++ b/stubs/Page.php @@ -4,5 +4,9 @@ use SilverStripe\CMS\Model\SiteTree; + if (!class_exists(SilverStripe\CMS\Model\SiteTree::class)) { + return; + } + class Page extends SiteTree {} } \ No newline at end of file diff --git a/stubs/PageController.php b/stubs/PageController.php index 26c93d5..939a3b8 100644 --- a/stubs/PageController.php +++ b/stubs/PageController.php @@ -4,5 +4,9 @@ use SilverStripe\CMS\Controllers\ContentController; + if (!class_exists(SilverStripe\CMS\Controllers\ContentController::class)) { + return; + } + class PageController extends ContentController {} } \ No newline at end of file