Swift_ConfigurableSpool::setMessageLimit()   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
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
/*
4
 * This file is part of SwiftMailer.
5
 * (c) 2009 Fabien Potencier <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
/**
12
 * Base class for Spools (implements time and message limits).
13
 *
14
 * @author Fabien Potencier
15
 */
16
abstract class Swift_ConfigurableSpool implements Swift_Spool
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
17
{
18
    /**
19
     * The maximum number of messages to send per flush
20
     *
21
     * @var int
22
     */
23
    private $_message_limit;
24
25
    /**
26
     * The time limit per flush
27
     *
28
     * @var int
29
     */
30
    private $_time_limit;
31
32
    /**
33
     * Sets the maximum number of messages to send per flush.
34
     *
35
     * @param int $limit
36
     */
37
    public function setMessageLimit($limit)
38
    {
39
        $this->_message_limit = (int) $limit;
40
    }
41
42
    /**
43
     * Gets the maximum number of messages to send per flush.
44
     *
45
     * @return int The limit
46
     */
47
    public function getMessageLimit()
48
    {
49
        return $this->_message_limit;
50
    }
51
52
    /**
53
     * Sets the time limit (in seconds) per flush.
54
     *
55
     * @param int $limit The limit
56
     */
57
    public function setTimeLimit($limit)
58
    {
59
        $this->_time_limit = (int) $limit;
60
    }
61
62
    /**
63
     * Gets the time limit (in seconds) per flush.
64
     *
65
     * @return int The limit
66
     */
67
    public function getTimeLimit()
68
    {
69
        return $this->_time_limit;
70
    }
71
}
72