Changeset 7681 for trunk/library


Ignore:
Timestamp:
12/19/12 16:44:18 (11 years ago)
Author:
douglasz
Message:

Ticket #3236 - Correcoes para Best Practice: Short Open Tag e Best Practice: Always Quote Array Keys.

Location:
trunk/library/PEAR/PEAR
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/library/PEAR/PEAR/Builder.php

    r5146 r7681  
    333333                if (substr($o['name'], 0, 5) == 'with-' && 
    334334                    ($r == 'yes' || $r == 'autodetect')) { 
    335                     $configure_command .= " --$o[name]"; 
     335                    $configure_command .= " --{$o['name']}"; 
    336336                } else { 
    337                     $configure_command .= " --$o[name]=".trim($r); 
     337                    $configure_command .= " --{$o['name']}=".trim($r); 
    338338                } 
    339339            } 
  • trunk/library/PEAR/PEAR/ChannelFile.php

    r5146 r7681  
    459459            . $channelInfo['attribs']['version'] . " http://pear.php.net/dtd/channel-" . 
    460460            $channelInfo['attribs']['version'] . ".xsd\"> 
    461  <name>$channelInfo[name]</name> 
     461 <name>{$channelInfo['name']}</name> 
    462462 <summary>" . htmlspecialchars($channelInfo['summary'])."</summary> 
    463463"; 
  • trunk/library/PEAR/PEAR/Command/Common.php

    r5146 r7681  
    223223                        $lapp = "[=$arg]"; 
    224224                    } else { 
    225                         $sapp = " $v[arg]"; 
    226                         $lapp = "=$v[arg]"; 
     225                        $sapp = " {$v['arg']}"; 
     226                        $lapp = "={$v['arg']}"; 
    227227                    } 
    228228                } else { 
  • trunk/library/PEAR/PEAR/Command/Registry.php

    r5146 r7681  
    514514                                $mstr .= $m['handle'] . '@php.net'; 
    515515                            } 
    516                             $mstr .= "> ($m[role])"; 
     516                            $mstr .= "> ({$m['role']})"; 
    517517                        } 
    518518                        $info[$key] = $mstr; 
     
    866866                    $info[$infoindex] .= "$type $name"; 
    867867                    if (isset($package['uri'])) { 
    868                         $info[$infoindex] .= "\n  Download URI: $package[uri]"; 
     868                        $info[$infoindex] .= "\n  Download URI: {$package['uri']}"; 
    869869                        continue; 
    870870                    } 
     
    882882 
    883883                    if (isset($package['recommended'])) { 
    884                         $info[$infoindex] .= "\n  Recommended version: $package[recommended]"; 
     884                        $info[$infoindex] .= "\n  Recommended version: {$package['recommended']}"; 
    885885                    } 
    886886 
     
    920920                        $info['Not Compatible with'] .= "\n"; 
    921921                    } 
    922                     $info['Not Compatible with'] .= "$os[name] Operating System"; 
     922                    $info['Not Compatible with'] .= "{$os['name']} Operating System"; 
    923923                } else { 
    924924                    $info['Required Dependencies'] .= "\n"; 
    925                     $info['Required Dependencies'] .= "$os[name] Operating System"; 
     925                    $info['Required Dependencies'] .= "{$os['name']} Operating System"; 
    926926                } 
    927927            } 
     
    940940                        $info['Not Compatible with'] .= "\n"; 
    941941                    } 
    942                     $info['Not Compatible with'] .= "OS/Arch matching pattern '/$os[pattern]/'"; 
     942                    $info['Not Compatible with'] .= "OS/Arch matching pattern '/{$os['pattern']}/'"; 
    943943                } else { 
    944944                    $info['Required Dependencies'] .= "\n"; 
    945                     $info['Required Dependencies'] .= "OS/Arch matching pattern '/$os[pattern]/'"; 
     945                    $info['Required Dependencies'] .= "OS/Arch matching pattern '/{$os['pattern']}/'"; 
    946946                } 
    947947            } 
     
    10061006 
    10071007                        if (isset($package['recommended'])) { 
    1008                             $info[$infoindex] .= "\n  Recommended version: $package[recommended]"; 
     1008                            $info[$infoindex] .= "\n  Recommended version: {$package['recommended']}"; 
    10091009                        } 
    10101010 
     
    10661066                                } 
    10671067 
    1068                                 $info[$groupindex] .= "\n  Download URI: $package[uri]"; 
     1068                                $info[$groupindex] .= "\n  Download URI: {$package['uri']}"; 
    10691069                                continue; 
    10701070                            } 
     
    10881088 
    10891089                            if (isset($package['recommended'])) { 
    1090                                 $info[$groupindex] .= "\n  Recommended version: $package[recommended]"; 
     1090                                $info[$groupindex] .= "\n  Recommended version: {$package['recommended']}"; 
    10911091                            } 
    10921092 
     
    11191119                if (isset($package['uri'])) { 
    11201120                    $info['Bundled Packages'] .= '__uri/' . $package['name']; 
    1121                     $info['Bundled Packages'] .= "\n  (URI: $package[uri]"; 
     1121                    $info['Bundled Packages'] .= "\n  (URI: {$package['uri']}"; 
    11221122                } else { 
    11231123                    $info['Bundled Packages'] .= $package['channel'] . '/' . $package['name']; 
  • trunk/library/PEAR/PEAR/Command/Remote.php

    r7655 r7681  
    623623        $downloaded = $downloader->getDownloadedPackages(); 
    624624        foreach ($downloaded as $pkg) { 
    625             $this->ui->outputData("File $pkg[file] downloaded", $command); 
     625            $this->ui->outputData("File {$pkg['file']} downloaded", $command); 
    626626        } 
    627627 
  • trunk/library/PEAR/PEAR/Downloader.php

    r7655 r7681  
    16331633 
    16341634            if (isset($lastmodified['ETag'])) { 
    1635                 $ifmodifiedsince .= "If-None-Match: $lastmodified[ETag]\r\n"; 
     1635                $ifmodifiedsince .= "If-None-Match: {$lastmodified['ETag']}\r\n"; 
    16361636            } 
    16371637        } else { 
  • trunk/library/PEAR/PEAR/Frontend/CLI.php

    r7673 r7681  
    106106                    $frame['function'] = !isset($frame['function']) ? '' : $frame['function']; 
    107107                    $frame['line']     = !isset($frame['line'])     ? '' : $frame['line']; 
    108                     $this->_displayLine("#$i: $frame[class]$frame[type]$frame[function] $frame[line]"); 
     108                    $this->_displayLine("#$i: {$frame['class']}{$frame['type']}{$frame['function']}{$frame['line']}"); 
    109109                } 
    110110            } 
  • trunk/library/PEAR/PEAR/Installer.php

    r5146 r7681  
    236236 
    237237            if ((bool) $os->matchSignature($platform) === $negate) { 
    238                 $this->log(3, "skipped $file (meant for $atts[platform], we are ".$os->getSignature().")"); 
     238                $this->log(3, "skipped $file (meant for {$atts['platform']}, we are ".$os->getSignature().")"); 
    239239                return PEAR_INSTALLER_SKIPPED; 
    240240            } 
     
    264264                break; 
    265265            default: 
    266                 return $this->raiseError("Invalid role `$atts[role]' for file $file"); 
     266                return $this->raiseError("Invalid role '{$atts['role']}' for file $file"); 
    267267        } 
    268268 
     
    354354                    if ($a['type'] == 'php-const') { 
    355355                        if (preg_match('/^[a-z0-9_]+\\z/i', $a['to'])) { 
    356                             eval("\$to = $a[to];"); 
     356                            eval("\$to = {$a['to']};"); 
    357357                        } else { 
    358358                            if (!isset($options['soft'])) { 
    359                                 $this->log(0, "invalid php-const replacement: $a[to]"); 
     359                                $this->log(0, "invalid php-const replacement: {$a['to']}"); 
    360360                            } 
    361361                            continue; 
     
    374374                        if (is_null($to)) { 
    375375                            if (!isset($options['soft'])) { 
    376                                 $this->log(0, "invalid pear-config replacement: $a[to]"); 
     376                                $this->log(0, "invalid pear-config replacement: {$a['to']}"); 
    377377                            } 
    378378                            continue; 
     
    383383                        } else { 
    384384                            if (!isset($options['soft'])) { 
    385                                 $this->log(0, "invalid package-info replacement: $a[to]"); 
     385                                $this->log(0, "invalid package-info replacement: {$a['to']}"); 
    386386                            } 
    387387                            continue; 
     
    15861586                } 
    15871587 
    1588                 $this->log(3, "+ cp $ext[file] $copyto"); 
     1588                $this->log(3, "+ cp {$ext['file']} $copyto"); 
    15891589                $this->addFileOperation('rename', array($ext['file'], $copyto)); 
    15901590                if (!OS_WINDOWS) { 
  • trunk/library/PEAR/PEAR/PackageFile/Generator/v1.php

    r5146 r7681  
    204204" <name>$pkginfo[package]</name>"; 
    205205        if (isset($pkginfo['extends'])) { 
    206             $ret .= "\n<extends>$pkginfo[extends]</extends>"; 
     206            $ret .= "\n<extends>{$pkginfo['extends']}</extends>"; 
    207207        } 
    208208        $ret .= 
     
    251251        $ret = "$indent <release>\n"; 
    252252        if (!empty($pkginfo['version'])) { 
    253             $ret .= "$indent  <version>$pkginfo[version]</version>\n"; 
     253            $ret .= "$indent  <version>{$pkginfo['version']}</version>\n"; 
    254254        } 
    255255        if (!empty($pkginfo['release_date'])) { 
    256             $ret .= "$indent  <date>$pkginfo[release_date]</date>\n"; 
     256            $ret .= "$indent  <date>{$pkginfo['release_date']}</date>\n"; 
    257257        } 
    258258        if (!empty($pkginfo['release_license'])) { 
    259             $ret .= "$indent  <license>$pkginfo[release_license]</license>\n"; 
     259            $ret .= "$indent  <license>{$pkginfo['release_license']}</license>\n"; 
    260260        } 
    261261        if (!empty($pkginfo['release_state'])) { 
    262             $ret .= "$indent  <state>$pkginfo[release_state]</state>\n"; 
     262            $ret .= "$indent  <state>{$pkginfo['release_state']}</state>\n"; 
    263263        } 
    264264        if (!empty($pkginfo['release_notes'])) { 
     
    272272            $ret .= "$indent  <deps>\n"; 
    273273            foreach ($pkginfo['release_deps'] as $dep) { 
    274                 $ret .= "$indent   <dep type=\"$dep[type]\" rel=\"$dep[rel]\""; 
     274                $ret .= "$indent   <dep type=\"{$dep['type']}\" rel=\"{$dep['rel']}\""; 
    275275                if (isset($dep['version'])) { 
    276                     $ret .= " version=\"$dep[version]\""; 
     276                    $ret .= " version=\"{$dep['version']}\""; 
    277277                } 
    278278                if (isset($dep['optional'])) { 
    279                     $ret .= " optional=\"$dep[optional]\""; 
     279                    $ret .= " optional=\"{$dep['optional']}\""; 
    280280                } 
    281281                if (isset($dep['name'])) { 
    282                     $ret .= ">$dep[name]</dep>\n"; 
     282                    $ret .= ">{$dep['name']}</dep>\n"; 
    283283                } else { 
    284284                    $ret .= "/>\n"; 
     
    302302        if (isset($pkginfo['provides'])) { 
    303303            foreach ($pkginfo['provides'] as $key => $what) { 
    304                 $ret .= "$indent  <provides type=\"$what[type]\" "; 
    305                 $ret .= "name=\"$what[name]\" "; 
     304                $ret .= "$indent  <provides type=\"{$what['type']}\" "; 
     305                $ret .= "name=\"{$what['name']}\" "; 
    306306                if (isset($what['extends'])) { 
    307                     $ret .= "extends=\"$what[extends]\" "; 
     307                    $ret .= "extends=\"{$what['extends']}\" "; 
    308308                } 
    309309                $ret .= "/>\n"; 
     
    319319                        $fa['role'] = ''; 
    320320                    } 
    321                     $ret .= "$indent   <file role=\"$fa[role]\""; 
     321                    $ret .= "$indent   <file role=\"{$fa['role']}\""; 
    322322                    if (isset($fa['baseinstalldir'])) { 
    323323                        $ret .= ' baseinstalldir="' . 
     
    325325                    } 
    326326                    if (isset($fa['md5sum'])) { 
    327                         $ret .= " md5sum=\"$fa[md5sum]\""; 
     327                        $ret .= " md5sum=\"{$fa['md5sum']}\""; 
    328328                    } 
    329329                    if (isset($fa['platform'])) { 
    330                         $ret .= " platform=\"$fa[platform]\""; 
     330                        $ret .= " platform=\"{$fa['platform']}\""; 
    331331                    } 
    332332                    if (!empty($fa['install-as'])) { 
     
    427427    function _formatFile($file, $attributes, $indent) 
    428428    { 
    429         $ret = "$indent   <file role=\"$attributes[role]\""; 
     429        $ret = "$indent   <file role=\"{$attributes['role']}\""; 
    430430        if (isset($attributes['baseinstalldir'])) { 
    431431            $ret .= ' baseinstalldir="' . 
     
    433433        } 
    434434        if (isset($attributes['md5sum'])) { 
    435             $ret .= " md5sum=\"$attributes[md5sum]\""; 
     435            $ret .= " md5sum=\"{$attributes['md5sum']}\""; 
    436436        } 
    437437        if (isset($attributes['platform'])) { 
    438             $ret .= " platform=\"$attributes[platform]\""; 
     438            $ret .= " platform=\"{$attributes['platform']}\""; 
    439439        } 
    440440        if (!empty($attributes['install-as'])) { 
  • trunk/library/PEAR/PEAR/PackageFile/Parser/v1.php

    r5146 r7681  
    269269                } 
    270270                $attribs['explicit'] = true; 
    271                 $this->_packageInfo['provides']["$attribs[type];$attribs[name]"] = $attribs; 
     271                $this->_packageInfo['provides']["{$attribs['type']};{$attribs['name']}"] = $attribs; 
    272272                break; 
    273273            case 'package' : 
  • trunk/library/PEAR/PEAR/REST.php

    r5146 r7681  
    377377 
    378378            if (isset($lastmodified['ETag'])) { 
    379                 $ifmodifiedsince .= "If-None-Match: $lastmodified[ETag]\r\n"; 
     379                $ifmodifiedsince .= "If-None-Match: {$lastmodified['ETag']}\r\n"; 
    380380            } 
    381381        } else { 
  • trunk/library/PEAR/PEAR/Task/Replace.php

    r5146 r7681  
    124124                        $to = $chan->getServer(); 
    125125                    } else { 
    126                         $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); 
     126                        $this->logger->log(0, "$dest: invalid pear-config replacement: {$a['to']}"); 
    127127                        return false; 
    128128                    } 
     
    140140                } 
    141141                if (is_null($to)) { 
    142                     $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); 
     142                    $this->logger->log(0, "$dest: invalid pear-config replacement: {$a['to']}"); 
    143143                    return false; 
    144144                } 
     
    150150                    $to = constant($a['to']); 
    151151                } else { 
    152                     $this->logger->log(0, "$dest: invalid php-const replacement: $a[to]"); 
     152                    $this->logger->log(0, "$dest: invalid php-const replacement: {$a['to']}"); 
    153153                    return false; 
    154154                } 
     
    157157                    $to = $t; 
    158158                } else { 
    159                     $this->logger->log(0, "$dest: invalid package-info replacement: $a[to]"); 
     159                    $this->logger->log(0, "$dest: invalid package-info replacement: {$a['to']}"); 
    160160                    return false; 
    161161                } 
Note: See TracChangeset for help on using the changeset viewer.