<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Input; use ModStart\Core\Util\StrUtil; use ModStart\Core\Util\TimeUtil; class ArrayPackage { private $data; private $cursor = 0; public function __construct($OTBPk) { $this->data = $OTBPk; } public static function build($OTBPk) { goto AaJW0; AaJW0: $WJmrC = new ArrayPackage($OTBPk); goto zcFc5; zcFc5: $WJmrC->cursor = 0; goto JWB8e; JWB8e: return $WJmrC; goto Kl1XZ; Kl1XZ: } public function resetCursor() { $this->cursor = 0; } public function next($K5eKM = null) { goto PdL0m; PdL0m: $R80S9 = $this->cursor; goto gcu5W; SW6UL: if (isset($this->data[$R80S9])) { return $this->data[$R80S9]; } goto WourX; WourX: return $K5eKM; goto WfHKT; gcu5W: $this->cursor++; goto SW6UL; WfHKT: } public function nextTrimString($K5eKM = null) { goto SqOte; wgrQ8: $gwXrh = StrUtil::filterSpecialChars($gwXrh); goto fufjc; bYc4X: if (null === $gwXrh) { return $K5eKM; } goto zp3Zg; SqOte: $gwXrh = $this->next($K5eKM); goto bYc4X; fufjc: return $gwXrh; goto sGa2d; zp3Zg: $gwXrh = @trim((string) $gwXrh); goto wgrQ8; sGa2d: } public function nextTrimStringMapInteger($q3KSF = array(), $K5eKM = null) { goto Fldph; Kmd3P: if (isset($q3KSF[$gwXrh])) { return $q3KSF[$gwXrh]; } goto mGuDc; Fldph: $gwXrh = $this->nextTrimString(); goto Kmd3P; mGuDc: return $K5eKM; goto IxXC9; IxXC9: } public function nextType($sqwo8, $K5eKM = null) { goto VX6Zf; TaVbv: return $K5eKM; goto T1sWd; cfEsA: $FZE6h = $sqwo8::getList(); goto AkN1E; AkN1E: foreach ($FZE6h as $GBNIv => $VFelt) { if ($gwXrh == $GBNIv) { return $GBNIv; } } goto TaVbv; VX6Zf: $gwXrh = $this->nextTrimString(); goto cfEsA; T1sWd: } public function nextTypeValue($sqwo8, $K5eKM = null) { goto nmmim; ziXhY: $FZE6h = $sqwo8::getList(); goto sLBCR; nmmim: $gwXrh = $this->nextTrimString(); goto ziXhY; sLBCR: foreach ($FZE6h as $GBNIv => $VFelt) { if ($gwXrh === $VFelt) { return $GBNIv; } } goto hsjql; hsjql: return $K5eKM; goto OUMc3; OUMc3: } public function nextInteger($K5eKM = null) { goto vRLPA; vRLPA: $gwXrh = $this->next($K5eKM); goto RZiqM; c1VrL: return intval($gwXrh); goto iwJZ9; RZiqM: if (null === $gwXrh) { return $gwXrh; } goto c1VrL; iwJZ9: } public function nextDatetime($K5eKM = null) { goto tThVo; Ylt_M: if (TimeUtil::isDatetimeEmpty($gwXrh)) { return $K5eKM; } goto d_Gt1; tThVo: $gwXrh = $this->next($K5eKM); goto Ylt_M; d_Gt1: return $gwXrh; goto GxWkw; GxWkw: } }