Skip to content

Commit

Permalink
csfixed work with skippable
Browse files Browse the repository at this point in the history
  • Loading branch information
hiqsol committed Dec 26, 2016
1 parent 9f4362e commit 02019cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ public function readConfig($name)
*/
public function readFile($__path)
{
if (strncmp($__path, '?', 1) === 0) {
$__skippable = true;
$__skippable = strncmp($__path, '?', 1) === 0 ? '?' : '';
if ($__skippable) {
$__path = substr($__path, 1);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,19 @@ protected function prepareAliases(PackageInterface $package, $psr)
*/
public function preparePath(PackageInterface $package, $path)
{
$skippable = false;
if (strncmp($path, '?', 1) === 0) {
$skippable = true;
$skippable = strncmp($path, '?', 1) === 0 ? '?' : '';
if ($skippable) {
$path = substr($path, 1);
}

if (!$this->getFilesystem()->isAbsolutePath($path)) {
$prefix = $package instanceof RootPackageInterface
? $this->getBaseDir()
: $this->getVendorDir() . '/' . $package->getPrettyName();
$path = $prefix . '/' . $path;
}

return ($skippable ? '?' : '') . $this->getFilesystem()->normalizePath($path);
return $skippable . $this->getFilesystem()->normalizePath($path);
}

/**
Expand Down

0 comments on commit 02019cd

Please sign in to comment.