Test Setup Failed
Push — master ( aa9039...94c501 )
by Derek
03:32
created
src/Nabu/LoggerHandler/File.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return null|string  The file_path set for the File instance
62
+     * @return string  The file_path set for the File instance
63 63
      */
64 64
     public function getFilePath()
65 65
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
         $full_file = "";
177 177
 
178 178
         if (isset($this->file_path)) {
179
-            $full_file = $this->file_path . DIRECTORY_SEPARATOR;
179
+            $full_file = $this->file_path.DIRECTORY_SEPARATOR;
180 180
         }
181 181
 
182 182
         $full_file .= $this->file_name;
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
         if ($locked) {
231 231
             $now = date('Y-m-d H:i:s');
232
-            $this->file_pointer->fwrite("$now : $message" . "\r\n");
232
+            $this->file_pointer->fwrite("$now : $message"."\r\n");
233 233
             $this->file_pointer->flock(LOCK_UN);
234 234
 
235 235
             return true;
Please login to merge, or discard this patch.
app/config/app_constants.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,29 +2,29 @@
 block discarded – undo
2 2
 /**
3 3
  * @const DILMUN_BASE_DIR The base directory at which Dilmun resides
4 4
  */
5
-define('DILMUN_BASE_DIR', dirname(dirname(dirname(__FILE__))) . "/");
5
+define('DILMUN_BASE_DIR', dirname(dirname(dirname(__FILE__)))."/");
6 6
 
7 7
 /**
8 8
  * @const DILMUN_SOURCE_DIR The source directory
9 9
  */
10
-define('DILMUN_SOURCE_DIR', DILMUN_BASE_DIR . "src/");
10
+define('DILMUN_SOURCE_DIR', DILMUN_BASE_DIR."src/");
11 11
 
12 12
 /**
13 13
  * @const DILMUN_VENDOR_DIR The vendor directory
14 14
  */
15
-define('DILMUN_VENDOR_DIR', DILMUN_BASE_DIR . "vendor/");
15
+define('DILMUN_VENDOR_DIR', DILMUN_BASE_DIR."vendor/");
16 16
 
17 17
 /**
18 18
  * @const DILMUN_LOGS_DIR The log directory
19 19
  */
20
-define('DILMUN_LOGS_DIR', DILMUN_BASE_DIR . "app/logs/");
20
+define('DILMUN_LOGS_DIR', DILMUN_BASE_DIR."app/logs/");
21 21
 
22 22
 /**
23 23
  * @const DILMUN_CONFIG_DIR The configurations directory
24 24
  */
25
-define('DILMUN_CONFIG_DIR', DILMUN_BASE_DIR . "app/config/");
25
+define('DILMUN_CONFIG_DIR', DILMUN_BASE_DIR."app/config/");
26 26
 
27 27
 /**
28 28
  * @const DILMUN_TEST_DIR The tests directory
29 29
  */
30
-define('DILMUN_TEST_DIR', DILMUN_BASE_DIR . "tests/");
30
+define('DILMUN_TEST_DIR', DILMUN_BASE_DIR."tests/");
Please login to merge, or discard this patch.
app/bootstrap.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
  */
5 5
 
6 6
 require "config/app_constants.php";
7
-require DILMUN_VENDOR_DIR . "autoload.php";
8
-require DILMUN_SOURCE_DIR . "Nabu/Autoloader.php";
7
+require DILMUN_VENDOR_DIR."autoload.php";
8
+require DILMUN_SOURCE_DIR."Nabu/Autoloader.php";
9 9
 
10 10
 //Pre-load logger classes for autoloader logging!
11
-require DILMUN_SOURCE_DIR . "Nabu/Logger.php";
12
-require DILMUN_SOURCE_DIR . "Nabu/StaticLogger.php";
13
-require DILMUN_SOURCE_DIR . "Nabu/LoggerHandler/HandlerInterface.php";
14
-require DILMUN_SOURCE_DIR . "Nabu/LoggerHandler/File.php";
11
+require DILMUN_SOURCE_DIR."Nabu/Logger.php";
12
+require DILMUN_SOURCE_DIR."Nabu/StaticLogger.php";
13
+require DILMUN_SOURCE_DIR."Nabu/LoggerHandler/HandlerInterface.php";
14
+require DILMUN_SOURCE_DIR."Nabu/LoggerHandler/File.php";
15 15
 
16 16
 use Subreality\Dilmun\Nabu\Autoloader as std_loader;
17 17
 
Please login to merge, or discard this patch.
tests/Nabu/StaticLoggerTest.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 
17 17
     public static function setUpBeforeClass()
18 18
     {
19
-        self::$full_log_location = DILMUN_LOGS_DIR . "StaticLogger_test.log";
19
+        self::$full_log_location = DILMUN_LOGS_DIR."StaticLogger_test.log";
20 20
 
21
-        if(file_exists(self::$full_log_location))
21
+        if (file_exists(self::$full_log_location))
22 22
         {
23 23
             unlink(self::$full_log_location);
24 24
         }
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     protected function setUp()
36 36
     {
37
-        if(file_exists(self::$full_log_location))
37
+        if (file_exists(self::$full_log_location))
38 38
         {
39 39
             self::$log_file->clearFile();
40 40
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     public static function tearDownAfterClass()
48 48
     {
49
-        if(file_exists(self::$full_log_location))
49
+        if (file_exists(self::$full_log_location))
50 50
         {
51 51
             unlink(self::$full_log_location);
52 52
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 
97 97
         $expected_context_message = "Here is some stuff for ya.";
98 98
 
99
-        $returned_message = static_logger::log("debug","Here is some {context} for ya.",$context_array);
99
+        $returned_message = static_logger::log("debug", "Here is some {context} for ya.", $context_array);
100 100
 
101 101
         $this->assertContains($expected_context_message, $returned_message);
102 102
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         //affecting the {context} section and not throw any exceptions.
113 113
         $expected_context_message = "Here is some {context} for ya.";
114 114
 
115
-        $returned_message = static_logger::log("debug","Here is some {context} for ya.",$context_array);
115
+        $returned_message = static_logger::log("debug", "Here is some {context} for ya.", $context_array);
116 116
 
117 117
         $this->assertContains($expected_context_message, $returned_message);
118 118
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
     {
122 122
         static_logger::setHandler(self::$log_file);
123 123
 
124
-        try{
124
+        try {
125 125
             throw new \Exception("This is an arbitrary exception");
126 126
         }
127 127
         catch (\Exception $e)
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 
137 137
         $expected_context_message = 'The Exception processor provides line, file (/home/derek/PHP/Subreality/Dilmun/tests/Nabu/StaticLoggerTest.php), and message (This is an arbitrary exception)';
138 138
 
139
-        $returned_message = static_logger::log("debug",$log_message,$context_array);
139
+        $returned_message = static_logger::log("debug", $log_message, $context_array);
140 140
 
141 141
         $this->assertContains($expected_context_message, $returned_message);
142 142
     }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         //affecting the {context} section and not throw any exceptions.
155 155
         $expected_context_message = "Here is some {context} for ya.";
156 156
 
157
-        $returned_message = static_logger::log("debug","Here is some {context} for ya.",$context_array);
157
+        $returned_message = static_logger::log("debug", "Here is some {context} for ya.", $context_array);
158 158
 
159 159
         $this->assertContains($expected_context_message, $returned_message);
160 160
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,8 +123,7 @@
 block discarded – undo
123 123
 
124 124
         try{
125 125
             throw new \Exception("This is an arbitrary exception");
126
-        }
127
-        catch (\Exception $e)
126
+        } catch (\Exception $e)
128 127
         {
129 128
             $context_array = array(
130 129
                 "exception" =>  $e
Please login to merge, or discard this patch.
tests/Nabu/LoggerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     public static function setUpBeforeClass()
21 21
     {
22
-        self::$full_log_location = DILMUN_LOGS_DIR . "Logger_test.log";
22
+        self::$full_log_location = DILMUN_LOGS_DIR."Logger_test.log";
23 23
 
24 24
         if (file_exists(self::$full_log_location)) {
25 25
             unlink(self::$full_log_location);
Please login to merge, or discard this patch.
tests/Nabu/AutoloaderTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
     public static function setUpBeforeClass()
17 17
     {
18
-        self::$autoloader_log_location = DILMUN_LOGS_DIR . "autoloader.log";
18
+        self::$autoloader_log_location = DILMUN_LOGS_DIR."autoloader.log";
19 19
 
20 20
         //Creating a pointed to the existing log file.
21 21
         $autoloader_file = new File("autoloader.log", DILMUN_LOGS_DIR);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         /** @noinspection PhpUnusedLocalVariableInspection */
92 92
         $stub = new TestClass();
93 93
 
94
-        $autoloader_log = file_get_contents(DILMUN_LOGS_DIR . "autoloader.log");
94
+        $autoloader_log = file_get_contents(DILMUN_LOGS_DIR."autoloader.log");
95 95
 
96 96
         $this->assertContains("TestClass", $autoloader_log);
97 97
     }
Please login to merge, or discard this patch.
tests/Nabu/LoggerHandler/FileTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
     {
19 19
         self::$log_file_name = "File_test.log";
20 20
         self::$log_file_path = DILMUN_LOGS_DIR;
21
-        self::$full_log_location = DILMUN_LOGS_DIR . "File_test.log";
21
+        self::$full_log_location = DILMUN_LOGS_DIR."File_test.log";
22 22
 
23
-        if(file_exists(self::$full_log_location))
23
+        if (file_exists(self::$full_log_location))
24 24
         {
25 25
             unlink(self::$full_log_location);
26 26
         }
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
     protected function setUp()
35 35
     {
36
-        if(file_exists(self::$full_log_location))
36
+        if (file_exists(self::$full_log_location))
37 37
         {
38 38
             unlink(self::$full_log_location);
39 39
         }
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
     public static function tearDownAfterClass()
43 43
     {
44
-        if(file_exists(self::$full_log_location))
44
+        if (file_exists(self::$full_log_location))
45 45
         {
46 46
             unlink(self::$full_log_location);
47 47
         }
Please login to merge, or discard this patch.
src/Nabu/StaticLogger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
         $replace = array();
166 166
 
167 167
         foreach ($context as $key => $value) {
168
-            $templated = "{" . $key . "}";
168
+            $templated = "{".$key."}";
169 169
             $replace[$templated] = $value;
170 170
         }
171 171
 
Please login to merge, or discard this patch.
src/Nabu/Autoloader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     public function register()
35 35
     {
36
-        spl_autoload_register(array($this,"includeClass"));
36
+        spl_autoload_register(array($this, "includeClass"));
37 37
     }
38 38
 
39 39
     /**
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
         $this->logger->debug("Inputs: package: {$package}, path: {$path}");
47 47
 
48 48
         $package = trim($package, "\\");
49
-        $package = $package . "\\";
49
+        $package = $package."\\";
50 50
 
51 51
         $path = rtrim($path, "/");
52
-        $path = $path . "/";
52
+        $path = $path."/";
53 53
 
54 54
         $this->logger->debug("Registering index {$package} with {$path}");
55 55
         $this->packages[$package][] = $path;
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
 
128 128
             foreach ($this->packages[$package_name] as $path) {
129 129
                 $converted_class = str_replace('\\', '/', $class_name);
130
-                $class_path = $path . $converted_class . ".php";
130
+                $class_path = $path.$converted_class.".php";
131 131
                 $this->logger->debug("Set up class path as {$class_path}");
132 132
 
133 133
                 if (file_exists($class_path)) {
134 134
                     $this->logger->debug("File {$class_path} exists");
135 135
 
136
-                    $this->logger->debug("Including " . $class_path);
136
+                    $this->logger->debug("Including ".$class_path);
137 137
                     /** @noinspection PhpIncludeInspection */
138 138
                     include $class_path;
139 139
 
Please login to merge, or discard this patch.