Ignore:
Timestamp:
2013/02/18 19:09:54 (11 years ago)
Author:
shutta
Message:

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

File:
1 edited

Legend:

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

    r22206 r22567  
    2828 * @version $Id$ 
    2929 */ 
    30 class SC_Helper_Transform { 
     30class SC_Helper_Transform  
     31{ 
    3132    protected $objDOM; 
    3233    protected $arrSmartyTagsOrg; 
     
    4950     * @return void 
    5051     */ 
    51     public function __construct($source) { 
     52    public function __construct($source) 
     53    { 
    5254        $this->objDOM = new DOMDocument(); 
    5355        $this->objDOM->strictErrorChecking = false; 
     
    132134     * @return SC_Helper_Transformオブジェクト 
    133135     */ 
    134     public function select($selector, $index = NULL, $require = true, $err_msg = NULL) { 
     136    public function select($selector, $index = NULL, $require = true, $err_msg = NULL) 
     137    { 
    135138        $this->arrSelectElements = array(); 
    136139        $this->search_depth = 0; 
     
    172175     * @return SC_Helper_Transformオブジェクト 
    173176     */ 
    174     public function find($selector, $index = NULL, $require = true, $err_msg = NULL) { 
     177    public function find($selector, $index = NULL, $require = true, $err_msg = NULL) 
     178    { 
    175179        $arrParentElements = $this->arrSelectElements[$this->search_depth]; 
    176180        $this->search_depth++; 
     
    212216     * @return SC_Helper_Transformオブジェクト 
    213217     */ 
    214     public function end($back_num = 1) { 
     218    public function end($back_num = 1) 
     219    { 
    215220        if ($this->search_depth >= $back_num) { 
    216221            $this->search_depth -= $back_num; 
     
    229234     * @return SC_Helper_Transformオブジェクト 
    230235     */ 
    231     public function insertBefore($html_snip) { 
     236    public function insertBefore($html_snip) 
     237    { 
    232238        foreach ($this->arrSelectElements[$this->search_depth] as $key => $objElement) { 
    233239            $this->lfSetTransform('insertBefore', $objElement[0], $html_snip); 
     
    243249     * @return SC_Helper_Transformオブジェクト 
    244250     */ 
    245     public function insertAfter($html_snip) { 
     251    public function insertAfter($html_snip) 
     252    { 
    246253        foreach ($this->arrSelectElements[$this->search_depth] as $key => $objElement) { 
    247254            $this->lfSetTransform('insertAfter', $objElement[0], $html_snip); 
     
    257264     * @return SC_Helper_Transformオブジェクト 
    258265     */ 
    259     public function appendFirst($html_snip) { 
     266    public function appendFirst($html_snip) 
     267    { 
    260268        foreach ($this->arrSelectElements[$this->search_depth] as $key => $objElement) { 
    261269            $this->lfSetTransform('appendFirst', $objElement[0], $html_snip); 
     
    271279     * @return SC_Helper_Transformオブジェクト 
    272280     */ 
    273     public function appendChild($html_snip) { 
     281    public function appendChild($html_snip) 
     282    { 
    274283        foreach ($this->arrSelectElements[$this->search_depth] as $key => $objElement) { 
    275284            $this->lfSetTransform('appendChild', $objElement[0], $html_snip); 
     
    285294     * @return SC_Helper_Transformオブジェクト 
    286295     */ 
    287     public function replaceElement($html_snip) { 
     296    public function replaceElement($html_snip) 
     297    { 
    288298        foreach ($this->arrSelectElements[$this->search_depth] as $key => &$objElement) { 
    289299            $this->lfSetTransform('replaceElement', $objElement[0], $html_snip); 
     
    298308     * @return SC_Helper_Transformオブジェクト 
    299309     */ 
    300     public function removeElement() { 
     310    public function removeElement() 
     311    { 
    301312        foreach ($this->arrSelectElements[$this->search_depth] as $key => &$objElement) { 
    302313            $this->lfSetTransform('replaceElement', $objElement[0], ''); 
     
    311322     * @return string トランスフォーム済みHTML。まったくトランスフォームが行われなかった場合は元のHTMLを返す。。 
    312323     */ 
    313     public function getHTML() { 
     324    public function getHTML() 
     325    { 
    314326        if (count($this->arrErr)) { 
    315327            // エラーメッセージ組み立て 
     
    358370     * @return string 代わりの文字列 
    359371     */ 
    360     protected function lfCaptureSmartyTags2Comment(array $arrMatches) { 
     372    protected function lfCaptureSmartyTags2Comment(array $arrMatches) 
     373    { 
    361374        $substitute_tag = sprintf('<!--###%08d###-->', $this->smarty_tags_idx); 
    362375        $this->arrSmartyTagsOrg[$this->smarty_tags_idx] = $arrMatches[0]; 
     
    375388     * @return string 代わりの文字列 
    376389     */ 
    377     protected function lfCaptureHeadTags2Comment(array $arrMatches) { 
     390    protected function lfCaptureHeadTags2Comment(array $arrMatches) 
     391    { 
    378392        $substitute_tag = sprintf('<!--###%08d###-->', $this->smarty_tags_idx); 
    379393        $this->arrSmartyTagsOrg[$this->smarty_tags_idx] = $arrMatches[2]; 
     
    398412     * @return string 代わりの文字列 
    399413     */ 
    400     protected function lfCaptureSmartyTagsInTag(array $arrMatches) { 
     414    protected function lfCaptureSmartyTagsInTag(array $arrMatches) 
     415    { 
    401416        // Smartyタグ内のクォートを処理しやすいよう、いったんダミーのタグに 
    402417        $html = preg_replace_callback('/<\!--{.+?\}-->/s', array($this, 'lfCaptureSmartyTags2Temptag'), $arrMatches[0]); 
     
    415430     * @return string 代わりの文字列 
    416431     */ 
    417     protected function lfCaptureSmartyTags2Temptag(array $arrMatches) { 
     432    protected function lfCaptureSmartyTags2Temptag(array $arrMatches) 
     433    { 
    418434        $substitute_tag = sprintf('###TEMP%08d###', $this->smarty_tags_idx); 
    419435        $this->arrSmartyTagsOrg[$this->smarty_tags_idx] = $arrMatches[0]; 
     
    432448     * @return string 代わりの文字列 
    433449     */ 
    434     protected function lfCaptureSmartyTagsInQuote(array $arrMatches) { 
     450    protected function lfCaptureSmartyTagsInQuote(array $arrMatches) 
     451    { 
    435452        $html = preg_replace_callback( 
    436453            '/###TEMP(\d{8})###/s', 
     
    450467     * @return string 代わりの文字列 
    451468     */ 
    452     protected function lfCaptureSmartyTags2Value(array $arrMatches) { 
     469    protected function lfCaptureSmartyTags2Value(array $arrMatches) 
     470    { 
    453471        $tag_idx = (int)$arrMatches[1]; 
    454472        $substitute_tag = sprintf('###%08d###', $tag_idx); 
     
    466484     * @return string 代わりの文字列 
    467485     */ 
    468     protected function lfCaptureSmartyTags2Attr(array $arrMatches) { 
     486    protected function lfCaptureSmartyTags2Attr(array $arrMatches) 
     487    { 
    469488        $tag_idx = (int)$arrMatches[1]; 
    470489        $substitute_tag = sprintf('rel%08d="######"', $tag_idx); 
     
    480499     * @return void 
    481500     */ 
    482     protected function lfScanChild(DOMNode $objDOMElement, $parent_selector = '') { 
     501    protected function lfScanChild(DOMNode $objDOMElement, $parent_selector = '') 
     502    { 
    483503        $objNodeList = $objDOMElement->childNodes; 
    484504        if (is_null($objNodeList)) return; 
     
    516536     * @return string 正規表現文字列 
    517537     */ 
    518     protected function lfSelector2Regex($selector, $parent_index = NULL){ 
     538    protected function lfSelector2Regex($selector, $parent_index = NULL) 
     539    { 
    519540        // jQueryライクなセレクタを正規表現に 
    520541        $selector = preg_replace('/ *> */', ' >', $selector);   // 子セレクタをツリー検索用に 「A >B」の記法にする 
     
    551572     * @return void 
    552573     */ 
    553     protected function lfAddElement($elementNo, array &$arrElement) { 
     574    protected function lfAddElement($elementNo, array &$arrElement) 
     575    { 
    554576        if (is_array($this->arrSelectElements[$this->search_depth]) && array_key_exists($arrElement[0], $this->arrSelectElements[$this->search_depth])) { 
    555577            //nop 
     
    569591     * @return boolean 
    570592     */ 
    571     protected function lfSetTransform($mode, $target_key, $html_snip) { 
     593    protected function lfSetTransform($mode, $target_key, $html_snip) 
     594    { 
    572595 
    573596        $substitute_tag = sprintf('<!--###%08d###-->', $this->smarty_tags_idx); 
     
    635658     * @return void 
    636659     */ 
    637     protected function lfSetError($selector, $type, $err_msg = NULL) { 
     660    protected function lfSetError($selector, $type, $err_msg = NULL) 
     661    { 
    638662        $this->arrErr[] = array( 
    639663            'selector'    => $selector, 
Note: See TracChangeset for help on using the changeset viewer.