Swift_ConfigurableSpool   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 56
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setMessageLimit() 0 4 1
A getMessageLimit() 0 4 1
A setTimeLimit() 0 4 1
A getTimeLimit() 0 4 1
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