Ignore:
Timestamp:
2012/02/06 11:27:03 (14 years ago)
Author:
Seasoft
Message:

#1613 (ソース整形・ソースコメントの改善)

  • Zend Framework PHP 標準コーディング規約への準拠を高めた
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_CheckError.php

    r21441 r21442  
    4242 
    4343    function doFunc($value, $arrFunc) { 
    44         foreach ($arrFunc as $key ) { 
     44        foreach ($arrFunc as $key) { 
    4545            $this->$key($value); 
    4646        } 
     
    9191        } 
    9292        $this->createParam($value); 
    93         if (!is_array($this->arrParam[$value[1]]) && strlen($this->arrParam[$value[1]]) == 0 ) { 
     93        if (!is_array($this->arrParam[$value[1]]) && strlen($this->arrParam[$value[1]]) == 0) { 
    9494            $this->arrErr[$value[1]] = "※ " . $value[0] . "が入力されていません。<br />"; 
    9595        } else if (is_array($this->arrParam[$value[1]]) && count($this->arrParam[$value[1]]) == 0) { 
     
    110110        } 
    111111        $this->createParam($value); 
    112         if (strlen($this->arrParam[$value[0]]) == 0 ) { 
     112        if (strlen($this->arrParam[$value[0]]) == 0) { 
    113113            $this->arrErr[$value[0]] = "※ " . $value[0] . "が入力されていません。<br />"; 
    114114        } 
     
    172172        } 
    173173        $this->createParam($value); 
    174         if (strlen($this->arrParam[$value[1]]) == 0 ) { 
     174        if (strlen($this->arrParam[$value[1]]) == 0) { 
    175175            $this->arrErr[$value[1]] = "※ " . $value[0] . "が選択されていません。<br />"; 
    176176        } 
     
    244244        $this->createParam($value); 
    245245        // 文字数の取得 
    246         if (mb_strlen($this->arrParam[$value[1]]) > $value[2] ) { 
     246        if (mb_strlen($this->arrParam[$value[1]]) > $value[2]) { 
    247247            $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "字以下で入力してください。<br />"; 
    248248        } 
     
    262262        $this->createParam($value); 
    263263        // 文字数の取得 
    264         if (mb_strlen($this->arrParam[$value[1]]) < $value[2] ) { 
     264        if (mb_strlen($this->arrParam[$value[1]]) < $value[2]) { 
    265265            $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "字以上で入力してください。<br />"; 
    266266        } 
     
    280280        $this->createParam($value); 
    281281        // 文字数の取得 
    282         if ($this->arrParam[$value[1]] > $value[2] ) { 
     282        if ($this->arrParam[$value[1]] > $value[2]) { 
    283283            $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以下で入力してください。<br />"; 
    284284        } 
     
    297297        } 
    298298        $this->createParam($value); 
    299         if ($this->arrParam[$value[1]] < $value[2] ) { 
     299        if ($this->arrParam[$value[1]] < $value[2]) { 
    300300            $this->arrErr[$value[1]] = "※ " . $value[0] . "は" . $value[2] . "以上で入力してください。<br />"; 
    301301        } 
     
    314314        } 
    315315        $this->createParam($value); 
    316         if ($this->numelicCheck($this->arrParam[$value[1]]) ) { 
     316        if ($this->numelicCheck($this->arrParam[$value[1]])) { 
    317317            $this->arrErr[$value[1]] = "※ " . $value[0] . "は数字で入力してください。<br />"; 
    318318        } 
     
    551551        } 
    552552        $this->createParam($value); 
    553         if (strlen($this->arrParam[$value[1]]) > 0 && !ctype_alnum($this->arrParam[$value[1]]) ) { 
     553        if (strlen($this->arrParam[$value[1]]) > 0 && !ctype_alnum($this->arrParam[$value[1]])) { 
    554554            $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数字で入力してください。<br />"; 
    555555        } 
     
    564564        } 
    565565        $this->createParam($value); 
    566         if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[[:graph:]|[:space:]]+$/i", $this->arrParam[$value[1]] ) ) { 
     566        if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[[:graph:]|[:space:]]+$/i", $this->arrParam[$value[1]] )) { 
    567567            $this->arrErr[$value[1]] = "※ " . $value[0] . "は英数記号で入力してください。<br />"; 
    568568        } 
     
    574574    function ZERO_CHECK( $value ) { 
    575575        $this->createParam($value); 
    576         if ($this->arrParam[$value[1]] == "0" ) { 
     576        if ($this->arrParam[$value[1]] == "0") { 
    577577            $this->arrErr[$value[1]] = "※ " . $value[0] . "は1以上を入力してください。<br />"; 
    578578        } 
     
    589589        // $this->arrParam[$value[0]] = mb_convert_kana($this->arrParam[$value[0]], 'n'); 
    590590        $count = strlen($this->arrParam[$value[1]]); 
    591         if (( $count > 0 ) && $value[2] > $count || $value[3] < $count ) { 
     591        if (( $count > 0 ) && $value[2] > $count || $value[3] < $count) { 
    592592            $this->arrErr[$value[1]] =  "※ $value[0]は$value[2]桁~$value[3]桁で入力して下さい。<br />"; 
    593593        } 
     
    603603        $this->createParam($value); 
    604604        $count = strlen($this->arrParam[$value[1]]); 
    605         if (($count > 0) && $count != $value[2] ) { 
     605        if (($count > 0) && $count != $value[2]) { 
    606606            $this->arrErr[$value[1]] =  "※ $value[0]は$value[2]桁で入力して下さい。<br />"; 
    607607        } 
     
    671671        } 
    672672        $this->createParam($value); 
    673         if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[a-zA-Z0-9_\.@\+\?-]+$/i",$this->arrParam[$value[1]]) ) { 
     673        if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("/^[a-zA-Z0-9_\.@\+\?-]+$/i",$this->arrParam[$value[1]])) { 
    674674            $this->arrErr[$value[1]] = "※ " . $value[0] . "に使用する文字を正しく入力してください。<br />"; 
    675675        } 
     
    683683            return; 
    684684        } 
    685          if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("@^https?://+($|[a-zA-Z0-9_~=:&\?\.\/-])+$@i", $this->arrParam[$value[1]] ) ) { 
     685         if (strlen($this->arrParam[$value[1]]) > 0 && !preg_match("@^https?://+($|[a-zA-Z0-9_~=:&\?\.\/-])+$@i", $this->arrParam[$value[1]] )) { 
    686686            $this->arrErr[$value[1]] = "※ " . $value[0] . "を正しく入力してください。<br />"; 
    687687        } 
     
    719719        $this->createParam($value); 
    720720 
    721         if ($_FILES[$value[1]]['name'] != "" ) { 
     721        if ($_FILES[$value[1]]['name'] != "") { 
    722722            $errFlag = 1; 
    723723            $array_ext = explode(".", $_FILES[$value[1]]['name']); 
     
    725725            $strExt = ""; 
    726726 
    727             foreach ($value[2] as $checkExt ) { 
     727            foreach ($value[2] as $checkExt) { 
    728728                $ext = ""; 
    729729 
     
    802802        } 
    803803        $this->createParam($value); 
    804         if ($_FILES[$value[1]]['size'] > $value[2] *  1024 ) { 
     804        if ($_FILES[$value[1]]['size'] > $value[2] *  1024) { 
    805805            $byte = 'KB'; 
    806             if ($value[2] >= 1000 ) { 
     806            if ($value[2] >= 1000) { 
    807807                $value[2] = $value[2] / 1000; 
    808808                $byte = 'MB'; 
     
    820820        } 
    821821        $this->createParam($value); 
    822         if (strlen($_FILES[$value[1]]['name']) > 0 && !preg_match("/^[[:alnum:]_\.-]+$/i", $_FILES[$value[1]]['name']) ) { 
     822        if (strlen($_FILES[$value[1]]['name']) > 0 && !preg_match("/^[[:alnum:]_\.-]+$/i", $_FILES[$value[1]]['name'])) { 
    823823            $this->arrErr[$value[1]] = "※ " . $value[0] . "のファイル名に日本語やスペースは使用しないで下さい。<br />"; 
    824824        } 
     
    960960        $this->createParam($value); 
    961961        $error = 0; 
    962         if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]]) ) { 
     962        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    963963            $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 
    964964        } 
    965         if ((strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) && ! checkdate($this->arrParam[$value[6]], $this->arrParam[$value[7]], $this->arrParam[$value[5]]) ) { 
     965        if ((strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) && ! checkdate($this->arrParam[$value[6]], $this->arrParam[$value[7]], $this->arrParam[$value[5]])) { 
    966966            $this->arrErr[$value[5]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 
    967967        } 
    968         if ((strlen($this->arrParam[$value[2]]) > 0 && strlen($this->arrParam[$value[3]]) > 0 && strlen($this->arrParam[$value[4]] ) > 0) &&  (strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0) ) { 
     968        if ((strlen($this->arrParam[$value[2]]) > 0 && strlen($this->arrParam[$value[3]]) > 0 && strlen($this->arrParam[$value[4]] ) > 0) &&  (strlen($this->arrParam[$value[5]]) > 0 || strlen($this->arrParam[$value[6]]) > 0 || strlen($this->arrParam[$value[7]] ) > 0)) { 
    969969 
    970970            $date1 = $this->arrParam[$value[2]] .sprintf("%02d", $this->arrParam[$value[3]]) .sprintf("%02d",$this->arrParam[$value[4]]) ."000000"; 
     
    10111011        $this->createParam($value); 
    10121012        $error = 0; 
    1013         if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]]) ) { 
     1013        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0 || strlen($this->arrParam[$value[4]] ) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[3]], $this->arrParam[$value[4]], $this->arrParam[$value[2]])) { 
    10141014            $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 
    10151015        } 
    1016         if ((strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) && ! checkdate($this->arrParam[$value[9]], $this->arrParam[$value[10]], $this->arrParam[$value[8]]) ) { 
     1016        if ((strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) && ! checkdate($this->arrParam[$value[9]], $this->arrParam[$value[10]], $this->arrParam[$value[8]])) { 
    10171017            $this->arrErr[$value[8]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 
    10181018        } 
    1019         if ((strlen($this->arrParam[$value[2]]) > 0 && strlen($this->arrParam[$value[3]]) > 0 && strlen($this->arrParam[$value[4]] ) > 0 && strlen($this->arrParam[$value[5]] ) > 0) &&  (strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0) ) { 
     1019        if ((strlen($this->arrParam[$value[2]]) > 0 && strlen($this->arrParam[$value[3]]) > 0 && strlen($this->arrParam[$value[4]] ) > 0 && strlen($this->arrParam[$value[5]] ) > 0) &&  (strlen($this->arrParam[$value[8]]) > 0 || strlen($this->arrParam[$value[9]]) > 0 || strlen($this->arrParam[$value[10]] ) > 0 || strlen($this->arrParam[$value[11]] ) > 0)) { 
    10201020 
    10211021            $date1 = $this->arrParam[$value[2]] .sprintf("%02d", $this->arrParam[$value[3]]) .sprintf("%02d",$this->arrParam[$value[4]]) .sprintf("%02d",$this->arrParam[$value[5]]).sprintf("%02d",$this->arrParam[$value[6]]).sprintf("%02d",$this->arrParam[$value[7]]); 
     
    10551055        $this->createParam($value); 
    10561056        $error = 0; 
    1057         if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]]) ) { 
     1057        if ((strlen($this->arrParam[$value[2]]) > 0 || strlen($this->arrParam[$value[3]]) > 0) && ! checkdate($this->arrParam[$value[3]], 1, $this->arrParam[$value[2]])) { 
    10581058            $this->arrErr[$value[2]] = "※ " . $value[0] . "を正しく指定してください。<br />"; 
    10591059        } 
    1060         if ((strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[5]], 1, $this->arrParam[$value[4]]) ) { 
     1060        if ((strlen($this->arrParam[$value[4]]) > 0 || strlen($this->arrParam[$value[5]]) > 0) && ! checkdate($this->arrParam[$value[5]], 1, $this->arrParam[$value[4]])) { 
    10611061            $this->arrErr[$value[4]] = "※ " . $value[1] . "を正しく指定してください。<br />"; 
    10621062        } 
     
    11421142     */ 
    11431143    function PROHIBITED_STR_CHECK( $value ) { 
    1144         if (isset($this->arrErr[$value[1]]) || empty($this->arrParam[$value[1]]) ) { 
     1144        if (isset($this->arrErr[$value[1]]) || empty($this->arrParam[$value[1]])) { 
    11451145            return; 
    11461146        } 
Note: See TracChangeset for help on using the changeset viewer.