X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2Fhelpers%2FLicense.php;h=fbd801d06e5e26721914fa57f3327ab7d3842c00;hb=4051e45504a0da71718bb46f51b0dab1ea65c7fe;hp=4f94b4d232b292421fd9be09ff11eed09eba954c;hpb=3df3b575c6617df64ec98533cc7141bd2314e274;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/helpers/License.php b/includes/specials/helpers/License.php index 4f94b4d232..fbd801d06e 100644 --- a/includes/specials/helpers/License.php +++ b/includes/specials/helpers/License.php @@ -21,7 +21,7 @@ * @ingroup SpecialPage * @author Ævar Arnfjörð Bjarmason * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason - * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later + * @license GPL-2.0-or-later */ /** @@ -35,12 +35,27 @@ class License { public $text; /** - * @param string $str License name?? + * @param string $str */ - function __construct( $str ) { - list( $text, $template ) = explode( '|', strrev( $str ), 2 ); + public function __construct( $str ) { + $str = $this->parse( $str ); + list( $this->template, $this->text ) = $this->split( $str ); + } - $this->template = strrev( $template ); - $this->text = strrev( $text ); + /** + * @param string $str + * @return string + */ + protected function parse( $str ) { + return $str; + } + + /** + * @param string $str + * @return string[] Array with [template, text] + */ + protected function split( $str ) { + list( $text, $template ) = explode( '|', strrev( $str ), 2 ); + return [ strrev( $template ), strrev( $text ) ]; } }