Browse Source

Update file headers

Timothy J. Warren 10 months ago
parent
commit
c735c27559

+ 131
- 1
.gitignore View File

@@ -1,3 +1,133 @@
1
+
2
+# Created by https://www.gitignore.io/api/linux,macos,windows,jetbrains+all
3
+
4
+### JetBrains+all ###
5
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
6
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7
+
8
+# User-specific stuff:
9
+.idea/**/workspace.xml
10
+.idea/**/tasks.xml
11
+.idea/dictionaries
12
+
13
+# Sensitive or high-churn files:
14
+.idea/**/dataSources/
15
+.idea/**/dataSources.ids
16
+.idea/**/dataSources.xml
17
+.idea/**/dataSources.local.xml
18
+.idea/**/sqlDataSources.xml
19
+.idea/**/dynamic.xml
20
+.idea/**/uiDesigner.xml
21
+
22
+# Gradle:
23
+.idea/**/gradle.xml
24
+.idea/**/libraries
25
+
26
+# CMake
27
+cmake-build-debug/
28
+
29
+# Mongo Explorer plugin:
30
+.idea/**/mongoSettings.xml
31
+
32
+## File-based project format:
33
+*.iws
34
+
35
+## Plugin-specific files:
36
+
37
+# IntelliJ
38
+/out/
39
+
40
+# mpeltonen/sbt-idea plugin
41
+.idea_modules/
42
+
43
+# JIRA plugin
44
+atlassian-ide-plugin.xml
45
+
46
+# Cursive Clojure plugin
47
+.idea/replstate.xml
48
+
49
+# Ruby plugin and RubyMine
50
+/.rakeTasks
51
+
52
+# Crashlytics plugin (for Android Studio and IntelliJ)
53
+com_crashlytics_export_strings.xml
54
+crashlytics.properties
55
+crashlytics-build.properties
56
+fabric.properties
57
+
58
+### JetBrains+all Patch ###
59
+# Ignores the whole idea folder
60
+# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360
61
+
62
+.idea/
63
+
64
+### Linux ###
65
+*~
66
+
67
+# temporary files which can be created if a process still has a handle open of a deleted file
68
+.fuse_hidden*
69
+
70
+# KDE directory preferences
71
+.directory
72
+
73
+# Linux trash folder which might appear on any partition or disk
74
+.Trash-*
75
+
76
+# .nfs files are created when an open file is removed but is still being accessed
77
+.nfs*
78
+
79
+### macOS ###
80
+*.DS_Store
81
+.AppleDouble
82
+.LSOverride
83
+
84
+# Icon must end with two \r
85
+Icon
86
+
87
+# Thumbnails
88
+._*
89
+
90
+# Files that might appear in the root of a volume
91
+.DocumentRevisions-V100
92
+.fseventsd
93
+.Spotlight-V100
94
+.TemporaryItems
95
+.Trashes
96
+.VolumeIcon.icns
97
+.com.apple.timemachine.donotpresent
98
+
99
+# Directories potentially created on remote AFP share
100
+.AppleDB
101
+.AppleDesktop
102
+Network Trash Folder
103
+Temporary Items
104
+.apdisk
105
+
106
+### Windows ###
107
+# Windows thumbnail cache files
108
+Thumbs.db
109
+ehthumbs.db
110
+ehthumbs_vista.db
111
+
112
+# Folder config file
113
+Desktop.ini
114
+
115
+# Recycle Bin used on file shares
116
+$RECYCLE.BIN/
117
+
118
+# Windows Installer files
119
+*.cab
120
+*.msi
121
+*.msm
122
+*.msp
123
+
124
+# Windows shortcuts
125
+*.lnk
126
+
127
+
128
+# End of https://www.gitignore.io/api/linux,macos,windows,jetbrains+all
129
+
130
+
1 131
 test_config.json
2 132
 index.html
