protected function execute(InputInterface $input, OutputInterface $output) { $name = $input->getArgument('name'); $id = SteamID::create($name); $status = $id->isOnline() ? 'Online' : 'Offline'; $output->writeln("Current user nickname: <info>" . $id->getNickname() . '</info>, user is: <info>' . $status . '</info>'); if ($input->getOption('showgames')) { $games = $id->getGames(); foreach ($games as $gameId => $game) { $output->writeln('[' . $gameId . '] ' . $game->getName()); } } }
/** * @param $username * @param $game * @return array */ public function hoursPlayed($username, $game) { $id = SteamID::create($username); $stats = $id->getGameStats('tf2'); return $stats->getHoursPlayed(); }