@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param $reflection |
25 | 25 | * @param array $class |
26 | 26 | */ |
27 | - public function __construct($app,$reflection,$class=array()) |
|
27 | + public function __construct($app, $reflection, $class = array()) |
|
28 | 28 | { |
29 | 29 | parent::__construct($app); |
30 | 30 | |
@@ -45,27 +45,27 @@ discard block |
||
45 | 45 | { |
46 | 46 | $cacheData = []; |
47 | 47 | |
48 | - if(!isset($this->class[1]) && !is_object($this->class[0])) return; |
|
48 | + if (!isset($this->class[1]) && !is_object($this->class[0])) return; |
|
49 | 49 | |
50 | 50 | // if you have information about cache in |
51 | 51 | // the document section of the method, the cache process is executed. |
52 | - if($this->reflection->isAvailableMethodDocument($this->class[1],'cache')){ |
|
52 | + if ($this->reflection->isAvailableMethodDocument($this->class[1], 'cache')) { |
|
53 | 53 | |
54 | 54 | //as static we inject the name value into the cache data. |
55 | 55 | $cacheData = ['cache'=>['name' => Utils::encryptArrayData($this->class)]]; |
56 | 56 | |
57 | 57 | //cache data with the help of foreach data are transferred into the cache. |
58 | - foreach(array_filter(explode(" ",$this->reflection->getDocumentData()),'strlen') as $item){ |
|
58 | + foreach (array_filter(explode(" ", $this->reflection->getDocumentData()), 'strlen') as $item) { |
|
59 | 59 | |
60 | - $items = explode("=",$item); |
|
60 | + $items = explode("=", $item); |
|
61 | 61 | |
62 | 62 | $cacheData['cache'][$items[0]] = $items[1]; |
63 | 63 | |
64 | - if(in_array('query',$items)){ |
|
64 | + if (in_array('query', $items)) { |
|
65 | 65 | |
66 | - foreach(explode(':',$items[1]) as $queryValue){ |
|
67 | - $query = get($queryValue,null); |
|
68 | - if(!is_null($query)){ |
|
66 | + foreach (explode(':', $items[1]) as $queryValue) { |
|
67 | + $query = get($queryValue, null); |
|
68 | + if (!is_null($query)) { |
|
69 | 69 | $cacheData['cache']['name'] = md5(sha1( |
70 | 70 | $cacheData['cache']['name'].'_'.$queryValue.':'.$query |
71 | 71 | )); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | } |
78 | 78 | |
79 | 79 | //we save the data stored in the cacheData variable as methodCache. |
80 | - $this->app->register('cache','methodCache',$cacheData); |
|
81 | - $this->app->register('cache','class',$this->class); |
|
80 | + $this->app->register('cache', 'methodCache', $cacheData); |
|
81 | + $this->app->register('cache', 'class', $this->class); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | \ No newline at end of file |