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.
Passed
Push — master ( ec1f73...36613f )
by Samuel
02:53
created
src/Core/Validator/Validators/UserIDValidator.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -21,18 +21,18 @@
 block discarded – undo
21 21
  */
22 22
 class UserIDValidator implements ValidatorInterface
23 23
 {
24
-    public function isValidUserId(string $userId)
25
-    {
26
-        $selectQuery = (new Builder('QueryBuilder', 'Select'))->getBuilder();
24
+	public function isValidUserId(string $userId)
25
+	{
26
+		$selectQuery = (new Builder('QueryBuilder', 'Select'))->getBuilder();
27 27
 
28
-        $selectQuery
29
-            ->top(1)
30
-            ->columns('StaffID')
31
-            ->from('[Staffs].[Staff]')
32
-            ->where(
33
-                'StaffID',
34
-                '='.
35
-                $userId
36
-            );
37
-    }
28
+		$selectQuery
29
+			->top(1)
30
+			->columns('StaffID')
31
+			->from('[Staffs].[Staff]')
32
+			->where(
33
+				'StaffID',
34
+				'='.
35
+				$userId
36
+			);
37
+	}
38 38
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types=1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 /**
4 4
  * @license MIT
Please login to merge, or discard this patch.
src/Core/Exception/UnexpectedErrorException.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
  */
21 21
 class UnexpectedErrorException extends Exception
22 22
 {
23
-    public function __construct(string $message, int $databaseUser)
24
-    {
25
-        parent::__construct($message, 0, $previous);
23
+	public function __construct(string $message, int $databaseUser)
24
+	{
25
+		parent::__construct($message, 0, $previous);
26 26
 
27
-        $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_HIGH);
28
-    }
27
+		$this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_HIGH);
28
+	}
29 29
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types=1);
1
+<?php declare(strict_types=1);
2 2
 /**
3 3
  * @license MIT
4 4
  * @author Samuel Adeshina <[email protected]>
Please login to merge, or discard this patch.
src/Core/Exception/SQLException.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
  */
21 21
 class SQLException extends Exception
22 22
 {
23
-    public function __construct(string $message, int $databaseUser)
24
-    {
25
-        parent::__construct($message, 0, null);
23
+	public function __construct(string $message, int $databaseUser)
24
+	{
25
+		parent::__construct($message, 0, null);
26 26
         
27
-        $this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_NORMAL);
28
-    }
27
+		$this->log($databaseUser, Constant::ERROR_401, Constant::ERROR_NORMAL);
28
+	}
29 29
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types=1);
1
+<?php declare(strict_types=1);
2 2
 /**
3 3
  * @license MIT
4 4
  * @author Samuel Adeshina <[email protected]>
Please login to merge, or discard this patch.
src/Core/Exception/UndefinedValueException.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -20,10 +20,10 @@
 block discarded – undo
20 20
  */
21 21
 class UndefinedValueException extends Exception
22 22
 {
23
-    public function __construct(string $message, int $databaseUser)
24
-    {
25
-        parent::__construct($message, 0, null);
23
+	public function __construct(string $message, int $databaseUser)
24
+	{
25
+		parent::__construct($message, 0, null);
26 26
         
27
-        $this->log($databaseUser, Constant::ERROR_404, Constant::ERROR_NORMAL);
28
-    }
27
+		$this->log($databaseUser, Constant::ERROR_404, Constant::ERROR_NORMAL);
28
+	}
29 29
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types=1);
1
+<?php declare(strict_types=1);
2 2
 /**
3 3
  * @license MIT
4 4
  * @author Samuel Adeshina <[email protected]>
Please login to merge, or discard this patch.
src/Core/Session/Session.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -37,6 +37,8 @@
 block discarded – undo
37 37
 
38 38
     /**
39 39
      * 
40
+     * @param string $key
41
+     * @return string
40 42
      */
41 43
     public static function get($key)
