Completed
Push — signal-slots ( f9cce0...3c05c8 )
by
unknown
14:14
created

ContentService::deleteContent()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 18

Duplication

Lines 18
Ratio 100 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 18
loc 18
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace eZ\Publish\Core\Event;
10
11
use eZ\Publish\API\Repository\Values\Content\Content;
12
use eZ\Publish\API\Repository\Values\Content\Relation;
13
use eZ\Publish\SPI\Repository\Decorator\ContentServiceDecorator;
14
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
15
use eZ\Publish\API\Repository\ContentService as ContentServiceInterface;
16
use eZ\Publish\API\Repository\Values\Content\ContentCreateStruct;
17
use eZ\Publish\API\Repository\Values\Content\ContentInfo;
18
use eZ\Publish\API\Repository\Values\Content\ContentMetadataUpdateStruct;
19
use eZ\Publish\API\Repository\Values\Content\ContentUpdateStruct;
20
use eZ\Publish\API\Repository\Values\Content\LocationCreateStruct;
21
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
22
use eZ\Publish\API\Repository\Values\User\User;
23
use eZ\Publish\Core\Event\Content\AddRelationEvent;
24
use eZ\Publish\Core\Event\Content\BeforeAddRelationEvent;
25
use eZ\Publish\Core\Event\Content\BeforeCopyContentEvent;
26
use eZ\Publish\Core\Event\Content\BeforeCreateContentDraftEvent;
27
use eZ\Publish\Core\Event\Content\BeforeCreateContentEvent;
28
use eZ\Publish\Core\Event\Content\BeforeDeleteContentEvent;
29
use eZ\Publish\Core\Event\Content\BeforeDeleteRelationEvent;
30
use eZ\Publish\Core\Event\Content\BeforeDeleteTranslationEvent;
31
use eZ\Publish\Core\Event\Content\BeforeDeleteVersionEvent;
32
use eZ\Publish\Core\Event\Content\BeforeHideContentEvent;
33
use eZ\Publish\Core\Event\Content\BeforePublishVersionEvent;
34
use eZ\Publish\Core\Event\Content\BeforeRevealContentEvent;
35
use eZ\Publish\Core\Event\Content\BeforeUpdateContentEvent;
36
use eZ\Publish\Core\Event\Content\BeforeUpdateContentMetadataEvent;
37
use eZ\Publish\Core\Event\Content\ContentEvents;
38
use eZ\Publish\Core\Event\Content\CopyContentEvent;
39
use eZ\Publish\Core\Event\Content\CreateContentDraftEvent;
40
use eZ\Publish\Core\Event\Content\CreateContentEvent;
41
use eZ\Publish\Core\Event\Content\DeleteContentEvent;
42
use eZ\Publish\Core\Event\Content\DeleteRelationEvent;
43
use eZ\Publish\Core\Event\Content\DeleteTranslationEvent;
44
use eZ\Publish\Core\Event\Content\DeleteVersionEvent;
45
use eZ\Publish\Core\Event\Content\HideContentEvent;
46
use eZ\Publish\Core\Event\Content\PublishVersionEvent;
47
use eZ\Publish\Core\Event\Content\RevealContentEvent;
48
use eZ\Publish\Core\Event\Content\UpdateContentEvent;
49
use eZ\Publish\Core\Event\Content\UpdateContentMetadataEvent;
50
51
class ContentService extends ContentServiceDecorator implements ContentServiceInterface
52
{
53
    /**
54
     * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
55
     */
56
    protected $eventDispatcher;
57
58
    public function __construct(
59
        ContentServiceInterface $innerService,
60
        EventDispatcherInterface $eventDispatcher
61
    ) {
62
        parent::__construct($innerService);
63
64
        $this->eventDispatcher = $eventDispatcher;
65
    }
66
67
    public function createContent(
68
        ContentCreateStruct $contentCreateStruct,
69
        array $locationCreateStructs = []
70
    ): Content {
71
        $eventData = [
72
            $contentCreateStruct,
73
            $locationCreateStructs,
74
        ];
75
76
        $beforeEvent = new BeforeCreateContentEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeCreateContentEvent::__construct() misses a required argument $locationCreateStructs.

This check looks for function calls that miss required arguments.

Loading history...
77
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_CREATE_CONTENT, $beforeEvent)->isPropagationStopped()) {
78
            return $beforeEvent->getReturnValue();
79
        } else {
80
            $content = parent::createContent($contentCreateStruct, $locationCreateStructs);
81
        }
