Skip to content

Commit 60aeaa3

Browse files
committed
Less dumpy
1 parent 5517e40 commit 60aeaa3

File tree

2 files changed

+11
-32
lines changed

2 files changed

+11
-32
lines changed

src/Managers/DownloadManager.php

+7-13
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DownloadManager
1616
* @var \Composer\Package\CompletePackage
1717
*/
1818
private $ownerPackage;
19-
19+
2020
/**
2121
* @var \Composer\Downloader\DownloadManager
2222
*/
@@ -26,7 +26,7 @@ class DownloadManager
2626
* @var \Composer\Installer\InstallationManager
2727
*/
2828
private $installationManager;
29-
29+
3030
/**
3131
* @var \Composer\Cache
3232
*/
@@ -46,7 +46,7 @@ class DownloadManager
4646
* @var \Vaimo\WebDriverBinaryDownloader\Analysers\PlatformAnalyser
4747
*/
4848
private $platformAnalyser;
49-
49+
5050
/**
5151
* @var \Vaimo\WebDriverBinaryDownloader\Utils\SystemUtils
5252
*/
@@ -91,13 +91,13 @@ public function __construct(
9191
$this->driverPkgFactory = $driverPkgFactory;
9292
$this->pluginConfig = $pluginConfig;
9393
$this->composer = $composer;
94-
94+
9595
$this->platformAnalyser = new \Vaimo\WebDriverBinaryDownloader\Analysers\PlatformAnalyser();
9696
$this->systemUtils = new \Vaimo\WebDriverBinaryDownloader\Utils\SystemUtils();
9797
$this->dataUtils = new \Vaimo\WebDriverBinaryDownloader\Utils\DataUtils();
9898
$this->stringUtils = new \Vaimo\WebDriverBinaryDownloader\Utils\StringUtils();
9999
}
100-
100+
101101
public function downloadRelease(array $versions)
102102
{
103103
$executableName = $this->dataUtils->extractValue(
@@ -107,7 +107,7 @@ public function downloadRelease(array $versions)
107107
);
108108

109109
$ownerName = $this->ownerPackage->getName();
110-
110+
111111
if (!$executableName) {
112112
$platformName = $this->platformAnalyser->getPlatformName();
113113

@@ -117,7 +117,7 @@ public function downloadRelease(array $versions)
117117
}
118118

119119
$name = sprintf('%s-virtual', $ownerName);
120-
120+
121121
$relativePath = $this->systemUtils->composePath(
122122
$this->ownerPackage->getName(),
123123
'downloads'
@@ -128,13 +128,7 @@ public function downloadRelease(array $versions)
128128
'downloads'
129129
);
130130

131-
echo "== downloadRelease fullpath == \n";
132-
\Symfony\Component\VarDumper\VarDumper::dump($fullPath);
133-
134131
while ($version = array_shift($versions)) {
135-
\Symfony\Component\VarDumper\VarDumper::dump($this->getDownloadUrl($version));
136-
\Symfony\Component\VarDumper\VarDumper::dump($relativePath);
137-
138132
$package = $this->driverPkgFactory->create(
139133
$name,
140134
$this->getDownloadUrl($version),

src/Managers/PackageManager.php

+4-19
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class PackageManager
1919
* @var \Composer\Util\Filesystem
2020
*/
2121
private $fileSystem;
22-
22+
2323
/**
2424
* @var \Vaimo\WebDriverBinaryDownloader\Analysers\PlatformAnalyser
2525
*/
@@ -71,36 +71,23 @@ public function installBinaries(PackageInterface $package, $binDir)
7171
{
7272
$sourceDir = $this->systemUtils->composePath($this->vendorDir, $package->getTargetDir());
7373

74-
echo "\n== installBinaries == \n";
75-
76-
\Symfony\Component\VarDumper\VarDumper::dump($this->vendorDir);
77-
\Symfony\Component\VarDumper\VarDumper::dump($package->getTargetDir());
78-
7974
$matches = [];
8075

8176
$binaries = $package->getBinaries();
8277

83-
\Symfony\Component\VarDumper\VarDumper::dump($binaries);
84-
8578
foreach ($binaries as $binary) {
8679
if (file_exists($this->systemUtils->composePath($sourceDir, $binary))) {
8780
$matches[] = $this->systemUtils->composePath($sourceDir, $binary);
8881
}
8982

9083
$globPattern = $this->systemUtils->composePath($sourceDir, '**', $binary);
9184

92-
\Symfony\Component\VarDumper\VarDumper::dump($globPattern);
93-
9485
$matches = array_merge(
9586
$matches,
9687
$this->systemUtils->recursiveGlob($globPattern)
9788
);
9889
}
9990

100-
echo "\n\n== Matches ==\n\n";
101-
\Symfony\Component\VarDumper\VarDumper::dump($matches);
102-
103-
10491
if (!$matches) {
10592
$errorMessage = sprintf(
10693
'Could not locate binaries (%s) from downloaded source',
@@ -113,19 +100,17 @@ public function installBinaries(PackageInterface $package, $binDir)
113100
)
114101
)
115102
);
116-
103+
117104
throw new \Exception($errorMessage);
118105
}
119106

120-
echo "\n== end installBinaries == \n";
121-
122107
$fileRenames = $this->pluginConfig->getExecutableFileRenames();
123-
108+
124109
$this->fileSystem->ensureDirectoryExists($binDir);
125110

126111
foreach (array_filter($matches, 'is_executable') as $fromPath) {
127112
$fileName = basename($fromPath);
128-
113+
129114
$toPath = $this->systemUtils->composePath(
130115
$binDir,
131116
$this->dataUtils->extractValue($fileRenames, $fileName, $fileName)

0 commit comments

Comments
 (0)