Completed
Pull Request — test (#1)
by Temitope
02:52
created
src/Exceptions/NoRecordDeletionException.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 
11 11
 class NoRecordDeletionException extends Exception
12 12
 {
13
-    public static function create($message)
14
-    {
15
-        return new static($message);
16
-    }
13
+	public static function create($message)
14
+	{
15
+		return new static($message);
16
+	}
17 17
 }
Please login to merge, or discard this patch.
src/Exceptions/NoRecordInsertionException.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 
11 11
 class NoRecordInsertionException extends Exception
12 12
 {
13
-    public static function create($mesaage)
14
-    {
15
-        return new static($mesaage);
16
-    }
13
+	public static function create($mesaage)
14
+	{
15
+		return new static($mesaage);
16
+	}
17 17
 }
Please login to merge, or discard this patch.
src/Interface/InterfaceBaseClass.php 1 patch
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -8,39 +8,39 @@
 block discarded – undo
8 8
 
9 9
 interface InterfaceBaseClass
10 10
 {
11
-    /**
12
-     * This method gets all the record from a particular table.
13
-     *
14
-     * @params void
15
-     *
16
-     * @return associative array
17
-     */
18
-    public static function getAll();
11
+	/**
12
+	 * This method gets all the record from a particular table.
13
+	 *
14
+	 * @params void
15
+	 *
16
+	 * @return associative array
17
+	 */
18
+	public static function getAll();
19 19
 
20
-    /**
21
-     * This method create or update record in a database table.
22
-     *
23
-     * @params void
24
-     *
25
-     * @return bool true or false;
26
-     */
27
-    public function save();
20
+	/**
21
+	 * This method create or update record in a database table.
22
+	 *
23
+	 * @params void
24
+	 *
25
+	 * @return bool true or false;
26
+	 */
27
+	public function save();
28 28
 
29
-    /**
30
-     * This method delete a row from the table by the row id.
31
-     *
32
-     * @params int $id
33
-     *
34
-     * @return bool true or false
35
-     */
36
-    public static function destroy($id);
29
+	/**
30
+	 * This method delete a row from the table by the row id.
31
+	 *
32
+	 * @params int $id
33
+	 *
34
+	 * @return bool true or false
35
+	 */
36
+	public static function destroy($id);
37 37
 
38
-    /**
39
-     * This method find a record by id.
40
-     *
41
-     * @params int $id
42
-     *
43
-     * @return object find
44
-     */
45
-    public static function find($id);
38
+	/**
39
+	 * This method find a record by id.
40
+	 *
41
+	 * @params int $id
42
+	 *
43
+	 * @return object find
44
+	 */
45
+	public static function find($id);
46 46
 }
Please login to merge, or discard this patch.
src/Database/DatabaseHelper.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,33 +8,33 @@
 block discarded – undo
8 8
 
9 9
 class DatabaseHelper
10 10
 {
11
-    public $dbConn;
11
+	public $dbConn;
12 12
 
13
-    /**
14
-     * This is a constructor; a default method  that will be called automatically during class instantiation.
15
-     */
16
-    public function __construct($dbConnect)
17
-    {
18
-        $this->dbConn = $dbConnect;
19
-    }
13
+	/**
14
+	 * This is a constructor; a default method  that will be called automatically during class instantiation.
15
+	 */
16
+	public function __construct($dbConnect)
17
+	{
18
+		$this->dbConn = $dbConnect;
19
+	}
20 20
 
21
-    /**
22
-     * This method creates a particular table.
23
-     *
24
-     * @param tableName
25
-     * $return boolean true or false
26
-     */
27
-    public function createTable($tableName, $conn = null)
28
-    {
29
-        if (is_null($conn)) {
30
-            $conn = $this->dbConn;
31
-        }
21
+	/**
22
+	 * This method creates a particular table.
23
+	 *
24
+	 * @param tableName
25
+	 * $return boolean true or false
26
+	 */
27
+	public function createTable($tableName, $conn = null)
28
+	{
29
+		if (is_null($conn)) {
30
+			$conn = $this->dbConn;
31
+		}
32 32
 
33
-        $sql = 'CREATE TABLE IF NOT EXISTS '.$tableName.'(';
34
-        $sql .= ' id INT( 11 ) AUTO_INCREMENT PRIMARY KEY, name VARCHAR( 100 ), gender VARCHAR( 10 ), alias VARCHAR( 150 ) NOT NULL, class VARCHAR( 150 ), stack VARCHAR( 50 ) )';
33
+		$sql = 'CREATE TABLE IF NOT EXISTS '.$tableName.'(';
34
+		$sql .= ' id INT( 11 ) AUTO_INCREMENT PRIMARY KEY, name VARCHAR( 100 ), gender VARCHAR( 10 ), alias VARCHAR( 150 ) NOT NULL, class VARCHAR( 150 ), stack VARCHAR( 50 ) )';
35 35
 
36
-        return $conn->exec($sql);
36
+		return $conn->exec($sql);
37 37
 
38
-        throw TableNotCreatedException::create('Check your database connection');
39
-    }
38
+		throw TableNotCreatedException::create('Check your database connection');
39
+	}
40 40
 }
Please login to merge, or discard this patch.
src/Database/DatabaseConnection.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -12,71 +12,71 @@
 block discarded – undo
12 12
 
13 13
 class DatabaseConnection extends PDO
14 14
 {
15
-    private $databaseName;
16
-    private $databaseHost;
17
-    private $databaseDriver;
18
-    private $databaseUsername;
19
-    private $databasePassword;
15
+	private $databaseName;
16
+	private $databaseHost;
17
+	private $databaseDriver;
18
+	private $databaseUsername;
19
+	private $databasePassword;
20 20
 
21
-    public function __construct()
22
-    {
23
-        $this->loadEnv(); // load the environment variables
21
+	public function __construct()
22
+	{
23
+		$this->loadEnv(); // load the environment variables
24 24
 
25
-        $this->databaseName = getenv('databaseName');
26
-        $this->databaseHost = getenv('databaseHost');
27
-        $this->databaseDriver = getenv('databaseDriver');
28
-        $this->databaseUsername = getenv('databaseUsername');
29
-        $this->databasePassword = getenv('databasePassword');
25
+		$this->databaseName = getenv('databaseName');
26
+		$this->databaseHost = getenv('databaseHost');
27
+		$this->databaseDriver = getenv('databaseDriver');
28
+		$this->databaseUsername = getenv('databaseUsername');
29
+		$this->databasePassword = getenv('databasePassword');
30 30
 
31
-        try {
32
-            $options = [
33
-                PDO::ATTR_PERSISTENT => true,
34
-                PDO::ATTR_ERRMODE    => PDO::ERRMODE_EXCEPTION,
35
-            ];
31
+		try {
32
+			$options = [
33
+				PDO::ATTR_PERSISTENT => true,
34
+				PDO::ATTR_ERRMODE    => PDO::ERRMODE_EXCEPTION,
35
+			];
36 36
 
37
-            parent::__construct($this->getDatabaseDriver(), $this->databaseUsername, $this->databasePassword, $options);
38
-        } catch (PDOException $e) {
39
-            return $e->getMessage();
40
-        }
41
-    }
37
+			parent::__construct($this->getDatabaseDriver(), $this->databaseUsername, $this->databasePassword, $options);
38
+		} catch (PDOException $e) {
39
+			return $e->getMessage();
40
+		}
41
+	}
42 42
 
43
-     /**
44
-      * This method determines the driver to be used for appropriate database server.
45
-      *
46
-      * @params void
47
-      *
48
-      * @return string dsn
49
-      */
50
-     public function getDatabaseDriver()
51
-     {
52
-         $dsn = '';
43
+	 /**
44
+	  * This method determines the driver to be used for appropriate database server.
45
+	  *
46
+	  * @params void
47
+	  *
48
+	  * @return string dsn
49
+	  */
50
+	 public function getDatabaseDriver()
51
+	 {
52
+		 $dsn = '';
53 53
 
54
-         switch ($this->databaseDriver) {
55
-            case 'mysql':
56
-                $dsn = 'mysql:host='.$this->databaseHost.';dbname='.$this->databaseName; // Set DSN
57
-                break;
58
-            case 'sqlite':
59
-                $dsn = 'sqlite:host='.$this->databaseHost.';dbname='.$this->databaseName;
60
-                break;
61
-            case 'pgsql':
62
-                $dsn = 'pgsqlsql:host='.$this->databaseHost.';dbname='.$this->databaseName;
63
-                break;
64
-            default:
65
-                $dsn = 'mysql:host='.$this->databaseHost.';dbname='.$this->databaseName;
66
-                break;
67
-        }
54
+		 switch ($this->databaseDriver) {
55
+			case 'mysql':
56
+				$dsn = 'mysql:host='.$this->databaseHost.';dbname='.$this->databaseName; // Set DSN
57
+				break;
58
+			case 'sqlite':
59
+				$dsn = 'sqlite:host='.$this->databaseHost.';dbname='.$this->databaseName;
60
+				break;
61
+			case 'pgsql':
62
+				$dsn = 'pgsqlsql:host='.$this->databaseHost.';dbname='.$this->databaseName;
63
+				break;
64
+			default:
65
+				$dsn = 'mysql:host='.$this->databaseHost.';dbname='.$this->databaseName;
66
+				break;
67
+		}
68 68
 
69
-         return $dsn;
70
-     }
69
+		 return $dsn;
70
+	 }
71 71
 
72
-     /**
73
-      * Load Dotenv to grant getenv() access to environment variables in .env file.
74
-      */
75
-     public function loadEnv()
76
-     {
77
-         if (!getenv('APP_ENV')) {
78
-             $dotenv = new Dotenv(__DIR__.'/../../');
79
-             $dotenv->load();
80
-         }
81
-     }
72
+	 /**
73
+	  * Load Dotenv to grant getenv() access to environment variables in .env file.
74
+	  */
75
+	 public function loadEnv()
76
+	 {
77
+		 if (!getenv('APP_ENV')) {
78
+			 $dotenv = new Dotenv(__DIR__.'/../../');
79
+			 $dotenv->load();
80
+		 }
81
+	 }
82 82
 }
Please login to merge, or discard this patch.
src/Helper/Inflector.php 2 patches
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -37,62 +37,62 @@
 block discarded – undo
37 37
 
38 38
 trait Inflector
39 39
 {
40
-    /**
41
-     * Pluralizes English nouns.
42
-     *
43
-     * @static
44
-     *
45
-     * @param string $word English noun to pluralize
46
-     *
47
-     * @return string Plural noun
48
-     */
49
-    public static function pluralize($word)
50
-    {
51
-        $plural = [
52
-            '/(quiz)$/i'                     => '$1zes',
53
-            '/^(ox)$/i'                      => '$1en',
54
-            '/([m|l])ouse$/i'                => '$1ice',
55
-            '/(matr|vert|ind)ix|ex$/i'       => '$1ices',
56
-            '/(x|ch|ss|sh)$/i'               => '$1es',
57
-            '/([^aeiouy]|qu)y$/i'            => '$1ies',
58
-            '/(hive)$/i'                     => '$1s',
59
-            '/(?:([^f])fe|([lr])f)$/i'       => '$1$2ves',
60
-            '/(shea|lea|loa|thie)f$/i'       => '$1ves',
61
-            '/sis$/i'                        => 'ses',
62
-            '/([ti])um$/i'                   => '$1a',
63
-            '/(tomat|potat|ech|her|vet)o$/i' => '$1oes',
64
-            '/(bu)s$/i'                      => '$1ses',
65
-            '/(alias)$/i'                    => '$1es',
66
-            '/(octop)us$/i'                  => '$1i',
67
-            '/(ax|test)is$/i'                => '$1es',
68
-            '/(us)$/i'                       => '$1es',
69
-            '/s$/i'                          => 's',
70
-            '/$/'                            => 's',
71
-        ];
72
-        $uncountable = ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'];
73
-        $irregular = [
74
-            'person' => 'people',
75
-            'man'    => 'men',
76
-            'child'  => 'children',
77
-            'sex'    => 'sexes',
78
-            'move'   => 'moves', ];
79
-        $lowercased_word = strtolower($word);
80
-        foreach ($uncountable as $_uncountable) {
81
-            if (substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable) {
82
-                return $word;
83
-            }
84
-        }
85
-        foreach ($irregular as $_plural => $_singular) {
86
-            if (preg_match('/('.$_plural.')$/i', $word, $arr)) {
87
-                return preg_replace('/('.$_plural.')$/i', substr($arr[0], 0, 1).substr($_singular, 1), $word);
88
-            }
89
-        }
90
-        foreach ($plural as $rule => $replacement) {
91
-            if (preg_match($rule, $word)) {
92
-                return preg_replace($rule, $replacement, $word);
93
-            }
94
-        }
40
+	/**
41
+	 * Pluralizes English nouns.
42
+	 *
43
+	 * @static
44
+	 *
45
+	 * @param string $word English noun to pluralize
46
+	 *
47
+	 * @return string Plural noun
48
+	 */
49
+	public static function pluralize($word)
50
+	{
51
+		$plural = [
52
+			'/(quiz)$/i'                     => '$1zes',
53
+			'/^(ox)$/i'                      => '$1en',
54
+			'/([m|l])ouse$/i'                => '$1ice',
55
+			'/(matr|vert|ind)ix|ex$/i'       => '$1ices',
56
+			'/(x|ch|ss|sh)$/i'               => '$1es',
57
+			'/([^aeiouy]|qu)y$/i'            => '$1ies',
58
+			'/(hive)$/i'                     => '$1s',
59
+			'/(?:([^f])fe|([lr])f)$/i'       => '$1$2ves',
60
+			'/(shea|lea|loa|thie)f$/i'       => '$1ves',
61
+			'/sis$/i'                        => 'ses',
62
+			'/([ti])um$/i'                   => '$1a',
63
+			'/(tomat|potat|ech|her|vet)o$/i' => '$1oes',
64
+			'/(bu)s$/i'                      => '$1ses',
65
+			'/(alias)$/i'                    => '$1es',
66
+			'/(octop)us$/i'                  => '$1i',
67
+			'/(ax|test)is$/i'                => '$1es',
68
+			'/(us)$/i'                       => '$1es',
69
+			'/s$/i'                          => 's',
70
+			'/$/'                            => 's',
71
+		];
72
+		$uncountable = ['equipment', 'information', 'rice', 'money', 'species', 'series', 'fish', 'sheep'];
73
+		$irregular = [
74
+			'person' => 'people',
75
+			'man'    => 'men',
76
+			'child'  => 'children',
77
+			'sex'    => 'sexes',
78
+			'move'   => 'moves', ];
79
+		$lowercased_word = strtolower($word);
80
+		foreach ($uncountable as $_uncountable) {
81
+			if (substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable) {
82
+				return $word;
83
+			}
84
+		}
85
+		foreach ($irregular as $_plural => $_singular) {
86
+			if (preg_match('/('.$_plural.')$/i', $word, $arr)) {
87
+				return preg_replace('/('.$_plural.')$/i', substr($arr[0], 0, 1).substr($_singular, 1), $word);
88
+			}
89
+		}
90
+		foreach ($plural as $rule => $replacement) {
91
+			if (preg_match($rule, $word)) {
92
+				return preg_replace($rule, $replacement, $word);
93
+			}
94
+		}
95 95
 
96
-        return false;
97
-    }
96
+		return false;
97
+	}
98 98
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
             'move'   => 'moves', ];
79 79
         $lowercased_word = strtolower($word);
80 80
         foreach ($uncountable as $_uncountable) {
81
-            if (substr($lowercased_word, (-1 * strlen($_uncountable))) == $_uncountable) {
81
+            if (substr($lowercased_word, (-1*strlen($_uncountable))) == $_uncountable) {
82 82
                 return $word;
83 83
             }
84 84
         }
Please login to merge, or discard this patch.