[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-doc
Subject: [PEAR-DOC] cvs: peardoc /en/chapters standards.xml
From: "Christian Weiske" <cweiske () php ! net>
Date: 2007-10-26 22:52:18
Message-ID: cvscweiske1193439138 () cvsserver
[Download RAW message or body]
cweiske Fri Oct 26 22:52:18 2007 UTC
Modified files:
/peardoc/en/chapters standards.xml
Log:
Fix bug #11718: "Coding Standards" variance
Make CS document comply to CS...
http://cvs.php.net/viewvc.cgi/peardoc/en/chapters/standards.xml?r1=1.54&r2=1.55&diff_format=u
Index: peardoc/en/chapters/standards.xml
diff -u peardoc/en/chapters/standards.xml:1.54 peardoc/en/chapters/standards.xml:1.55
--- peardoc/en/chapters/standards.xml:1.54 Fri Sep 7 07:21:59 2007
+++ peardoc/en/chapters/standards.xml Fri Oct 26 22:52:18 2007
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1" ?>
-<!-- $Revision: 1.54 $ -->
+<!-- $Revision: 1.55 $ -->
<chapter id="standards">
<title>Coding Standards</title>
@@ -900,7 +900,8 @@
* @throws Example_Datasource_Exception when it can't connect
* to specified DSN.
*/
-function connectDB($dsn) {
+function connectDB($dsn)
+{
$this->db =& DB::connect($dsn);
if (DB::isError($this->db)) {
throw new Example_Datasource_Exception(
@@ -934,16 +935,17 @@
* in the configuration.
*/
-function connect(Config $conf) {
+function connect(Config $conf)
+{
$dsns =& $conf->searchPath(array('config', 'db'));
if ($dsns === FALSE) throw new Example_Config_Exception(
'Unable to find config/db section in configuration.'
);
$dsns =& $dsns->toArray();
-
+
foreach($dsns as $dsn) {
- try {
+ try {
$this->connectDB($dsn);
return;
} catch (Example_Datasource_Exception e) {
@@ -980,7 +982,8 @@
* is invalid, it will set the configuration to the default config.
*
*/
-function loadConfig(Config $conf) {
+function loadConfig(Config $conf)
+{
try {
$this->config = $conf->parse();
} catch (Config_Parse_Exception e) {
@@ -1066,7 +1069,8 @@
<title />
<programlisting role="php">
<![CDATA[
-function divide($x, $y) {
+function divide($x, $y)
+{
if ($y == 0) {
throw new Example_Aritmetic_Exception('Division by zero');
}
@@ -1092,7 +1096,8 @@
*
* @throws Example_Datasource_Exception when it can't connect to specified DSN.
*/
-function connectDB($dsn) {
+function connectDB($dsn)
+{
$this->db =& DB::connect($dsn);
if (DB::isError($this->db)) {
throw new Example_Datasource_Exception(
@@ -1118,7 +1123,8 @@
<programlisting role="php">
<![CDATA[
-function preTaxPrice($retailPrice, $taxRate) {
+function preTaxPrice($retailPrice, $taxRate)
+{
try {
return $this->divide($retailPrice, 1 + $taxRate);
} catch (Example_Aritmetic_Exception e) {
@@ -1134,7 +1140,8 @@
<programlisting role="php">
<![CDATA[
-function preTaxPrice($retailPrice, $taxRate) {
+function preTaxPrice($retailPrice, $taxRate)
+{
return $this->divide($retailPrice, 1 + $taxRate);
}
]]>
@@ -1193,12 +1200,13 @@
* Recursively search a tree for string.
* @throws ResultException
*/
-public function search(TreeNode $node, $data) {
+public function search(TreeNode $node, $data)
+{
if ($node->data === $data) {
- throw new ResultException( $node );
+ throw new ResultException( $node );
} else {
- search( $node->leftChild, $data );
- search( $node->rightChild, $data );
+ search( $node->leftChild, $data );
+ search( $node->rightChild, $data );
}
}
]]>
--
PEAR Documentation List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic