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 ) ];
}
}