diff --git a/src/Command/Activity/ActivityGetCommand.php b/src/Command/Activity/ActivityGetCommand.php index 23c8f66b3..26d2415e1 100644 --- a/src/Command/Activity/ActivityGetCommand.php +++ b/src/Command/Activity/ActivityGetCommand.php @@ -1,7 +1,6 @@ getProject() ->getActivity($id); if (!$activity) { - /** @var Activity $activity */ $activity = $this->api->matchPartialId($id, $this->activityLoader->loadFromInput($apiResource, $input, 10) ?: [], 'Activity'); } } else { $activities = $this->activityLoader->loadFromInput($apiResource, $input, 1); - /** @var Activity|false $activity */ $activity = reset($activities); if (!$activity) { $this->stdErr->writeln('No activities found'); @@ -88,6 +86,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } + /** @var Activity $activity */ $properties = $activity->getProperties(); if (!$input->getOption('property') && !$this->table->formatIsMachineReadable()) { @@ -98,7 +97,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int // Add the fake "duration" property. if (!isset($properties['duration'])) { - $properties['duration'] = (new Activity())->getDuration($activity); + $properties['duration'] = (new \Platformsh\Cli\Model\Activity())->getDuration($activity); } if ($property = $input->getOption('property')) {