[ticket/11150] CS

PHPBB3-11150
This commit is contained in:
Tristan Darricau 2015-12-15 22:05:18 +01:00 committed by Tristan Darricau
parent 43038a65de
commit 1c9ecd084c
No known key found for this signature in database
GPG key ID: 817043C2E29DB881
4 changed files with 9 additions and 23 deletions

View file

@ -20,12 +20,10 @@ use Composer\IO\NullIO;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Repository\ComposerRepository; use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Semver\Constraint\ConstraintInterface; use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Util\RemoteFilesystem; use Composer\Util\RemoteFilesystem;
use phpbb\composer\io\null_io;
use phpbb\config\config; use phpbb\config\config;
use phpbb\exception\runtime_exception; use phpbb\exception\runtime_exception;
use phpbb\filesystem\filesystem; use phpbb\filesystem\filesystem;
@ -147,7 +145,7 @@ class installer
{ {
if (!$io) if (!$io)
{ {
$io = new NullIO(); $io = new null_io();
} }
$this->generate_ext_json_file($packages); $this->generate_ext_json_file($packages);
@ -241,7 +239,7 @@ class installer
$installed = []; $installed = [];
/** @var Link[] $required_links */ /** @var \Composer\Package\Link[] $required_links */
$required_links = $composer->getPackage()->getRequires(); $required_links = $composer->getPackage()->getRequires();
$installed_packages = $composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages(); $installed_packages = $composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
@ -318,7 +316,7 @@ class installer
$compatible_packages = []; $compatible_packages = [];
$repositories = $composer->getRepositoryManager()->getRepositories(); $repositories = $composer->getRepositoryManager()->getRepositories();
/** @var RepositoryInterface $repository */ /** @var \Composer\Repository\RepositoryInterface $repository */
foreach ($repositories as $repository) foreach ($repositories as $repository)
{ {
try try
@ -339,7 +337,7 @@ class installer
$hostname = parse_url($url, PHP_URL_HOST) ?: $url; $hostname = parse_url($url, PHP_URL_HOST) ?: $url;
$json = $rfs->getContents($hostname, $url, false); $json = $rfs->getContents($hostname, $url, false);
/** @var PackageInterface $package */ /** @var \Composer\Package\PackageInterface $package */
foreach (JsonFile::parseJson($json, $url)['packageNames'] as $package) foreach (JsonFile::parseJson($json, $url)['packageNames'] as $package)
{ {
$versions = $repository->findPackages($package); $versions = $repository->findPackages($package);
@ -351,7 +349,7 @@ class installer
{ {
// Pre-filter repo packages by their type // Pre-filter repo packages by their type
$packages = []; $packages = [];
/** @var PackageInterface $package */ /** @var \Composer\Package\PackageInterface $package */
foreach ($repository->getPackages() as $package) foreach ($repository->getPackages() as $package)
{ {
if ($package->getType() === $type) if ($package->getType() === $type)
@ -454,7 +452,7 @@ class installer
{ {
$core_stability_value = BasePackage::$stabilities[$core_stability]; $core_stability_value = BasePackage::$stabilities[$core_stability];
//VersionParser::parseStability($version['version']) //VersionParser::parseStability($version['version'])
/** @var PackageInterface $version */ /** @var \Composer\Package\PackageInterface $version */
foreach ($versions as $version) foreach ($versions as $version)
{ {
if (BasePackage::$stabilities[$version->getStability()] > $core_stability_value) if (BasePackage::$stabilities[$version->getStability()] > $core_stability_value)

View file

@ -13,13 +13,7 @@
namespace phpbb\composer\io; namespace phpbb\composer\io;
use Composer\IO\ConsoleIO;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use phpbb\language\language;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
interface io_interface extends IOInterface interface io_interface extends IOInterface
{ {

View file

@ -13,14 +13,9 @@
namespace phpbb\composer\io; namespace phpbb\composer\io;
use Composer\IO\ConsoleIO;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use phpbb\language\language;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class console_io extends NullIO implements io_interface class null_io extends NullIO implements io_interface
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}

View file

@ -13,7 +13,6 @@
namespace phpbb\composer\io; namespace phpbb\composer\io;
use phpbb\language\language;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
/** /**
@ -22,7 +21,7 @@ use Symfony\Component\Console\Output\OutputInterface;
trait translate_composer_trait trait translate_composer_trait
{ {
/** /**
* @var language * @var \phpbb\language\language
*/ */
protected $language; protected $language;