Skip to content

Commit eb87ca3

Browse files
committed
Change method names identical to class names to __construct. (Stops deprecated warnings in PHP7)
1 parent 51bb37e commit eb87ca3

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/gettext.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function readintarray($count) {
9898
* @param object Reader the StreamReader object
9999
* @param boolean enable_cache Enable or disable caching of strings (default on)
100100
*/
101-
function gettext_reader($Reader, $enable_cache = true) {
101+
function __construct($Reader, $enable_cache = true) {
102102
// If there isn't a StreamReader, turn on short circuit mode.
103103
if (! $Reader || isset($Reader->error) ) {
104104
$this->short_circuit = true;

src/streams.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class StringReader {
4949
var $_pos;
5050
var $_str;
5151

52-
function StringReader($str='') {
52+
function __construct($str='') {
5353
$this->_str = $str;
5454
$this->_pos = 0;
5555
}
@@ -86,7 +86,7 @@ class FileReader {
8686
var $_fd;
8787
var $_length;
8888

89-
function FileReader($filename) {
89+
function __construct($filename) {
9090
if (file_exists($filename)) {
9191

9292
$this->_length=filesize($filename);
@@ -143,7 +143,7 @@ function close() {
143143
// Preloads entire file in memory first, then creates a StringReader
144144
// over it (it assumes knowledge of StringReader internals)
145145
class CachedFileReader extends StringReader {
146-
function CachedFileReader($filename) {
146+
function __construct($filename) {
147147
if (file_exists($filename)) {
148148

149149
$length=filesize($filename);

0 commit comments

Comments
 (0)