Completed
Push — master ( e8e851...71a8c4 )
by BENOIT
06:28
created

ShhException::throwFromLastOpenSSLError()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 1
nop 1
1
<?php
2
3
namespace BenTools\Shh;
4
5
final class ShhException extends \RuntimeException
6
{
7
    /**
8
     * @param string $defaultMessage
9
     */
10
    public static function throwFromLastOpenSSLError(string $defaultMessage = 'Unexpected OpenSSL Exception')
11
    {
12
        throw new self(\openssl_error_string() ?: $defaultMessage);
13
    }
14
}
15