Skip to content

Commit d107e1c

Browse files
authored
Merge pull request #13 from jr-cologne/jr_fix-#12
Fix #12
2 parents 5e545a1 + adb980a commit d107e1c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jr-cologne/db-class",
33
"type": "library",
4-
"version": "2.1.0",
4+
"version": "2.1.1",
55
"description": "A simple database class with PHP, PDO and a query builder.",
66
"keywords": [
77
"database",
@@ -19,7 +19,7 @@
1919
}
2020
},
2121
"homepage": "https://github.com/jr-cologne/db-class",
22-
"time": "2017-11-10",
22+
"time": "2017-11-11",
2323
"license": "MIT",
2424
"authors": [
2525
{
@@ -31,7 +31,7 @@
3131
],
3232
"support": {
3333
"issues": "https://github.com/jr-cologne/db-class/issues",
34-
"source": "https://github.com/jr-cologne/db-class/tree/v2.1.0",
34+
"source": "https://github.com/jr-cologne/db-class/tree/v2.1.1",
3535
"docs": "https://github.com/jr-cologne/db-class/blob/README.md"
3636
}
3737
}

src/API.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ Returns the first record given in DB::results.
270270

271271
On success: `array` (default) or other type based on `PDO::FETCH_MODE`
272272

273+
If not existing: `null`
274+
273275
On failure: `boolean` false
274276

275277

src/DB.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author JR Cologne <[email protected]>
1414
* @copyright 2017 JR Cologne
1515
* @license https://github.com/jr-cologne/db-class/blob/master/LICENSE MIT
16-
* @version v2.1.0
16+
* @version v2.1.1
1717
* @link https://github.com/jr-cologne/db-class GitHub Repository
1818
* @link https://packagist.org/packages/jr-cologne/db-class Packagist site
1919
*
@@ -212,11 +212,11 @@ protected function all() {
212212
/**
213213
* Returns the first record given in DB::results.
214214
*
215-
* @return mixed on success: array (default), based on PDO::FETCH_MODE, on failure: boolean false
215+
* @return mixed on success: array (default), based on PDO::FETCH_MODE, if not existing: null, on failure: boolean false
216216
*/
217217
protected function first() {
218218
if (!$this->query_failed) {
219-
return $this->results[0];
219+
return isset($this->results[0]) ? $this->results[0] : null;
220220
}
221221

222222
return false;

src/Exceptions/UnsupportedKeywordException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author JR Cologne <[email protected]>
1414
* @copyright 2017 JR Cologne
1515
* @license https://github.com/jr-cologne/db-class/blob/master/LICENSE MIT
16-
* @version v2.1.0
16+
* @version v2.1.1
1717
* @link https://github.com/jr-cologne/db-class GitHub Repository
1818
* @link https://packagist.org/packages/jr-cologne/db-class Packagist site
1919
*

src/QueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* @author JR Cologne <[email protected]>
1414
* @copyright 2017 JR Cologne
1515
* @license https://github.com/jr-cologne/db-class/blob/master/LICENSE MIT
16-
* @version v2.1.0
16+
* @version v2.1.1
1717
* @link https://github.com/jr-cologne/db-class GitHub Repository
1818
* @link https://packagist.org/packages/jr-cologne/db-class Packagist site
1919
*

0 commit comments

Comments
 (0)