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

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

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

Legend:

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

    r21420 r21441  
    4848        $total = ""; 
    4949        $new_total = ""; 
    50         if(!is_array($array)) { 
     50        if (!is_array($array)) { 
    5151            return; 
    5252        } 
    5353        $arrRet = array(); 
    54         foreach($array as $val) { 
     54        foreach ($array as $val) { 
    5555            $total += $val; 
    5656        } 
    57         if($total <= 0) { 
     57        if ($total <= 0) { 
    5858            return; 
    5959        } 
     
    6262        $p_rate = 100 / $total; 
    6363        $cnt = 0; 
    64         foreach($array as $val) { 
     64        foreach ($array as $val) { 
    6565            $ret = round($val * $rate); 
    6666            $new_total+= $ret; 
     
    9191    function drawShade() { 
    9292        $move = 1; 
    93         for($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) { 
     93        for ($i = ($this->cy + $this->cz); $i <= ($this->cy + $this->cz + ($this->cz * PIE_SHADE_IMPACT)); $i++) { 
    9494            imagefilledarc($this->image, $this->cx + $move, $i, $this->cw, $this->ch, 0, 360, $this->shade_color, IMG_ARC_PIE); 
    9595            $move += 0.5; 
     
    115115 
    116116        // データが存在しない場合 
    117         if($rd_max <= 0) { 
     117        if ($rd_max <= 0) { 
    118118            return; 
    119119        } 
    120120 
    121121        // 影の描画 
    122         if($this->shade_on) { 
     122        if ($this->shade_on) { 
    123123            $this->drawShade(); 
    124124        } 
     
    131131        for ($i = ($y + $z - 1); $i >= $y; $i--) { 
    132132            $start = 0; 
    133             for($j = 0; $j < $rd_max; $j++) { 
     133            for ($j = 0; $j < $rd_max; $j++) { 
    134134                // 角度が0度以上の場合のみ側面を描画する。 
    135                 if($arrRad[$j] > 0) { 
     135                if ($arrRad[$j] > 0) { 
    136136                    $end = $start + $arrRad[$j]; 
    137                     if($start == 0 && $end == 360) { 
     137                    if ($start == 0 && $end == 360) { 
    138138                        // -90~270で指定すると円が描画できないので0~360に指定 
    139139                        imagearc($this->image, $x, $i, $w, $h, 0, 360, $this->arrDarkColor[($j % $dc_max)]); 
     
    151151        // 上面の描画 
    152152        $start = 0; 
    153         for($i = 0; $i < $rd_max; $i++) { 
    154             $end = $start + $arrRad[$i]; 
    155             if($start == 0 && $end == 360) { 
     153        for ($i = 0; $i < $rd_max; $i++) { 
     154            $end = $start + $arrRad[$i]; 
     155            if ($start == 0 && $end == 360) { 
    156156                // -90~270で指定すると円が描画できないので0~360に指定 
    157157                imagefilledarc($this->image, $x, $y, $w, $h, 0, 360, $this->arrColor[($i % $c_max)], IMG_ARC_PIE); 
     
    165165        // 上面の縁取り 
    166166        $start = 0; 
    167         for($i = 0; $i < $rd_max; $i++) { 
    168             $end = $start + $arrRad[$i]; 
    169             if($start == 0 && $end == 360) { 
     167        for ($i = 0; $i < $rd_max; $i++) { 
     168            $end = $start + $arrRad[$i]; 
     169            if ($start == 0 && $end == 360) { 
    170170                // -90~270で指定すると円が描画できないので0~360に指定 
    171171                imagearc($this->image, $x, $y, $w, $h, 0, 360 , $this->flame_color); 
     
    180180        imageline($this->image, $x - ($w / 2), $y, $x - ($w / 2), $y + $z, $this->flame_color); 
    181181        $start = 0; 
    182         for($i = 0; $i < $rd_max; $i++) { 
     182        for ($i = 0; $i < $rd_max; $i++) { 
    183183            $end = $start + $arrRad[$i]; 
    184184            // 前面のみ 
    185             if($end > 90 && $end < 270) { 
     185            if ($end > 90 && $end < 270) { 
    186186                list($ax, $ay) = $this->lfGetArcPos($x, $y, $w, $h, $end); 
    187187                // ラインのずれを補正する 
    188                 if($end > 180) { 
     188                if ($end > 180) { 
    189189                    $ax = $ax + 1; 
    190190                } 
     
    204204        $rd_max = count($arrRad); 
    205205        $start = 0; 
    206         for($i = 0; $i < $rd_max; $i++) { 
     206        for ($i = 0; $i < $rd_max; $i++) { 
    207207            $center = $start + ($arrRad[$i] / 2); 
    208208            $end = $start + $arrRad[$i]; 
Note: See TracChangeset for help on using the changeset viewer.