MediaWiki  1.23.2
ComposerVersionNormalizer.php
Go to the documentation of this file.
1 <?php
2 
8 
23  public function normalizeSuffix( $version ) {
24  if ( !is_string( $version ) ) {
25  throw new InvalidArgumentException( '$version must be a string' );
26  }
27 
28  return preg_replace( '/^(\d[\d\.]*)([a-zA-Z]+)(\d*)$/', '$1-$2$3', $version, 1 );
29  }
30 
46  public function normalizeLevelCount( $version ) {
47  if ( !is_string( $version ) ) {
48  throw new InvalidArgumentException( '$version must be a string' );
49  }
50 
51  $dashPosition = strpos( $version, '-' );
52 
53  if ( $dashPosition !== false ) {
54  $suffix = substr( $version, $dashPosition );
55  $version = substr( $version, 0, $dashPosition );
56  }
57 
58  $version = implode( '.', array_pad( explode( '.', $version ), 4, '0' ) );
59 
60  if ( $dashPosition !== false ) {
61  $version .= $suffix;
62  }
63 
64  return $version;
65  }
66 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ComposerVersionNormalizer\normalizeLevelCount
normalizeLevelCount( $version)
Ensures the version has four levels.
Definition: ComposerVersionNormalizer.php:46
$version
$version
Definition: parserTests.php:86
ComposerVersionNormalizer\normalizeSuffix
normalizeSuffix( $version)
Ensures there is a dash in between the version and the stability suffix.
Definition: ComposerVersionNormalizer.php:23
ComposerVersionNormalizer
@licence GNU GPL v2+
Definition: ComposerVersionNormalizer.php:7