Fix CS
parent
6825c04a62
commit
0ed5b541a9
|
@ -60,7 +60,7 @@ EOT
|
||||||
|
|
||||||
// First assemble lookup list of packages that are installed, replaced or provided
|
// First assemble lookup list of packages that are installed, replaced or provided
|
||||||
$installed = array();
|
$installed = array();
|
||||||
foreach($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
$installed[] = $package['name'];
|
$installed[] = $package['name'];
|
||||||
|
|
||||||
if (!empty($package['provide'])) {
|
if (!empty($package['provide'])) {
|
||||||
|
@ -88,8 +88,9 @@ EOT
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach ($package['suggest'] as $suggestion => $reason) {
|
foreach ($package['suggest'] as $suggestion => $reason) {
|
||||||
if (false === strpos('/', $suggestion) && !is_null($platform->findPackage($suggestion, '*')))
|
if (false === strpos('/', $suggestion) && !is_null($platform->findPackage($suggestion, '*'))) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (!isset($installed[$suggestion])) {
|
if (!isset($installed[$suggestion])) {
|
||||||
$suggesters[$packageName][$suggestion] = $reason;
|
$suggesters[$packageName][$suggestion] = $reason;
|
||||||
$suggested[$suggestion][$packageName] = $reason;
|
$suggested[$suggestion][$packageName] = $reason;
|
||||||
|
@ -114,6 +115,7 @@ EOT
|
||||||
foreach (array_keys($suggested) as $suggestion) {
|
foreach (array_keys($suggested) as $suggestion) {
|
||||||
$io->write(sprintf('<info>%s</info>', $suggestion));
|
$io->write(sprintf('<info>%s</info>', $suggestion));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
|
|
||||||
namespace Composer\Downloader;
|
namespace Composer\Downloader;
|
||||||
|
|
||||||
use Composer\Config;
|
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\IO\IOInterface;
|
use Composer\IO\IOInterface;
|
||||||
use Composer\Util\Filesystem;
|
use Composer\Util\Filesystem;
|
||||||
|
@ -313,6 +312,7 @@ class DownloadManager
|
||||||
if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) {
|
if ('dist' === $preference || (!$package->isDev() && 'auto' === $preference)) {
|
||||||
return 'dist';
|
return 'dist';
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'source';
|
return 'source';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ interface DvcsDownloaderInterface
|
||||||
* Checks for unpushed changes to a current branch
|
* Checks for unpushed changes to a current branch
|
||||||
*
|
*
|
||||||
* @param PackageInterface $package package directory
|
* @param PackageInterface $package package directory
|
||||||
* @param string $path package directory
|
* @param string $path package directory
|
||||||
* @return string|null changes or null
|
* @return string|null changes or null
|
||||||
*/
|
*/
|
||||||
public function getUnpushedChanges(PackageInterface $package, $path);
|
public function getUnpushedChanges(PackageInterface $package, $path);
|
||||||
|
|
|
@ -49,7 +49,7 @@ class PathDownloader extends FileDownloader
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the transport options with default values
|
// Get the transport options with default values
|
||||||
$transportOptions = $package->getTransportOptions() + array('symlink'=>null);
|
$transportOptions = $package->getTransportOptions() + array('symlink' => null);
|
||||||
|
|
||||||
// When symlink transport option is null, both symlink and mirror are allowed
|
// When symlink transport option is null, both symlink and mirror are allowed
|
||||||
$currentStrategy = self::STRATEGY_SYMLINK;
|
$currentStrategy = self::STRATEGY_SYMLINK;
|
||||||
|
@ -58,7 +58,7 @@ class PathDownloader extends FileDownloader
|
||||||
if (true === $transportOptions['symlink']) {
|
if (true === $transportOptions['symlink']) {
|
||||||
$currentStrategy = self::STRATEGY_SYMLINK;
|
$currentStrategy = self::STRATEGY_SYMLINK;
|
||||||
$allowedStrategies = array(self::STRATEGY_SYMLINK);
|
$allowedStrategies = array(self::STRATEGY_SYMLINK);
|
||||||
} elseif(false === $transportOptions['symlink']) {
|
} elseif (false === $transportOptions['symlink']) {
|
||||||
$currentStrategy = self::STRATEGY_MIRROR;
|
$currentStrategy = self::STRATEGY_MIRROR;
|
||||||
$allowedStrategies = array(self::STRATEGY_MIRROR);
|
$allowedStrategies = array(self::STRATEGY_MIRROR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,12 +88,12 @@ class RootPackageLoader extends ArrayLoader
|
||||||
$config['source'] = array(
|
$config['source'] = array(
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'url' => '',
|
'url' => '',
|
||||||
'reference' => $commit
|
'reference' => $commit,
|
||||||
);
|
);
|
||||||
$config['dist'] = array(
|
$config['dist'] = array(
|
||||||
'type' => '',
|
'type' => '',
|
||||||
'url' => '',
|
'url' => '',
|
||||||
'reference' => $commit
|
'reference' => $commit,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,8 +56,8 @@ class VersionGuesser
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $packageConfig
|
* @param array $packageConfig
|
||||||
* @param string $path Path to guess into
|
* @param string $path Path to guess into
|
||||||
*
|
*
|
||||||
* @return array versionData, 'version' and 'commit' keys
|
* @return array versionData, 'version' and 'commit' keys
|
||||||
*/
|
*/
|
||||||
|
@ -136,8 +136,8 @@ class VersionGuesser
|
||||||
return $this->versionParser->normalize(trim($output));
|
return $this->versionParser->normalize(trim($output));
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,9 +236,9 @@ class VersionGuesser
|
||||||
}
|
}
|
||||||
|
|
||||||
$version = $this->versionParser->normalize(trim($matches[1]));
|
$version = $this->versionParser->normalize(trim($matches[1]));
|
||||||
|
|
||||||
return array('version' => $version, 'commit' => '');
|
return array('version' => $version, 'commit' => '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,6 +639,7 @@ class Filesystem
|
||||||
* #define _S_IFREG 0x8000
|
* #define _S_IFREG 0x8000
|
||||||
*/
|
*/
|
||||||
$stat = lstat($junction);
|
$stat = lstat($junction);
|
||||||
|
|
||||||
return !($stat['mode'] & 0xC000);
|
return !($stat['mode'] & 0xC000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,6 +244,7 @@ class Perforce
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
$command = 'echo $' . $name;
|
$command = 'echo $' . $name;
|
||||||
|
|
|
@ -842,7 +842,7 @@ class DownloadManagerTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$manager->download($package, 'target_dir');
|
$manager->download($package, 'target_dir');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers Composer\Downloader\DownloadManager::resolvePackageInstallPreference
|
* @covers Composer\Downloader\DownloadManager::resolvePackageInstallPreference
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue