Issues (3)

src/Support/QRCode.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace PragmaRX\Google2FA\Support;
4
5
trait QRCode
6
{
7
    /**
8
     * Creates a QR code url.
9
     *
10
     * @param string $company
11
     * @param string $holder
12
     * @param string $secret
13
     *
14
     * @return string
15
     */
16
    public function getQRCodeUrl($company, $holder, $secret)
17
    {
18
        return 'otpauth://totp/' .
19
            rawurlencode($company) .
20
            ':' .
21
            rawurlencode($holder) .
22
            '?secret=' .
23
            $secret .
24
            '&issuer=' .
25
            rawurlencode($company) .
26
            '&algorithm=' .
27
            rawurlencode(strtoupper($this->getAlgorithm())) .
0 ignored issues
show
It seems like getAlgorithm() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
            rawurlencode(strtoupper($this->/** @scrutinizer ignore-call */ getAlgorithm())) .
Loading history...
28
            '&digits=' .
29
            rawurlencode(strtoupper((string) $this->getOneTimePasswordLength())) .
0 ignored issues
show
It seems like getOneTimePasswordLength() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

29
            rawurlencode(strtoupper((string) $this->/** @scrutinizer ignore-call */ getOneTimePasswordLength())) .
Loading history...
30
            '&period=' .
31
            rawurlencode(strtoupper((string) $this->getKeyRegeneration())) .
0 ignored issues
show
It seems like getKeyRegeneration() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
            rawurlencode(strtoupper((string) $this->/** @scrutinizer ignore-call */ getKeyRegeneration())) .
Loading history...
32
            '';
33
    }
34
}
35