GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( c609dc...4389c4 )
by Samuel
02:09
created

ErrorLog   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
B logDeprecated() 0 34 1
A log() 0 3 1
1
<?php declare (strict_types=1);
2
/**
3
 * @license MIT
4
 * @author Samuel Adeshina <[email protected]>
5
 *
6
 * This file is part of the EmmetBlue project, please read the license document
7
 * available in the root level of the project
8
 */
9
namespace EmmetBlue\Core\Logger;
10
11
use EmmetBlue\Core\Builder\BuilderFactory as Builder;
12
use EmmetBlue\Core\Factory\DatabaseConnectionFactory as DBConnectionFactory;
13
use EmmetBlue\Core\Builder\QueryBuilder\QueryBuilder as QB;
14
use EmmetBlue\Core\Exception\SQLException;
15
16
/**
17
 * Class ErrorLog
18
 *
19
 * @author Samuel Adeshina <[email protected]>
20
 *
21
 * @since v0.0.1 08/06/2016 14:20
22
 */
23
class ErrorLog implements LogInterface
24
{
25
    public static function logDeprecated(int $databaseUserId, string $errorNumber, string $errorSeverity, string $errorMessage, string $errorObject=null)
0 ignored issues
show
Unused Code introduced by
The parameter $errorObject is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
26
    {
27
        /**
28
         * For now I am not doing anything with $errorObject yet.
29
         *
30
         * As soon as it can be properly serialized for the MSSQL Server db
31
         * it shall be saved in the database.
32
         *
33
         * FUNNY: I'M GONNA INTENTIONALLY LEAVE THIS COMMIT FOR MY AMUSEMENT
34
         * $errorObject, wasn't the issue. My DB schema was.
35
         */
36
        $insertBuilder = (new Builder("QueryBuilder", "Insert"))->getBuilder();
37
38
        $insertBuilder
39
            ->into('
40
                [Logs].[ErrorLog]
41
                (
42
                    ErrorTime,
43
                    DatabaseUserId,
44
                    ErrorNumber,
45
                    ErrorSeverity,
46
                    ErrorMessage
47
                )
48
            ')
49
            ->values([
50
                'GETDATE()',
51
                $databaseUserId,
52
                QB::wrapString($errorNumber, "'"),
53
                QB::wrapString($errorSeverity, "'"),
54
                QB::wrapString($errorMessage, "'")
55
            ]);
56
            
57
        DBConnectionFactory::getConnection()->query((string)$insertBuilder);
58
    }
59
60
    public static function log(int $databaseUserId, string $errorNumber, string $errorSeverity, string $errorMessage, string $errorObject=null) {
0 ignored issues
show
Unused Code introduced by
The parameter $databaseUserId is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $errorNumber is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $errorSeverity is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $errorMessage is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $errorObject is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
61
62
    }
63
}
64