Notifiable
last analyzed

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 19
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
notify() 0 1 ?
routeNotification() 0 1 ?
1
<?php namespace nyx\notify\interfaces;
2
3
/**
4
 * Notifiable Interface
5
 *
6
 * @package     Nyx\Notify
7
 * @version     0.1.0
8
 * @author      Michal Chojnacki <[email protected]>
9
 * @copyright   2012-2017 Nyx Dev Team
10
 * @link        https://github.com/unyx/nyx
11
 */
12
interface Notifiable
13
{
14
    /**
15
     * Notifies the underlying entity with the given Notification.
16
     *
17
     * @param   Notification $notification
18
     */
19
    public function notify(Notification $notification);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a @return doc comment to communicate to implementors of these methods what they are expected to return.

Loading history...
20
21
    /**
22
     * Returns data necessary for the specified Transport to route a constructed notification message
23
     * to the underlying entity, granting the Notifiable the ability to modify the message before delivery.
24
     *
25
     * @param   string  $transport  The name of the Transport to return metadata for.
26
     * @param   object  $message    The notification message being routed.
27
     * @return  mixed
28
     */
29
    public function routeNotification(string $transport, $message);
30
}
31