Completed
Pull Request — master (#161)
by Kenji
02:26
created
tests/_ci_phpunit_test/patcher/Patcher/FunctionPatcher/NodeVisitor.php 2 patches
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -21,15 +21,11 @@
 block discarded – undo
21 21
 
22 22
 namespace Kenjis\MonkeyPatch\Patcher\FunctionPatcher;
23 23
 
24
-use ReflectionFunction;
25
-use ReflectionException;
26
-
27 24
 use PhpParser\Node;
28 25
 use PhpParser\Node\Expr\FuncCall;
29 26
 use PhpParser\Node\Name;
30 27
 use PhpParser\Node\Name\FullyQualified;
31 28
 use PhpParser\NodeVisitorAbstract;
32
-
33 29
 use Kenjis\MonkeyPatch\Patcher\FunctionPatcher;
34 30
 
35 31
 class NodeVisitor extends NodeVisitorAbstract
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,17 +36,17 @@  discard block
 block discarded – undo
36 36
 {
37 37
 	public function leaveNode(Node $node)
38 38
 	{
39
-		if (! ($node instanceof FuncCall))
39
+		if ( ! ($node instanceof FuncCall))
40 40
 		{
41 41
 			return;
42 42
 		}
43 43
 
44
-		if (! ($node->name instanceof Name))
44
+		if ( ! ($node->name instanceof Name))
45 45
 		{
46 46
 			return;
47 47
 		}
48 48
 
49
-		if (! $node->name->isUnqualified())
49
+		if ( ! $node->name->isUnqualified())
50 50
 		{
51 51
 			return;
52 52
 		}
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 		) {
58 58
 			$replacement = new FullyQualified(array());
59 59
 			$replacement->set(
60
-				'\__FuncProxy__::' . (string) $node->name
60
+				'\__FuncProxy__::'.(string) $node->name
61 61
 			);
62 62
 
63 63
 			$pos = $node->getAttribute('startTokenPos');
64 64
 			FunctionPatcher::$replacement[$pos] = 
65
-				'\__FuncProxy__::' . (string) $node->name;
65
+				'\__FuncProxy__::'.(string) $node->name;
66 66
 
67 67
 			$node->name = $replacement;
68 68
 		}
Please login to merge, or discard this patch.
tests/_ci_phpunit_test/patcher/Patcher/MethodPatcher/NodeVisitor.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use PhpParser\Node;
14 14
 use PhpParser\Node\Stmt\ClassMethod;
15 15
 use PhpParser\NodeVisitorAbstract;
16
-
17 16
 use Kenjis\MonkeyPatch\Patcher\MethodPatcher;
18 17
 
19 18
 class NodeVisitor extends NodeVisitorAbstract
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
 	public function leaveNode(Node $node)
22 22
 	{
23
-		if (! ($node instanceof ClassMethod))
23
+		if ( ! ($node instanceof ClassMethod))
24 24
 		{
25 25
 			return;
26 26
 		}
Please login to merge, or discard this patch.
application/tests/Bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
  * NOTE: If you change these, also change the error_reporting() code below
55 55
  */
56 56
 // This is needed for @runInSeparateProcess
57
-if (! defined('ENVIRONMENT'))
57
+if ( ! defined('ENVIRONMENT'))
58 58
 {
59 59
 	define('ENVIRONMENT', 'testing');
60 60
 }
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
  *  Added for CI PHPUnit Test
328 328
  * -------------------------------------------------------------------
329 329
  */
330
-require __DIR__ . '/_ci_phpunit_test/CIPHPUnitTest.php';
330
+require __DIR__.'/_ci_phpunit_test/CIPHPUnitTest.php';
331 331
 CIPHPUnitTest::init();
332 332
 /*
333 333
  * Or you can set directories for autoloading
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestAutoloader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	{
70 70
 		if (in_array($class, $this->alias))
71 71
 		{
72
-			$dir = __DIR__ . '/alias';
72
+			$dir = __DIR__.'/alias';
73 73
 			$this->loadClassFile($dir, $class);
74 74
 		}
75 75
 	}
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		}
89 89
 		else
90 90
 		{
91
-			$dir = __DIR__ . '/exceptions';
91
+			$dir = __DIR__.'/exceptions';
92 92
 			$this->loadClassFile($dir, $class);
93 93
 		}
94 94
 	}
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
 	protected function loadClassFile($dir, $class)
131 131
 	{
132
-		$class_file = $dir . '/' . $class . '.php';
132
+		$class_file = $dir.'/'.$class.'.php';
133 133
 		if (file_exists($class_file))
134 134
 		{
135 135
 			require $class_file;
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestDouble.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 				break;
87 87
 			default:
88 88
 				throw new RuntimeException(
89
-					'Sorry, ' . $count . ' params not implemented yet'
89
+					'Sorry, '.$count.' params not implemented yet'
90 90
 				);
91 91
 		}
92 92
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestFileCache.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,18 +24,18 @@
 block discarded – undo
24 24
 		}
25 25
 
26 26
 		$dir = dirname($this->file);
27
-		if (! is_dir($dir))
27
+		if ( ! is_dir($dir))
28 28
 		{
29 29
 			if (@mkdir($dir, 0777, true) === false)
30 30
 			{
31
-				throw new RuntimeException('Failed to create folder: ' . $dir);
31
+				throw new RuntimeException('Failed to create folder: '.$dir);
32 32
 			}
33 33
 		}
34 34
 
35 35
 		if (file_put_contents($this->file, '') === false)
36 36
 		{
37 37
 			throw new RuntimeException(
38
-				'Failed to write to cache file: ' . $this->file
38
+				'Failed to write to cache file: '.$this->file
39 39
 			);
40 40
 		}
41 41
 	}
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/CIPHPUnitTestReflection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		$ref_method->setAccessible(true);
22 22
 		$obj = (gettype($obj) === 'object') ? $obj : null;
23 23
 
24
-		return function () use ($obj, $ref_method) {
24
+		return function() use ($obj, $ref_method) {
25 25
 			$args = func_get_args();
26 26
 			return $ref_method->invokeArgs($obj, $args);
27 27
 		};
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/autoloader.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
  */
10 10
 
11 11
 // Autoloader for ci-phpunit-test
12
-require __DIR__ . '/CIPHPUnitTestAutoloader.php';
13
-require __DIR__ . '/CIPHPUnitTestFileCache.php';
12
+require __DIR__.'/CIPHPUnitTestAutoloader.php';
13
+require __DIR__.'/CIPHPUnitTestFileCache.php';
14 14
 $cache = new CIPHPUnitTestFileCache(
15
-	__DIR__ . '/tmp/cache/autoload.php'
15
+	__DIR__.'/tmp/cache/autoload.php'
16 16
 );
17 17
 $autoload_dirs = CIPHPUnitTest::getAutoloadDirs();
18 18
 $autoloader = new CIPHPUnitTestAutoloader($cache, $autoload_dirs);
@@ -20,5 +20,5 @@  discard block
 block discarded – undo
20 20
 
21 21
 // Register CodeIgniter's tests/mocks/autoloader.php
22 22
 define('SYSTEM_PATH', BASEPATH);
23
-require APPPATH .'tests/mocks/autoloader.php';
23
+require APPPATH.'tests/mocks/autoloader.php';
24 24
 spl_autoload_register('autoload');
Please login to merge, or discard this patch.
application/tests/_ci_phpunit_test/patcher/Cache.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
 			throw new LogicException("No such directory: $dir");
46 46
 		}
47 47
 		
48
-		self::$src_cache_dir = self::$cache_dir . '/src';
48
+		self::$src_cache_dir = self::$cache_dir.'/src';
49 49
 		self::$tmp_function_whitelist_file = 
50
-			self::$cache_dir . '/conf/func_whiltelist.php';
50
+			self::$cache_dir.'/conf/func_whiltelist.php';
51 51
 		self::$tmp_function_blacklist_file = 
52
-			self::$cache_dir . '/conf/func_blacklist.php';
52
+			self::$cache_dir.'/conf/func_blacklist.php';
53 53
 		self::$tmp_patcher_list_file = 
54
-			self::$cache_dir . '/conf/patcher_list.php';
54
+			self::$cache_dir.'/conf/patcher_list.php';
55 55
 		self::$tmp_include_paths_file = 
56
-			self::$cache_dir . '/conf/include_paths.php';
56
+			self::$cache_dir.'/conf/include_paths.php';
57 57
 		self::$tmp_exclude_paths_file = 
58
-			self::$cache_dir . '/conf/exclude_paths.php';
58
+			self::$cache_dir.'/conf/exclude_paths.php';
59 59
 	}
60 60
 
61 61
 	public static function getCacheDir()
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 			return false;
74 74
 		}
