@@ -69,16 +69,6 @@ public function __construct($pattern, $timezone)
69
69
];
70
70
}
71
71
72
- /**
73
- * Return the array of Transformer objects.
74
- *
75
- * @return Transformer[] Associative array of Transformer objects (format char => Transformer)
76
- */
77
- public function getTransformers ()
78
- {
79
- return $ this ->transformers ;
80
- }
81
-
82
72
/**
83
73
* Format a DateTime using ICU dateformat pattern.
84
74
*
@@ -105,7 +95,7 @@ public function format(\DateTime $dateTime)
105
95
*
106
96
* @throws NotImplementedException When it encounters a not implemented date character
107
97
*/
108
- public function formatReplace ($ dateChars , $ dateTime )
98
+ private function formatReplace ($ dateChars , \ DateTime $ dateTime )
109
99
{
110
100
$ length = \strlen ($ dateChars );
111
101
@@ -172,7 +162,7 @@ public function parse(\DateTime $dateTime, $value)
172
162
* @return string The reverse matching regular expression with named captures being formed by the
173
163
* transformer index in the $transformer array
174
164
*/
175
- public function getReverseMatchingRegExp ($ pattern )
165
+ private function getReverseMatchingRegExp ($ pattern )
176
166
{
177
167
$ escapedPattern = preg_quote ($ pattern , '/ ' );
178
168
@@ -189,9 +179,8 @@ public function getReverseMatchingRegExp($pattern)
189
179
return $ this ->replaceQuoteMatch ($ dateChars );
190
180
}
191
181
192
- $ transformers = $ this ->getTransformers ();
193
- if (isset ($ transformers [$ transformerIndex ])) {
194
- $ transformer = $ transformers [$ transformerIndex ];
182
+ if (isset ($ this ->transformers [$ transformerIndex ])) {
183
+ $ transformer = $ this ->transformers [$ transformerIndex ];
195
184
$ captureName = str_repeat ($ transformerIndex , $ length );
196
185
197
186
return "(?P< $ captureName> " .$ transformer ->getReverseMatchingRegExp ($ length ).') ' ;
@@ -208,7 +197,7 @@ public function getReverseMatchingRegExp($pattern)
208
197
*
209
198
* @return bool true if matches, false otherwise
210
199
*/
211
- public function isQuoteMatch ($ quoteMatch )
200
+ private function isQuoteMatch ($ quoteMatch )
212
201
{
213
202
return "' " === $ quoteMatch [0 ];
214
203
}
@@ -220,7 +209,7 @@ public function isQuoteMatch($quoteMatch)
220
209
*
221
210
* @return string A string with the single quotes replaced
222
211
*/
223
- public function replaceQuoteMatch ($ quoteMatch )
212
+ private function replaceQuoteMatch ($ quoteMatch )
224
213
{
225
214
if (preg_match ("/^'+$/ " , $ quoteMatch )) {
226
215
return str_replace ("'' " , "' " , $ quoteMatch );
@@ -236,7 +225,7 @@ public function replaceQuoteMatch($quoteMatch)
236
225
*
237
226
* @return string The chars match regular expression
238
227
*/
239
- protected function buildCharsMatch ($ specialChars )
228
+ private function buildCharsMatch ($ specialChars )
240
229
{
241
230
$ specialCharsArray = str_split ($ specialChars );
242
231
@@ -253,7 +242,7 @@ protected function buildCharsMatch($specialChars)
253
242
*
254
243
* @return array
255
244
*/
256
- protected function normalizeArray (array $ data )
245
+ private function normalizeArray (array $ data )
257
246
{
258
247
$ ret = [];
259
248
@@ -280,7 +269,7 @@ protected function normalizeArray(array $data)
280
269
*
281
270
* @return bool|int The calculated timestamp or false if matched date is invalid
282
271
*/
283
- protected function calculateUnixTimestamp (\DateTime $ dateTime , array $ options )
272
+ private function calculateUnixTimestamp (\DateTime $ dateTime , array $ options )
284
273
{
285
274
$ options = $ this ->getDefaultValueForOptions ($ options );
286
275
0 commit comments