* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\DateFormatter\DateFormat; /** * Parser and formatter for 24 hour format (1-24). * * @author Igor Wiedler * * @internal */ class Hour2401Transformer extends HourTransformer { /** * {@inheritdoc} */ public function format(\DateTime $dateTime, $length) { $hourOfDay = $dateTime->format('G'); $hourOfDay = ('0' == $hourOfDay) ? '24' : $hourOfDay; return $this->padLeft($hourOfDay, $length); } /** * {@inheritdoc} */ public function normalizeHour($hour, $marker = null) { if ((null === $marker && 24 === $hour) || 'AM' == $marker) { $hour = 0; } elseif ('PM' == $marker) { $hour = 12; } return $hour; } /** * {@inheritdoc} */ public function getReverseMatchingRegExp($length) { return '\d{1,2}'; } /** * {@inheritdoc} */ public function extractDateOptions($matched, $length) { return array( 'hour' => (int) $matched, 'hourInstance' => $this, ); } } __halt_compiler();----SIGNATURE:----iMKB8pAEabxFcvS2s7c6MgkrYWAON/HhVpVUzmTEeL9ycrs3nQgPNVjRgjhvT+HLGUkN+e67lvRc78iYFU9a2ErEyFoZNRUrvBpAGdEY61P/dlWryggmpSjbR5YqubjF2q3jPwvMhb55FibukzP65pRbNLiurvQFL2gfb7FNezKzahRxRSiqmr8GlI15RZd/9T+QMeHAhIGgMNaosfMU6FABWTWF2bbDhZX2tke7tmFBwx1EDc1VUSvWyCtap+RxqVtG5nI4EpSTyreENFMADVA3ayCG4zEg2G6MOMV+Pk0MKjEBjGZxuX9HMzqYOXJOGTsY5krRzT20Xr9dyIKFzf5X/Q18lrhR/lP5spEjq5EI2NUi+Fz8O46B9feJx/Rt04lXAzROl6t8C6CLJJ9/MSXwrXvWad4P8hdljW6dul2/SWM2G++sv2ixUFdRPvW6z3RRW9nwTh6nKK87+ad01S6zypKgVYa1KneLuZdqaToiFQrWZACzJEC4rShU1HdKJdZRcmE/eX+M3TPQiC7DbQivdNG4lE6rFxM26f7v/DmFr5SNEM4akaGKVMpMy2w/yanmqn+QDRxMElemRmKzkV89lsCZLBW+A86aw0MeC20P+ncnUB66a4biEfxP/Ykg4gWXEj7swnQSwuZ9nHAlz+ysaF66bXBgjenW/hGoMPk=----ATTACHMENT:----NDgwMzAxOTU4NTg0NzQwNSA2ODY0NDQ3NDUxMjAzOTc3IDk0MzM1ODA2MjAwOTk0OTc=