Skip to content

Commit

Permalink
Merge pull request #2 from tech10/master
Browse files Browse the repository at this point in the history
Change method names identical to class names to __construct. (Stops deprecated warnings in PHP7)
  • Loading branch information
smmoosavi committed Sep 15, 2015
2 parents 51bb37e + eb87ca3 commit 0e339ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/gettext.php
Expand Up @@ -98,7 +98,7 @@ function readintarray($count) {
* @param object Reader the StreamReader object
* @param boolean enable_cache Enable or disable caching of strings (default on)
*/
function gettext_reader($Reader, $enable_cache = true) {
function __construct($Reader, $enable_cache = true) {
// If there isn't a StreamReader, turn on short circuit mode.
if (! $Reader || isset($Reader->error) ) {
$this->short_circuit = true;
Expand Down
6 changes: 3 additions & 3 deletions src/streams.php
Expand Up @@ -49,7 +49,7 @@ class StringReader {
var $_pos;
var $_str;

function StringReader($str='') {
function __construct($str='') {
$this->_str = $str;
$this->_pos = 0;
}
Expand Down Expand Up @@ -86,7 +86,7 @@ class FileReader {
var $_fd;
var $_length;

function FileReader($filename) {
function __construct($filename) {
if (file_exists($filename)) {

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

$length=filesize($filename);
Expand Down

0 comments on commit 0e339ee

Please sign in to comment.