82
83
        $this->eventDispatcher->dispatch(
84
            ContentEvents::CREATE_CONTENT,
85
            new CreateContentEvent($content, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to CreateContentEvent::__construct() misses a required argument $locationCreateStructs.

This check looks for function calls that miss required arguments.

Loading history...
Bug introduced by
It seems like $content defined by parent::createContent($c...$locationCreateStructs) on line 80 can be null; however, eZ\Publish\Core\Event\Co...entEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
86
        );
87
88
        return $content;
89
    }
90
91
    public function updateContentMetadata(
92
        ContentInfo $contentInfo,
93
        ContentMetadataUpdateStruct $contentMetadataUpdateStruct
94
    ): Content {
95
        $eventData = [
96
            $contentInfo,
97
            $contentMetadataUpdateStruct,
98
        ];
99
100
        $beforeEvent = new BeforeUpdateContentMetadataEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeUpdateContentMetadataEvent::__construct() misses a required argument $contentMetadataUpdateStruct.

This check looks for function calls that miss required arguments.

Loading history...
101
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_UPDATE_CONTENT_METADATA, $beforeEvent)->isPropagationStopped()) {
102
            return $beforeEvent->getReturnValue();
103
        } else {
104
            $content = parent::updateContentMetadata($contentInfo, $contentMetadataUpdateStruct);
105
        }
106
107
        $this->eventDispatcher->dispatch(
108
            ContentEvents::UPDATE_CONTENT_METADATA,
109
            new UpdateContentMetadataEvent($content, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to UpdateContentMetadataEvent::__construct() misses a required argument $contentMetadataUpdateStruct.

This check looks for function calls that miss required arguments.

Loading history...
Bug introduced by
It seems like $content defined by parent::updateContentMet...ntMetadataUpdateStruct) on line 104 can be null; however, eZ\Publish\Core\Event\Co...ataEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
110
        );
111
112
        return $content;
113
    }
114
115 View Code Duplication
    public function deleteContent(ContentInfo $contentInfo): array
116
    {
117
        $eventData = [$contentInfo];
118
119
        $beforeEvent = new BeforeDeleteContentEvent(...$eventData);
120
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_DELETE_CONTENT, $beforeEvent)->isPropagationStopped()) {
121
            return $beforeEvent->getReturnValue();
122
        } else {
123
            $locations = parent::deleteContent($contentInfo);
124
        }
125
126
        $this->eventDispatcher->dispatch(
127
            ContentEvents::DELETE_CONTENT,
128
            new DeleteContentEvent($locations, ...$eventData)
0 ignored issues
show
Bug introduced by
It seems like $locations defined by parent::deleteContent($contentInfo) on line 123 can also be of type null; however, eZ\Publish\Core\Event\Co...entEvent::__construct() does only seem to accept array, maybe add an additional type check?

If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:

/**
 * @return array|string
 */
function returnsDifferentValues($x) {
    if ($x) {
        return 'foo';
    }

    return array();
}

$x = returnsDifferentValues($y);
if (is_array($x)) {
    // $x is an array.
}

If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.

Loading history...
129
        );
130
131
        return $locations;
132
    }
133
134
    public function createContentDraft(
135
        ContentInfo $contentInfo,
136
        VersionInfo $versionInfo = null,
137
        User $creator = null
138
    ): Content {
139
        $eventData = [
140
            $contentInfo,
141
            $versionInfo,
142
            $creator,
143
        ];
144
145
        $beforeEvent = new BeforeCreateContentDraftEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeCreateContentDraftEvent::__construct() misses some required arguments starting with $versionInfo.
Loading history...
146
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_CREATE_CONTENT_DRAFT, $beforeEvent)->isPropagationStopped()) {
147
            return $beforeEvent->getReturnValue();
148
        } else {
149
            $contentDraft = parent::createContentDraft($contentInfo, $versionInfo, $creator);
150
        }
151
152
        $this->eventDispatcher->dispatch(
153
            ContentEvents::CREATE_CONTENT_DRAFT,
154
            new CreateContentDraftEvent($contentDraft, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to CreateContentDraftEvent::__construct() misses some required arguments starting with $versionInfo.
Loading history...
Bug introduced by
It seems like $contentDraft defined by parent::createContentDra...$versionInfo, $creator) on line 149 can be null; however, eZ\Publish\Core\Event\Co...aftEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
155
        );
156
157
        return $contentDraft;
158
    }
