CountsRecipients::countRecipients()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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