Completed
Push — master ( 5b84c6...1f2285 )
by Julien
16:45
created

ArticleTopic::getSubscribedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace Eole\Sandstone\Tests\Integration\App;
4
5
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
6
use Eole\Sandstone\Websocket\Topic;
7
use Eole\Sandstone\Tests\Integration\App\ArticleCreatedEvent;
8
9
class ArticleTopic extends Topic implements EventSubscriberInterface
10
{
11
    /**
12
     * {@InheritDoc}
13
     */
14
    public static function getSubscribedEvents()
15
    {
16
        return [
17
            'article.created' => 'onArticleCreated',
18
        ];
19
    }
20
21
    /**
22
     * @param ArticleCreatedEvent $event
23
     */
24
    public function onArticleCreated(ArticleCreatedEvent $event)
25
    {
26
        $this->broadcast([
27
            'message' => 'An article has just been published: '.$event->title,
0 ignored issues
show
Bug introduced by
The property title cannot be accessed from this context as it is declared private in class Eole\Sandstone\Tests\Int...App\ArticleCreatedEvent.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
28
        ]);
29
    }
30
}
31