75 75
 
76
-		return self::$src_cache_dir . '/' . $relative_path;
76
+		return self::$src_cache_dir.'/'.$relative_path;
77 77
 	}
78 78
 
79 79
 	protected static function createDir($dir)
80 80
 	{
81
-		if (! is_dir($dir))
81
+		if ( ! is_dir($dir))
82 82
 		{
83
-			if (! @mkdir($dir, 0777, true))
83
+			if ( ! @mkdir($dir, 0777, true))
84 84
 			{
85
-				throw new RuntimeException('Failed to create folder: ' . $dir);
85
+				throw new RuntimeException('Failed to create folder: '.$dir);
86 86
 			}
87 87
 		}
88 88
 	}
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	public static function appendTmpFunctionBlacklist($function)
155 155
 	{
156 156
 		file_put_contents(
157
-			self::getTmpFunctionBlacklistFile(), $function . "\n", FILE_APPEND
157
+			self::getTmpFunctionBlacklistFile(), $function."\n", FILE_APPEND
158 158
 		);
159 159
 	}
160 160
 
@@ -234,20 +234,20 @@  discard block
 block discarded – undo
234 234
 	{
235 235
 		$cache = self::getSrcCacheFilePath($orig_file);
236 236
 		@unlink($cache);
237
-		MonkeyPatchManager::log('remove_src_cache: ' . $cache);
237
+		MonkeyPatchManager::log('remove_src_cache: '.$cache);
238 238
 		return $cache;
239 239
 	}