42 44
     {
Please login to merge, or discard this patch.
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -17,37 +17,37 @@
 block discarded – undo
17 17
  */
18 18
 class Session
19 19
 {
20
-    protected $session;
20
+	protected $session;
21 21
     
22
-    /**
23
-     * 
24
-     */
25
-    public static function init($session = "")
26
-    {
27
-        $this->session = $session;
28
-    }
22
+	/**
23
+	 * 
24
+	 */
25
+	public static function init($session = "")
26
+	{
27
+		$this->session = $session;
28
+	}
29 29
     
30
-    /**
31
-     * 
32
-     */
33
-    public static function save($key, $value)
34
-    {
35
-        $session[$key] = $value;
36
-    }
30
+	/**
31
+	 * 
32
+	 */
33
+	public static function save($key, $value)
34
+	{
35
+		$session[$key] = $value;
36
+	}
37 37
 
38
-    /**
39
-     * 
40
-     */
41
-    public static function get($key)
42
-    {
43
-        return $session[$key] ?? '';
44
-    }
38
+	/**
39
+	 * 
40
+	 */
41
+	public static function get($key)
42
+	{
43
+		return $session[$key] ?? '';
44
+	}
45 45
 
46
-    /**
47
-     * 
48
-     */
49
-    public static function delete($key)
50
-    {
51
-       unset($session[$key]);
52
-    }
46
+	/**
47
+	 * 
48
+	 */
49
+	public static function delete($key)
50
+	{
51
+	   unset($session[$key]);
52
+	}
53 53
 }
Please login to merge, or discard this patch.
src/Core/Connection/Adapters/SQLServer.php 3 patches
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -21,110 +21,110 @@
 block discarded – undo
21 21
  */
22 22
 class SQlServer implements ConnectableInterface
23 23
 {
24
-    /**
25
-     * @var string $dsn
26
-     */
27
-    protected $dsn;
24
+	/**
25
+	 * @var string $dsn
26
+	 */
27
+	protected $dsn;
28 28
 
29
-    /**
30
-     * @var \PDO $connectionObject
31
-     */
32
-    protected $connectionObject;
29
+	/**
30
+	 * @var \PDO $connectionObject
31
+	 */
32
+	protected $connectionObject;
33 33
 
34
-    /**
35
-     * @var array loginData
36
-     */
37
-    private $loginData = [];
34
+	/**
35
+	 * @var array loginData
36
+	 */
37
+	private $loginData = [];
38 38
 
39
-    /**
40
-     * Setter for the DSN string {@see $dsn}
41
-     *
42
-     * MSSQl Server DSN Structure: sqlsrv:Server={srv};Database={db}"
43
-     * `$dsnArray[0] = {srv}`
44
-     * `$dsnArray[1] = {db}`
45
-     * Attributes = [2 - infinity]
46
-     *
47
-     * @param array $dsnArray
48
-     * @return void
49
-     */
50
-    public function setDsn(array $dsnArray)
51
-    {
52
-        $this->dsn = $dsnArray;
53
-    }
39
+	/**
40
+	 * Setter for the DSN string {@see $dsn}
41
+	 *
42
+	 * MSSQl Server DSN Structure: sqlsrv:Server={srv};Database={db}"
43
+	 * `$dsnArray[0] = {srv}`
44
+	 * `$dsnArray[1] = {db}`
45
+	 * Attributes = [2 - infinity]
46
+	 *
47
+	 * @param array $dsnArray
48
+	 * @return void
49
+	 */
50
+	public function setDsn(array $dsnArray)
51
+	{
52
+		$this->dsn = $dsnArray;
53
+	}
54 54
 
55
-    /**
56
-     * Establishes connection
57
-     *
58
-     * @param string $username
59
-     * @param string $password optional
60
-     * @throws \EmmetBlue\Core\Exception\SQLException
61
-     * @return void
62
-     */
63
-    public function connect(string $username, string $password="")
64
-    {
65
-        $server = $this->dsn[0];
66
-        $database = $this->dsn[1];
55
+	/**
56
+	 * Establishes connection
57
+	 *
58
+	 * @param string $username
59
+	 * @param string $password optional
60
+	 * @throws \EmmetBlue\Core\Exception\SQLException
61
+	 * @return void
62
+	 */
63
+	public function connect(string $username, string $password="")
64
+	{
65
+		$server = $this->dsn[0];
66
+		$database = $this->dsn[1];
67 67
 
68
-        $this->loginData['username'] = $username;
69
-        $this->loginData['password'] = $password;
68
+		$this->loginData['username'] = $username;
69
+		$this->loginData['password'] = $password;
70 70
 
71
-        try
72
-        {
73
-            $this->connectionObject = new \PDO("sqlsrv:Server=$server;Database=$database;ConnectionPooling=0", $username, $password);
74
-        }
75
-        catch (\PDOException $e)
76
-        {
77
-            throw new SQLException("Unable to connect to database", 400, $e);  
78
-        }
71
+		try
72
+		{
73
+			$this->connectionObject = new \PDO("sqlsrv:Server=$server;Database=$database;ConnectionPooling=0", $username, $password);
74
+		}
75
+		catch (\PDOException $e)
76
+		{
77
+			throw new SQLException("Unable to connect to database", 400, $e);  
78
+		}
79 79
 
80
-        $dsn = $this->dsn;
81
-        unset($dsn[0], $dsn[1]);
80
+		$dsn = $this->dsn;
81
+		unset($dsn[0], $dsn[1]);
82 82
         
83
-        foreach ($dsn as $attribute)
84
-        {
85
-            foreach ($attribute as $key=>$value)
86
-            {
87
-                $this->connectionObject->setAttribute($key, $value);
88
-            }
89
-        }
90
-    }
83
+		foreach ($dsn as $attribute)
84
+		{
85
+			foreach ($attribute as $key=>$value)
86
+			{
87
+				$this->connectionObject->setAttribute($key, $value);
88
+			}
89
+		}
90
+	}
91 91
 
92
-    /**
93
-     * Returns an instance a pdo intance of the connection object
94
-     *
95
-     * @return \PDO
96
-     */
97
-    public function getConnection() : \PDO
98
-    {
99
-        if ($this->connectionObject instanceof \PDO)
100
-        {
101
-            return $this->connectionObject;
102
-        }
92
+	/**
93
+	 * Returns an instance a pdo intance of the connection object
94
+	 *
95
+	 * @return \PDO
96
+	 */
97
+	public function getConnection() : \PDO
98
+	{
99
+		if ($this->connectionObject instanceof \PDO)
100
+		{
101
+			return $this->connectionObject;
102
+		}
103 103
 
104
-        $this->connect(
105
-            $this->loginData['username'] ?? '',
106
-            $this->loginData['password'] ?? ''
107
-        );
104
+		$this->connect(
105
+			$this->loginData['username'] ?? '',
106
+			$this->loginData['password'] ?? ''
107
+		);
108 108
 
109
-        return $this->connectionObject;
110
-    }
109
+		return $this->connectionObject;
110
+	}
111 111
 
112
-    /**
113
-     * Closes connection
114
-     */
115
-    public function disableConnection()
116
-    {
117
-        $this->connectionObject = null;
118
-    }
112
+	/**
113
+	 * Closes connection
114
+	 */
115
+	public function disableConnection()
116
+	{
117
+		$this->connectionObject = null;
118
+	}
119 119
 
120
-    /**
121
-     * Sets attributes for the PDO object
122
-     *
123
-     * @param \PDO $attribute
124
-     * @param \PDO $value
125
-     */
126
-    public function setAttribute(\PDO $attribute, \PDO $value)
127
-    {
128
-         $this->connectionObject->setAttribute($attribute, $value);
129
-    }
120
+	/**
121
+	 * Sets attributes for the PDO object
122
+	 *
123
+	 * @param \PDO $attribute
124
+	 * @param \PDO $value
125
+	 */
126
+	public function setAttribute(\PDO $attribute, \PDO $value)
127
+	{
128
+		 $this->connectionObject->setAttribute($attribute, $value);
129
+	}
130 130
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,8 +71,7 @@
 block discarded – undo
71 71
         try
72 72
         {
73 73
             $this->connectionObject = new \PDO("sqlsrv:Server=$server;Database=$database;ConnectionPooling=0", $username, $password);
74
-        }
75
-        catch (\PDOException $e)
74
+        } catch (\PDOException $e)
76 75
         {
77 76
             throw new SQLException("Unable to connect to database", 400, $e);  
78 77
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
      * @throws \EmmetBlue\Core\Exception\SQLException
61 61
      * @return void
62 62
      */
63
-    public function connect(string $username, string $password="")
63
+    public function connect(string $username, string $password = "")
64 64
     {
65 65
         $server = $this->dsn[0];
66 66
         $database = $this->dsn[1];
Please login to merge, or discard this patch.
src/Core/CustomFileNameGenerator.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -6,27 +6,27 @@
 block discarded – undo
6 6
 
7 7
 class CustomFileNameGenerator implements \FileUpload\FileNameGenerator\FileNameGenerator
8 8
 {
9
-    protected $generator;
9
+	protected $generator;
10 10
 
11
-    /**
12
-     * @param string|callable|Closure $nameGenerator
13
-     */
14
-    public function __construct($nameGenerator)
15
-    {
16
-        $this->generator = $nameGenerator;
17
-    }
11
+	/**
12
+	 * @param string|callable|Closure $nameGenerator
13
+	 */
14
+	public function __construct($nameGenerator)
15
+	{
16
+		$this->generator = $nameGenerator;
17
+	}
18 18
 
19
-    public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload)
20
-    {
21
-        $sourceNameArray = explode(".", $source_name);
22
-        $ext = $sourceNameArray[count($sourceNameArray) - 1];
23
-        if (is_string($this->generator) && !is_callable($this->generator)) {
24
-            return $this->generator.".".$ext;
25
-        }
19
+	public function getFileName($source_name, $type, $tmp_name, $index, $content_range, FileUpload $upload)
20
+	{
21
+		$sourceNameArray = explode(".", $source_name);
22
+		$ext = $sourceNameArray[count($sourceNameArray) - 1];
23
+		if (is_string($this->generator) && !is_callable($this->generator)) {
24
+			return $this->generator.".".$ext;
25
+		}
26 26
 
27
-        return call_user_func_array(
28
-            $this->generator,
29
-            func_get_args()
30
-        );
31
-    }
27
+		return call_user_func_array(
28
+			$this->generator,
29
+			func_get_args()
30
+		);
31
+	}
32 32
 }
Please login to merge, or discard this patch.
src/Core/Factory/DatabaseQueryFactory.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -27,46 +27,46 @@
 block discarded – undo
27 27
  */
28 28
 class DatabaseQueryFactory
29 29
 {
30
-    public static function insert(string $table, array $data)
31
-    {
32
-        $insertBuilder = (new Builder("QueryBuilder","Insert"))->getBuilder();
33
-        $columns = [];
34
-        $values = [];
30
+	public static function insert(string $table, array $data)
31
+	{
32
+		$insertBuilder = (new Builder("QueryBuilder","Insert"))->getBuilder();
33
+		$columns = [];
34
+		$values = [];
35 35
 
36
-        foreach ($data as $index=>$datum)
37
-        {
38
-            $columns[] = $index;
39
-            $values[] = $datum;
40
-        }
36
+		foreach ($data as $index=>$datum)
37
+		{
38
+			$columns[] = $index;
39
+			$values[] = $datum;
40
+		}
41 41
 
42
-        $columns = "(".implode(", ", $columns).")";
43
-        $values =    "(".implode(", ", $values).")";
44
-        $insertBuilder->into($table.$columns);
42
+		$columns = "(".implode(", ", $columns).")";
43
+		$values =    "(".implode(", ", $values).")";
44
+		$insertBuilder->into($table.$columns);
45 45
 
46
-        $query = (string)$insertBuilder." VALUES ".$values;
47
-        // die($query);
48
-        try
49
-        {
50
-            $parts = explode(".", $table);
51
-            $schemaName = $parts[0];
52
-            $tableName = $parts[1];
46
+		$query = (string)$insertBuilder." VALUES ".$values;
47
+		// die($query);
48
+		try
49
+		{
50
+			$parts = explode(".", $table);
51
+			$schemaName = $parts[0];
52
+			$tableName = $parts[1];
53 53
 
54
-            $connection = DBConnectionFactory::getConnection();
54
+			$connection = DBConnectionFactory::getConnection();
55 55
 
56
-            $result = $connection->prepare((string)$query)->execute();
56
+			$result = $connection->prepare((string)$query)->execute();
57 57
 
58
-            DatabaseLog::log(Session::get('USER_ID'), Constant::EVENT_INSERT, $schemaName, $tableName, $query);
58
+			DatabaseLog::log(Session::get('USER_ID'), Constant::EVENT_INSERT, $schemaName, $tableName, $query);
59 59
 
60
-            $lastInsertId = ($connection->query("SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) as id")->fetchColumn());
60
+			$lastInsertId = ($connection->query("SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) as id")->fetchColumn());
61 61
 
62
-            return [$result, "lastInsertId"=>$lastInsertId];
63
-        }
64
-        catch (\PDOException $e)
65
-        {
66
-            throw new SQLException(sprintf(
67
-                "%s",
68
-                $e->getMessage()
69
-            ), Constant::UNDEFINED);
70
-        }
71
-    }
62
+			return [$result, "lastInsertId"=>$lastInsertId];
63
+		}
64
+		catch (\PDOException $e)
65
+		{
66
+			throw new SQLException(sprintf(
67
+				"%s",
68
+				$e->getMessage()
69
+			), Constant::UNDEFINED);
70
+		}
71
+	}
72 72
 }
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@
 block discarded – undo
60 60
             $lastInsertId = ($connection->query("SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS int) as id")->fetchColumn());
61 61
 
62 62
             return [$result, "lastInsertId"=>$lastInsertId];
63
-        }
64
-        catch (\PDOException $e)
63
+        } catch (\PDOException $e)
65 64
         {
66 65
             throw new SQLException(sprintf(
67 66
                 "%s",
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 {
30 30
     public static function insert(string $table, array $data)
31 31
     {
32
-        $insertBuilder = (new Builder("QueryBuilder","Insert"))->getBuilder();
32
+        $insertBuilder = (new Builder("QueryBuilder", "Insert"))->getBuilder();
33 33
         $columns = [];
34 34
         $values = [];
35 35
 
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
         }
41 41
 
42 42
         $columns = "(".implode(", ", $columns).")";
43
-        $values =    "(".implode(", ", $values).")";
43
+        $values = "(".implode(", ", $values).")";
44 44
         $insertBuilder->into($table.$columns);
45 45
 
46
-        $query = (string)$insertBuilder." VALUES ".$values;
46
+        $query = (string) $insertBuilder." VALUES ".$values;
47 47
         // die($query);
48 48
         try
49 49
         {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
             $connection = DBConnectionFactory::getConnection();
55 55
 
56
-            $result = $connection->prepare((string)$query)->execute();
56
+            $result = $connection->prepare((string) $query)->execute();
57 57
 
58 58
             DatabaseLog::log(Session::get('USER_ID'), Constant::EVENT_INSERT, $schemaName, $tableName, $query);
59 59
 
Please login to merge, or discard this patch.
src/Core/DirtChecker.php 3 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -17,65 +17,65 @@
 block discarded – undo
17 17
  */
18 18
 class DirtChecker
19 19
 {
20
-    public $dirtFilterConditions = [">", "<", "="];
20
+	public $dirtFilterConditions = [">", "<", "="];
21 21
 
22
-    public $workingValue;
23
-    public $conditionValue;
24
-    public $workingConditions = [];
22
+	public $workingValue;
23
+	public $conditionValue;
24
+	public $workingConditions = [];
25 25
 
26
-    public function __construct(string $value, string $conditionValue, array $conditions = [])
27
-    {
28
-        $this->workingValue = $value;
29
-        $this->conditionValue = $conditionValue;
26
+	public function __construct(string $value, string $conditionValue, array $conditions = [])
27
+	{
28
+		$this->workingValue = $value;
29
+		$this->conditionValue = $conditionValue;
30 30
 
31
-        if (!empty($conditions)){
32
-            foreach ($conditions as $value) {
33
-                if (!in_array($value, $this->dirtFilterConditions)){
34
-                    throw new \Exception("Invalid Dirt Filter Condition Provided: ".$value);
35
-                }
36
-            }
37
-            $this->workingConditions = $conditions;
38
-        }
39
-        else {
40
-            $this->workingConditions = $this->dirtFilterConditions;
41
-        }
42
-    }
31
+		if (!empty($conditions)){
32
+			foreach ($conditions as $value) {
33
+				if (!in_array($value, $this->dirtFilterConditions)){
34
+					throw new \Exception("Invalid Dirt Filter Condition Provided: ".$value);
35
+				}
36
+			}
37
+			$this->workingConditions = $conditions;
38
+		}
39
+		else {
40
+			$this->workingConditions = $this->dirtFilterConditions;
41
+		}
42
+	}
43 43
 
44
-    public function isDirty() : bool
45
-    {
46
-        $explodedString = explode(" ", $this->workingValue);
47
-        foreach ($explodedString as $string){
48
-            foreach ($this->workingConditions as $condition){
49
-                $switchValue = false;
50
-                switch ($condition) {
51
-                    case '=':
52
-                        $switchValue = strpos($string, $this->conditionValue) !== false;
53
-                        break;
54
-                    case '>':
55
-                        $string = self::turnToNumber($string);
56
-                        $_condition = self::turnToNumber($this->conditionValue);
44
+	public function isDirty() : bool
45
+	{
46
+		$explodedString = explode(" ", $this->workingValue);
47
+		foreach ($explodedString as $string){
48
+			foreach ($this->workingConditions as $condition){
49
+				$switchValue = false;
50
+				switch ($condition) {
51
+					case '=':
52
+						$switchValue = strpos($string, $this->conditionValue) !== false;
53
+						break;
54
+					case '>':
55
+						$string = self::turnToNumber($string);
56
+						$_condition = self::turnToNumber($this->conditionValue);
57 57
 
58
-                        $switchValue = $string > $_condition;
59
-                        break;
60
-                    case '<':
61
-                        $string = self::turnToNumber($string);
62
-                        $_condition = self::turnToNumber($this->conditionValue);
58
+						$switchValue = $string > $_condition;
59
+						break;
60
+					case '<':
61
+						$string = self::turnToNumber($string);
62
+						$_condition = self::turnToNumber($this->conditionValue);
63 63
 
64
-                        $switchValue = $string < $_condition;
65
-                        break;
66
-                }
64
+						$switchValue = $string < $_condition;
65
+						break;
66
+				}
67 67
 
68
-                if (!$switchValue) {
69
-                    return true;
70
-                }
71
-            }
72
-        }
68
+				if (!$switchValue) {
69
+					return true;
70
+				}
71
+			}
72
+		}
73 73
 
74
-        return false;
75
-    }
74
+		return false;
75
+	}
76 76
 
77
-    private function turnToNumber(string $string) : float 
78
-    {
79
-        return (float) filter_var($string, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION | FILTER_FLAG_ALLOW_THOUSAND);
80
-    }
77
+	private function turnToNumber(string $string) : float 
78
+	{
79
+		return (float) filter_var($string, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION | FILTER_FLAG_ALLOW_THOUSAND);
80
+	}
81 81
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@
 block discarded – undo
35 35
                 }
36 36
             }
37 37
             $this->workingConditions = $conditions;
38
-        }
39
-        else {
38
+        } else {
40 39
             $this->workingConditions = $this->dirtFilterConditions;
41 40
         }
42 41
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types=1);
1
+<?php declare(strict_types=1);
2 2
 /**
3 3
  * @license MIT
4 4
  * @author Samuel Adeshina <[email protected]>
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
         $this->workingValue = $value;
29 29
         $this->conditionValue = $conditionValue;
30 30
 
31
-        if (!empty($conditions)){
31
+        if (!empty($conditions)) {
32 32
             foreach ($conditions as $value) {
33
-                if (!in_array($value, $this->dirtFilterConditions)){
33
+                if (!in_array($value, $this->dirtFilterConditions)) {
34 34
                     throw new \Exception("Invalid Dirt Filter Condition Provided: ".$value);
35 35
                 }
36 36
             }
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
     public function isDirty() : bool
45 45
     {
46 46
         $explodedString = explode(" ", $this->workingValue);
47
-        foreach ($explodedString as $string){
48
-            foreach ($this->workingConditions as $condition){
47
+        foreach ($explodedString as $string) {
48
+            foreach ($this->workingConditions as $condition) {
49 49
                 $switchValue = false;
50 50
                 switch ($condition) {
51 51
                     case '=':
Please login to merge, or discard this patch.