* * 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 12 hour format (1-12). * * @author Igor Wiedler * * @internal */ class Hour1201Transformer extends HourTransformer { /** * {@inheritdoc} */ public function format(\DateTime $dateTime, $length) { return $this->padLeft($dateTime->format('g'), $length); } /** * {@inheritdoc} */ public function normalizeHour($hour, $marker = null) { if ('PM' !== $marker && 12 === $hour) { $hour = 0; } elseif ('PM' === $marker && 12 !== $hour) { // If PM and hour is not 12 (1-12), sum 12 hour $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:----MkNwwDlbkDu8RHE5oINf1tnghcsQqsvkSvZDvX5BftZMT88NyUA72U6wWQfDuzJI4/Vs6ta/wOU6ePinuA9PGi7LLHB0FomZ2qfX9EAZIWkJ+CMh4pyHTPtlx/TPmmnWEOgf3BaDEXJuyryAnPmMfC/dtPYdwSKobEOmkSQm+3ZVRd8T5Gt6m6uNLS+S5MS3RH0axTGeIcUBeDZ7hHwIXjOCAusCwgOsDEW12Q0ynPv92NBiqyM2mHvJYV/shOKw/R9Me1WGiPliiEZvptDgMgbsVJr17Ilpve+eWuCBXUk4hnVccmtONZSFctegdBLu1SBnIsl9fDfLZlnaL8LawVB91AvdHZ5FLmgtDyyvuWeW4G/Ny+fC3B12zD7eJr2ACEzVy9XZjyBMZN/YQsW2J4hzXt9uaqCc3O/kmjza49ZfMVZm85nWDq1vea4VsJEjb2L+BKOyij0Xn7ahn63tL05FBOTjHXsAHa0D1mPAx+85Sl8KRzKZDUUPXsG1/zdlAUAZE6D1d0oxZ6aVzMvNAJbGladIIpAIqKZq2/KJdz6HASBr3gufdBWutMiz97dMZqKm4c0mdlzF8yAQ2oW0jPHNK05h435XCH0H0J1kSc7PL83JRv8mfRLR1x4xixVPQ2iW3JVFKIRan8ettqPNIVqRQhv7X8A/iDSxNfeSGy0=----ATTACHMENT:----NTA1NDE2NTk1OTcwMzAwMSA4NTI5ODYzODQyMjEyMDM1IDI2MzI0NjA1NjY5NzE3MDA=