@@ -3,7 +3,7 @@ |
||
3 | 3 | namespace luya\web\jsonld; |
4 | 4 | |
5 | 5 | /** |
6 | - * JsonLd Comment Trait. |
|
6 | + * JsonLd Comment Trait. |
|
7 | 7 | * |
8 | 8 | * @see http://schema.org/Comment |
9 | 9 | * @author Basil Suter <[email protected]> |
@@ -74,33 +74,33 @@ |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
77 | - * Method combines both [[setHasCache()]] and [[getHasCache()]] methods to retrieve value identified by a $key, |
|
78 | - * or to store the result of $closure execution if there is no cache available for the $key. |
|
79 | - * |
|
80 | - * Usage example: |
|
81 | - * |
|
82 | - * ```php |
|
83 | - * use CacheableTrait; |
|
84 | - * |
|
85 | - * public function getTopProducts($count = 10) |
|
86 | - * { |
|
87 | - * return $this->getOrSetHasCache(['top-n-products', 'n' => $count], function ($cache) use ($count) { |
|
88 | - * return Products::find()->mostPopular()->limit(10)->all(); |
|
89 | - * }, 1000); |
|
90 | - * } |
|
91 | - * ``` |
|
92 | - * |
|
93 | - * @param mixed $key a key identifying the value to be cached. This can be a simple string or |
|
94 | - * a complex data structure consisting of factors representing the key. |
|
95 | - * @param \Closure $closure the closure that will be used to generate a value to be cached. |
|
96 | - * In case $closure returns `false`, the value will not be cached. |
|
97 | - * @param int $duration default duration in seconds before the cache will expire. If not set, |
|
98 | - * [[defaultDuration]] value will be used. 0 means never expire. |
|
99 | - * @param \yii\caching\Dependency $dependency dependency of the cached item. If the dependency changes, |
|
100 | - * the corresponding value in the cache will be invalidated when it is fetched via [[get()]]. |
|
101 | - * This parameter is ignored if [[serializer]] is `false`. |
|
102 | - * @return mixed result of $closure execution |
|
103 | - */ |
|
77 | + * Method combines both [[setHasCache()]] and [[getHasCache()]] methods to retrieve value identified by a $key, |
|
78 | + * or to store the result of $closure execution if there is no cache available for the $key. |
|
79 | + * |
|
80 | + * Usage example: |
|
81 | + * |
|
82 | + * ```php |
|
83 | + * use CacheableTrait; |
|
84 | + * |
|
85 | + * public function getTopProducts($count = 10) |
|
86 | + * { |
|
87 | + * return $this->getOrSetHasCache(['top-n-products', 'n' => $count], function ($cache) use ($count) { |
|
88 | + * return Products::find()->mostPopular()->limit(10)->all(); |
|
89 | + * }, 1000); |
|
90 | + * } |
|
91 | + * ``` |
|
92 | + * |
|
93 | + * @param mixed $key a key identifying the value to be cached. This can be a simple string or |
|
94 | + * a complex data structure consisting of factors representing the key. |
|
95 | + * @param \Closure $closure the closure that will be used to generate a value to be cached. |
|
96 | + * In case $closure returns `false`, the value will not be cached. |
|
97 | + * @param int $duration default duration in seconds before the cache will expire. If not set, |
|
98 | + * [[defaultDuration]] value will be used. 0 means never expire. |
|
99 | + * @param \yii\caching\Dependency $dependency dependency of the cached item. If the dependency changes, |
|
100 | + * the corresponding value in the cache will be invalidated when it is fetched via [[get()]]. |
|
101 | + * This parameter is ignored if [[serializer]] is `false`. |
|
102 | + * @return mixed result of $closure execution |
|
103 | + */ |
|
104 | 104 | public function getOrSetHasCache($key, \Closure $closure, $duration = null, $dependency = null) |
105 | 105 | { |
106 | 106 | if (($value = $this->getHasCache($key)) !== false) { |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - return [ |
|
2 | + return [ |
|
3 | 3 | '{attribute} must have a minimum length of {length} characters.' => '{attribute} musi mieć co najmniej {length} znaków.', |
4 | 4 | '{attribute} must include at least one special character.' => '{attribute} musi zawierać przynajmniej jeden znak specjalny.', |
5 | 5 | '{attribute} must include at least one digit.' => '{attribute} musi zawierać co najmniej jedną cyfrę.', |