Show
Ignore:
Timestamp:
10/21/07 07:23:59 (15 months ago)
Author:
jwage
Message:

Mass search and replace for coding standards changes, doc block formatting, and code spacing.

Location:
trunk/vendor/spikephpcoverage
Files:
19 modified

Legend:

Unmodified
Added
Removed
  • trunk/vendor/spikephpcoverage/cli/driver.php

    r2847 r2963  
    1919    */ 
    2020 
    21     if(!defined("__PHPCOVERAGE_HOME")) { 
     21    if( ! defined("__PHPCOVERAGE_HOME")) { 
    2222        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    2323    } 
     
    149149    $excludePaths = array(); 
    150150 
    151     if (!$OPTION['cov-url']){ 
    152         if(!$OPTION['report'] && !$OPTION['cov-data-files']) { 
     151    if ( ! $OPTION['cov-url']){ 
     152        if( ! $OPTION['report'] && !$OPTION['cov-data-files']) { 
    153153            echo "ERROR: No --cov-url option specified.\n"; 
    154154            exit(1); 
     
    157157 
    158158    if($OPTION['init']) { 
    159         if(!$OPTION['tmp-dir']) { 
     159        if( ! $OPTION['tmp-dir']) { 
    160160            $OPTION['tmp-dir'] = $util->getTmpDir(); 
    161161        } 
    162         if(!$OPTION['cov-file-name']) { 
     162        if( ! $OPTION['cov-file-name']) { 
    163163            $OPTION['cov-file-name'] = "phpcoverage.data.xml"; 
    164164        } 
     
    166166 
    167167    if($OPTION['report']) { 
    168         if (!$OPTION['report-name']){ 
     168        if ( ! $OPTION['report-name']){ 
    169169            echo "ERROR: No --report-name option specified.\n"; 
    170170            exit(1); 
    171171        } 
    172172 
    173         if(!$OPTION['report-dir']) { 
    174             if(!empty($PHPCOVERAGE_REPORT_DIR)) { 
     173        if( ! $OPTION['report-dir']) { 
     174            if( ! empty($PHPCOVERAGE_REPORT_DIR)) { 
    175175                $OPTION["report-dir"] = $PHPCOVERAGE_REPORT_DIR; 
    176176            } 
     
    226226            $OPTION['cov-data-fileset'] = explode(",", $OPTION['cov-data-files']); 
    227227            foreach($OPTION['cov-data-fileset'] as $covDataFile) { 
    228                 if(!is_readable($covDataFile)) { 
     228                if( ! is_readable($covDataFile)) { 
    229229                    echo "Error: Cannot read cov-data-file: " . $covDataFile . "\n"; 
    230230                    exit(1); 
  • trunk/vendor/spikephpcoverage/cli/instrument.php

    r2847 r2963  
    1111    #!/bin/php 
    1212 
    13     if(!defined("__PHPCOVERAGE_HOME")) { 
     13    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1414        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1515    } 
     
    8282 
    8383        $fp = fopen($tmpfile, "w"); 
    84         if(!$fp) { 
     84        if( ! $fp) { 
    8585            error("Cannot write to file: $tmpfile"); 
    8686        } 
     
    9494        } 
    9595        $ret = rename($tmpfile, $file); 
    96         if(!$ret) { 
     96        if( ! $ret) { 
    9797            error("Cannot save file: $file"); 
    9898        } 
     
    119119        $fr = fopen($file, "r"); 
    120120        $fw = fopen($tmpfile, "w"); 
    121         if(!$fr) { 
     121        if( ! $fr) { 
    122122            error("Cannot read file: $file"); 
    123123        } 
    124         if(!$fr) { 
     124        if( ! $fr) { 
    125125            error("Cannot write to file: $tmpfile"); 
    126126        } 
    127         while(!feof($fr)) { 
     127        while( ! feof($fr)) { 
    128128            $line = fgets($fr); 
    129129            if(strpos($line, $top) === false && strpos($line, $bottom) === false) { 
     
    139139        } 
    140140        $ret = rename($tmpfile, $file); 
    141         if(!$ret) { 
     141        if( ! $ret) { 
    142142            error("Cannot save file: $file"); 
    143143        } 
     
    159159        while(count($dirs) > 0) { 
    160160            $currDir = realpath(array_pop($dirs)); 
    161             if(!is_readable($currDir)) { 
     161            if( ! is_readable($currDir)) { 
    162162                continue; 
    163163            } 
     
    237237 
    238238 
    239     if(!is_dir($LOCAL_PHPCOVERAGE_LOCATION)) { 
     239    if( ! is_dir($LOCAL_PHPCOVERAGE_LOCATION)) { 
    240240        error("LOCAL_PHPCOVERAGE_LOCATION [$LOCAL_PHPCOVERAGE_LOCATION] not found."); 
    241241    } 
     
    252252    } 
    253253    $ret = copy($PHPCOVERAGE_HOME . $top_file, $LOCAL_PHPCOVERAGE_LOCATION . $top_file); 
    254     if(!$ret) { 
     254    if( ! $ret) { 
    255255        error("Cannot copy to $LOCAL_PHPCOVERAGE_LOCATION"); 
    256256    } 
     
    259259    } 
    260260    $ret = copy($PHPCOVERAGE_HOME . $bottom_file, $LOCAL_PHPCOVERAGE_LOCATION . $bottom_file); 
    261     if(!$ret) { 
     261    if( ! $ret) { 
    262262        error("Cannot copy to $LOCAL_PHPCOVERAGE_LOCATION"); 
    263263    } 
     
    268268        $paths[] = getcwd(); 
    269269    } 
    270     if(!isset($EXCLUDE_FILES) || empty($EXCLUDE_FILES)) { 
     270    if( ! isset($EXCLUDE_FILES) || empty($EXCLUDE_FILES)) { 
    271271        $EXCLUDE_FILES = array(); 
    272272    } 
    273273    for($i = 0; $i < count($EXCLUDE_FILES); $i++) { 
    274274        // Remove a file from the array if it does not exist 
    275         if(!file_exists($EXCLUDE_FILES[$i])) { 
     275        if( ! file_exists($EXCLUDE_FILES[$i])) { 
    276276            array_splice($EXCLUDE_FILES, $i, 1); 
    277277            $i --; 
  • trunk/vendor/spikephpcoverage/CoverageRecorder.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(__FILE__)); 
    1414    } 
     
    169169        protected function removeAbsentPaths(&$dirs) { 
    170170            for($i = 0; $i < count($dirs); $i++) { 
    171                 if(! file_exists($dirs[$i])) { 
     171                if( ! file_exists($dirs[$i])) { 
    172172                    // echo "Not found: " . $dirs[$i] . "\n"; 
    173173                    $this->errors[] = "Not found: " . $dirs[$i]  
     
    212212            while(count($dirs) > 0) { 
    213213                $currDir = realpath(array_pop($dirs)); 
    214                 if(!is_readable($currDir)) { 
     214                if( ! is_readable($currDir)) { 
    215215                    continue; 
    216216                } 
     
    272272                    } 
    273273                } 
    274                 if(!array_key_exists($files[$i], $this->coverageData)) { 
     274                if( ! array_key_exists($files[$i], $this->coverageData)) { 
    275275                    $this->coverageData[$files[$i]] =  array(); 
    276276                } 
  • trunk/vendor/spikephpcoverage/parser/BasicXmlParser.php

    r2847 r2963  
    1212    require_once("XML/Parser.php"); 
    1313 
    14     if(!defined("ATTRIBUTES")) { 
     14    if( ! defined("ATTRIBUTES")) { 
    1515        define("ATTRIBUTES", "__ATTRIBUTES__"); 
    1616    } 
  • trunk/vendor/spikephpcoverage/parser/CoverageXmlParser.php

    r2847 r2963  
    4343                $fileAttributes = $this->handleAttrTag($name, $attrs); 
    4444                $this->_lastFilePath = $fileAttributes["PATH"]; 
    45                 if(!isset($this->_data[$this->_lastFilePath])) { 
     45                if( ! isset($this->_data[$this->_lastFilePath])) { 
    4646                    $this->_data[$this->_lastFilePath] = array(); 
    4747                } 
     
    5151                $lineAttributes = $this->handleAttrTag($name, $attrs); 
    5252                $lineNumber = (int)$lineAttributes["LINE-NUMBER"]; 
    53                 if(!isset($this->_data[$this->_lastFilePath][$lineNumber])) { 
     53                if( ! isset($this->_data[$this->_lastFilePath][$lineNumber])) { 
    5454                    $this->_data[$this->_lastFilePath][$lineNumber] = (int)$lineAttributes["FREQUENCY"]; 
    5555                } 
  • trunk/vendor/spikephpcoverage/parser/Parser.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1414    } 
     
    7474            $this->filename = $filename; 
    7575            $ret = $this->openFileReadOnly(); 
    76             if(!$ret) { 
     76            if( ! $ret) { 
    7777                die("Error: Cannot open file: $this->filename \n"); 
    7878            } 
     
    102102        */ 
    103103        public function getLine() { 
    104             if(!feof($this->fileRef)) { 
     104            if( ! feof($this->fileRef)) { 
    105105                $this->line = fgets($this->fileRef); 
    106106                $this->processLine($this->line); 
  • trunk/vendor/spikephpcoverage/parser/PHPParser.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1414    } 
     
    8484 
    8585            // If we are not inside PHP opening tag 
    86             if(!$this->inPHP) { 
     86            if( ! $this->inPHP) { 
    8787                $pos = -1; 
    8888 
  • trunk/vendor/spikephpcoverage/PEAR.php

    r2847 r2963  
    4646 
    4747// instant backwards compatibility 
    48 if (!defined('PATH_SEPARATOR')) { 
     48if ( ! defined('PATH_SEPARATOR')) { 
    4949    if (OS_WINDOWS) { 
    5050        define('PATH_SEPARATOR', ';'); 
     
    165165                global $_PEAR_destructor_object_list; 
    166166                $_PEAR_destructor_object_list[] = &$this; 
    167                 if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { 
     167                if ( ! isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { 
    168168                    register_shutdown_function("_PEAR_call_destructors"); 
    169169                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; 
     
    440440            } 
    441441            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME 
    442         } elseif (!empty($error_code)) { 
     442        } elseif ( ! empty($error_code)) { 
    443443            // $error_code comes alone, trying to unset it 
    444444            if ($this->_checkDelExpect($error_code)) { 
     
    708708    function loadExtension($ext) 
    709709    { 
    710         if (!extension_loaded($ext)) { 
     710        if ( ! extension_loaded($ext)) { 
    711711            // if either returns true dl() will produce a FATAL error, stop that 
    712712            if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { 
  • trunk/vendor/spikephpcoverage/phpcoverage.inc.php

    r2847 r2963  
    4444 
    4545    // Fallback 
    46     if(!defined("PHPCOVERAGE_HOME")) { 
     46    if( ! defined("PHPCOVERAGE_HOME")) { 
    4747        $include_path = get_include_path(); 
    4848        set_include_path($PHPCOVERAGE_HOME. PATH_SEPARATOR . $include_path); 
  • trunk/vendor/spikephpcoverage/phpcoverage.remote.bottom.inc.php

    r2847 r2963  
    2020            __FILE__, __LINE__); 
    2121 
    22         if(!isset($cov)) { 
     22        if( ! isset($cov)) { 
    2323            if(file_exists($tmpFile)) { 
    2424                $object = file_get_contents($tmpFile); 
     
    3030        if(isset($cov)) { 
    3131            // PHPCoverage bottom half 
    32             if(!isset($called_script)) { 
     32            if( ! isset($called_script)) { 
    3333                $called_script = ""; 
    3434            } 
  • trunk/vendor/spikephpcoverage/phpcoverage.remote.top.inc.php

    r2847 r2963  
    2929        $called_script = basename($_SERVER["SCRIPT_FILENAME"]); 
    3030 
    31         if(!empty($_REQUEST["PHPCOVERAGE_HOME"])) { 
     31        if( ! empty($_REQUEST["PHPCOVERAGE_HOME"])) { 
    3232            $PHPCOVERAGE_HOME = $_REQUEST["PHPCOVERAGE_HOME"]; 
    3333        } 
     
    5252 
    5353        // Fallback 
    54         if(!defined("PHPCOVERAGE_HOME")) { 
     54        if( ! defined("PHPCOVERAGE_HOME")) { 
    5555            $include_path = get_include_path(); 
    5656            set_include_path($PHPCOVERAGE_HOME. ":" . $include_path); 
     
    9595        } 
    9696 
    97         if(!empty($_REQUEST["phpcoverage-action"])) { 
     97        if( ! empty($_REQUEST["phpcoverage-action"])) { 
    9898            $logger->info("[phpcoverage.remote.top.inc.php] phpcoverage-action=" . strtolower($_REQUEST["phpcoverage-action"]), 
    9999                __FILE__, __LINE__); 
    100100            switch(strtolower($_REQUEST["phpcoverage-action"])) { 
    101101            case "init": 
    102                 if(!empty($_REQUEST["tmp-dir"])) { 
     102                if( ! empty($_REQUEST["tmp-dir"])) { 
    103103                    $cov->setTmpDir($_REQUEST["tmp-dir"]); 
    104104                } 
    105105                $cov->setCoverageFileName($_REQUEST["cov-file-name"]); 
    106                 if(!$cov->cleanCoverageFile()) { 
     106                if( ! $cov->cleanCoverageFile()) { 
    107107                    die("Cannot delete existing coverage data."); 
    108108                } 
  • trunk/vendor/spikephpcoverage/remote/RemoteCoverageRecorder.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1414    } 
     
    125125            $xmlString = ""; 
    126126            $xmlBody = ""; 
    127             if(!empty($this->coverageData)) { 
     127            if( ! empty($this->coverageData)) { 
    128128                foreach($this->coverageData as $file => &$lines) { 
    129129                    $xmlBody .= "<file path=\"". $util->replaceBackslashes($file) . "\">"; 
     
    158158        protected function parseCoverageXml(&$xml, $stream=false) { 
    159159            // Need to handle multiple xml files. 
    160             if(!is_array($xml)) { 
     160            if( ! is_array($xml)) { 
    161161                $xml = array($xml); 
    162162            } 
     
    195195                $fp = fopen($filepath, "r"); 
    196196                if($fp) { 
    197                     while(!feof($fp)) { 
     197                    while( ! feof($fp)) { 
    198198                        $xml = fread($fp, 4096); 
    199199                        echo $xml; 
     
    226226        protected function appendDataToFile($newXml) { 
    227227            $filepath = $this->tmpDir . "/" . $this->coverageFileName; 
    228             if(!file_exists($filepath)) { 
     228            if( ! file_exists($filepath)) { 
    229229                // If new file, write the xml start and end tags 
    230230                $bytes = file_put_contents($filepath, $this->xmlStart . "\n" . $this->xmlEnd); 
    231                 if(!$bytes) { 
     231                if( ! $bytes) { 
    232232                    $this->logger->critical("[RemoteCoverageRecorder::appendDataToFile()] Could not create file: " . $filepath, __FILE__, __LINE__); 
    233233                    return false; 
     
    239239                    fseek($res, -1 * strlen($this->xmlEnd), SEEK_END); 
    240240                    $ret = fwrite($res, $newXml); 
    241                     if(!$ret) { 
     241                    if( ! $ret) { 
    242242                        $this->logger->error("[RemoteCoverageRecorder::appendDataToFile()] Could not append data to file.", 
    243243                            __FILE__, __LINE__); 
     
    271271                $xml = $this->prepareCoverageXml(); 
    272272                $ret = $this->appendDataToFile($xml); 
    273                 if(!$ret) { 
     273                if( ! $ret) { 
    274274                    $this->logger->warn("[RemoteCoverageRecorder::saveCoverageXml()] " 
    275275                    . "ERROR: Nothing was written to " . $filepath, 
  • trunk/vendor/spikephpcoverage/remote/XdebugTraceReader.php

    r2847 r2963  
    6161        */ 
    6262        public function parseTraceFile() { 
    63             if(!$this->openTraceFile()) { 
     63            if( ! $this->openTraceFile()) { 
    6464                error_log("[XdebugTraceReader::parseTraceFile()] Unable to read trace file."); 
    6565                return false; 
    6666            } 
    67             while(!feof($this->handle)) { 
     67            while( ! feof($this->handle)) { 
    6868                $line = fgets($this->handle); 
    6969                // echo "Line: " . $line . "\n"; 
     
    9191                return false; 
    9292            } 
    93             if(!file_exists($dataparts[$cnt-2])) { 
     93            if( ! file_exists($dataparts[$cnt-2])) { 
    9494                // echo "No file: " . $dataparts[$cnt-2] . "\n"; 
    9595                return false; 
     
    9999            $dataparts[$cnt-1] = trim($dataparts[$cnt-1]); 
    100100 
    101             if(!isset($this->coverage[$dataparts[$cnt-2]][$dataparts[$cnt-1]])) { 
     101            if( ! isset($this->coverage[$dataparts[$cnt-2]][$dataparts[$cnt-1]])) { 
    102102                $this->coverage[$dataparts[$cnt-2]][$dataparts[$cnt-1]] = 1; 
    103103            } 
  • trunk/vendor/spikephpcoverage/reporter/CoverageReporter.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1414    } 
     
    101101        protected function createReportDir() { 
    102102            global $util; 
    103             if(!file_exists($this->outputDir)) { 
     103            if( ! file_exists($this->outputDir)) { 
    104104                $util->makeDirRecursive($this->outputDir, 0755); 
    105105            } 
     
    201201            else { 
    202202                $filename = $util->replaceBackslashes($filename); 
    203                 if(!file_exists(dirname($filename))) { 
     203                if( ! file_exists(dirname($filename))) { 
    204204                    $ret = $util->makeDirRecursive(dirname($filename), 0755); 
    205                     if(!$ret) { 
     205                    if( ! $ret) { 
    206206                        die ("Cannot create directory " . dirname($filename) . "\n"); 
    207207                    } 
  • trunk/vendor/spikephpcoverage/reporter/HtmlCoverageReporter.php

    r2847 r2963  
    1010<?php 
    1111 
    12     if(!defined("__PHPCOVERAGE_HOME")) { 
     12    if( ! defined("__PHPCOVERAGE_HOME")) { 
    1313        define("__PHPCOVERAGE_HOME", dirname(dirname(__FILE__))); 
    1414    } 
     
    6767        */ 
    6868        public function generateReport(&$data) { 
    69             if(!file_exists($this->outputDir)) { 
     69            if( ! file_exists($this->outputDir)) { 
    7070                mkdir($this->outputDir); 
    7171            } 
     
    155155            } 
    156156            $imagesSpikeDir = $imagesDir . "/spikesource"; 
    157             if(!file_exists($imagesSpikeDir)) { 
     157            if( ! file_exists($imagesSpikeDir)) { 
    158158                mkdir($imagesSpikeDir); 
    159159            } 
     
    342342            $str .= $this->writeIndexFileTableHead(); 
    343343            $str .= '<tbody>'; 
    344             if(!empty($this->coverageData)) { 
     344            if( ! empty($this->coverageData)) { 
    345345                foreach($this->coverageData as $filename => &$lines) { 
    346346                    $realFile = realpath($filename); 
     
    440440            $fileLink = $util->replaceBackslashes($fileLink); 
    441441            $parentDir = $util->replaceBackslashes(dirname($fileLink)); 
    442             if(!file_exists($parentDir)) { 
     442            if( ! file_exists($parentDir)) { 
    443443                //echo "\nCreating dir: $parentDir\n"; 
    444444      &nb