Skip to content

Commit

Permalink
Fixing trailing commas and a documentation bug
Browse files Browse the repository at this point in the history
Trailing commas aren't allowed when calling a constructor, as is the code causes a parse error.  Also fixing a variable name to match the example above.
  • Loading branch information
jklein committed Apr 24, 2014
1 parent 60e47f4 commit d6b1fd3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ $connections->setDefault(function () {
return new ExtendedPdo(
'mysql:host=default.db.localhost;dbname=database',
'username',
'password',
'password'
);
});
?>
Expand All @@ -371,7 +371,7 @@ $connections->setWrite('master', function () {
return new ExtendedPdo(
'mysql:host=master.db.localhost;dbname=database',
'username',
'password',
'password'
);
});

Expand All @@ -380,7 +380,7 @@ $connections->setRead('slave1', function () {
return new ExtendedPdo(
'mysql:host=slave1.db.localhost;dbname=database',
'username',
'password',
'password'
);
});

Expand All @@ -389,7 +389,7 @@ $connections->setRead('slave2', function () {
return new ExtendedPdo(
'mysql:host=slave2.db.localhost;dbname=database',
'username',
'password',
'password'
);
});

Expand All @@ -398,7 +398,7 @@ $connections->setRead('slave3', function () {
return new ExtendedPdo(
'mysql:host=slave3.db.localhost;dbname=database',
'username',
'password',
'password'
);
});
?>
Expand All @@ -419,7 +419,7 @@ create the connection (if needed) and then return it.

```php
<?php
$read = $connection->getRead();
$read = $connections->getRead();
$results = $read->fetchAll('SELECT * FROM table_name LIMIT 10');
?>
```
Expand All @@ -439,7 +439,7 @@ $default = function () {
return new ExtendedPdo(
'mysql:host=default.db.localhost;dbname=database',
'username',
'password',
'password'
);
};

Expand All @@ -449,21 +449,21 @@ $read = array(
return new ExtendedPdo(
'mysql:host=slave1.db.localhost;dbname=database',
'username',
'password',
'password'
);
},
'slave2' => function () {
return new ExtendedPdo(
'mysql:host=slave2.db.localhost;dbname=database',
'username',
'password',
'password'
);
},
'slave3' => function () {
return new ExtendedPdo(
'mysql:host=slave3.db.localhost;dbname=database',
'username',
'password',
'password'
);
},
);
Expand All @@ -474,7 +474,7 @@ $write = array(
return new ExtendedPdo(
'mysql:host=master.db.localhost;dbname=database',
'username',
'password',
'password'
);
},
);
Expand Down

0 comments on commit d6b1fd3

Please sign in to comment.