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
*
* @param string $path The file to check
*
* @throws \RuntimeException
* @return array The found classes
*/
private static function findClasses($path)

View File

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

View File

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

View File

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

View File

@ -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)

View File

@ -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)

View File

@ -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())
{

View File

@ -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)
{

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)
{

View File

@ -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

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)

View File

@ -61,8 +61,9 @@ class VersionConstraint extends SpecificConstraint
}
/**
*
* @param VersionConstraint $provider
* @param bool $compareBranches
* @return bool
*/
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.
*
* @param bool $withDevReqs true to retrieve the locked dev packages
* @throws \RuntimeException
* @return \Composer\Repository\RepositoryInterface
*/
public function getLockedRepository($withDevReqs = false)

View File

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

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)
{

View File

@ -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)

View File

@ -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)
{

View File

@ -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)

View File

@ -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)

View File

@ -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)
{

View File

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