MediaWiki master
License.php
Go to the documentation of this file.
1<?php
16class License {
17 public string $template;
18 public string $text;
19
20 public function __construct( string $str ) {
21 $str = $this->parse( $str );
22 [ $this->template, $this->text ] = $this->split( $str );
23 }
24
29 protected function parse( $str ) {
30 return $str;
31 }
32
37 protected function split( $str ) {
38 [ $text, $template ] = explode( '|', strrev( $str ), 2 );
39 return [ strrev( $template ), strrev( $text ) ];
40 }
41}
A License class for use on Special:Upload (represents a single type of license).
Definition License.php:16
split( $str)
Definition License.php:37
string $template
Definition License.php:17
__construct(string $str)
Definition License.php:20
parse( $str)
Definition License.php:29
string $text
Definition License.php:18