CountsRecipients   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A countRecipients() 0 4 1
1
<?php namespace nyx\notify\transports\mail\drivers\traits;
2
3
/**
4
 * Counts Recipients Mail Driver Trait
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
trait CountsRecipients
13
{
14
    /**
15
     * Returns the number of recipients defined in the Message.
16
     *
17
     * @param   \Swift_Mime_Message $message    The Message whose recipients will be counted.
18
     * @return  int                             The number of recipients.
19
     */
20
    protected function countRecipients(\Swift_Mime_Message $message) : int
21
    {
22
        return count((array) $message->getTo() + (array) $message->getCc() + (array) $message->getBcc());
23
    }
24
}
25