Skip to content

Commit

Permalink
Fix activity command bugs shown in Go tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Dec 25, 2024
1 parent 1452d86 commit 952e914
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Console/AdaptiveTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,9 @@ protected function getMaxContentWidth(int $columnCount): int|float
private function getCellWidth(mixed $cell): int|float
{
$lineWidths = [0];
$formatter = $this->outputCopy->getFormatter();
foreach (explode(PHP_EOL, (string) $cell) as $line) {
$lineWidths[] = Helper::width($line);
$lineWidths[] = Helper::width(Helper::removeDecoration($formatter, $line));
}
$cellWidth = max($lineWidths);
if ($cell instanceof TableCell && $cell->getColspan() > 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ActivityLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function loadFromInput(HasActivitiesInterface $apiResource, InputInterfac
}
}
if ($limit === null) {
$limit = $input->hasOption('limit') ? $input->getOption('limit') : null;
$limit = $input->hasOption('limit') ? (int) $input->getOption('limit') : null;
}
$availableTypes = self::getAvailableTypes();
$requestedIncludeTypes = $input->hasOption('type') ? ArrayArgument::getOption($input, 'type') : [];
Expand Down

0 comments on commit 952e914

Please sign in to comment.