3 133
 tests/db_files/*
@@ -15,4 +145,4 @@ vendor/*
15 145
 composer.lock
16 146
 docs/phpdoc*
17 147
 .project
18
-all_tests
148
+all_tests

+ 7
- 2
.gitlab-ci.yml View File

@@ -19,8 +19,13 @@ test:7:
19 19
     image: php:7
20 20
     script:
21 21
       - phpunit -c build --no-coverage
22
-      
22
+
23 23
 test:7.1:
24 24
     image: php:7.1
25 25
     script:
26
-      - phpunit -c build  --no-coverage
26
+      - phpunit -c build  --no-coverage
27
+
28
+test:7.2:
29
+    image: php:7.2
30
+    script:
31
+      - phpunit -c build  --no-coverage

+ 3
- 3
build/header_comment.txt View File

@@ -3,11 +3,11 @@
3 3
  *
4 4
  * SQL Query Builder / Database Abstraction Layer
5 5
  *
6
- * PHP version 7
6
+ * PHP version 7.1
7 7
  *
8 8
  * @package     Query
9 9
  * @author      Timothy J. Warren <tim@timshomepage.net>
10
- * @copyright   2012 - 2016 Timothy J. Warren
10
+ * @copyright   2012 - 2018 Timothy J. Warren
11 11
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
12 12
  * @link        https://git.timshomepage.net/aviat4ion/Query
13
- */
13
+ */

+ 59
- 50
build/update_header_comments.php View File

@@ -2,81 +2,90 @@
2 2
 declare(strict_types=1);
3 3
 
4 4
 $file_patterns = [
5
-	'src/*.php',
6
-	'tests/**/*.php',
5
+    'src/**/*.php',
6
+    'src/*.php',
7
+    'tests/**/*.php',
8
+    'tests/*.php',
9
+    'Robofile.php'
7 10
 ];
8 11
 
9 12
 if ( ! function_exists('glob_recursive'))
10 13
 {
11
-	// Does not support flag GLOB_BRACE
14
+    // Does not support flag GLOB_BRACE
12 15
 
13
-	function glob_recursive($pattern, $flags = 0)
14
-	{
15
-		$files = glob($pattern, $flags);
16
+    function glob_recursive($pattern, $flags = 0)
17
+    {
18
+        $files = glob($pattern, $flags);
16 19
 
17
-		foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir)
18
-		{
19
-			$files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));
20
-		}
20
+        foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir)
21
+        {
22
+            $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));
23
+        }
21 24
 
22
-		return $files;
23
-	}
25
+        return $files;
26
+    }
24 27
 }
25 28
 
26 29
 function get_text_to_replace($tokens)
27 30
 {
28
-	if ($tokens[0][0] !== T_OPEN_TAG)
29
-	{
30
-		return NULL;
31
-	}
32
-
33
-	// If there is already a docblock, as the second token after the
34
-	// open tag, get the contents of that token to replace
35
-	if ($tokens[1][0] === T_DOC_COMMENT)
36
-	{
37
-		return "<?php\n" . $tokens[1][1];
38
-	}
39
-	// If there is a declare strict types,
40
-	else if ($tokens[1][0] === T_DECLARE && $tokens[9][0] === T_DOC_COMMENT)
41
-	{
42
-		// '<?php' and 'declare(strict_types=1);' makes for 8 tokens
43
-		// replace it all
44
-		return "<?php\ndeclare(strict_types=1);\n" . $tokens[9][1];
45
-	}
46
-	else if ($tokens[1][0] !== T_DOC_COMMENT)
47
-	{
48
-		return "<?php";
49
-	}
31
+    $output = '';
32
+
33
+    // Tokens have the follow structure if arrays:
34
+    // [0] => token type constant
35
+    // [1] => raw sytax parsed to that token
36
+    // [2] => line number
37
+    foreach($tokens as $token)
38
+    {
39
+        // Since we only care about opening docblocks,
40
+        // bail out when we get to the namespace token
41
+        if (is_array($token) && $token[0] === T_NAMESPACE)
42
+        {
43
+            break;
44
+        }
45
+
46
+        if (is_array($token))
47
+        {
48
+            $token = $token[1];
49
+        }
50
+
51
+        $output .= $token;
52
+    }
53
+
54
+    return $output;
50 55
 }
51 56
 
52 57
 function get_tokens($source)
53 58
 {
54
-	return token_get_all($source);
59
+    return token_get_all($source);
55 60
 }
56 61
 
57 62
 function replace_files(array $files, $template)
