Skip to content

Commit

Permalink
MNT: Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Cambis committed Aug 12, 2024
1 parent aeaf9cf commit fe70175
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Admin/AdvancedWorkflowAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\Filterable;
use SilverStripe\ORM\SS_List;
use SilverStripe\Security\Member;
use SilverStripe\Security\Permission;
use SilverStripe\Security\Security;
Expand Down Expand Up @@ -180,15 +182,15 @@ public function getFieldDependentData(Member $user, string $fieldName): ?DataLis
$list = null;

if ($fieldName === 'PendingObjects') {
$list = $this->getWorkflowService()->userPendingItems($user);
$list = $this->getWorkflowService()->userPendingItems($user);
}

if ($fieldName === 'SubmittedObjects') {
$list = $this->getWorkflowService()->userSubmittedItems($user);
}

// If the list is null, then the user has entered a bad input
if (!$list instanceof DataList && !$list instanceof ArrayList) {
if (!$list instanceof Filterable) {
throw new InvalidArgumentException('$fieldName must be one of ("PendingObjects", "SubmittedObjects")');
}

Expand Down

0 comments on commit fe70175

Please sign in to comment.