Completed
Push — master ( 9632cd...9db2a1 )
by Bruno
02:34
created
src/CacheAbstract.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 	 * @return CacheAbstract
109 109
 	 */
110 110
 	public static function factory($backend) {
111
-		$classname = '\Cachearium\Backend\Cache' . $backend;
111
+		$classname = '\Cachearium\Backend\Cache'.$backend;
112 112
 		if (!class_exists($classname)) {
113 113
 			throw new Exceptions\CacheInvalidBackendException("Class does not exist");
114 114
 		}
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 			\Cachearium\Backend\CacheMemcached::singleton(),
127 127
 			// TODO cache apc is broken \Cachearium\Backend\CacheAPC::singleton()
128 128
 		];
129
-		foreach($caches as $cacheInst) {
129
+		foreach ($caches as $cacheInst) {
130 130
 			if ($cacheInst->isEnabled()) {
131 131
 				$cacheInst->clear();
132 132
 			}
@@ -579,16 +579,16 @@  discard block
 block discarded – undo
579 579
 		}
580 580
 
581 581
 		if ($print) {
582
-			$key = "cache-" . rand();
582
+			$key = "cache-".rand();
583 583
 			// @codeCoverageIgnoreStart
584 584
 			if (static::$debugOnPage) {
585 585
 				echo '<span class="debug-probe-begin"
586
-					data-key="' . $key .
587
-					'" data-base="' . $cachedata->getKey()->base .
588
-					'" data-id="' . $cachedata->getKey()->id .
589
-					'" data-sub="' . print_r($cachedata->getKey()->sub, true) .
590
-					'" data-lifetime="' . $cachedata->lifetime .
591
-					'" data-backend="' . get_class($this) .
586
+					data-key="' . $key.
587
+					'" data-base="'.$cachedata->getKey()->base.
588
+					'" data-id="'.$cachedata->getKey()->id.
589
+					'" data-sub="'.print_r($cachedata->getKey()->sub, true).
590
+					'" data-lifetime="'.$cachedata->lifetime.
591
+					'" data-backend="'.get_class($this).
592 592
 					'" data-type="save"></span>';
593 593
 			}
594 594
 			// @codeCoverageIgnoreEnd
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 
598 598
 			// @codeCoverageIgnoreStart
599 599
 			if (static::$debugOnPage) {
600
-				echo '<span class="debug-probe-end" data-key="' . $key . '"></span>';
600
+				echo '<span class="debug-probe-end" data-key="'.$key.'"></span>';
601 601
 			}
602 602
 			// @codeCoverageIgnoreEnd
603 603
 			return;
@@ -616,13 +616,13 @@  discard block
 block discarded – undo
616 616
 	 */
617 617
 	protected function printProbeStart($key, CacheData $cachedata, $type) {
618 618
 		echo '<span class="cachearium-debug-probe-begin"
619
-			data-key="' . $key .
620
-			'" data-base="' . $cachedata->getKey()->base .
621
-			'" data-id="' . $cachedata->getKey()->id .
622
-			'" data-sub="' . print_r($cachedata->getKey()->sub, true) .
623
-			'" data-lifetime="' . $cachedata->lifetime .
624
-			'" data-backend="' . get_class($this) .
625
-			'" data-type="' . $type . '"></span>';
619
+			data-key="' . $key.
620
+			'" data-base="'.$cachedata->getKey()->base.
621
+			'" data-id="'.$cachedata->getKey()->id.
622
+			'" data-sub="'.print_r($cachedata->getKey()->sub, true).
623
+			'" data-lifetime="'.$cachedata->lifetime.
624
+			'" data-backend="'.get_class($this).
625
+			'" data-type="'.$type.'"></span>';
626 626
 	}
627 627
 
628 628
 	/**
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
 	 * @codeCoverageIgnore
635 635
 	 */
636 636
 	protected function printProbeEnd($key, CacheData $cachedata) {
637
-		echo '<span class="cachearium-debug-probe-end" data-key="' . $key . '"></span>';
637
+		echo '<span class="cachearium-debug-probe-end" data-key="'.$key.'"></span>';
638 638
 	}
639 639
 
640 640
 	/**
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 					$cachedata->key,
685 685
 					$cachedata->lifetime
686 686
 				);
687
-				$key = "cache-" . rand();
687
+				$key = "cache-".rand();
688 688
 
689 689
 				$retval = $cachedata->stringify($this);
690 690
 
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 		}
789 789
 
790 790
 		if ($print) {
791
-			$key = "cache-" . rand();
791
+			$key = "cache-".rand();
792 792
 			// @codeCoverageIgnoreStart
793 793
 			if (static::$debugOnPage) {
794 794
 				$this->printProbeStart($key, $cachedata, 'save');
@@ -851,10 +851,10 @@  discard block
 block discarded – undo
851 851
 		foreach ($bt as $i => $d) {
852 852
 			if (strpos($d['file'], '/Cache') === false) {
853 853
 				// TODO: if() may not work well if user has a file called Cache
854
-				$trace = $d['function'] . ' at ' . $d['file'] . ':' . $d['line'];
854
+				$trace = $d['function'].' at '.$d['file'].':'.$d['line'];
855 855
 				$this->cache_log[] = array(
856 856
 					'status' => $status,
857
-					'message' => "(" . $k->debug() . ", $lifetime) by " . $trace
857
+					'message' => "(".$k->debug().", $lifetime) by ".$trace
858 858
 				);
859 859
 				break;
860 860
 			}
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 	public static function dumpSummary() {
869 869
 		echo '<div id="cache-summary">Cache Summary (non-ajax): ';
870 870
 		foreach (static::getLogSummary() as $key => $val) {
871
-			echo $key . '=>' . $val . ' / ';
871
+			echo $key.'=>'.$val.' / ';
872 872
 		}
873 873
 		echo '</div>';
874 874
 	}
Please login to merge, or discard this patch.