@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | - * @param Download $driver |
|
| 112 | + * @param Driver\Download $driver |
|
| 113 | 113 | * @return self |
| 114 | 114 | */ |
| 115 | 115 | public function setDriver(Driver\Download $driver) |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | /** |
| 126 | 126 | * Set global VAT. |
| 127 | - * @param type $v |
|
| 127 | + * @param double $v |
|
| 128 | 128 | * @param bool $in |
| 129 | 129 | * @param bool $out |
| 130 | 130 | * @return self |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * Count, format price. |
| 214 | - * @param number $number |
|
| 214 | + * @param double $number |
|
| 215 | 215 | * @param string|bool $from FALSE currency doesn't counting, NULL set actual |
| 216 | 216 | * @param string $to output currency, NULL set actual |
| 217 | 217 | * @param int|float|Vat $vat |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | |
| 364 | 364 | /** |
| 365 | 365 | * Prototype INumberFormat. |
| 366 | - * @return INumberFormat |
|
| 366 | + * @return Number\INumberFormat |
|
| 367 | 367 | */ |
| 368 | 368 | public function getDefaultFormat() |
| 369 | 369 | { |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Exchange; |
| 4 | 4 | |
| 5 | -use DateTime, |
|
| 6 | - h4kuna\Number, |
|
| 7 | - h4kuna\Exchange\Currency; |
|
| 5 | +use DateTime; |
|
| 6 | +use h4kuna\Number; |
|
| 7 | +use h4kuna\Exchange\Currency; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | if ($this->offsetExists($index)) { |
| 169 | 169 | return parent::offsetGet($index); |
| 170 | 170 | } |
| 171 | - throw new UnknownCurrencyException('Undefined currency code: ' . $index . ', you must call loadCurrency before.'); |
|
| 171 | + throw new UnknownCurrencyException('Undefined currency code: '.$index.', you must call loadCurrency before.'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // </editor-fold> |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | $profil = $this->getDefaultFormat(); |
| 298 | 298 | $profil->setSymbol($code); |
| 299 | 299 | foreach ($property as $k => $v) { |
| 300 | - $k = 'set' . ucfirst($k); |
|
| 300 | + $k = 'set'.ucfirst($k); |
|
| 301 | 301 | $profil->$k($v); |
| 302 | 302 | } |
| 303 | 303 | } else { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @param string $hour |
| 30 | - * @return Storage |
|
| 30 | + * @return Cache |
|
| 31 | 31 | */ |
| 32 | 32 | public function setRefresh($hour) |
| 33 | 33 | { |
@@ -60,6 +60,9 @@ discard block |
||
| 60 | 60 | $this->save(self::ALL_CURRENCIES, array_keys($currencies)); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | + /** |
|
| 64 | + * @param string $code |
|
| 65 | + */ |
|
| 63 | 66 | public function loadCurrency($code) |
| 64 | 67 | { |
| 65 | 68 | return $this->load($code); |
@@ -2,10 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Exchange\Nette; |
| 4 | 4 | |
| 5 | -use DateTime, |
|
| 6 | - h4kuna\Exchange\Currency, |
|
| 7 | - h4kuna\Exchange\Storage, |
|
| 8 | - Nette\Caching; |
|
| 5 | +use DateTime; |
|
| 6 | +use h4kuna\Exchange\Currency; |
|
| 7 | +use h4kuna\Exchange\Storage; |
|
| 8 | +use Nette\Caching; |
|
| 9 | 9 | |
| 10 | 10 | final class Cache extends Caching\Cache implements Storage\IStock |
| 11 | 11 | { |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | private function getRefresh() |
| 18 | 18 | { |
| 19 | 19 | if (is_string($this->refresh)) { |
| 20 | - $this->refresh = new DateTime('today ' . $this->refresh); |
|
| 20 | + $this->refresh = new DateTime('today '.$this->refresh); |
|
| 21 | 21 | if (new DateTime >= $this->refresh) { |
| 22 | 22 | $this->refresh->modify('+1 day'); |
| 23 | 23 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Exchange\Nette; |
| 4 | 4 | |
| 5 | -use h4kuna\Exchange\Storage, |
|
| 6 | - Nette\Http; |
|
| 5 | +use h4kuna\Exchange\Storage; |
|
| 6 | +use Nette\Http; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * |
@@ -28,6 +28,11 @@ |
||
| 28 | 28 | $this->setVat($vat, $in, $out); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | + /** |
|
| 32 | + * @param integer $vat |
|
| 33 | + * @param boolean $in |
|
| 34 | + * @param boolean $out |
|
| 35 | + */ |
|
| 31 | 36 | public function setVat($vat, $in, $out) |
| 32 | 37 | { |
| 33 | 38 | $this->vat = $vat; |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | protected function createFactoryCache() |
| 66 | 66 | { |
| 67 | - return new CacheFactory(__NAMESPACE__ . '\Cache', $this->temp); |
|
| 67 | + return new CacheFactory(__NAMESPACE__.'\Cache', $this->temp); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * @param DateTime $date |
| 80 | - * @return Store |
|
| 80 | + * @return Warehouse |
|
| 81 | 81 | */ |
| 82 | 82 | public function setDate(DateTime $date) |
| 83 | 83 | { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | /** |
| 90 | 90 | * Change driver runtime |
| 91 | 91 | * @param Exchange\Driver\Download $driver |
| 92 | - * @return Store |
|
| 92 | + * @return Warehouse |
|
| 93 | 93 | */ |
| 94 | 94 | public function setDriver(Exchange\Driver\Download $driver) |
| 95 | 95 | { |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace h4kuna\Exchange\Storage; |
| 4 | 4 | |
| 5 | -use DateTime, |
|
| 6 | - h4kuna\Exchange, |
|
| 7 | - Nette\Object; |
|
| 5 | +use DateTime; |
|
| 6 | +use h4kuna\Exchange; |
|
| 7 | +use Nette\Object; |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | /** @return string */ |
| 102 | 102 | public function getName() |
| 103 | 103 | { |
| 104 | - return $this->getNameOf($this->date) . $this->download->getName(); |
|
| 104 | + return $this->getNameOf($this->date).$this->download->getName(); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function loadNameByDriver(Exchange\Driver\Download $driver) |
| 112 | 112 | { |
| 113 | - return $this->getNameOf($this->date) . $driver->getName(); |
|
| 113 | + return $this->getNameOf($this->date).$driver->getName(); |
|
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | public function loadNameByDate(DateTime $date = NULL) |
| 121 | 121 | { |
| 122 | - return $this->getNameOf($date) . $this->download->getName(); |
|
| 122 | + return $this->getNameOf($date).$this->download->getName(); |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $ymd = $date->format('Y-m-d'); |
| 136 | 136 | if (date('Y-m-d') > $ymd) { |
| 137 | - return $ymd . '\\'; |
|
| 137 | + return $ymd.'\\'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | return NULL; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $class = $this->storageClass; |
| 35 | 35 | $service = new $class($this->storage, $name); |
| 36 | 36 | if (!($service instanceof Storage\IStock)) { |
| 37 | - throw new ExchangeException('Storage must be instance ' . __NAMESPACE__ . '\IStock.'); |
|
| 37 | + throw new ExchangeException('Storage must be instance '.__NAMESPACE__.'\IStock.'); |
|
| 38 | 38 | } |
| 39 | 39 | return $service; |
| 40 | 40 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function __construct($name, $temp) |
| 20 | 20 | { |
| 21 | - $this->path = $temp . DIRECTORY_SEPARATOR . str_replace('\\', '-', $name) . DIRECTORY_SEPARATOR; |
|
| 21 | + $this->path = $temp.DIRECTORY_SEPARATOR.str_replace('\\', '-', $name).DIRECTORY_SEPARATOR; |
|
| 22 | 22 | @mkdir($this->path, 0777, TRUE); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | private function getRefresh() |
| 51 | 51 | { |
| 52 | 52 | if (is_string($this->refresh)) { |
| 53 | - $this->refresh = new DateTime('today ' . $this->refresh); |
|
| 53 | + $this->refresh = new DateTime('today '.$this->refresh); |
|
| 54 | 54 | if (new DateTime >= $this->refresh) { |
| 55 | 55 | $this->refresh->modify('+1 day'); |
| 56 | 56 | } |
@@ -71,25 +71,25 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function offsetExists($offset) |
| 73 | 73 | { |
| 74 | - return is_file($this->path . $offset) && (!$this->getRefresh() || date(DateTime::ISO8601, filemtime($this->path . $offset)) < $this->refresh->format(DateTime::ISO8601)); |
|
| 74 | + return is_file($this->path.$offset) && (!$this->getRefresh() || date(DateTime::ISO8601, filemtime($this->path.$offset)) < $this->refresh->format(DateTime::ISO8601)); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public function offsetGet($offset) |
| 78 | 78 | { |
| 79 | 79 | if ($this->offsetExists($offset)) { |
| 80 | - return unserialize(file_get_contents($this->path . $offset)); |
|
| 80 | + return unserialize(file_get_contents($this->path.$offset)); |
|
| 81 | 81 | } |
| 82 | 82 | return NULL; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | public function offsetSet($offset, $value) |
| 86 | 86 | { |
| 87 | - file_put_contents($this->path . $offset, serialize($value)); |
|
| 87 | + file_put_contents($this->path.$offset, serialize($value)); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | public function offsetUnset($offset) |
| 91 | 91 | { |
| 92 | - @unlink($this->path . $offset); |
|
| 92 | + @unlink($this->path.$offset); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | //put your code here |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | |
| 59 | 59 | protected function createUrlDay($url, DateTime $date) |
| 60 | 60 | { |
| 61 | - return $url . '?date=' . urlencode($date->format('d.m.Y')); |
|
| 61 | + return $url.'?date='.urlencode($date->format('d.m.Y')); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | continue; |
| 32 | 32 | } |
| 33 | 33 | if (isset($currencies[$property->getCode()])) { |
| 34 | - throw new Exchange\DuplicityCurrencyException('Downloaded duplicity: ' . $property->getCode()); |
|
| 34 | + throw new Exchange\DuplicityCurrencyException('Downloaded duplicity: '.$property->getCode()); |
|
| 35 | 35 | } |
| 36 | 36 | $currencies[$property->getCode()] = $property; |
| 37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** @return string */ |
| 42 | 42 | public function getName() |
| 43 | 43 | { |
| 44 | - return str_replace(__NAMESPACE__ . '\\', '', get_class($this)); |
|
| 44 | + return str_replace(__NAMESPACE__.'\\', '', get_class($this)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |