From: Kunal Mehta Date: Thu, 29 Jan 2015 05:28:56 +0000 (-0800) Subject: ReplacementArray: Set explicit visiblity on functions X-Git-Tag: 1.31.0-rc.0~12568 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=5a2277d7199b577451bc5a5215d58a0186673089;p=lhc%2Fweb%2Fwiklou.git ReplacementArray: Set explicit visiblity on functions Also add a type-hint Change-Id: I78a322dfa11a71e22a3d0b7064b808aec6bfbf83 --- diff --git a/includes/libs/ReplacementArray.php b/includes/libs/ReplacementArray.php index 8c8c0101c4..7fdb309383 100644 --- a/includes/libs/ReplacementArray.php +++ b/includes/libs/ReplacementArray.php @@ -31,18 +31,18 @@ class ReplacementArray { * The array should have the same form as the replacement array for strtr() * @param array $data */ - function __construct( $data = array() ) { + public function __construct( $data = array() ) { $this->data = $data; } /** * @return array */ - function __sleep() { + public function __sleep() { return array( 'data' ); } - function __wakeup() { + public function __wakeup() { $this->fss = false; } @@ -50,7 +50,7 @@ class ReplacementArray { * Set the whole replacement array at once * @param array $data */ - function setArray( $data ) { + public function setArray( $data ) { $this->data = $data; $this->fss = false; } @@ -58,7 +58,7 @@ class ReplacementArray { /** * @return array|bool */ - function getArray() { + public function getArray() { return $this->data; } @@ -67,7 +67,7 @@ class ReplacementArray { * @param string $from * @param string $to */ - function setPair( $from, $to ) { + public function setPair( $from, $to ) { $this->data[$from] = $to; $this->fss = false; } @@ -75,7 +75,7 @@ class ReplacementArray { /** * @param array $data */ - function mergeArray( $data ) { + public function mergeArray( $data ) { $this->data = array_merge( $this->data, $data ); $this->fss = false; } @@ -83,7 +83,7 @@ class ReplacementArray { /** * @param ReplacementArray $other */ - function merge( $other ) { + public function merge( ReplacementArray $other ) { $this->data = array_merge( $this->data, $other->data ); $this->fss = false; } @@ -91,7 +91,7 @@ class ReplacementArray { /** * @param string $from */ - function removePair( $from ) { + public function removePair( $from ) { unset( $this->data[$from] ); $this->fss = false; } @@ -99,7 +99,7 @@ class ReplacementArray { /** * @param array $data */ - function removeArray( $data ) { + public function removeArray( $data ) { foreach ( $data as $from => $to ) { $this->removePair( $from ); } @@ -110,7 +110,7 @@ class ReplacementArray { * @param string $subject * @return string */ - function replace( $subject ) { + public function replace( $subject ) { if ( function_exists( 'fss_prep_replace' ) ) { if ( $this->fss === false ) { $this->fss = fss_prep_replace( $this->data );