Skip to content

Commit 54cad84

Browse files
thiemowmdeKrinkle
authored andcommitted
Move property initialization up and add missing docs
Some simple clean-ups that don't change how the code behaves. Change-Id: I849c9c822ce39f27cc91b32e2881059c629adc88
1 parent aae3ebe commit 54cad84

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Reader/DBA.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
class DBA extends Reader {
2828
/**
29-
* The file handle
29+
* @var resource|false|null The file handle
3030
*/
3131
protected $handle;
3232

src/Writer/PHP.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@
3030
*/
3131
class PHP extends Writer {
3232
/**
33-
* The file handle
33+
* @var resource|false|null The file handle
3434
*/
3535
protected $handle;
3636

37-
protected $hplist;
37+
/** @var int[][] */
38+
protected $hplist = [];
3839

39-
protected $numentries;
40+
/** @var int */
41+
protected $numentries = 0;
4042

43+
/** @var int */
4144
protected $pos;
4245

4346
/**
@@ -53,8 +56,6 @@ public function __construct( string $fileName ) {
5356
$this->throwException(
5457
'Unable to open CDB file "' . $this->tmpFileName . '" for write.' );
5558
}
56-
$this->hplist = [];
57-
$this->numentries = 0;
5859
$this->pos = 2048; // leaving space for the pointer array, 256 * 8
5960
if ( fseek( $this->handle, $this->pos ) == -1 ) {
6061
$this->throwException( 'fseek failed in file "' . $this->tmpFileName . '".' );

0 commit comments

Comments
 (0)