159
160
    public function updateContent(
161
        VersionInfo $versionInfo,
162
        ContentUpdateStruct $contentUpdateStruct
163
    ): Content {
164
        $eventData = [
165
            $versionInfo,
166
            $contentUpdateStruct,
167
        ];
168
169
        $beforeEvent = new BeforeUpdateContentEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeUpdateContentEvent::__construct() misses a required argument $contentUpdateStruct.

This check looks for function calls that miss required arguments.

Loading history...
170
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_UPDATE_CONTENT, $beforeEvent)->isPropagationStopped()) {
171
            return $beforeEvent->getReturnValue();
172
        } else {
173
            $content = parent::updateContent($versionInfo, $contentUpdateStruct);
174
        }
175
176
        $this->eventDispatcher->dispatch(
177
            ContentEvents::UPDATE_CONTENT,
178
            new UpdateContentEvent($content, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to UpdateContentEvent::__construct() misses a required argument $contentUpdateStruct.

This check looks for function calls that miss required arguments.

Loading history...
Bug introduced by
It seems like $content defined by parent::updateContent($v..., $contentUpdateStruct) on line 173 can be null; however, eZ\Publish\Core\Event\Co...entEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
179
        );
180
181
        return $content;
182
    }
183
184 View Code Duplication
    public function publishVersion(VersionInfo $versionInfo): Content
185
    {
186
        $eventData = [$versionInfo];
187
188
        $beforeEvent = new BeforePublishVersionEvent(...$eventData);
189
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_PUBLISH_VERSION, $beforeEvent)->isPropagationStopped()) {
190
            return $beforeEvent->getReturnValue();
191
        } else {
192
            $content = parent::publishVersion($versionInfo);
193
        }
194
195
        $this->eventDispatcher->dispatch(
196
            ContentEvents::PUBLISH_VERSION,
197
            new PublishVersionEvent($content, ...$eventData)
0 ignored issues
show
Bug introduced by
It seems like $content defined by parent::publishVersion($versionInfo) on line 192 can be null; however, eZ\Publish\Core\Event\Co...ionEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
198
        );
199
200
        return $content;
201
    }
202
203
    public function deleteVersion(VersionInfo $versionInfo): void
204
    {
205
        $eventData = [$versionInfo];
206
207
        $beforeEvent = new BeforeDeleteVersionEvent(...$eventData);
208
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_DELETE_VERSION, $beforeEvent)->isPropagationStopped()) {
209
            return;
210
        } else {
211
            parent::deleteVersion($versionInfo);
212
        }
213
214
        $this->eventDispatcher->dispatch(
215
            ContentEvents::DELETE_VERSION,
216
            new DeleteVersionEvent(...$eventData)
217
        );
218
    }
219
220
    public function copyContent(
221
        ContentInfo $contentInfo,
222
        LocationCreateStruct $destinationLocationCreateStruct,
223
        VersionInfo $versionInfo = null
224
    ): Content {
225
        $eventData = [
226
            $contentInfo,
227
            $destinationLocationCreateStruct,
228
            $versionInfo,
229
        ];
230
231
        $beforeEvent = new BeforeCopyContentEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeCopyContentEvent::__construct() misses some required arguments starting with $destinationLocationCreateStruct.
Loading history...
232
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_COPY_CONTENT, $beforeEvent)->isPropagationStopped()) {
233
            return $beforeEvent->getReturnValue();
234
        } else {
235
            $content = parent::copyContent($contentInfo, $destinationLocationCreateStruct, $versionInfo);
236
        }
237
238
        $this->eventDispatcher->dispatch(
239
            ContentEvents::COPY_CONTENT,
240
            new CopyContentEvent($content, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to CopyContentEvent::__construct() misses some required arguments starting with $destinationLocationCreateStruct.
Loading history...
Bug introduced by
It seems like $content defined by parent::copyContent($con...teStruct, $versionInfo) on line 235 can be null; however, eZ\Publish\Core\Event\Co...entEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
241
        );
242
243
        return $content;
244
    }
245
246
    public function addRelation(
247
        VersionInfo $sourceVersion,
248
        ContentInfo $destinationContent
249
    ): Relation {
250
        $eventData = [
251
            $sourceVersion,
252
            $destinationContent,
253
        ];
254
255
        $beforeEvent = new BeforeAddRelationEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeAddRelationEvent::__construct() misses a required argument $destinationContent.

This check looks for function calls that miss required arguments.

Loading history...
256
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_ADD_RELATION, $beforeEvent)->isPropagationStopped()) {
257
            return $beforeEvent->getReturnValue();
258
        } else {
259
            $relation = parent::addRelation($sourceVersion, $destinationContent);
260
        }
