Skip to content

Commit

Permalink
Initial work on v5
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Feb 18, 2024
1 parent 49b6387 commit 8c8cf7e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand All @@ -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,
Expand Down
17 changes: 17 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

declare(strict_types=1);

use craft\ecs\SetList;
use Symplify\EasyCodingStandard\Config\ECSConfig;

return static function(ECSConfig $ecsConfig): void {
$ecsConfig->parallel();
$ecsConfig->paths([
__DIR__ . '/src',
__FILE__,
]);


$ecsConfig->sets([SetList::CRAFT_CMS_4]); // for Craft 4 projects
};
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
includes:
- vendor/craftcms/phpstan/phpstan.neon

parameters:
level: 0
paths:
- src
2 changes: 1 addition & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8c8cf7e

Please sign in to comment.