58 63
 {
59
-	foreach ($files as $file)
60
-	{
61
-		$source = file_get_contents($file);
62
-		$tokens = get_tokens($source);
63
-//print_r($tokens);
64
-		$text_to_replace = get_text_to_replace($tokens);
64
+    print_r($files);
65
+    foreach ($files as $file)
66
+    {
67
+        $source = file_get_contents($file);
68
+
69
+        if (stripos($source, 'namespace') === FALSE)
70
+        {
71
+            continue;
72
+        }
65 73
 
66
-		$header = file_get_contents(__DIR__ . $template);
67
-		$new_text = "<?php declare(strict_types=1);\n{$header}";
74
+        $tokens = get_tokens($source);
75
+        $text_to_replace = get_text_to_replace($tokens);
68 76
 
69
-		$new_source = str_replace($text_to_replace, $new_text, $source);
70
-		file_put_contents($file, $new_source);
77
+        $header = file_get_contents(__DIR__ . $template);
78
+        $new_text = "<?php declare(strict_types=1);\n{$header}";
71 79
 
72
-		//break;
73
-	}
80
+        $new_source = str_replace($text_to_replace, $new_text, $source);
81
+        file_put_contents($file, $new_source);
82
+    }
74 83
 }
75 84
 
76 85
 foreach ($file_patterns as $glob)
77 86
 {
78
-	$files = glob_recursive($glob);
79
-	replace_files($files, '/header_comment.txt');
87
+    $files = glob_recursive($glob);
88
+    replace_files($files, '/header_comment.txt');
80 89
 }
81 90
 
82
-echo "Successfully updated headers \n";
91
+echo "Successfully updated headers \n";

+ 1
- 1
composer.json View File

@@ -44,7 +44,7 @@
44 44
 	},
45 45
 	"scripts": {
46 46
 		"coverage": "phpdbg -qrr -- vendor/bin/phpunit -c build",
47
-		"phpstan": "phpstan analyse src tests",
47
+		"phpstan": "phpstan analyse -l 3 -c phpstan.neon src tests",
48 48
 		"test": "vendor/bin/phpunit"
49 49
 	},
