From 8c8cf7e5471cca5f9e509fdfcfcc9cd594d4b459 Mon Sep 17 00:00:00 2001 From: Ransom Roberson Date: Sun, 18 Feb 2024 14:40:27 -0500 Subject: [PATCH] Initial work on v5 --- composer.json | 10 +++++++--- ecs.php | 17 +++++++++++++++++ phpstan.neon | 7 +++++++ src/Plugin.php | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 ecs.php create mode 100644 phpstan.neon diff --git a/composer.json b/composer.json index aafed56..90c4ef2 100644 --- a/composer.json +++ b/composer.json @@ -21,9 +21,14 @@ } ], "require": { - "craftcms/cms": "^4.0.0", + "craftcms/cms": "^5.0.0-beta.1", "php": "^8.0.2" }, + "require-dev": { + "craftcms/phpstan": "dev-main", + "craftcms/ecs": "dev-main", + "craftcms/rector": "dev-main" + }, "autoload": { "psr-4": { "venveo\\bulkedit\\": "src/" @@ -32,8 +37,7 @@ "extra": { "name": "Bulk Edit", "handle": "venveo-bulk-edit", - "changelogUrl": "https://raw.githubusercontent.com/venveo/craft-bulkedit/master/CHANGELOG.md", - "class": "venveo\\bulkedit\\Plugin" + "changelogUrl": "https://raw.githubusercontent.com/venveo/craft-bulkedit/master/CHANGELOG.md" }, "config": { "sort-packages": true, diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000..386e9f5 --- /dev/null +++ b/ecs.php @@ -0,0 +1,17 @@ +parallel(); + $ecsConfig->paths([ + __DIR__ . '/src', + __FILE__, + ]); + + + $ecsConfig->sets([SetList::CRAFT_CMS_4]); // for Craft 4 projects +}; \ No newline at end of file diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..a9a75fe --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +includes: + - vendor/craftcms/phpstan/phpstan.neon + +parameters: + level: 0 + paths: + - src \ No newline at end of file diff --git a/src/Plugin.php b/src/Plugin.php index 597fb67..dd5198b 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -114,7 +114,7 @@ function (RegisterElementActionsEvent $event) { } if (Craft::$app->user->checkPermission(self::PERMISSION_BULKEDIT_PRODUCTS)) { - if (Craft::$app->plugins->isPluginInstalled('commerce') && class_exists(Product::class)) { + if (Craft::$app->plugins->isPluginInstalled('commerce') && class_exists('\craft\commerce\elements\Product')) { Event::on(Product::class, Element::EVENT_REGISTER_ACTIONS, function (RegisterElementActionsEvent $event) { $event->actions[] = BulkEditElementAction::class;