mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fixes for implicit variable declarations, return type mismatches and invalid method declarations.
This commit is contained in:
parent
b059cbe37c
commit
f794ee7870
7 changed files with 26 additions and 8 deletions
|
@ -38,6 +38,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
protected $loader;
|
||||
protected $repoConfig;
|
||||
protected $branchErrorOccurred = false;
|
||||
private $drivers;
|
||||
|
||||
public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null)
|
||||
{
|
||||
|
@ -77,6 +78,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
if (isset($this->drivers[$this->type])) {
|
||||
$class = $this->drivers[$this->type];
|
||||
$driver = new $class($this->repoConfig, $this->io, $this->config);
|
||||
/** @var VcsDriverInterface $driver */
|
||||
$driver->initialize();
|
||||
|
||||
return $driver;
|
||||
|
@ -85,6 +87,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
foreach ($this->drivers as $driver) {
|
||||
if ($driver::supports($this->io, $this->config, $this->url)) {
|
||||
$driver = new $driver($this->repoConfig, $this->io, $this->config);
|
||||
/** @var VcsDriverInterface $driver */
|
||||
$driver->initialize();
|
||||
|
||||
return $driver;
|
||||
|
@ -94,6 +97,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
foreach ($this->drivers as $driver) {
|
||||
if ($driver::supports($this->io, $this->config, $this->url, true)) {
|
||||
$driver = new $driver($this->repoConfig, $this->io, $this->config);
|
||||
/** @var VcsDriverInterface $driver */
|
||||
$driver->initialize();
|
||||
|
||||
return $driver;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue