@@ -69,16 +69,6 @@ public function __construct($pattern, $timezone)
6969 ];
7070 }
7171
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-
8272 /**
8373 * Format a DateTime using ICU dateformat pattern.
8474 *
@@ -105,7 +95,7 @@ public function format(\DateTime $dateTime)
10595 *
10696 * @throws NotImplementedException When it encounters a not implemented date character
10797 */
108- public function formatReplace ($ dateChars , $ dateTime )
98+ private function formatReplace ($ dateChars , \ DateTime $ dateTime )
10999 {
110100 $ length = \strlen ($ dateChars );
111101
@@ -172,7 +162,7 @@ public function parse(\DateTime $dateTime, $value)
172162 * @return string The reverse matching regular expression with named captures being formed by the
173163 * transformer index in the $transformer array
174164 */
175- public function getReverseMatchingRegExp ($ pattern )
165+ private function getReverseMatchingRegExp ($ pattern )
176166 {
177167 $ escapedPattern = preg_quote ($ pattern , '/ ' );
178168
@@ -189,9 +179,8 @@ public function getReverseMatchingRegExp($pattern)
189179 return $ this ->replaceQuoteMatch ($ dateChars );
190180 }
191181
192- $ transformers = $ this ->getTransformers ();
193- if (isset ($ transformers [$ transformerIndex ])) {
194- $ transformer = $ transformers [$ transformerIndex ];
182+ if (isset ($ this ->transformers [$ transformerIndex ])) {
183+ $ transformer = $ this ->transformers [$ transformerIndex ];
195184 $ captureName = str_repeat ($ transformerIndex , $ length );
196185
197186 return "(?P< $ captureName> " .$ transformer ->getReverseMatchingRegExp ($ length ).') ' ;
@@ -208,7 +197,7 @@ public function getReverseMatchingRegExp($pattern)
208197 *
209198 * @return bool true if matches, false otherwise
210199 */
211- public function isQuoteMatch ($ quoteMatch )
200+ private function isQuoteMatch ($ quoteMatch )
212201 {
213202 return "' " === $ quoteMatch [0 ];
214203 }
@@ -220,7 +209,7 @@ public function isQuoteMatch($quoteMatch)
220209 *
221210 * @return string A string with the single quotes replaced
222211 */
223- public function replaceQuoteMatch ($ quoteMatch )
212+ private function replaceQuoteMatch ($ quoteMatch )
224213 {
225214 if (preg_match ("/^'+$/ " , $ quoteMatch )) {
226215 return str_replace ("'' " , "' " , $ quoteMatch );
@@ -236,7 +225,7 @@ public function replaceQuoteMatch($quoteMatch)
236225 *
237226 * @return string The chars match regular expression
238227 */
239- protected function buildCharsMatch ($ specialChars )
228+ private function buildCharsMatch ($ specialChars )
240229 {
241230 $ specialCharsArray = str_split ($ specialChars );
242231
@@ -253,7 +242,7 @@ protected function buildCharsMatch($specialChars)
253242 *
254243 * @return array
255244 */
256- protected function normalizeArray (array $ data )
245+ private function normalizeArray (array $ data )
257246 {
258247 $ ret = [];
259248
@@ -280,7 +269,7 @@ protected function normalizeArray(array $data)
280269 *
281270 * @return bool|int The calculated timestamp or false if matched date is invalid
282271 */
283- protected function calculateUnixTimestamp (\DateTime $ dateTime , array $ options )
272+ private function calculateUnixTimestamp (\DateTime $ dateTime , array $ options )
284273 {
285274 $ options = $ this ->getDefaultValueForOptions ($ options );
286275
0 commit comments