Skip to content

Commit e6f4844

Browse files
committed
docs: Clean up file headers
* Move license header to very top of the file as other Wikimedia projects do. This makes the top consistently ignorable, which is not the case if e.g. namespace and imports are above it. * Remove file-level docs for files that only contain one class. These docs are basically inaccessible in the Doxygen output, as they don't appear on the class page. Merge them into the class-level docs instead. * Remove `@file` for files that only contain a single class, they are not useful in the Doxgen navigation as they are just empty pages with a link to a single class (and tend to add noise to the in-doc search results). * Add `@copyright` above the license so that the header doesn't get indexed as the description of namespaces etc. When a given intermediary namespace like "Cdb\Writer" doesn't have its own doc block, then whichever file first declares it will have the comment above it used as its description, which added lots of "This program is free software …" to the doc index. Change-Id: I9f72da338522f29fd2aada054ae4e41ec8af369b
1 parent 5674772 commit e6f4844

File tree

10 files changed

+61
-98
lines changed

10 files changed

+61
-98
lines changed

src/Exception.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
<?php
2-
3-
namespace Cdb;
4-
52
/**
3+
* @copyright
64
* This program is free software; you can redistribute it and/or modify
75
* it under the terms of the GNU General Public License as published by
86
* the Free Software Foundation; either version 2 of the License, or
@@ -17,10 +15,10 @@
1715
* with this program; if not, write to the Free Software Foundation, Inc.,
1816
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1917
* http://www.gnu.org/copyleft/gpl.html
20-
*
21-
* @file
2218
*/
2319

20+
namespace Cdb;
21+
2422
/**
2523
* Exception for Cdb errors.
2624
*/

src/Reader.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?php
2-
3-
namespace Cdb;
4-
52
/**
6-
* Native CDB file reader and writer.
7-
*
3+
* @copyright
84
* This program is free software; you can redistribute it and/or modify
95
* it under the terms of the GNU General Public License as published by
106
* the Free Software Foundation; either version 2 of the License, or
@@ -19,14 +15,15 @@
1915
* with this program; if not, write to the Free Software Foundation, Inc.,
2016
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2117
* http://www.gnu.org/copyleft/gpl.html
22-
*
23-
* @file
2418
*/
2519

