1
0
Fork 0

Almost PHPDoc problems fixed

pull/1999/head
Pavel Savinov 2013-06-13 11:05:44 +11:00
parent 2cb697a4bb
commit 831bd844bd
31 changed files with 57 additions and 18 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -104,7 +104,7 @@ interface IOInterface
* *
* @param string|array $question The question to ask * @param string|array $question The question to ask
* @param callback $validator A PHP callback * @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 * @param string $default The default answer if none is given by the user
* *
* @return mixed * @return mixed

View File

@ -90,7 +90,7 @@ class InstallationManager
* *
* @return InstallerInterface * @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) public function getInstaller($type)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -88,7 +88,7 @@ class RepositoryManager
* @param string $type repository type * @param string $type repository type
* @param string $config repository configuration * @param string $config repository configuration
* @return RepositoryInterface * @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) public function createRepository($type, $config)
{ {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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