diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index ace946f3a..62fc7e0ee 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -104,6 +104,9 @@ EOT $this->updatePreferredOptions($config, $input, $preferSource, $preferDist, true); + if ($input->getOption('dev')) { + $io->writeError('You are using the deprecated option "dev". Dev packages are installed by default now.'); + } if ($input->getOption('no-custom-installers')) { $io->writeError('You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.'); $input->setOption('no-plugins', true); diff --git a/src/Composer/DependencyResolver/DefaultPolicy.php b/src/Composer/DependencyResolver/DefaultPolicy.php index 5c94c4680..542c6e625 100644 --- a/src/Composer/DependencyResolver/DefaultPolicy.php +++ b/src/Composer/DependencyResolver/DefaultPolicy.php @@ -62,16 +62,6 @@ class DefaultPolicy implements PolicyInterface return $pool->getPriority($package->getRepository()); } - /** - * @deprecated Method has been renamed to selectPreferredPackages, you should update usages - */ - public function selectPreferedPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null) - { - trigger_error('Method selectPreferedPackages is deprecated and replaced by selectPreferredPackages, please update your usage', E_USER_DEPRECATED); - - return $this->selectPreferredPackages($pool, $installedMap, $literals, $requiredPackage); - } - public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null) { $packages = $this->groupLiteralsByNamePreferInstalled($pool, $installedMap, $literals); diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index 54a002203..fbf2b92f8 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -147,14 +147,6 @@ class Rule return !(($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED); } - /** - * @deprecated Use public literals member - */ - public function getLiterals() - { - return $this->literals; - } - public function isAssertion() { return 1 === count($this->literals); diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 78ea92c03..509c01d81 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -175,21 +175,6 @@ class Installer $this->mockLocalRepositories($this->repositoryManager); } - // TODO remove this BC feature at some point - // purge old require-dev packages to avoid conflicts with the new way of handling dev requirements - $devRepo = new InstalledFilesystemRepository(new JsonFile($this->config->get('vendor-dir').'/composer/installed_dev.json')); - if ($devRepo->getPackages()) { - $this->io->writeError('BC Notice: Removing old dev packages to migrate to the new require-dev handling.'); - foreach ($devRepo->getPackages() as $package) { - if ($this->installationManager->isPackageInstalled($devRepo, $package)) { - $this->installationManager->uninstall($devRepo, new UninstallOperation($package)); - } - } - unlink($this->config->get('vendor-dir').'/composer/installed_dev.json'); - } - unset($devRepo, $package); - // end BC - if ($this->runScripts) { // dispatch pre event $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD; diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index 31090de00..e3cd6bd9b 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -153,7 +153,7 @@ class LibraryInstaller implements InstallerInterface /** * Returns the base path of the package without target-dir path * - * It is used for BC as getInstallPath tends to be overriden by + * It is used for BC as getInstallPath tends to be overridden by * installer plugins but not getPackageBasePath * * @param PackageInterface $package diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 4101d7826..ec673a62f 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -236,13 +236,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito return array_keys($this->providerListing); } - // BC handling for old providers-includes - $providers = array(); - foreach (array_keys($this->providerListing) as $provider) { - $providers[] = substr($provider, 2, -5); - } - - return $providers; + return array(); } protected function configurePackageTransportOptions(PackageInterface $package) @@ -304,15 +298,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito $url = str_replace(array('%package%', '%hash%'), array($name, $hash), $this->providersUrl); $cacheKey = 'provider-'.strtr($name, '/', '$').'.json'; } else { - // BC handling for old providers-includes - $url = 'p/'.$name.'.json'; - - // package does not exist in this repo - if (!isset($this->providerListing[$url])) { - return array(); - } - $hash = $this->providerListing[$url]['sha256']; - $cacheKey = null; + return array(); } $packages = null; @@ -459,9 +445,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito if (!empty($data['notify-batch'])) { $this->notifyUrl = $this->canonicalizeUrl($data['notify-batch']); - } elseif (!empty($data['notify_batch'])) { - // TODO remove this BC notify_batch support - $this->notifyUrl = $this->canonicalizeUrl($data['notify_batch']); } elseif (!empty($data['notify'])) { $this->notifyUrl = $this->canonicalizeUrl($data['notify']); } @@ -557,18 +540,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito $includedData = $this->fetchFile($url, $cacheKey, $metadata['sha256']); } - $this->loadProviderListings($includedData); - } - } elseif (isset($data['providers-includes'])) { - // BC layer for old-style providers-includes - $includes = $data['providers-includes']; - foreach ($includes as $include => $metadata) { - if ($this->cache->sha256($include) === $metadata['sha256']) { - $includedData = json_decode($this->cache->read($include), true); - } else { - $includedData = $this->fetchFile($include, null, $metadata['sha256']); - } - $this->loadProviderListings($includedData); } } diff --git a/src/Composer/Repository/RepositoryManager.php b/src/Composer/Repository/RepositoryManager.php index 42c14106f..05dcc1b4a 100644 --- a/src/Composer/Repository/RepositoryManager.php +++ b/src/Composer/Repository/RepositoryManager.php @@ -154,17 +154,4 @@ class RepositoryManager { return $this->localRepository; } - - /** - * Returns all local repositories for the project. - * - * @deprecated getLocalDevRepository is gone, so this is useless now, just use getLocalRepository instead - * @return array[WritableRepositoryInterface] - */ - public function getLocalRepositories() - { - trigger_error('This method is deprecated, use getLocalRepository instead since the getLocalDevRepository is now gone', E_USER_DEPRECATED); - - return array($this->localRepository); - } } diff --git a/tests/Composer/Test/Repository/ComposerRepositoryTest.php b/tests/Composer/Test/Repository/ComposerRepositoryTest.php index 3b35714df..115069441 100644 --- a/tests/Composer/Test/Repository/ComposerRepositoryTest.php +++ b/tests/Composer/Test/Repository/ComposerRepositoryTest.php @@ -110,7 +110,8 @@ class ComposerRepositoryTest extends TestCase $properties = array( 'cache' => $cache, 'loader' => new ArrayLoader(), - 'providerListing' => array('p/a.json' => array('sha256' => 'xxx')), + 'providerListing' => array('a' => array('sha256' => 'xxx')), + 'providersUrl' => 'https://dummy.test.link/to/%package%/file', ); foreach ($properties as $property => $value) {