Browse Source

Merge remote-tracking branch 'francoispluchino/fix-phpdoc'

Conflicts:
	src/Composer/EventDispatcher/EventDispatcher.php
Jordi Boggiano 10 years ago
parent
commit
0ce0cf42e8

+ 4 - 0
src/Composer/Autoload/ClassLoader.php

@@ -143,6 +143,8 @@ class ClassLoader
      * @param string       $prefix  The prefix/namespace, with trailing '\\'
      * @param array|string $paths   The PSR-0 base directories
      * @param bool         $prepend Whether to prepend the directories
+     *
+     * @throws \InvalidArgumentException
      */
     public function addPsr4($prefix, $paths, $prepend = false)
     {
@@ -204,6 +206,8 @@ class ClassLoader
      *
      * @param string       $prefix The prefix/namespace, with trailing '\\'
      * @param array|string $paths  The PSR-4 base directories
+     *
+     * @throws \InvalidArgumentException
      */
     public function setPsr4($prefix, $paths)
     {

+ 1 - 0
src/Composer/Config/JsonConfigSource.php

@@ -37,6 +37,7 @@ class JsonConfigSource implements ConfigSourceInterface
      * Constructor
      *
      * @param JsonFile $file
+     * @param bool     $authConfig
      */
     public function __construct(JsonFile $file, $authConfig = false)
     {

+ 1 - 0
src/Composer/Console/Application.php

@@ -139,6 +139,7 @@ class Application extends BaseApplication
 
     /**
      * @param  InputInterface    $input
+     * @return string
      * @throws \RuntimeException
      */
     private function getNewWorkingDir(InputInterface $input)

+ 1 - 0
src/Composer/Downloader/ArchiveDownloader.php

@@ -138,6 +138,7 @@ abstract class ArchiveDownloader extends FileDownloader
      * Returns the folder content, excluding dotfiles
      *
      * @param string $dir Directory
+     * @return \SplFileInfo[]
      */
     private function getFolderContent($dir)
     {

+ 1 - 0
src/Composer/Downloader/DownloadManager.php

@@ -164,6 +164,7 @@ class DownloadManager
      * @param bool             $preferSource prefer installation from source
      *
      * @throws \InvalidArgumentException if package have no urls to download from
+     * @throws \RuntimeException
      */
     public function download(PackageInterface $package, $targetDir, $preferSource = null)
     {

+ 3 - 1
src/Composer/Downloader/GitDownloader.php

@@ -204,8 +204,10 @@ class GitDownloader extends VcsDownloader
      * @param  string      $path
      * @param  string      $reference
      * @param  string      $branch
-     * @param  DateTime    $date
+     * @param  \DateTime   $date
      * @return null|string if a string is returned, it is the commit reference that was checked out if the original could not be found
+     *
+     * @throws \RuntimeException
      */
     protected function updateToCommit($path, $reference, $branch, $date)
     {

+ 1 - 1
src/Composer/EventDispatcher/EventDispatcher.php

@@ -75,7 +75,7 @@ class EventDispatcher
      * Dispatch a script event.
      *
      * @param  string       $eventName The constant in ScriptEvents
-     * @param  Script\Event $event
+     * @param  bool         $devMode
      * @param  array        $additionalArgs
      * @return int          return code of the executed script if any, for php scripts a false return
      *                                value is changed to 1, anything else to 0

+ 8 - 0
src/Composer/Factory.php

@@ -38,6 +38,7 @@ class Factory
 {
     /**
      * @return string
+     * @throws \RuntimeException
      */
     protected static function getHomeDir()
     {
@@ -60,6 +61,8 @@ class Factory
     }
 
     /**
+     * @param string $home
+     *
      * @return string
      */
     protected static function getCacheDir($home)
@@ -82,6 +85,7 @@ class Factory
     }
 
     /**
+     * @param IOInterface|null $io
      * @return Config
      */
     public static function createConfig(IOInterface $io = null)
@@ -333,6 +337,7 @@ class Factory
      /**
      * @param Config $config
      * @param string $vendorDir
+     * @return Repository\InstalledFilesystemRepository|null
      */
     protected function createGlobalRepository(Config $config, $vendorDir)
     {
@@ -410,6 +415,9 @@ class Factory
     }
 
     /**
+     * @param Composer            $composer
+     * @param IOInterface         $io
+     * @param RepositoryInterface $globalRepository
      * @return Plugin\PluginManager
      */
     protected function createPluginManager(Composer $composer, IOInterface $io, RepositoryInterface $globalRepository = null)

+ 2 - 0
src/Composer/Installer.php

@@ -152,6 +152,8 @@ class Installer
      * Run installation (or update)
      *
      * @return int 0 on success or a positive error code on failure
+     *
+     * @throws \Exception
      */
     public function run()
     {

+ 1 - 1
src/Composer/Package/Package.php

@@ -495,7 +495,7 @@ class Package extends BasePackage
     /**
      * Set the dev autoload mapping
      *
-     * @param array $autoload Mapping of dev autoloading rules
+     * @param array $devAutoload Mapping of dev autoloading rules
      */
     public function setDevAutoload(array $devAutoload)
     {

+ 2 - 2
src/Composer/Package/Version/VersionParser.php

@@ -89,7 +89,7 @@ class VersionParser
      * @param  string                    $version
      * @param  string                    $fullVersion optional complete version string to give more context
      * @throws \UnexpectedValueException
-     * @return array
+     * @return string
      */
     public function normalize($version, $fullVersion = null)
     {
@@ -161,7 +161,7 @@ class VersionParser
      * Normalizes a branch name to be able to perform comparisons on it
      *
      * @param  string $name
-     * @return array
+     * @return string
      */
     public function normalizeBranch($name)
     {

+ 4 - 0
src/Composer/Plugin/PluginManager.php

@@ -103,6 +103,8 @@ class PluginManager
      * call this method as early as possible.
      *
      * @param RepositoryInterface $repo Repository to scan for plugins to install
+     *
+     * @throws \RuntimeException
      */
     public function loadRepository(RepositoryInterface $repo)
     {
@@ -186,6 +188,8 @@ class PluginManager
      * instead for BC
      *
      * @param PackageInterface $package
+     *
+     * @throws \UnexpectedValueException
      */
     public function registerPackage(PackageInterface $package)
     {

+ 6 - 0
src/Composer/Util/Filesystem.php

@@ -90,6 +90,8 @@ class Filesystem
      *
      * @param  string $directory
      * @return bool
+     *
+     * @throws \RuntimeException
      */
     public function removeDirectory($directory)
     {
@@ -174,6 +176,8 @@ class Filesystem
      *
      * @param  string $path
      * @return bool
+     *
+     * @throws \RuntimeException
      */
     public function unlink($path)
     {
@@ -198,6 +202,8 @@ class Filesystem
      *
      * @param  string $path
      * @return bool
+     *
+     * @throws \RuntimeException
      */
     public function rmdir($path)
     {

+ 2 - 1
src/Composer/Util/RemoteFilesystem.php

@@ -43,6 +43,7 @@ class RemoteFilesystem
      * Constructor.
      *
      * @param IOInterface $io      The IO instance
+     * @param Config      $config  The config
      * @param array       $options The options
      */
     public function __construct(IOInterface $io, Config $config = null, array $options = array())
@@ -76,7 +77,7 @@ class RemoteFilesystem
      * @param boolean $progress  Display the progression
      * @param array   $options   Additional context options
      *
-     * @return string The content
+     * @return bool|string The content
      */
     public function getContents($originUrl, $fileUrl, $progress = true, $options = array())
     {

+ 1 - 0
src/Composer/Util/Svn.php

@@ -66,6 +66,7 @@ class Svn
     /**
      * @param string                   $url
      * @param \Composer\IO\IOInterface $io
+     * @param Config                   $config
      * @param ProcessExecutor          $process
      */
     public function __construct($url, IOInterface $io, Config $config, ProcessExecutor $process = null)