240 240
 
241 241
 	public static function clearSrcCache()
242 242
 	{
243 243
 		self::recursiveUnlink(self::$src_cache_dir);
244
-		MonkeyPatchManager::log('clear_src_cache: cleared ' . self::$src_cache_dir);
244
+		MonkeyPatchManager::log('clear_src_cache: cleared '.self::$src_cache_dir);
245 245
 	}
246 246
 
247 247
 	public static function clearCache()
248 248
 	{
249 249
 		self::recursiveUnlink(self::$cache_dir);
250
-		MonkeyPatchManager::log('clear_cache: cleared ' . self::$cache_dir);
250
+		MonkeyPatchManager::log('clear_cache: cleared '.self::$cache_dir);
251 251
 	}
252 252
 
253 253
 	/**
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	*/
258 258
 	protected static function recursiveUnlink($dir)
259 259
 	{
260
-		if (! is_dir($dir))
260
+		if ( ! is_dir($dir))
261 261
 		{
262 262
 			return;
263 263
 		}
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use PhpParser\Node;
14 14
 use PhpParser\Node\Stmt\ClassMethod;
15 15
 use PhpParser\NodeVisitorAbstract;
16
-
17 16
 use Kenjis\MonkeyPatch\Patcher\MethodPatcher;
18 17
 
19 18
 class NodeVisitor extends NodeVisitorAbstract
Please login to merge, or discard this patch.