PSR 2 compliance
This commit is contained in:
parent
b0e0dc33b6
commit
e84de66dfa
|
@ -52,7 +52,7 @@ function setFocusToWindow($window)
|
||||||
|
|
||||||
$container = getFocusedWindowContainer(getTree());
|
$container = getFocusedWindowContainer(getTree());
|
||||||
|
|
||||||
if ($container !== null) {
|
if (null !== $container) {
|
||||||
$number = getFocusWindowNumber(getDefaultFocusWindowNumber($container), count($container));
|
$number = getFocusWindowNumber(getDefaultFocusWindowNumber($container), count($container));
|
||||||
|
|
||||||
foreach ($container as $k => $window) {
|
foreach ($container as $k => $window) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ function getVisibleWorkspacesNodes(array $tree, array $workspaces): array
|
||||||
$nodes,
|
$nodes,
|
||||||
$tree['floating_nodes']
|
$tree['floating_nodes']
|
||||||
);
|
);
|
||||||
} elseif ($output === '__i3' && isset($tree['window'])) {
|
} elseif ('__i3' === $output && isset($tree['window'])) {
|
||||||
$nodes[] = $tree;
|
$nodes[] = $tree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,6 @@ function getVisibleWorkspacesNodes(array $tree, array $workspaces): array
|
||||||
foreach ($n['floating_nodes'] as $node) {
|
foreach ($n['floating_nodes'] as $node) {
|
||||||
$nodes[] = $node;
|
$nodes[] = $node;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ function getOrderedWorkspaces()
|
||||||
$json = shell_exec('i3-msg -t get_workspaces');
|
$json = shell_exec('i3-msg -t get_workspaces');
|
||||||
$workspaces = json_decode($json);
|
$workspaces = json_decode($json);
|
||||||
|
|
||||||
$ordered = array();
|
$ordered = [];
|
||||||
|
|
||||||
foreach ($workspaces as $w) {
|
foreach ($workspaces as $w) {
|
||||||
$ordered[] = $w->name;
|
$ordered[] = $w->name;
|
||||||
|
@ -34,7 +34,7 @@ function getMoveOption()
|
||||||
$argv[1] = 'next';
|
$argv[1] = 'next';
|
||||||
}
|
}
|
||||||
|
|
||||||
return in_array($argv[1], array('next', 'previous')) ? $argv[1] : 'next';
|
return in_array($argv[1], ['next', 'previous']) ? $argv[1] : 'next';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNextWorkspace($workspaces)
|
function getNextWorkspace($workspaces)
|
||||||
|
@ -70,4 +70,4 @@ function moveToWorkspace($workspace)
|
||||||
}
|
}
|
||||||
|
|
||||||
$workspaces = getOrderedWorkspaces();
|
$workspaces = getOrderedWorkspaces();
|
||||||
moveToWorkspace(getMoveOption() === 'next' ? getNextWorkspace($workspaces) : getPreviousWorkspace($workspaces));
|
moveToWorkspace('next' === getMoveOption() ? getNextWorkspace($workspaces) : getPreviousWorkspace($workspaces));
|
||||||
|
|
Loading…
Reference in a new issue