20+
namespace Cdb;
21+
2622
/**
27-
* Read from a CDB file.
28-
* Native and pure PHP implementations are provided.
29-
* http://cr.yp.to/cdb.html
23+
* Read data from a CDB file.
24+
* Native C and pure PHP implementations are provided.
25+
*
26+
* @see http://cr.yp.to/cdb.html
3027
*/
3128
abstract class Reader {
3229
/**

src/Reader/DBA.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?php
2-
3-
namespace Cdb\Reader;
4-
5-
use Cdb\Exception;
6-
use Cdb\Reader;
7-
82
/**
9-
* DBA-based CDB reader/writer
10-
*
3+
* @copyright
114
* This program is free software; you can redistribute it and/or modify
125
* it under the terms of the GNU General Public License as published by
136
* the Free Software Foundation; either version 2 of the License, or
@@ -22,12 +15,15 @@
2215
* with this program; if not, write to the Free Software Foundation, Inc.,
2316
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2417
* http://www.gnu.org/copyleft/gpl.html
25-
*
26-
* @file
2718
*/
2819

20+
namespace Cdb\Reader;
21+
22+
use Cdb\Exception;
23+
use Cdb\Reader;
24+
2925
/**
30-
* Reader class which uses the DBA extension
26+
* Reader class which uses the DBA extension (php-dba)
3127
*/
3228
class DBA extends Reader {
3329
public function __construct( $fileName ) {

src/Reader/Hash.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?php
2-
3-
namespace Cdb\Reader;
4-
5-
use Cdb\Reader;
6-
72
/**
8-
* Hash implements the CdbReader interface based on an associative
9-
* PHP array (a.k.a "hash").
10-
*
3+
* @copyright
114
* This program is free software; you can redistribute it and/or modify
125
* it under the terms of the GNU General Public License as published by
136
* the Free Software Foundation; either version 2 of the License, or
@@ -22,10 +15,12 @@
2215
* with this program; if not, write to the Free Software Foundation, Inc.,
2316
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2417
* http://www.gnu.org/copyleft/gpl.html
25-
*
26-
* @file
2718
*/
2819

20+
namespace Cdb\Reader;
21+
22+
use Cdb\Reader;
23+
2924
/**
3025
* Hash implements the CdbReader interface based on an associative
3126
* PHP array (a.k.a "hash").

src/Reader/PHP.php

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
<?php
2-
3-
namespace Cdb\Reader;
4-
5-
use Cdb\Exception;
6-
use Cdb\Reader;
7-
use Cdb\Util;
8-
92
/**
10-
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
11-
* appears in PHP 5.3.
12-
*
3+
* @copyright
134
* This program is free software; you can redistribute it and/or modify
145
* it under the terms of the GNU General Public License as published by
156
* the Free Software Foundation; either version 2 of the License, or
@@ -24,12 +15,19 @@
2415
* with this program; if not, write to the Free Software Foundation, Inc.,
2516
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2617
* http://www.gnu.org/copyleft/gpl.html
27-
*
28-
* @file
2918
*/
3019

20+
namespace Cdb\Reader;
21+
22+
use Cdb\Exception;
23+
use Cdb\Reader;
24+
use Cdb\Util;
25+
3126
/**
3227
* CDB reader class
28+
*
29+
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
30+
* appears in PHP 5.3.
3331
*/
3432
class PHP extends Reader {
3533

src/Util.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
<?php
2-
3-
namespace Cdb;
4-
52
/**
6-
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
7-
* appears in PHP 5.3. Changes are:
8-
* * Error returns replaced with exceptions
9-
* * Exception thrown if sizes or offsets are between 2GB and 4GB
10-
* * Some variables renamed
11-
*
3+
* @copyright
124
* This program is free software; you can redistribute it and/or modify
135
* it under the terms of the GNU General Public License as published by
146
* the Free Software Foundation; either version 2 of the License, or
@@ -23,12 +15,15 @@
2315
* with this program; if not, write to the Free Software Foundation, Inc.,
2416
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2517
* http://www.gnu.org/copyleft/gpl.html
26-
*
27-
* @file
2818
*/
2919

20+
namespace Cdb;
21+
3022
/**
3123
* Common functions for readers and writers
24+
*
25+
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
26+
* appears in PHP 5.3.
3227
*/
3328
class Util {
3429
/**

src/Writer.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?php
2-
3-
namespace Cdb;
4-
52
/**
6-
* Native CDB file reader and writer.
7-
*
3+
* @copyright
84
* This program is free software; you can redistribute it and/or modify
95
* it under the terms of the GNU General Public License as published by
106
* the Free Software Foundation; either version 2 of the License, or
@@ -19,14 +15,15 @@
1915
* with this program; if not, write to the Free Software Foundation, Inc.,
2016
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2117
* http://www.gnu.org/copyleft/gpl.html
22-
*
23-
* @file
2418
*/
2519

20+
namespace Cdb;
21+
2622
/**
2723
* Write to a CDB file.
28-
* Native and pure PHP implementations are provided.
29-
* http://cr.yp.to/cdb.html
24+
* Native C and pure PHP implementations are provided.
25+
*
26+
* @see http://cr.yp.to/cdb.html
3027
*/
3128
abstract class Writer {
3229
/**

src/Writer/DBA.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
<?php
2-
3-
namespace Cdb\Writer;
4-
5-
use Cdb\Exception;
6-
use Cdb\Writer;
7-
82
/**
9-
* DBA-based CDB reader/writer
10-
*
3+
* @copyright
114
* This program is free software; you can redistribute it and/or modify
125
* it under the terms of the GNU General Public License as published by
136
* the Free Software Foundation; either version 2 of the License, or
@@ -22,12 +15,15 @@
2215
* with this program; if not, write to the Free Software Foundation, Inc.,
2316
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2417
* http://www.gnu.org/copyleft/gpl.html
25-
*
26-
* @file
2718
*/
2819

20+
namespace Cdb\Writer;
21+
22+
use Cdb\Exception;
23+
use Cdb\Writer;
24+
2925
/**
30-
* Writer class which uses the DBA extension
26+
* Writer class which uses the DBA extension (php-dba)
3127
*/
3228
class DBA extends Writer {
3329
/**

src/Writer/PHP.php

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
<?php
2-
3-
namespace Cdb\Writer;
4-
5-
use Cdb\Exception;
6-
use Cdb\Util;
7-
use Cdb\Writer;
8-
92
/**
10-
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
11-
* appears in PHP 5.3. Changes are:
12-
* * Error returns replaced with exceptions
13-
* * Exception thrown if sizes or offsets are between 2GB and 4GB
14-
* * Some variables renamed
15-
*
3+
* @copyright
164
* This program is free software; you can redistribute it and/or modify
175
* it under the terms of the GNU General Public License as published by
186
* the Free Software Foundation; either version 2 of the License, or
@@ -27,12 +15,19 @@
2715
* with this program; if not, write to the Free Software Foundation, Inc.,
2816
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2917
* http://www.gnu.org/copyleft/gpl.html
30-
*
31-
* @file
3218
*/
3319

20+
namespace Cdb\Writer;
21+
22+
use Cdb\Exception;
23+
use Cdb\Util;
24+
use Cdb\Writer;
25+
3426
/**
3527
* CDB writer class
28+
*
29+
* This is a port of D.J. Bernstein's CDB to PHP. It's based on the copy that
30+
* appears in PHP 5.3.
3631
*/
3732
class PHP extends Writer {
3833
protected $hplist;

tests/CdbTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
<?php
2-
32
namespace Cdb\Test;
43

54
use Cdb\Reader;
65
use Cdb\Writer;
76

8-
/**
9-
* Test the CDB reader/writer
10-
*/
117
class CdbTest extends \PHPUnit\Framework\TestCase {
128
/** @var string */
139
private $phpCdbFile, $dbaCdbFile;

0 commit comments

Comments
 (0)