• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ringcentral / ringcentral-php / 10243692747

05 Aug 2024 06:22AM UTC coverage: 77.389% (-13.4%) from 90.761%
10243692747

push

github

web-flow
Merge pull request #137 from ringcentral/vendorPatch

Remove PubNub SubscriptionTest

575 of 743 relevant lines covered (77.39%)

7.11 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/Subscription/SubscriptionBase.php
1
<?php
2

3
namespace RingCentral\SDK\Subscription;
4

5
use RingCentral\SDK\Platform\Platform;
6
use Symfony\Component\EventDispatcher\EventDispatcher;
7

8
class SubscriptionBase extends EventDispatcher
9
{
10
    const EVENT_NOTIFICATION = 'notification';
11
    const EVENT_REMOVE_SUCCESS = 'removeSuccess';
12
    const EVENT_REMOVE_ERROR = 'removeError';
13
    const EVENT_RENEW_SUCCESS = 'renewSuccess';
14
    const EVENT_RENEW_ERROR = 'renewError';
15
    const EVENT_SUBSCRIBE_SUCCESS = 'subscribeSuccess';
16
    const EVENT_SUBSCRIBE_ERROR = 'subscribeError';
17
    const EVENT_TIMEOUT = 'timeout';
18

19
    /** @var string[] */
20
    protected $_eventFilters = [];
21

22
    /** @var array */
23
    protected $_subscription = [
24
        'eventFilters'   => [],
25
        'expirationTime' => '', // 2014-03-12T19:54:35.613Z
26
        'expiresIn'      => 0,
27
        'deliveryMode'   => [
28
            'transportType' => 'PubNub',
29
            'encryption'    => false,
30
            'address'       => '',
31
            'subscriberKey' => '',
32
            'secretKey'     => ''
33
        ],
34
        'id'             => '',
35
        'creationTime'   => '', // 2014-03-12T19:54:35.613Z
36
        'status'         => '', // Active
37
        'uri'            => ''
38
    ];
39

40
    /** @var Platform */
41
    protected $_platform;
42

43
    function __construct(Platform $platform)
44
    {
45
        $this->_platform = $platform;
4✔
46
    }
47

48
     /**
49
     * @param array $events
50
     *
51
     * @return $this
52
     */
53
    function addEvents(array $events)
54
    {
55
        $this->_eventFilters = array_merge($this->_eventFilters, $events);
3✔
56
        return $this;
3✔
57
    }
58

59
    /**
60
     * @param array $events
61
     *
62
     * @return $this
63
     */
64
    function setEvents(array $events)
65
    {
66
        $this->_eventFilters = $events;
2✔
67
        return $this;
2✔
68
    }
69

70
    /**
71
     * @return array
72
     */
73
    function subscription()
74
    {
75
        return $this->_subscription;
×
76
    }
77

78
    /**
79
     * @param array $subscription
80
     *
81
     * @return $this
82
     */
83
    function setSubscription($subscription)
84
    {
85
        $this->_subscription = $subscription;
2✔
86
        return $this;
2✔
87
    }
88

89
    /**
90
     * @return array
91
     */
92
    protected function getFullEventFilters()
93
    {
94
        $events = [];
2✔
95
        foreach ($this->_eventFilters as $event) {
2✔
96
            $events[] = $this->_platform->createUrl($event);
2✔
97
        }
98
        return $events;
2✔
99
    }
100
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc