Browse Source

Almost PHPDoc problems fixed

Pavel Savinov 11 years ago
parent
commit
831bd844bd
31 changed files with 57 additions and 18 deletions
  1. 1 1
      src/Composer/Autoload/ClassMapGenerator.php
  2. 1 0
      src/Composer/Command/Command.php
  3. 1 0
      src/Composer/Config.php
  4. 1 0
      src/Composer/Console/Application.php
  5. 1 1
      src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php
  6. 1 1
      src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php
  7. 3 0
      src/Composer/DependencyResolver/Problem.php
  8. 8 5
      src/Composer/Downloader/DownloadManager.php
  9. 1 0
      src/Composer/Downloader/GitDownloader.php
  10. 1 1
      src/Composer/Downloader/SvnDownloader.php
  11. 2 0
      src/Composer/Factory.php
  12. 1 0
      src/Composer/IO/BufferIO.php
  13. 1 1
      src/Composer/IO/IOInterface.php
  14. 1 1
      src/Composer/Installer/InstallationManager.php
  15. 5 1
      src/Composer/Json/JsonFile.php
  16. 2 0
      src/Composer/Package/AliasPackage.php
  17. 2 1
      src/Composer/Package/Archiver/ArchiveManager.php
  18. 2 1
      src/Composer/Package/LinkConstraint/VersionConstraint.php
  19. 1 0
      src/Composer/Package/Locker.php
  20. 1 1
      src/Composer/Package/Package.php
  21. 1 0
      src/Composer/Package/Version/VersionParser.php
  22. 2 0
      src/Composer/Repository/Pear/BaseChannelReader.php
  23. 1 0
      src/Composer/Repository/Pear/ChannelReader.php
  24. 1 0
      src/Composer/Repository/Pear/ChannelRest10Reader.php
  25. 1 1
      src/Composer/Repository/RepositoryManager.php
  26. 1 1
      src/Composer/Repository/Vcs/SvnDriver.php
  27. 2 0
      src/Composer/Script/EventDispatcher.php
  28. 3 0
      src/Composer/Util/Filesystem.php
  29. 2 0
      src/Composer/Util/GitHub.php
  30. 4 0
      src/Composer/Util/RemoteFilesystem.php
  31. 2 1
      tests/Composer/Test/Repository/Pear/PackageDependencyParserTest.php

+ 1 - 1
src/Composer/Autoload/ClassMapGenerator.php

@@ -94,7 +94,7 @@ class ClassMapGenerator
      * Extract the classes in the given file
      *
      * @param string $path The file to check
-     *
+     * @throws \RuntimeException
      * @return array The found classes
      */
     private static function findClasses($path)

+ 1 - 0
src/Composer/Command/Command.php

@@ -38,6 +38,7 @@ abstract class Command extends BaseCommand
 
     /**
      * @param  bool     $required
+     * @throws \RuntimeException
      * @return Composer
      */
     public function getComposer($required = true)

+ 1 - 0
src/Composer/Config.php

@@ -123,6 +123,7 @@ class Config
      * Returns a setting
      *
      * @param  string $key
+     * @throws \RuntimeException
      * @return mixed
      */
     public function get($key)

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

@@ -143,6 +143,7 @@ class Application extends BaseApplication
 
     /**
      * @param  bool               $required
+     * @throws JsonValidationException
      * @return \Composer\Composer
      */
     public function getComposer($required = true)

+ 1 - 1
src/Composer/DependencyResolver/Operation/MarkAliasInstalledOperation.php

@@ -26,7 +26,7 @@ class MarkAliasInstalledOperation extends SolverOperation
     /**
      * Initializes operation.
      *
-     * @param PackageInterface $package package instance
+     * @param AliasPackage $package package instance
      * @param string           $reason  operation reason
      */
     public function __construct(AliasPackage $package, $reason = null)

+ 1 - 1
src/Composer/DependencyResolver/Operation/MarkAliasUninstalledOperation.php

@@ -26,7 +26,7 @@ class MarkAliasUninstalledOperation extends SolverOperation
     /**
      * Initializes operation.
      *
-     * @param PackageInterface $package package instance
+     * @param AliasPackage $package package instance
      * @param string           $reason  operation reason
      */
     public function __construct(AliasPackage $package, $reason = null)

+ 3 - 0
src/Composer/DependencyResolver/Problem.php

@@ -12,6 +12,8 @@
 
 namespace Composer\DependencyResolver;
 
+use Composer\Package\Link;
+
 /**
  * Represents a problem detected while solving dependencies
  *
@@ -67,6 +69,7 @@ class Problem
      * A human readable textual representation of the problem's reasons
      *
      * @param array $installedMap A map of all installed packages
+     * @return string
      */
     public function getPrettyString(array $installedMap = array())
     {

+ 8 - 5
src/Composer/Downloader/DownloadManager.php

@@ -44,6 +44,7 @@ class DownloadManager
      * Makes downloader prefer source installation over the dist.
      *
      * @param bool $preferSource prefer downloading from source
+     * @return DownloadManager
      */
     public function setPreferSource($preferSource)
     {
@@ -56,6 +57,7 @@ class DownloadManager
      * Makes downloader prefer dist installation over the source.
      *
      * @param bool $preferDist prefer downloading from dist
+     * @return DownloadManager
      */
     public function setPreferDist($preferDist)
     {
@@ -85,6 +87,7 @@ class DownloadManager
      *
      * @param string              $type       installation type
      * @param DownloaderInterface $downloader downloader instance
+     * @return DownloadManager
      */
     public function setDownloader($type, DownloaderInterface $downloader)
     {
@@ -101,7 +104,7 @@ class DownloadManager
      *
      * @return DownloaderInterface
      *
-     * @throws UnexpectedValueException if downloader for provided type is not registered
+     * @throws \InvalidArgumentException if downloader for provided type is not registered
      */
     public function getDownloader($type)
     {
@@ -120,8 +123,8 @@ class DownloadManager
      *
      * @return DownloaderInterface
      *
-     * @throws InvalidArgumentException if package has no installation source specified
-     * @throws LogicException           if specific downloader used to load package with
+     * @throws \InvalidArgumentException if package has no installation source specified
+     * @throws \LogicException           if specific downloader used to load package with
      *                                          wrong type
      */
     public function getDownloaderForInstalledPackage(PackageInterface $package)
@@ -155,7 +158,7 @@ class DownloadManager
      * @param string           $targetDir    target dir
      * @param bool             $preferSource prefer installation from source
      *
-     * @throws InvalidArgumentException if package have no urls to download from
+     * @throws \InvalidArgumentException if package have no urls to download from
      */
     public function download(PackageInterface $package, $targetDir, $preferSource = null)
     {
@@ -184,7 +187,7 @@ class DownloadManager
      * @param PackageInterface $target    target package version
      * @param string           $targetDir target dir
      *
-     * @throws InvalidArgumentException if initial package is not installed
+     * @throws \InvalidArgumentException if initial package is not installed
      */
     public function update(PackageInterface $initial, PackageInterface $target, $targetDir)
     {

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

@@ -272,6 +272,7 @@ class GitDownloader extends VcsDownloader
      * @param  string            $url
      * @param  string            $cwd
      * @param  bool              $initialClone    If true, the directory if cleared between every attempt
+     * @throws \InvalidArgumentException
      * @throws \RuntimeException
      */
     protected function runCommand($commandCallable, $url, $cwd, $initialClone = false)

+ 1 - 1
src/Composer/Downloader/SvnDownloader.php

@@ -68,7 +68,7 @@ class SvnDownloader extends VcsDownloader
      * @param string $url     SVN url
      * @param string $cwd     Working directory
      * @param string $path    Target for a checkout
-     *
+     * @throws \RuntimeException
      * @return string
      */
     protected function execute($baseUrl, $command, $url, $cwd = null, $path = null)

+ 2 - 0
src/Composer/Factory.php

@@ -34,6 +34,7 @@ use Composer\Autoload\AutoloadGenerator;
 class Factory
 {
     /**
+     * @throws \RuntimeException
      * @return Config
      */
     public static function createConfig()
@@ -175,6 +176,7 @@ class Factory
      * @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will
      *                                       read from the default filename
      * @throws \InvalidArgumentException
+     * @throws \UnexpectedValueException
      * @return Composer
      */
     public function createComposer(IOInterface $io, $localConfig = null)

+ 1 - 0
src/Composer/IO/BufferIO.php

@@ -25,6 +25,7 @@ class BufferIO extends ConsoleIO
     /**
      * @param string $input
      * @param int    $verbosity
+     * @param OutputFormatterInterface $formatter
      */
     public function __construct($input = '', $verbosity = null, OutputFormatterInterface $formatter = null)
     {

+ 1 - 1
src/Composer/IO/IOInterface.php

@@ -104,7 +104,7 @@ interface IOInterface
      *
      * @param string|array $question  The question to ask
      * @param callback     $validator A PHP callback
-     * @param integer      $attempts  Max number of times to ask before giving up (false by default, which means infinite)
+     * @param bool|integer      $attempts  Max number of times to ask before giving up (false by default, which means infinite)
      * @param string       $default   The default answer if none is given by the user
      *
      * @return mixed

+ 1 - 1
src/Composer/Installer/InstallationManager.php

@@ -90,7 +90,7 @@ class InstallationManager
      *
      * @return InstallerInterface
      *
-     * @throws InvalidArgumentException if installer for provided type is not registered
+     * @throws \InvalidArgumentException if installer for provided type is not registered
      */
     public function getInstaller($type)
     {

+ 5 - 1
src/Composer/Json/JsonFile.php

@@ -42,6 +42,7 @@ class JsonFile
      *
      * @param string           $path path to a lockfile
      * @param RemoteFilesystem $rfs  required for loading http/https json files
+     * @throws \InvalidArgumentException
      */
     public function __construct($path, RemoteFilesystem $rfs = null)
     {
@@ -74,6 +75,7 @@ class JsonFile
     /**
      * Reads json file.
      *
+     * @throws \RuntimeException
      * @return mixed
      */
     public function read()
@@ -98,6 +100,7 @@ class JsonFile
      *
      * @param array $hash    writes hash into json file
      * @param int   $options json_encode options (defaults to JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)
+     * @throws \UnexpectedValueException
      */
     public function write(array $hash, $options = 448)
     {
@@ -122,7 +125,7 @@ class JsonFile
      *
      * @param  int                       $schema a JsonFile::*_SCHEMA constant
      * @return bool                      true on success
-     * @throws \UnexpectedValueException
+     * @throws JsonValidationException
      */
     public function validateSchema($schema = self::STRICT_SCHEMA)
     {
@@ -291,6 +294,7 @@ class JsonFile
      * @return bool                      true on success
      * @throws \UnexpectedValueException
      * @throws JsonValidationException
+     * @throws ParsingException
      */
     protected static function validateSyntax($json, $file = null)
     {

+ 2 - 0
src/Composer/Package/AliasPackage.php

@@ -160,6 +160,8 @@ class AliasPackage extends BasePackage implements CompletePackageInterface
      * Use by the policy for sorting manually aliased packages first, see #576
      *
      * @param bool $value
+     *
+     * @return mixed
      */
     public function setRootPackageAlias($value)
     {

+ 2 - 1
src/Composer/Package/Archiver/ArchiveManager.php

@@ -95,7 +95,8 @@ class ArchiveManager
      * @param PackageInterface $package   The package to archive
      * @param string           $format    The format of the archive (zip, tar, ...)
      * @param string           $targetDir The diretory where to build the archive
-     *
+     * @throws \InvalidArgumentException
+     * @throws \RuntimeException
      * @return string The path of the created archive
      */
     public function archive(PackageInterface $package, $format, $targetDir)

+ 2 - 1
src/Composer/Package/LinkConstraint/VersionConstraint.php

@@ -61,8 +61,9 @@ class VersionConstraint extends SpecificConstraint
     }
 
     /**
-     *
      * @param VersionConstraint $provider
+     * @param bool $compareBranches
+     * @return bool
      */
     public function matchSpecific(VersionConstraint $provider, $compareBranches = false)
     {

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

@@ -88,6 +88,7 @@ class Locker
      * Searches and returns an array of locked packages, retrieved from registered repositories.
      *
      * @param  bool                                     $withDevReqs true to retrieve the locked dev packages
+     * @throws \RuntimeException
      * @return \Composer\Repository\RepositoryInterface
      */
     public function getLockedRepository($withDevReqs = false)

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

@@ -299,7 +299,7 @@ class Package extends BasePackage
     /**
      * Set the releaseDate
      *
-     * @param DateTime $releaseDate
+     * @param \DateTime $releaseDate
      */
     public function setReleaseDate(\DateTime $releaseDate)
     {

+ 1 - 0
src/Composer/Package/Version/VersionParser.php

@@ -88,6 +88,7 @@ class VersionParser
      *
      * @param  string $version
      * @param  string $fullVersion optional complete version string to give more context
+     * @throws \UnexpectedValueException
      * @return array
      */
     public function normalize($version, $fullVersion = null)

+ 2 - 0
src/Composer/Repository/Pear/BaseChannelReader.php

@@ -46,6 +46,7 @@ abstract class BaseChannelReader
      *
      * @param $origin string server
      * @param $path   string relative path to content
+     * @throws \UnexpectedValueException
      * @return \SimpleXMLElement
      */
     protected function requestContent($origin, $path)
@@ -64,6 +65,7 @@ abstract class BaseChannelReader
      *
      * @param $origin string server
      * @param $path   string relative path to content
+     * @throws \UnexpectedValueException
      * @return \SimpleXMLElement
      */
     protected function requestXml($origin, $path)

+ 1 - 0
src/Composer/Repository/Pear/ChannelReader.php

@@ -45,6 +45,7 @@ class ChannelReader extends BaseChannelReader
      * Reads PEAR channel through REST interface and builds list of packages
      *
      * @param $url string PEAR Channel url
+     * @throws \UnexpectedValueException
      * @return ChannelInfo
      */
     public function read($url)

+ 1 - 0
src/Composer/Repository/Pear/ChannelRest10Reader.php

@@ -107,6 +107,7 @@ class ChannelRest10Reader extends BaseChannelReader
      *
      * @param $baseUrl      string
      * @param $packageName  string
+     * @throws \Composer\Downloader\TransportException|\Exception
      * @return ReleaseInfo[] hash array with keys as version numbers
      */
     private function readPackageReleases($baseUrl, $packageName)

+ 1 - 1
src/Composer/Repository/RepositoryManager.php

@@ -88,7 +88,7 @@ class RepositoryManager
      * @param  string                   $type   repository type
      * @param  string                   $config repository configuration
      * @return RepositoryInterface
-     * @throws InvalidArgumentException if repository for provided type is not registered
+     * @throws \InvalidArgumentException if repository for provided type is not registered
      */
     public function createRepository($type, $config)
     {

+ 1 - 1
src/Composer/Repository/Vcs/SvnDriver.php

@@ -291,7 +291,7 @@ class SvnDriver extends VcsDriver
      *
      * @param string $command The svn command to run.
      * @param string $url     The SVN URL.
-     *
+     * @throws \RuntimeException
      * @return string
      */
     protected function execute($command, $url)

+ 2 - 0
src/Composer/Script/EventDispatcher.php

@@ -93,6 +93,8 @@ class EventDispatcher
      * Triggers the listeners of an event.
      *
      * @param Event $event The event object to pass to the event handlers/listeners.
+     * @throws \RuntimeException
+     * @throws \Exception
      */
     protected function doDispatch(Event $event)
     {

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

@@ -194,6 +194,7 @@ class Filesystem
      * @param  string $from
      * @param  string $to
      * @param  bool   $directories if true, the source/target are considered to be directories
+     * @throws \InvalidArgumentException
      * @return string
      */
     public function findShortestPath($from, $to, $directories = false)
@@ -235,6 +236,7 @@ class Filesystem
      * @param  string $from
      * @param  string $to
      * @param  bool   $directories if true, the source/target are considered to be directories
+     * @throws \InvalidArgumentException
      * @return string
      */
     public function findShortestPathCode($from, $to, $directories = false)
@@ -286,6 +288,7 @@ class Filesystem
      * given, it's size will be computed recursively.
      *
      * @param  string $path Path to the file or directory
+     * @throws \RuntimeException
      * @return int
      */
     public function size($path)

+ 2 - 0
src/Composer/Util/GitHub.php

@@ -70,6 +70,8 @@ class GitHub
      *
      * @param  string $originUrl The host this GitHub instance is located at
      * @param  string $message   The reason this authorization is required
+     * @throws \RuntimeException
+     * @throws \Composer\Downloader\TransportException|\Exception
      * @return bool   true on success
      */
     public function authorizeOAuthInteractively($originUrl, $message = null)

+ 4 - 0
src/Composer/Util/RemoteFilesystem.php

@@ -85,7 +85,10 @@ class RemoteFilesystem
      * @param string  $fileName          the local filename
      * @param boolean $progress          Display the progression
      *
+     * @throws TransportException|\Exception
      * @throws TransportException When the file could not be downloaded
+     *
+     * @return bool|string
      */
     protected function get($originUrl, $fileUrl, $additionalOptions = array(), $fileName = null, $progress = true)
     {
@@ -213,6 +216,7 @@ class RemoteFilesystem
      * @param integer $messageCode      The message code
      * @param integer $bytesTransferred The loaded size
      * @param integer $bytesMax         The total size
+     * @throws TransportException
      */
     protected function callbackGet($notificationCode, $severity, $message, $messageCode, $bytesTransferred, $bytesMax)
     {

+ 2 - 1
tests/Composer/Test/Repository/Pear/PackageDependencyParserTest.php

@@ -19,7 +19,8 @@ class PackageDependencyParserTest extends TestCase
     /**
      * @dataProvider dataProvider10
      * @param $expected
-     * @param $data
+     * @param $data10
+     * @param $data20
      */
     public function testShouldParseDependencies($expected, $data10, $data20)
     {