Completed
Push — master ( 62f4e3...dee775 )
by Marc
02:56
created
core/traits/CacheableTrait.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -79,34 +79,34 @@
 block discarded – undo
79 79
         return $this->_cachable;
80 80
     }
81 81
     
82
-     /**
83
-     * Method combines both [[setHasCache()]] and [[getHasCache()]] methods to retrieve value identified by a $key,
84
-     * or to store the result of $closure execution if there is no cache available for the $key.
85
-     *
86
-     * Usage example:
87
-     *
88
-     * ```php
89
-     * use CacheableTrait;
90
-     *
91
-     * public function getTopProducts($count = 10)
92
-     * {
93
-     *     return $this->getOrSetHasCache(['top-n-products', 'n' => $count], function ($cache) use ($count) {
94
-     *         return Products::find()->mostPopular()->limit(10)->all();
95
-     *     }, 1000);
96
-     * }
97
-     * ```
98
-     *
99
-     * @param mixed $key a key identifying the value to be cached. This can be a simple string or
100
-     * a complex data structure consisting of factors representing the key.
101
-     * @param \Closure $closure the closure that will be used to generate a value to be cached.
102
-     * In case $closure returns `false`, the value will not be cached.
103
-     * @param int $duration default duration in seconds before the cache will expire. If not set,
104
-     * [[defaultDuration]] value will be used.
105
-     * @param Dependency $dependency dependency of the cached item. If the dependency changes,
106
-     * the corresponding value in the cache will be invalidated when it is fetched via [[get()]].
107
-     * This parameter is ignored if [[serializer]] is `false`.
108
-     * @return mixed result of $closure execution
109
-     */
82
+        /**
83
+         * Method combines both [[setHasCache()]] and [[getHasCache()]] methods to retrieve value identified by a $key,
84
+         * or to store the result of $closure execution if there is no cache available for the $key.
85
+         *
86
+         * Usage example:
87
+         *
88
+         * ```php
89
+         * use CacheableTrait;
90
+         *
91
+         * public function getTopProducts($count = 10)
92
+         * {
93
+         *     return $this->getOrSetHasCache(['top-n-products', 'n' => $count], function ($cache) use ($count) {
94
+         *         return Products::find()->mostPopular()->limit(10)->all();
95
+         *     }, 1000);
96
+         * }
97
+         * ```
98
+         *
99
+         * @param mixed $key a key identifying the value to be cached. This can be a simple string or
100
+         * a complex data structure consisting of factors representing the key.
101
+         * @param \Closure $closure the closure that will be used to generate a value to be cached.
102
+         * In case $closure returns `false`, the value will not be cached.
103
+         * @param int $duration default duration in seconds before the cache will expire. If not set,
104
+         * [[defaultDuration]] value will be used.
105
+         * @param Dependency $dependency dependency of the cached item. If the dependency changes,
106
+         * the corresponding value in the cache will be invalidated when it is fetched via [[get()]].
107
+         * This parameter is ignored if [[serializer]] is `false`.
108
+         * @return mixed result of $closure execution
109
+         */
110 110
     public function getOrSetHasCache($key, \Closure $closure, $duration = null, $dependency = null)
111 111
     {
112 112
         if (($value = $this->getHasCache($key)) !== false) {
Please login to merge, or discard this patch.
core/console/commands/MigrateController.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         }
44 44
         
45 45
         if (!isset($this->migrationPath[$module])) {
46
-        	throw new Exception("The module \"$module\" does not exist in the application modules configuration.");
46
+            throw new Exception("The module \"$module\" does not exist in the application modules configuration.");
47 47
         }
48 48
         
49 49
         // apply custom migration code to generate new migrations for a module specific path
@@ -58,14 +58,14 @@  discard block
 block discarded – undo
58 58
         
59 59
         $file = $migrationPath . DIRECTORY_SEPARATOR . $className . '.php';
60 60
         if ($this->confirm("Create new migration '$file'?")) {
61
-        	$content = $this->generateMigrationSourceCode([
62
-        		'name' => $name,
63
-        		'className' => $className,
64
-        		'namespace' => null,
65
-        	]);
66
-        	FileHelper::createDirectory($migrationPath);
67
-        	file_put_contents($file, $content);
68
-        	$this->stdout("New migration created successfully.\n", Console::FG_GREEN);
61
+            $content = $this->generateMigrationSourceCode([
62
+                'name' => $name,
63
+                'className' => $className,
64
+                'namespace' => null,
65
+            ]);
66
+            FileHelper::createDirectory($migrationPath);
67
+            file_put_contents($file, $content);
68
+            $this->stdout("New migration created successfully.\n", Console::FG_GREEN);
69 69
         }
70 70
     }
71 71
 }
Please login to merge, or discard this patch.