Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
7 / 7
MaxLag
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
4
100.00% covered (success)
100.00%
7 / 7
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 validateValue
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 getValue
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
namespace MediaWiki\Extension\WikibaseManifest;
use InvalidArgumentException;
class MaxLag {
    /**
     * @var mixed the max_lag value
     */
    private $value;
    /**
     * @param mixed $value
     */
    public function __construct( $value ) {
        $this->validateValue( $value );
        $this->value = $value;
    }
    private function validateValue( $value ): void {
        if ( !is_int( $value ) ) {
            throw new InvalidArgumentException( 'The max_lag value must be an integer number.' );
        }
    }
    public function getValue(): int {
        return $this->value;
    }
}