MySQLANSIDatabase::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * MySQL connector class.
4
 * @package sapphire
5
 * @subpackage model
6
 */
7
class MySQLANSIDatabase extends MySQLDatabase
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
8
{
9
    /**
10
     * Connection to the DBMS.
11
     * @var resource
12
     */
13
    private $dbConn;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $dbConn is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
14
15
    /**
16
     * True if we are connected to a database.
17
     * @var boolean
18
     */
19
    private $active;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $active is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
20
21
    /**
22
     * The name of the database.
23
     * @var string
24
     */
25
    private $database;
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $database is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
26
27
    /**
28
     * Connect to a MySQL database.
29
     * @param array $parameters An map of parameters, which should include:
30
     *  - server: The server, eg, localhost
31
     *  - username: The username to log on with
32
     *  - password: The password to log on with
33
     *  - database: The database to connect to
34
     */
35
    public function __construct($parameters)
36
    {
37
        parent::__construct($parameters);
38
        $this->query("SET sql_mode = 'ANSI'");
39
    }
40
}
41