Skip to content

Commit a55ba3b

Browse files
committed
Move the check whether an object is deactivated/activated from the command to the caller of the command.
1 parent 70175de commit a55ba3b

64 files changed

Lines changed: 100 additions & 196 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

wcfsetup/install/files/lib/command/ad/DisableAd.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if ($this->ad->isDisabled) {
27-
return;
28-
}
29-
3026
(new AdEditor($this->ad))->update([
3127
'isDisabled' => 1,
3228
]);

wcfsetup/install/files/lib/command/ad/EnableAd.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if (!$this->ad->isDisabled) {
27-
return;
28-
}
29-
3026
(new AdEditor($this->ad))->update([
3127
'isDisabled' => 0,
3228
]);

wcfsetup/install/files/lib/command/bbcode/media/provider/DisableBBCodeMediaProvider.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public function __construct(private readonly BBCodeMediaProvider $mediaProvider)
2121

2222
public function __invoke(): void
2323
{
24-
if ($this->mediaProvider->isDisabled) {
25-
return;
26-
}
27-
2824
(new BBCodeMediaProviderEditor($this->mediaProvider))->update([
2925
'isDisabled' => 1,
3026
]);

wcfsetup/install/files/lib/command/bbcode/media/provider/EnableBBCodeMediaProvider.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public function __construct(private readonly BBCodeMediaProvider $mediaProvider)
2121

2222
public function __invoke(): void
2323
{
24-
if (!$this->mediaProvider->isDisabled) {
25-
return;
26-
}
27-
2824
(new BBCodeMediaProviderEditor($this->mediaProvider))->update([
2925
'isDisabled' => 0,
3026
]);

wcfsetup/install/files/lib/command/box/DisableBox.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public function __construct(private readonly Box $box) {}
2121

2222
public function __invoke(): void
2323
{
24-
if ($this->box->isDisabled) {
25-
return;
26-
}
27-
2824
(new BoxEditor($this->box))->update([
2925
'isDisabled' => 1,
3026
]);

wcfsetup/install/files/lib/command/box/EnableBox.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ public function __construct(private readonly Box $box) {}
2121

2222
public function __invoke(): void
2323
{
24-
if (!$this->box->isDisabled) {
25-
return;
26-
}
27-
2824
(new BoxEditor($this->box))->update([
2925
'isDisabled' => 0,
3026
]);

wcfsetup/install/files/lib/command/captcha/question/DisableCaptchaQuestion.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if ($this->captchaQuestion->isDisabled) {
27-
return;
28-
}
29-
3026
(new CaptchaQuestionEditor($this->captchaQuestion))->update([
3127
'isDisabled' => 1,
3228
]);

wcfsetup/install/files/lib/command/captcha/question/EnableCaptchaQuestion.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if (!$this->captchaQuestion->isDisabled) {
27-
return;
28-
}
29-
3026
(new CaptchaQuestionEditor($this->captchaQuestion))->update([
3127
'isDisabled' => 0,
3228
]);

wcfsetup/install/files/lib/command/contact/option/DisableContactOption.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if ($this->contactOption->isDisabled) {
27-
return;
28-
}
29-
3026
(new ContactOptionEditor($this->contactOption))->update([
3127
'isDisabled' => 1,
3228
]);

wcfsetup/install/files/lib/command/contact/option/EnableContactOption.class.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ public function __construct(
2323

2424
public function __invoke(): void
2525
{
26-
if (!$this->contactOption->isDisabled) {
27-
return;
28-
}
29-
3026
(new ContactOptionEditor($this->contactOption))->update([
3127
'isDisabled' => 0,
3228
]);

0 commit comments

Comments
 (0)