50 50
 	"scripts-descriptions": {

+ 6
- 0
phpstan.neon View File

@@ -0,0 +1,6 @@
1
+parameters:
2
+	autoload_files:
3
+		- %rootDir%/../../../tests/bootstrap.php
4
+	ignoreErrors:
5
+		- '#Access to an undefined property Aviat\\\Ion\\\Friend::\$[a-zA-Z0-9_]+#'
6
+		- '#Call to an undefined method Aviat\\\Ion\\\Friend::[a-zA-Z0-9_]+\(\)#'

+ 2
- 3
src/Query/AbstractQueryBuilder.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query;
17 16
 
18 17
 use PDOStatement;

+ 2
- 2
src/Query/BadDBDriverException.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/ConnectionManager.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 3
src/Query/Drivers/AbstractDriver.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query\Drivers;
17 16
 
18 17
 use InvalidArgumentException;

+ 2
- 3
src/Query/Drivers/AbstractSQL.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query\Drivers;
17 16
 
18 17
 /**

+ 2
- 3
src/Query/Drivers/AbstractUtil.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query\Drivers;
17 16
 
18 17
 /**

+ 2
- 2
src/Query/Drivers/DriverInterface.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Firebird/Driver.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Firebird/Result.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Firebird/SQL.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Firebird/Util.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Mysql/Driver.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Mysql/SQL.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Mysql/Util.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/PDOInterface.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 3
src/Query/Drivers/PDOStatementInterface.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query\Drivers;
17 16
 
18 17
 use PDO;

+ 2
- 2
src/Query/Drivers/Pgsql/Driver.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Pgsql/SQL.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Pgsql/Util.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 3
src/Query/Drivers/SQLInterface.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query\Drivers;
17 16
 
18 17
 /**

+ 2
- 2
src/Query/Drivers/Sqlite/Driver.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Sqlite/SQL.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/Drivers/Sqlite/Util.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 2
src/Query/QueryBuilder.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 3
src/Query/QueryBuilderInterface.php View File

@@ -4,15 +4,14 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */
15
-
16 15
 namespace Query;
17 16
 
18 17
 use PDOStatement;

+ 2
- 2
src/Query/QueryParser.php View File

@@ -4,11 +4,11 @@
4 4
  *
5 5
  * SQL Query Builder / Database Abstraction Layer
6 6
  *
7
- * PHP version 7
7
+ * PHP version 7.1
8 8
  *
9 9
  * @package     Query
10 10
  * @author      Timothy J. Warren <tim@timshomepage.net>
11
- * @copyright   2012 - 2016 Timothy J. Warren
11
+ * @copyright   2012 - 2018 Timothy J. Warren
12 12
  * @license     http://www.opensource.org/licenses/mit-license.html  MIT License
13 13
  * @link        https://git.timshomepage.net/aviat4ion/Query
14 14
  */

+ 2
- 19
tests/bootstrap.php View File

@@ -21,27 +21,10 @@ define('QBASE_DIR', realpath(QTEST_DIR.'/../') . '/');
21 21
 define('QDS', DIRECTORY_SEPARATOR);
22 22
 
23 23
 // Set up autoloader
24
-require_once(QBASE_DIR . 'vendor/autoload.php');
24
+require_once QBASE_DIR . 'vendor/autoload.php';
25 25
 
26 26
 // --------------------------------------------------------------------------
27 27
 
28
-/**
29
- * Quercus detection for workarounds
30
- */
31
-if ( ! defined('IS_QUERCUS'))
32
-{
33
-	if ( ! isset($_sERVERSOFTWARE))
34
-	{
35
-		define('IS_QUERCUS', FALSE);
36
-	}
37
-	else
38
-	{
39
-		$test = strpos($_sERVER["SERVER_SOFTWARE"],'Quercus') !== FALSE;
40
-		define('IS_QUERCUS', $test);
41
-		unset($test);
42
-	}
43
-}
44
-
45 28
 function get_json_config()
46 29
 {
47 30
 	$files = array(
@@ -123,4 +106,4 @@ require_once(QTEST_DIR . '/core/base_db_test.php');
123 106
 require_once(QTEST_DIR . '/core/base_query_builder_test.php');
124 107
 
125 108
 
126
-// End of bootstrap.php
109
+// End of bootstrap.php

+ 8
- 18
tests/databases/sqlite/SQLiteTest.php View File

@@ -52,13 +52,13 @@ class SQLiteTest extends DBTest {
52 52
 		//Check
53 53
 		$dbs = self::$db->getTables();
54 54
 
55
-		$this->assertTrue(in_array('TEST1', $dbs));
56
-		$this->assertTrue(in_array('TEST2', $dbs));
57
-		$this->assertTrue(in_array('NUMBERS', $dbs));
58
-		$this->assertTrue(in_array('NEWTABLE', $dbs));
59
-		$this->assertTrue(in_array('create_test', $dbs));
60
-		$this->assertTrue(in_array('create_join', $dbs));
61
-		$this->assertTrue(in_array('create_delete', $dbs));
55
+		$this->assertTrue(in_array('TEST1', $dbs, TRUE));
56
+		$this->assertTrue(in_array('TEST2', $dbs, TRUE));
57
+		$this->assertTrue(in_array('NUMBERS', $dbs, TRUE));
58
+		$this->assertTrue(in_array('NEWTABLE', $dbs, TRUE));
59
+		$this->assertTrue(in_array('create_test', $dbs, TRUE));
60
+		$this->assertTrue(in_array('create_join', $dbs, TRUE));
61
+		$this->assertTrue(in_array('create_delete', $dbs, TRUE));
62 62
 	}
63 63
 
64 64
 	// --------------------------------------------------------------------------
@@ -224,11 +224,6 @@ SQL;
224 224
 
225 225
 	public function testCommitTransaction()
226 226
 	{
227
-		if (IS_QUERCUS)
228
-		{
229
-			$this->markTestSkipped("JDBC Driver doesn't support transactions");
230
-		}
231
-
232 227
 		$res = self::$db->beginTransaction();
233 228
 
234 229
 		$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (10, 12, 14)';
@@ -242,11 +237,6 @@ SQL;
242 237
 
243 238
 	public function testRollbackTransaction()
244 239
 	{
245
-		if (IS_QUERCUS)
246
-		{
247
-			$this->markTestSkipped("JDBC Driver doesn't support transactions");
248
-		}
249
-
250 240
 		$res = self::$db->beginTransaction();
251 241
 
252 242
 		$sql = 'INSERT INTO "create_test" ("id", "key", "val") VALUES (182, 96, 43)';
@@ -314,4 +304,4 @@ SQL;
314 304
 	{
315 305
 		$this->assertNull(self::$db->getProcedures());
316 306
 	}
317
-}
307
+}

+ 17
- 34
tests/index.php View File

@@ -11,23 +11,6 @@
11 11
  * @license		http://philsturgeon.co.uk/code/dbad-license
12 12
  */
13 13
 
14
-/**
15
- * Quercus detection for workarounds
16
- */
17
-if ( ! defined('IS_QUERCUS'))
18
-{
19
-	if ( ! array_key_exists('SERVER_SOFTWARE', $_SERVER))
20
-	{
21
-		define('IS_QUERCUS', FALSE);
22
-	}
23
-	else
24
-	{
25
-		$test = strpos($_SERVER["SERVER_SOFTWARE"],'Quercus') !== FALSE;
26
-		define('IS_QUERCUS', $test);
27
-		unset($test);
28
-	}
29
-}
30
-
31 14
 function get_json_config()
32 15
 {
33 16
 	$files = array(
@@ -49,8 +32,8 @@ function get_json_config()
49 32
 // --------------------------------------------------------------------------
50 33
 
51 34
 // Set up autoloaders
52
-require_once(__DIR__ . '/../vendor/autoload.php');
53
-require_once(__DIR__ . '/../vendor/simpletest/simpletest/autorun.php');
35
+require_once __DIR__ . '/../vendor/autoload.php';
36
+require_once __DIR__ . '/../vendor/simpletest/simpletest/autorun.php';
54 37
 
55 38
 /**
56 39
  * Base class for TestCases
@@ -150,11 +133,11 @@ define('QDS', DIRECTORY_SEPARATOR);
150 133
 $testPath = QTEST_DIR.'/databases/';
151 134
 
152 135
 // Require base testing classes
153
-require_once(QTEST_DIR . '/core/core_test.php');
154
-require_once(QTEST_DIR . '/core/connection_manager_test.php');
155
-require_once(QTEST_DIR . '/core/base_db_test.php');
156
-require_once(QTEST_DIR . '/core/query_parser_test.php');
157
-require_once(QTEST_DIR . '/core/base_query_builder_test.php');
136
+require_once QTEST_DIR . '/core/core_test.php';
137
+require_once QTEST_DIR . '/core/connection_manager_test.php';
138
+require_once QTEST_DIR . '/core/base_db_test.php';
139
+require_once QTEST_DIR . '/core/query_parser_test.php';
140
+require_once QTEST_DIR . '/core/base_query_builder_test.php';
158 141
 
159 142
 $drivers = PDO::getAvailableDrivers();
160 143
 
@@ -163,23 +146,23 @@ if (function_exists('fbird_connect'))
163 146
 	$drivers[] = 'interbase';
164 147
 }
165 148
 
166
-$driverTestMap = array(
167
-	'MySQL' => in_array('mysql', $drivers),
168
-	'SQLite' => in_array('sqlite', $drivers),
169
-	'PgSQL' => in_array('pgsql', $drivers),
170
-	'Firebird' => in_array('interbase', $drivers),
149
+$driverTestMap = [
150
+	'MySQL' => in_array('mysql', $drivers, TRUE),
151
+	'SQLite' => in_array('sqlite', $drivers, TRUE),
152
+	'PgSQL' => in_array('pgsql', $drivers, TRUE),
153
+	// 'Firebird' => in_array('interbase', $drivers),
171 154
 	//'PDOFirebird' => in_array('firebird', $drivers)
172
-);
155
+];
173 156
 
174 157
 // Determine which testcases to load
175 158
 foreach($driverTestMap as $name => $doLoad)
176 159
 {
177 160
 	$path = $testPath . strtolower($name) . '/';
178 161
 
179
-	if ($doLoad && (! IS_QUERCUS))
162
+	if ($doLoad)
180 163
 	{
181
-		require_once("{$path}{$name}Test.php");
182
-		require_once("{$path}{$name}QBTest.php");
164
+		require_once "{$path}{$name}Test.php";
165
+		require_once "{$path}{$name}QBTest.php";
183 166
 	}
184 167
 }
185
-// End of index.php
168
+// End of index.php