cvs: pear /PEAR_PackageFileManager/PackageFileManager Cvs.php File.php Perforce.php Svn.php

From: Date: Sat, 14 Oct 2006 11:18:19 +0000
Subject: cvs: pear /PEAR_PackageFileManager/PackageFileManager Cvs.php File.php Perforce.php Svn.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-42542@lists.php.net to get a copy of this message
farell Sat Oct 14 11:18:19 2006 UTC Modified files: /pear/PEAR_PackageFileManager/PackageFileManager Cvs.php File.php Perforce.php Svn.php Log: apply more CS detected by PHP_CodeSniffer 0.2.0

http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php?r1=1.13&r2=1.14&diff_format=u Index: pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php diff -u pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php:1.13 pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php:1.14 --- pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php:1.13 Sun Apr 23 07:46:17 2006 +++ pear/PEAR_PackageFileManager/PackageFileManager/Cvs.php Sat Oct 14 11:18:19 2006 @@ -14,7 +14,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 2003-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Cvs.php,v 1.13 2006/04/23 07:46:17 farell Exp $ + * @version CVS: $Id: Cvs.php,v 1.14 2006/10/14 11:18:19 farell Exp $ * @link http://pear.php.net/package/PEAR_PackageFileManager * @since File available since Release 0.1 */ @@ -105,7 +105,7 @@ $this->ignore = array(false, false); $this->_setupIgnore($ignore, 1); $this->_setupIgnore($include, 0); - foreach($entries as $cvsentry) { + foreach ($entries as $cvsentry) { $directory = @dirname(@dirname($cvsentry)); if (!$directory) { continue; @@ -114,7 +114,7 @@ if (!is_array($d)) { continue; } - foreach($d as $entry) { + foreach ($d as $entry) { if ($ignore) { if ($this->_checkIgnore($this->_getCVSFileName($entry), $directory . '/' . $this->_getCVSFileName($entry), 1)) { http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/PackageFileManager/File.php?r1=1.26&r2=1.27&diff_format=u Index: pear/PEAR_PackageFileManager/PackageFileManager/File.php diff -u pear/PEAR_PackageFileManager/PackageFileManager/File.php:1.26 pear/PEAR_PackageFileManager/PackageFileManager/File.php:1.27 --- pear/PEAR_PackageFileManager/PackageFileManager/File.php:1.26 Sat Apr 22 16:33:43 2006 +++ pear/PEAR_PackageFileManager/PackageFileManager/File.php Sat Oct 14 11:18:19 2006 @@ -14,7 +14,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 2003-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: File.php,v 1.26 2006/04/22 16:33:43 farell Exp $ + * @version CVS: $Id: File.php,v 1.27 2006/10/14 11:18:19 farell Exp $ * @link http://pear.php.net/package/PEAR_PackageFileManager * @since File available since Release 0.1 */ @@ -105,7 +105,7 @@ substr($package_directory, 0, strlen($package_directory) - 1)); } $struc = array(); - foreach($allfiles as $file) { + foreach ($allfiles as $file) { $path = substr(dirname($file), strlen(str_replace(DIRECTORY_SEPARATOR, '/', realpath($package_directory))) + 1); @@ -127,8 +127,8 @@ return PEAR_PackageFileManager::raiseError(PEAR_PACKAGEFILEMANAGER_IGNORED_EVERYTHING, substr($package_directory, 0, strlen($package_directory) - 1), $newig); } - uksort($struc,'strnatcasecmp'); - foreach($struc as $key => $ind) { + uksort($struc, 'strnatcasecmp'); + foreach ($struc as $key => $ind) { usort($ind, array($this, 'sortfiles')); $struc[$key] = $ind; } @@ -139,11 +139,10 @@ } $struc = array('/' => $tempstruc['/']); $bv = 0; - foreach($tempstruc as $key => $ind) { + foreach ($tempstruc as $key => $ind) { $save = $key; - if ($key != '/') - { - $struc['/'] = $this->_setupDirs($struc['/'], explode('/',$key), $tempstruc[$key]); + if ($key != '/') { + $struc['/'] = $this->_setupDirs($struc['/'], explode('/', $key), $tempstruc[$key]); } } uksort($struc['/'], array($this, 'mystrucsort')); @@ -167,7 +166,7 @@ if (@is_dir($directory)) { $ret = array(); $d = @dir($directory); // thanks to Jason E Sweat (jsweat@users.sourceforge.net) for fix - while($d && false !== ($entry=$d->read())) { + while ($d && false !== ($entry = $d->read())) { if ($this->_testFile($directory, $entry)) { if (is_file($directory . '/' . $entry)) { // if include option was set, then only pass included files @@ -187,7 +186,7 @@ if (is_dir($directory . '/' . $entry)) { $tmp = $this->dirList($directory . '/' . $entry); if (is_array($tmp)) { - foreach($tmp as $ent) { + foreach ($tmp as $ent) { $ret[] = $ent; } } @@ -240,11 +239,11 @@ $path = realpath($path); } if (is_array($this->ignore[$return])) { - foreach($this->ignore[$return] as $match) { + foreach ($this->ignore[$return] as $match) { // match is an array if the ignore parameter was a /path/to/pattern if (is_array($match)) { // check to see if the path matches with a path delimiter appended - preg_match('/^' . strtoupper($match[0]).'$/', strtoupper($path) . '/',$find); + preg_match('/^' . strtoupper($match[0]).'$/', strtoupper($path) . '/', $find); if (!count($find)) { // check to see if it matches without an appended path delimiter preg_match('/^' . strtoupper($match[0]).'$/', strtoupper($path), $find); @@ -291,9 +290,9 @@ { $ig = array(); if (is_array($ignore)) { - for($i=0; $i<count($ignore);$i++) { + for ($i=0; $i<count($ignore);$i++) { $ignore[$i] = strtr($ignore[$i], "\\", "/"); - $ignore[$i] = str_replace('//','/',$ignore[$i]); + $ignore[$i] = str_replace('//', '/', $ignore[$i]); if (!empty($ignore[$i])) { if (!is_numeric(strpos($ignore[$i], '/'))) { @@ -330,8 +329,8 @@ $y = '\\\\'; } $s = str_replace('/', DIRECTORY_SEPARATOR, $s); - $x = strtr($s, array('?' => '.','*' => '.*','.' => '\\.','\\' => '\\\\','/' => '\\/', - '[' => '\\[',']' => '\\]','-' => '\\-')); + $x = strtr($s, array('?' => '.', '*' => '.*', '.' => '\\.', '\\' => '\\\\', '/' => '\\/', + '[' => '\\[', ']' => '\\]', '-' => '\\-')); if (strpos($s, DIRECTORY_SEPARATOR) !== false && strrpos($s, DIRECTORY_SEPARATOR) === strlen($s) - 1) { $x = "(?:.*$y$x?.*|$x.*)"; @@ -355,7 +354,7 @@ function _setupDirs($struc, $dir, $contents) { if (!count($dir)) { - foreach($contents as $dir => $files) { + foreach ($contents as $dir => $files) { if (is_string($dir)) { if (strpos($dir, '/')) { $test = true; @@ -391,7 +390,7 @@ */ function _setDir($dir, $contents) { - while(list($one,$two) = each($contents)) { + while (list($one,$two) = each($contents)) { if (isset($dir[$one])) { $dir[$one] = $this->_setDir($dir[$one], $contents[$one]); } else { @@ -409,20 +408,19 @@ */ function sortfiles($a, $b) { - return strnatcasecmp($a['file'],$b['file']); + return strnatcasecmp($a['file'], $b['file']); } function mystrucsort($a, $b) { if (is_numeric($a) && is_string($b)) return 1; if (is_numeric($b) && is_string($a)) return -1; - if (is_numeric($a) && is_numeric($b)) - { + if (is_numeric($a) && is_numeric($b)) { if ($a > $b) return 1; if ($a < $b) return -1; if ($a == $b) return 0; } - return strnatcasecmp($a,$b); + return strnatcasecmp($a, $b); } /**#@-*/ } http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php?r1=1.4&r2=1.5&diff_format=u Index: pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php diff -u pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php:1.4 pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php:1.5 --- pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php:1.4 Sat Apr 22 16:38:54 2006 +++ pear/PEAR_PackageFileManager/PackageFileManager/Perforce.php Sat Oct 14 11:18:19 2006 @@ -14,7 +14,7 @@ * @author Jon Parise <jon@php.net> * @copyright 2005-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Perforce.php,v 1.4 2006/04/22 16:38:54 farell Exp $ + * @version CVS: $Id: Perforce.php,v 1.5 2006/10/14 11:18:19 farell Exp $ * @link http://pear.php.net/package/PEAR_PackageFileManager * @since File available since Release 1.3.0 */ @@ -53,8 +53,7 @@ { /* Return an error if the directory does not exist. */ if (@is_dir($directory) === false) { - return $this->_parent->raiseError( - PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST, + return $this->_parent->raiseError(PEAR_PACKAGEFILEMANAGER_DIR_DOESNT_EXIST, $directory); } http://cvs.php.net/viewvc.cgi/pear/PEAR_PackageFileManager/PackageFileManager/Svn.php?r1=1.6&r2=1.7&diff_format=u Index: pear/PEAR_PackageFileManager/PackageFileManager/Svn.php diff -u pear/PEAR_PackageFileManager/PackageFileManager/Svn.php:1.6 pear/PEAR_PackageFileManager/PackageFileManager/Svn.php:1.7 --- pear/PEAR_PackageFileManager/PackageFileManager/Svn.php:1.6 Thu May 4 05:47:35 2006 +++ pear/PEAR_PackageFileManager/PackageFileManager/Svn.php Sat Oct 14 11:18:19 2006 @@ -14,7 +14,7 @@ * @author Arnaud Limbourg <arnaud@limbourg.com> * @copyright 2005-2006 The PHP Group * @license http://www.php.net/license/3_01.txt PHP License 3.01 - * @version CVS: $Id: Svn.php,v 1.6 2006/05/04 05:47:35 farell Exp $ + * @version CVS: $Id: Svn.php,v 1.7 2006/10/14 11:18:19 farell Exp $ * @link http://pear.php.net/package/PEAR_PackageFileManager * @since File available since Release 1.3.0 */ @@ -112,7 +112,7 @@ $this->ignore = array(false, false); $this->_setupIgnore($ignore, 1); $this->_setupIgnore($include, 0); - foreach($entries as $cvsentry) { + foreach ($entries as $cvsentry) { $directory = @dirname(@dirname($cvsentry)); if (!$directory) { continue; @@ -121,7 +121,7 @@ if (!is_array($d)) { continue; } - foreach($d as $entry) { + foreach ($d as $entry) { if ($ignore) { if ($this->_checkIgnore($entry, $directory . '/' . $entry, 1)) {
« previous php.pear.cvs (#42542) next »