1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of PHP-Typography. |
4
|
|
|
* |
5
|
|
|
* Copyright 2017 Peter Putzer. |
6
|
|
|
* |
7
|
|
|
* This program is free software; you can redistribute it and/or modify |
8
|
|
|
* it under the terms of the GNU General Public License as published by |
9
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
10
|
|
|
* (at your option) any later version. |
11
|
|
|
* |
12
|
|
|
* This program is distributed in the hope that it will be useful, |
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15
|
|
|
* GNU General Public License for more details. |
16
|
|
|
* |
17
|
|
|
* You should have received a copy of the GNU General Public License along |
18
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc., |
19
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
20
|
|
|
* |
21
|
|
|
* *** |
22
|
|
|
* |
23
|
|
|
* @package mundschenk-at/php-typography |
24
|
|
|
* @license http://www.gnu.org/licenses/gpl-2.0.html |
25
|
|
|
*/ |
26
|
|
|
|
27
|
|
|
namespace PHP_Typography\Settings; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* A basic quotes implementation. |
31
|
|
|
* |
32
|
|
|
* @author Peter Putzer <[email protected]> |
33
|
|
|
* |
34
|
|
|
* @since 5.0.0 |
35
|
|
|
*/ |
36
|
|
|
final class Simple_Quotes implements Quotes { |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Opening quote character(s). |
40
|
|
|
* |
41
|
|
|
* @var string |
42
|
|
|
*/ |
43
|
|
|
private $open; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Closing quote character(s). |
47
|
|
|
* |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
private $close; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Creates a new quotes object. |
54
|
|
|
* |
55
|
|
|
* @param string $open Opening quote character(s). |
56
|
|
|
* @param string $close Closing quote character(s). |
57
|
|
|
*/ |
58
|
2 |
|
public function __construct( $open, $close ) { |
59
|
2 |
|
$this->open = $open; |
60
|
2 |
|
$this->close = $close; |
61
|
2 |
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Retrieves the quote styles opening quote characters. |
65
|
|
|
* |
66
|
|
|
* @return string |
67
|
|
|
*/ |
68
|
2 |
|
public function open() { |
69
|
2 |
|
return $this->open; |
70
|
|
|
} |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Retrieves the quote styles closing quote characters. |
74
|
|
|
* |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
2 |
|
public function close() { |
78
|
2 |
|
return $this->close; |
79
|
|
|
} |
80
|
|
|
} |
81
|
|
|
|