Skip to content

Commit

Permalink
Use Storage::build instead of setPathPrefix hack
Browse files Browse the repository at this point in the history
  • Loading branch information
juampi92 committed Aug 10, 2022
1 parent e32b8ac commit 57f8143
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/Application/Baseline/BaselineLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;

class BaselineLoader
{
Expand All @@ -12,13 +13,10 @@ class BaselineLoader
private Filesystem $filesystem;

public function __construct(
Repository $config,
Filesystem $filesystem
Repository $config
) {
$this->filesystem = $filesystem;
$this->config = $config;
// Hack needed to access files from the absolute path.
$this->filesystem->getDriver()->getAdapter()->setPathPrefix('\\');
$this->filesystem = Storage::build(base_path());
}

public function load(): BaselineCollection
Expand Down Expand Up @@ -46,6 +44,6 @@ public function save(BaselineCollection $baseline): void

private function getPath(): string
{
return base_path($this->config->get('phecks.baseline'));
return $this->config->get('phecks.baseline');
}
}

0 comments on commit 57f8143

Please sign in to comment.