Skip to content

Commit

Permalink
Fix routing problem with 'target'
Browse files Browse the repository at this point in the history
  • Loading branch information
linc committed Oct 22, 2022
1 parent be127c6 commit 02c7888
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Render.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ public static function viewResult(array $comments)
*/
public static function viewFeatureList(Request $request)
{
if ($request->get('source')) {
$platform = $request->get('source');
if ($request->get('showsource')) {
$platform = $request->get('showsource');
$supported = \Porter\Support::getInstance()->getSources();
} else {
$platform = $request->get('target');
$platform = $request->get('showtarget');
$supported = \Porter\Support::getInstance()->getTargets();
}
$features = \Porter\Support::getInstance()->getAllFeatures();
Expand Down Expand Up @@ -386,7 +386,7 @@ public static function viewFeatureTable(string $type = 'sources')
echo '</tr></thead><tbody>';

foreach ($packages as $package) {
echo '<tr><td class="Platform"><span><a href="?' . rtrim($type, 's') . '='
echo '<tr><td class="Platform"><span><a href="?show' . rtrim($type, 's') . '='
. $package . '">' . $supported[$package]['name'] . '</a></span></td>';

// Status per platform.
Expand Down
4 changes: 2 additions & 2 deletions src/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Router
public static function run($request): callable
{
switch (true) {
case $request->get('source'): // Single source feature list.
case $request->get('target'): // Single target feature list.
case $request->get('showsource'): // Single source feature list.
case $request->get('showtarget'): // Single target feature list.
return '\Porter\Render::viewFeatureList';
case $request->get('sources'): // Overview table.
return '\Porter\Render::viewSourcesTable';
Expand Down

0 comments on commit 02c7888

Please sign in to comment.