• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / ocsp / 3931153084

pending completion
3931153084

push

github

GitHub
Merge pull request #10 from mlocati/phpseclib3

15 of 15 new or added lines in 3 files covered. (100.0%)

452 of 677 relevant lines covered (66.77%)

1.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/Service/Math.php
1
<?php
2

3
namespace Ocsp\Service;
4

5
final class Math
6
{
7
    private static $bigIntegerClass = '';
8

9
    /**
10
     * Set the name of the class for new BigInteger instances
11
     *
12
     * @param string|null $className can be 'phpseclib3\Math\BigInteger' or 'phpseclib\Math\BigInteger'. If an empty string (or NULL) is passed, we'll detect it automatically
13
     */
14
    public static function setBigIntegerClass($className)
15
    {
16
        self::$bigIntegerClass = (string) $className;
×
17
    }
18

19
    public static function getBigIntegerClass()
20
    {
21
        if (self::$bigIntegerClass === '') {
3✔
22
            self::$bigIntegerClass = 'phpseclib3\Math\BigInteger';
1✔
23
            if (!class_exists(self::$bigIntegerClass)) {
1✔
24
                self::$bigIntegerClass = 'phpseclib\Math\BigInteger';
×
25
            }
26
        }
27
        return self::$bigIntegerClass;
3✔
28
    }
29

30
    /**
31
     * @param string|int|resource|\phpseclib3\Math\BigInteger\Engines\Engine $x
32
     * @param int $base
33
     *
34
     * @return \phpseclib\Math\BigInteger|\phpseclib3\Math\BigInteger
35
     */
36
    public static function createBigInteger($x, $base = 10)
37
    {
38
        $class = self::getBigIntegerClass();
3✔
39

40
        return new $class($x, $base);
3✔
41
    }
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc