spriebsch Mon Apr 20 16:57:32 2009 UTC Modified files: /phpruntests/src rtAutoload.php rtDirectoryList.php rtPhptFilterIterator.php rtText.php rtUtil.php Log: Reformatted to conform to PEAR coding standard. http://cvs.php.net/viewvc.cgi/phpruntests/src/rtAutoload.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/rtAutoload.php diff -u phpruntests/src/rtAutoload.php:1.1.1.1 phpruntests/src/rtAutoload.php:1.2 --- phpruntests/src/rtAutoload.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/rtAutoload.php Mon Apr 20 16:57:31 2009 @@ -8,55 +8,52 @@ */ class rtAutoload { - /** - * @var array - */ - protected static $classMap; - - /** - * @var string - */ - protected static $classPath; - - - /** - * Initialize the autoloader - * - * @return null - */ - public static function init() - { - self::$classPath = dirname(__FILE__); + /** + * @var array + */ + protected static $classMap; + + /** + * @var string + */ + protected static $classPath; + + /** + * Initialize the autoloader + * + * @return null + */ + public static function init() + { + self::$classPath = dirname(__FILE__); + + if (substr(self::$classPath, -1) != '/') { + self::$classPath .= '/'; + } + + if (file_exists(self::$classPath . 'rtClassMap.php')) { + include self::$classPath . 'rtClassMap.php'; + self::$classMap = $rtClassMap; + } + + if (function_exists('__autoload')) { + spl_autoload_register('__autoload'); + } - if (substr(self::$classPath, -1) != '/') { - self::$classPath .= '/'; + spl_autoload_register(array('rtAutoload', 'autoload')); } - if (file_exists(self::$classPath . 'rtClassMap.php')) { - include self::$classPath . 'rtClassMap.php'; - self::$classMap = $rtClassMap; + /** + * Autoload method + * + * @param string $class Class name to autoload + * @return null + */ + public static function autoload($class) + { + if (isset(self::$classMap[$class])) { + include self::$classPath . self::$classMap[$class]; + } } - - if (function_exists('__autoload')) { - spl_autoload_register('__autoload'); - } - - spl_autoload_register(array('rtAutoload', 'autoload')); - } - - - /** - * Autoload method - * - * @param string $class Class name to autoload - * @return null - */ - public static function autoload($class) - { - if (isset(self::$classMap[$class])) { - include self::$classPath . self::$classMap[$class]; - } - } } - ?> http://cvs.php.net/viewvc.cgi/phpruntests/src/rtDirectoryList.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/rtDirectoryList.php diff -u phpruntests/src/rtDirectoryList.php:1.1.1.1 phpruntests/src/rtDirectoryList.php:1.2 --- phpruntests/src/rtDirectoryList.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/rtDirectoryList.php Mon Apr 20 16:57:31 2009 @@ -1,29 +1,27 @@ <?php - /** * Lists all of the directories under a top level directory. * This is currently not used for anything * */ -class rtDirectoryList { - - +class rtDirectoryList +{ /** * Finds a list of subdirectories under the top level ditectory and returns the full path names in an array * * @param string $topDirectory * @return array */ - public function getSubDirectoryPaths($topDirectory) { - $result = array($topDirectory); - - foreach(new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($topDirectory)), 1) as $dir) { - $result[] = $dir->getPathName(); - } - return $result; + public function getSubDirectoryPaths($topDirectory) + { + $result = array($topDirectory); + + foreach (new RecursiveIteratorIterator(new ParentIterator(new RecursiveDirectoryIterator($topDirectory)), 1) as $dir) { + $result[] = $dir->getPathName(); + } + + return $result; } - - } -?> \ No newline at end of file +?> http://cvs.php.net/viewvc.cgi/phpruntests/src/rtPhptFilterIterator.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/rtPhptFilterIterator.php diff -u phpruntests/src/rtPhptFilterIterator.php:1.1.1.1 phpruntests/src/rtPhptFilterIterator.php:1.2 --- phpruntests/src/rtPhptFilterIterator.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/rtPhptFilterIterator.php Mon Apr 20 16:57:31 2009 @@ -1,11 +1,13 @@ <?php - +/** + * + */ class rtPhptFilterIterator extends FilterIterator - { +{ public function accept() { - return (substr($this->current(), -strlen('.phpt')) == '.phpt'); + return substr($this->current(), -strlen('.phpt')) == '.phpt'; } - } -?> \ No newline at end of file +} +?> http://cvs.php.net/viewvc.cgi/phpruntests/src/rtText.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/rtText.php diff -u phpruntests/src/rtText.php:1.1.1.1 phpruntests/src/rtText.php:1.2 --- phpruntests/src/rtText.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/rtText.php Mon Apr 20 16:57:31 2009 @@ -1,17 +1,19 @@ <?php - class rtText - { +/** + * + */ +class rtText +{ public static function get($name) { - $filename = dirname(__FILE__) . '/texts/' . $name . '.txt'; + $filename = dirname(__FILE__) . '/texts/' . $name . '.txt'; - if (!file_exists($filename)) { - throw new LogicException('The text ' . $name . ' does not exist'); - } + if (!file_exists($filename)) { + throw new LogicException('The text ' . $name . ' does not exist'); + } - return file_get_contents($filename); + return file_get_contents($filename); } - } - +} ?> http://cvs.php.net/viewvc.cgi/phpruntests/src/rtUtil.php?r1=1.1.1.1&r2=1.2&diff_format=u Index: phpruntests/src/rtUtil.php diff -u phpruntests/src/rtUtil.php:1.1.1.1 phpruntests/src/rtUtil.php:1.2 --- phpruntests/src/rtUtil.php:1.1.1.1 Wed Apr 15 16:30:18 2009 +++ phpruntests/src/rtUtil.php Mon Apr 20 16:57:31 2009 @@ -1,37 +1,38 @@ <?php -class rtUtil { - public static function getTestList($aDirectory) - { - $result = array(); - - foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $item) +/** + * + */ +class rtUtil +{ + public static function getTestList($aDirectory) { - $result[] = $item->getPathname(); - } + $result = array(); - return $result; - } + foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $item) { + $result[] = $item->getPathname(); + } - /** - * Returns a list of subdirectories (including the current directory) if they contatin .phpt files - * Directory names are full paths and are not terminated with a / - * There should be a cleaner way to do this - * - * @param path $aDirectory - * @return array - */ - public static function getDirectoryList($aDirectory) - { - $result = array(); + return $result; + } - foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $directory) + /** + * Returns a list of subdirectories (including the current directory) if they contatin .phpt files + * Directory names are full paths and are not terminated with a / + * There should be a cleaner way to do this + * + * @param path $aDirectory + * @return array + */ + public static function getDirectoryList($aDirectory) { - $result[] = $directory->getPath()."/"; - } + $result = array(); - return array_unique($result); - } + foreach (new rtPhptFilterIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($aDirectory))) as $directory) { + $result[] = $directory->getPath() . "/"; + } + return array_unique($result); + } } -?> \ No newline at end of file +?>
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php