Skip to content

Commit

Permalink
comments modified
Browse files Browse the repository at this point in the history
  • Loading branch information
dogstarTest committed Mar 5, 2018
1 parent ca9f4d5 commit c880372
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Request/Formatter/StringFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ class StringFormatter extends BaseFormatter implements Formatter {
* 对字符串进行格式化
*
* @param mixed $value 变量值
* @@param array $rule array('len' => ‘最长长度’)
* @param array $rule array('len' => ‘最长长度’)
*
* @return string 格式化后的变量
*/
public function parse($value, $rule) {

$rs = strval($this->filterByStrLen(strval($value), $rule));

$this->filterByRegex($rs, $rule);
Expand All @@ -35,7 +34,6 @@ public function parse($value, $rule) {
* 根据字符串长度进行截取
*/
protected function filterByStrLen($value, $rule) {

$lenRule = $rule;
$lenRule['name'] = $lenRule['name'] . '.len';
$lenValue = !empty($lenRule['format']) ? mb_strlen($value, $lenRule['format']) : strlen($value);
Expand All @@ -47,7 +45,6 @@ protected function filterByStrLen($value, $rule) {
* 进行正则匹配
*/
protected function filterByRegex($value, $rule) {

if (!isset($rule['regex']) || empty($rule['regex'])) {
return;
}
Expand Down

0 comments on commit c880372

Please sign in to comment.