✨ Ajoute le parser Orpi
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Parser;
|
||||
use GuzzleHttp\Exception\InvalidArgumentException;
|
||||
use Illuminate\Console\Command;
|
||||
use function GuzzleHttp\json_encode;
|
||||
|
||||
class ParseLinkCommand extends Command
|
||||
{
|
||||
@@ -39,7 +41,11 @@ class ParseLinkCommand extends Command
|
||||
public function handle()
|
||||
{
|
||||
$parser = Parser::factory($this->argument('url'));
|
||||
$parser->parse();
|
||||
try {
|
||||
$this->info(json_encode($parser->parse(), true));
|
||||
} catch (InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user