@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param string $sPath |
| 26 | 26 | * @return bool |
| 27 | 27 | */ |
| 28 | - public static function isValidMap ($sPath) { |
|
| 28 | + public static function isValidMap($sPath) { |
|
| 29 | 29 | return (basename($sPath) == 'map.php' && is_file($sPath)); |
| 30 | 30 | } |
| 31 | 31 | |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | namespace vsc\application\sitemaps; |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -trait ModuleMapTrait |
|
| 12 | -{ |
|
| 11 | +trait ModuleMapTrait { |
|
| 13 | 12 | /** |
| 14 | 13 | * @var MappingA |
| 15 | 14 | */ |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * @param HttpResponseA $oResponse |
| 29 | 29 | * @return HttpResponseA |
| 30 | 30 | */ |
| 31 | - public function addCacheHeaders (HttpRequestA $oRequest, ModelA $oModel, HttpResponseA $oResponse) { |
|
| 31 | + public function addCacheHeaders(HttpRequestA $oRequest, ModelA $oModel, HttpResponseA $oResponse) { |
|
| 32 | 32 | $iExpireTime = 600; // ten minute |
| 33 | 33 | $oNow = new \DateTime('now', new \DateTimeZone('GMT')); |
| 34 | 34 | $oResponse->setDate($oNow->format('r')); |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $aAcceptEncoding = []; |
|
| 35 | + protected $aAcceptEncoding = []; |
|
| 36 | 36 | /** |
| 37 | 37 | * @var array |
| 38 | 38 | */ |
| 39 | - protected $aAcceptLanguage = []; |
|
| 39 | + protected $aAcceptLanguage = []; |
|
| 40 | 40 | /** |
| 41 | 41 | * @var string |
| 42 | 42 | */ |
@@ -52,11 +52,11 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * @var string |
| 54 | 54 | */ |
| 55 | - protected $sIfNoneMatch = ''; |
|
| 55 | + protected $sIfNoneMatch = ''; |
|
| 56 | 56 | /** |
| 57 | 57 | * @var string |
| 58 | 58 | */ |
| 59 | - protected $sContentType = ''; |
|
| 59 | + protected $sContentType = ''; |
|
| 60 | 60 | /** |
| 61 | 61 | * @var bool |
| 62 | 62 | */ |
@@ -12,6 +12,6 @@ |
||
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | public function getChallenge() { |
| 15 | - return 'Digest realm="'.$this->sRealm.'",qop="auth",nonce="'.$this->sNonce.'",opaque="'.md5($this->sRealm).'"'; |
|
| 15 | + return 'Digest realm="' . $this->sRealm . '",qop="auth",nonce="' . $this->sNonce . '",opaque="' . md5($this->sRealm) . '"'; |
|
| 16 | 16 | } |
| 17 | 17 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | /** |
| 97 | 97 | * @return bool |
| 98 | 98 | */ |
| 99 | - public function outputStatusHeader () { |
|
| 99 | + public function outputStatusHeader() { |
|
| 100 | 100 | if (vsc::isCli()) { return false; } |
| 101 | 101 | if ($this->getStatus()) { |
| 102 | 102 | header(HttpResponseA::getHttpStatusString($this->getServerProtocol(), $this->getStatus())); |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | /** |
| 186 | 186 | * @return bool |
| 187 | 187 | */ |
| 188 | - protected function outputCustomHeaders () { |
|
| 188 | + protected function outputCustomHeaders() { |
|
| 189 | 189 | if (vsc::isCli()) { return false; } |
| 190 | 190 | $aHeaders = $this->getCustomHeaders(); |
| 191 | 191 | if (is_array($aHeaders)) { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // this will break if the current map is the first loaded |
| 20 | -$this->getCurrentModuleMap()->setMainTemplatePath(VSC_SRC_PATH.'templates'); |
|
| 20 | +$this->getCurrentModuleMap()->setMainTemplatePath(VSC_SRC_PATH . 'templates'); |
|
| 21 | 21 | $this->getCurrentModuleMap()->setMainTemplate('main.php'); |
| 22 | 22 | |
| 23 | 23 | //$oMap = $this->map ('.+', \vsc\application\processors\EmptyProcessor::class); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | // fallback 404 processor for everything |
| 34 | 34 | $oMap = $this->map('(.*)\Z', \vsc\application\processors\NotFoundProcessor::class); |
| 35 | -$oMap->setTemplatePath(VSC_SRC_PATH.'templates'); |
|
| 35 | +$oMap->setTemplatePath(VSC_SRC_PATH . 'templates'); |
|
| 36 | 36 | $oMap->setTemplate('404.php'); |
| 37 | 37 | |
| 38 | 38 | // front controllers |
@@ -23,8 +23,9 @@ discard block |
||
| 23 | 23 | * @param string $sOffset |
| 24 | 24 | */ |
| 25 | 25 | protected function setCurrent($sOffset) { |
| 26 | - if ($this->offsetExists($sOffset)) |
|
| 27 | - $this->_current = $sOffset; |
|
| 26 | + if ($this->offsetExists($sOffset)) { |
|
| 27 | + $this->_current = $sOffset; |
|
| 28 | + } |
|
| 28 | 29 | } |
| 29 | 30 | |
| 30 | 31 | /** |
@@ -61,7 +62,9 @@ discard block |
||
| 61 | 62 | $mirror = new \ReflectionClass($this); |
| 62 | 63 | foreach ($mirror->getProperties() as $mirrorProperty) { |
| 63 | 64 | $name = $mirrorProperty->getName(); |
| 64 | - if ($name == '_current') continue; |
|
| 65 | + if ($name == '_current') { |
|
| 66 | + continue; |
|
| 67 | + } |
|
| 65 | 68 | $ret[] = $name; |
| 66 | 69 | } |
| 67 | 70 | |
@@ -72,8 +75,7 @@ discard block |
||
| 72 | 75 | * Iterator interface |
| 73 | 76 | * @return mixed |
| 74 | 77 | */ |
| 75 | - public function current() |
|
| 76 | - { |
|
| 78 | + public function current() { |
|
| 77 | 79 | if (is_null($this->_current)) { |
| 78 | 80 | $this->rewind(); |
| 79 | 81 | } |
@@ -83,8 +85,7 @@ discard block |
||
| 83 | 85 | /** |
| 84 | 86 | * @return string |
| 85 | 87 | */ |
| 86 | - public function key() |
|
| 87 | - { |
|
| 88 | + public function key() { |
|
| 88 | 89 | if (is_null($this->_current)) { |
| 89 | 90 | $this->rewind(); |
| 90 | 91 | } |
@@ -94,8 +95,7 @@ discard block |
||
| 94 | 95 | /** |
| 95 | 96 | * @return void |
| 96 | 97 | */ |
| 97 | - public function next() |
|
| 98 | - { |
|
| 98 | + public function next() { |
|
| 99 | 99 | $aKeys = $this->getPropertyNames(); |
| 100 | 100 | |
| 101 | 101 | $iCurrent = array_search($this->_current, $aKeys); |
@@ -110,8 +110,7 @@ discard block |
||
| 110 | 110 | /** |
| 111 | 111 | * @return void |
| 112 | 112 | */ |
| 113 | - public function rewind() |
|
| 114 | - { |
|
| 113 | + public function rewind() { |
|
| 115 | 114 | $aKeys = $this->getPropertyNames(); |
| 116 | 115 | |
| 117 | 116 | if (is_array($aKeys) && isset($aKeys[0])) { |
@@ -122,8 +121,7 @@ discard block |
||
| 122 | 121 | /** |
| 123 | 122 | * @return bool |
| 124 | 123 | */ |
| 125 | - public function valid() |
|
| 126 | - { |
|
| 124 | + public function valid() { |
|
| 127 | 125 | $aKeys = $this->getPropertyNames(); |
| 128 | 126 | |
| 129 | 127 | if (in_array($this->_current, $aKeys)) { |
@@ -40,8 +40,7 @@ discard block |
||
| 40 | 40 | * @param mixed $mValue |
| 41 | 41 | * @throws |
| 42 | 42 | */ |
| 43 | - public function offsetSet($sOffset, $mValue) |
|
| 44 | - { |
|
| 43 | + public function offsetSet($sOffset, $mValue) { |
|
| 45 | 44 | $this->__set($sOffset, $mValue); |
| 46 | 45 | } |
| 47 | 46 | |
@@ -49,16 +48,14 @@ discard block |
||
| 49 | 48 | * @param string $sOffset |
| 50 | 49 | * @return bool |
| 51 | 50 | */ |
| 52 | - public function offsetExists($sOffset) |
|
| 53 | - { |
|
| 51 | + public function offsetExists($sOffset) { |
|
| 54 | 52 | return in_array($sOffset, $this->getPropertyNames()); |
| 55 | 53 | } |
| 56 | 54 | |
| 57 | 55 | /** |
| 58 | 56 | * @param string $sOffset |
| 59 | 57 | */ |
| 60 | - public function offsetUnset($sOffset) |
|
| 61 | - { |
|
| 58 | + public function offsetUnset($sOffset) { |
|
| 62 | 59 | $oProperty = new \ReflectionProperty($this, $sOffset); |
| 63 | 60 | if ($oProperty->isPublic()) { |
| 64 | 61 | unset ($this->$sOffset); |
@@ -69,8 +66,7 @@ discard block |
||
| 69 | 66 | * @param string $sOffset |
| 70 | 67 | * @return mixed |
| 71 | 68 | */ |
| 72 | - public function offsetGet($sOffset) |
|
| 73 | - { |
|
| 69 | + public function offsetGet($sOffset) { |
|
| 74 | 70 | return $this->__get($sOffset); |
| 75 | 71 | } |
| 76 | 72 | |