Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Sep 9, 2023
1 parent 159cdd0 commit 4fbe84c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 69 deletions.
68 changes: 34 additions & 34 deletions src/ActionForward.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@ public function get($k = null, $default = null)
public function setClientRedirect($type)
{
switch ($type) {
case 'href':
case 'replace':
$this->_isClientRedirect = $type;
break;
default:
$this->_isClientRedirect = false;
case 'href':
case 'replace':
$this->_isClientRedirect = $type;
break;
default:
$this->_isClientRedirect = false;
}

return $this->_isClientRedirect;
Expand Down Expand Up @@ -464,36 +464,36 @@ private function _processView()
public function go()
{
switch ($this->getType()) {
case 'redirect':
$this->_processHeader();
$path = $this->getPath(true);
if (!empty($this->_isClientRedirect)) {
$this['clientRedirectTo'] = $path;
$this['clientRedirectType'] = $this->_isClientRedirect;
}
callPlugin(
option('get', _ROUTER),
'go',
[
$path,
$this->_isClientRedirect,
]
);
case self::VIEW:
return $this->_processView();
case 'action':
default:
if (exists(_RUN_APP, 'plugin')) {
$run = plug(_RUN_APP);
$keepForward = $run[_FORWARD];
if (is_null($keepForward)) {
$keepForward = new HashMap();
$run[_FORWARD] = $keepForward;
case 'redirect':
$this->_processHeader();
$path = $this->getPath(true);
if (!empty($this->_isClientRedirect)) {
$this['clientRedirectTo'] = $path;
$this['clientRedirectType'] = $this->_isClientRedirect;
}
callPlugin(
option('get', _ROUTER),
'go',
[
$path,
$this->_isClientRedirect,
]
);
case self::VIEW:
return $this->_processView();
case 'action':
default:
if (exists(_RUN_APP, 'plugin')) {
$run = plug(_RUN_APP);
$keepForward = $run[_FORWARD];
if (is_null($keepForward)) {
$keepForward = new HashMap();
$run[_FORWARD] = $keepForward;
}
$keepForward[[]] = $this->get();
}
$keepForward[[]] = $this->get();
}

return $this;
return $this;
}
}
}
15 changes: 7 additions & 8 deletions src/_app_not_found.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @link https://packagist.org/packages/pmvc/pmvc
*/
// @codingStandardsIgnoreStart
${_INIT_CONFIG}[_CLASS] = __NAMESPACE__ . '\app_not_found';
${_INIT_CONFIG}[_CLASS] = __NAMESPACE__.'\app_not_found';
class app_not_found // @codingStandardsIgnoreEnd
{
public $caller;
Expand All @@ -59,21 +59,20 @@ public function __invoke($parents, $indexFile, $folders)
$path = $caller->getAppFile($parents, $indexFile);
if (!$path) {
throw new DomainException(
'Default app setting is not correct. [' .
$caller[_DEFAULT_APP] .
'Default app setting is not correct. ['.
$caller[_DEFAULT_APP].
']'
);
} else {
trigger_error(
json_encode([
'Error' =>
'No app found with routers, ' .
'Error' => 'No app found with routers, '.
'Please check following debug message.',
'Debug' => [
'Parent' => $parents,
'App' => $caller[_REAL_APP],
'Index' => $indexFile,
'Alias' => $alias ?: '',
'App' => $caller[_REAL_APP],
'Index' => $indexFile,
'Alias' => $alias ?: '',
],
]),
E_USER_WARNING
Expand Down
54 changes: 27 additions & 27 deletions src/_process_worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,38 +79,38 @@ public function __invoke()
}
};
switch ($taskAttr->type) {
case sup\TYPE_DAEMON:
$workerGroup = $taskAttr->group;
$inputConcurrency = get($form, $workerGroup);
$concurrency = !empty($inputConcurrency) &&
is_numeric($inputConcurrency) &&
$inputConcurrency > 1
? $form[$workerGroup]
: 1;
for ($i = 0; $i < $concurrency; $i++) {
case sup\TYPE_DAEMON:
$workerGroup = $taskAttr->group;
$inputConcurrency = get($form, $workerGroup);
$concurrency = !empty($inputConcurrency) &&
is_numeric($inputConcurrency) &&
$inputConcurrency > 1
? $form[$workerGroup]
: 1;
for ($i = 0; $i < $concurrency; $i++) {
new Parallel(
$wrap,
[
sup\TYPE => sup\TYPE_DAEMON,
sup\INTERVAL => $taskAttr->interval,
]
);
}
break;
case sup\TYPE_SCRIPT:
new Parallel(
$wrap,
[
sup\TYPE => sup\TYPE_DAEMON,
sup\INTERVAL => $taskAttr->interval,
sup\TYPE => sup\TYPE_SCRIPT,
sup\NAME => $action->name,
]
);
}
break;
case sup\TYPE_SCRIPT:
new Parallel(
$wrap,
[
sup\TYPE => sup\TYPE_SCRIPT,
sup\NAME => $action->name,
]
);
break;
default:
trigger_error(
'Wrong worker type ['.$taskAttr->type.']'
);
break;
break;
default:
trigger_error(
'Wrong worker type ['.$taskAttr->type.']'
);
break;
}
}
}
Expand Down

0 comments on commit 4fbe84c

Please sign in to comment.