Skip to content

Commit

Permalink
Merge pull request #22 from Jeroen-G/fix/console-constructor
Browse files Browse the repository at this point in the history
Fixes composer autoload issues
  • Loading branch information
Jeroen-G authored Nov 27, 2020
2 parents 7966d7c + 53767c7 commit 140087d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/Infrastructure/Console/ElasticCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ class ElasticCreate extends Command

private Client $client;

public function __construct()
{
$this->client = ClientBuilder::create()->setHosts(config('explorer.connection'))->build();
parent::__construct();
}

public function handle(): int
{
$this->client = ClientBuilder::create()->setHosts(config('explorer.connection'))->build();

$config = config('explorer');

if (!$config) {
Expand Down
7 changes: 1 addition & 6 deletions src/Infrastructure/Console/ElasticDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@ class ElasticDelete extends Command

private Client $client;

public function __construct()
{
$this->client = ClientBuilder::create()->setHosts(config('explorer.connection'))->build();
parent::__construct();
}

public function handle(): int
{
$this->client = ClientBuilder::create()->setHosts(config('explorer.connection'))->build();
$config = config('explorer');

if (!$config) {
Expand Down

0 comments on commit 140087d

Please sign in to comment.