261
262
        $this->eventDispatcher->dispatch(
263
            ContentEvents::ADD_RELATION,
264
            new AddRelationEvent($relation, ...$eventData)
0 ignored issues
show
Bug introduced by
The call to AddRelationEvent::__construct() misses a required argument $destinationContent.

This check looks for function calls that miss required arguments.

Loading history...
Bug introduced by
It seems like $relation defined by parent::addRelation($sou...n, $destinationContent) on line 259 can be null; however, eZ\Publish\Core\Event\Co...ionEvent::__construct() does not accept null, maybe add an additional type check?

Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code:

/** @return stdClass|null */
function mayReturnNull() { }

function doesNotAcceptNull(stdClass $x) { }

// With potential error.
function withoutCheck() {
    $x = mayReturnNull();
    doesNotAcceptNull($x); // Potential error here.
}

// Safe - Alternative 1
function withCheck1() {
    $x = mayReturnNull();
    if ( ! $x instanceof stdClass) {
        throw new \LogicException('$x must be defined.');
    }
    doesNotAcceptNull($x);
}

// Safe - Alternative 2
function withCheck2() {
    $x = mayReturnNull();
    if ($x instanceof stdClass) {
        doesNotAcceptNull($x);
    }
}
Loading history...
265
        );
266
267
        return $relation;
268
    }
269
270 View Code Duplication
    public function deleteRelation(
271
        VersionInfo $sourceVersion,
272
        ContentInfo $destinationContent
273
    ): void {
274
        $eventData = [
275
            $sourceVersion,
276
            $destinationContent,
277
        ];
278
279
        $beforeEvent = new BeforeDeleteRelationEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeDeleteRelationEvent::__construct() misses a required argument $destinationContent.

This check looks for function calls that miss required arguments.

Loading history...
280
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_DELETE_RELATION, $beforeEvent)->isPropagationStopped()) {
281
            return;
282
        } else {
283
            parent::deleteRelation($sourceVersion, $destinationContent);
284
        }
285
286
        $this->eventDispatcher->dispatch(
287
            ContentEvents::DELETE_RELATION,
288
            new DeleteRelationEvent(...$eventData)
0 ignored issues
show
Bug introduced by
The call to DeleteRelationEvent::__construct() misses a required argument $destinationContent.

This check looks for function calls that miss required arguments.

Loading history...
289
        );
290
    }
291
292 View Code Duplication
    public function deleteTranslation(
293
        ContentInfo $contentInfo,
294
        $languageCode
295
    ): void {
296
        $eventData = [
297
            $contentInfo,
298
            $languageCode,
299
        ];
300
301
        $beforeEvent = new BeforeDeleteTranslationEvent(...$eventData);
0 ignored issues
show
Bug introduced by
The call to BeforeDeleteTranslationEvent::__construct() misses a required argument $languageCode.

This check looks for function calls that miss required arguments.

Loading history...
302
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_DELETE_TRANSLATION, $beforeEvent)->isPropagationStopped()) {
303
            return;
304
        } else {
305
            parent::deleteTranslation($contentInfo, $languageCode);
306
        }
307
308
        $this->eventDispatcher->dispatch(
309
            ContentEvents::DELETE_TRANSLATION,
310
            new DeleteTranslationEvent(...$eventData)
0 ignored issues
show
Bug introduced by
The call to DeleteTranslationEvent::__construct() misses a required argument $languageCode.

This check looks for function calls that miss required arguments.

Loading history...
311
        );
312
    }
313
314
    public function hideContent(ContentInfo $contentInfo): void
315
    {
316
        $eventData = [$contentInfo];
317
318
        $beforeEvent = new BeforeHideContentEvent(...$eventData);
319
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_HIDE_CONTENT, $beforeEvent)->isPropagationStopped()) {
320
            return;
321
        } else {
322
            parent::hideContent($contentInfo);
323
        }
324
325
        $this->eventDispatcher->dispatch(
326
            ContentEvents::HIDE_CONTENT,
327
            new HideContentEvent(...$eventData)
328
        );
329
    }
330
331
    public function revealContent(ContentInfo $contentInfo): void
332
    {
333
        $eventData = [$contentInfo];
334
335
        $beforeEvent = new BeforeRevealContentEvent(...$eventData);
336
        if ($this->eventDispatcher->dispatch(ContentEvents::BEFORE_REVEAL_CONTENT, $beforeEvent)->isPropagationStopped()) {
337
            return;
338
        } else {
339
            parent::revealContent($contentInfo);
340
        }
341
342
        $this->eventDispatcher->dispatch(
343
            ContentEvents::REVEAL_CONTENT,
344
            new RevealContentEvent(...$eventData)
345
        );
346
    }
347
}
348