main
Jordi Boggiano 11 years ago
parent 6f6228fb1d
commit 8d0b7f278e

@ -317,7 +317,7 @@ EOF;
}
}
if (preg_match('/\.phar$/', $path)){
if (preg_match('/\.phar$/', $path)) {
$baseDir = "'phar://' . " . $baseDir;
}

@ -121,8 +121,8 @@ class ClassLoader
/**
* Registers a set of classes, replacing any others previously set.
*
* @param string $prefix The classes prefix
* @param array|string $paths The location(s) of the classes
* @param string $prefix The classes prefix
* @param array|string $paths The location(s) of the classes
*/
public function set($prefix, $paths)
{

@ -93,9 +93,9 @@ class ClassMapGenerator
/**
* 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)
{

@ -66,6 +66,7 @@ class Cache
if ($this->io->isDebug()) {
$this->io->write('Reading '.$this->root . $file.' from cache');
}
return file_get_contents($this->root . $file);
}
@ -80,6 +81,7 @@ class Cache
if ($this->io->isDebug()) {
$this->io->write('Writing '.$this->root . $file.' into cache');
}
return file_put_contents($this->root . $file, $contents);
}
@ -98,6 +100,7 @@ class Cache
if ($this->io->isDebug()) {
$this->io->write('Writing '.$this->root . $file.' into cache');
}
return copy($source, $this->root . $file);
}
@ -116,6 +119,7 @@ class Cache
if ($this->io->isDebug()) {
$this->io->write('Reading '.$this->root . $file.' from cache');
}
return copy($this->root . $file, $target);
}

@ -115,6 +115,7 @@ EOT
$io->write('<info>Found an exact match '.$package->getPrettyString().'.</info>');
} else {
$io->write('<error>Could not find a package matching '.$packageName.'.</error>');
return false;
}

@ -37,7 +37,7 @@ abstract class Command extends BaseCommand
private $io;
/**
* @param bool $required
* @param bool $required
* @throws \RuntimeException
* @return Composer
*/

@ -284,6 +284,7 @@ EOT
if ('stash' === $val) {
return 'stash';
}
return $val !== 'false' && (bool) $val;
}
),

@ -14,9 +14,7 @@ namespace Composer\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Composer\Repository\CompositeRepository;
use Symfony\Component\Console\Output\OutputInterface;
use Composer\Autoload\AutoloadGenerator;
/**
* @author Jordi Boggiano <j.boggiano@seld.be>

@ -19,8 +19,6 @@ use Symfony\Component\Console\Output\OutputInterface;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Package\CompletePackageInterface;
use Composer\Package\AliasPackage;
use Composer\Factory;
/**

@ -44,16 +44,16 @@ EOT
{
$localFilename = realpath($_SERVER['argv'][0]) ?: $_SERVER['argv'][0];
$tempFilename = dirname($localFilename) . '/' . basename($localFilename, '.phar').'-temp.phar';
// check for permissions in local filesystem before start connection process
if (!is_writable($tempDirectory = dirname($tempFilename))) {
throw new FilesystemException('Composer update failed: the "'.$tempDirectory.'" directory used to download the temp file could not be written');
}
if (!is_writable($localFilename)) {
throw new FilesystemException('Composer update failed: the "'.$localFilename. '" file could not be written');
}
$protocol = extension_loaded('openssl') ? 'https' : 'http';
$rfs = new RemoteFilesystem($this->getIO());
$latest = trim($rfs->getContents('getcomposer.org', $protocol . '://getcomposer.org/version', false));
@ -61,7 +61,7 @@ EOT
if (Composer::VERSION !== $latest) {
$output->writeln(sprintf("Updating to version <info>%s</info>.", $latest));
$remoteFilename = $protocol . '://getcomposer.org/composer.phar';
$remoteFilename = $protocol . '://getcomposer.org/composer.phar';
$rfs->copy('getcomposer.org', $remoteFilename, $tempFilename);

@ -17,7 +17,6 @@ use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\DefaultPolicy;
use Composer\Factory;
use Composer\Package\CompletePackageInterface;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\Version\VersionParser;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;

@ -122,7 +122,7 @@ class Config
/**
* Returns a setting
*
* @param string $key
* @param string $key
* @throws \RuntimeException
* @return mixed
*/

@ -142,7 +142,7 @@ class Application extends BaseApplication
}
/**
* @param bool $required
* @param bool $required
* @throws JsonValidationException
* @return \Composer\Composer
*/

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

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

@ -66,7 +66,7 @@ class Problem
/**
* 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())

@ -43,7 +43,7 @@ class DownloadManager
/**
* 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)
@ -56,7 +56,7 @@ class DownloadManager
/**
* 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)
@ -85,8 +85,8 @@ class DownloadManager
/**
* Sets installer downloader for a specific installation type.
*
* @param string $type installation type
* @param DownloaderInterface $downloader downloader instance
* @param string $type installation type
* @param DownloaderInterface $downloader downloader instance
* @return DownloadManager
*/
public function setDownloader($type, DownloaderInterface $downloader)

@ -14,7 +14,7 @@ namespace Composer\Downloader;
/**
* Exception thrown when issues exist on local filesystem
*
*
* @author Javier Spagnoletti <jspagnoletti@javierspagnoletti.com.ar>
*/
class FilesystemException extends \Exception

@ -268,10 +268,10 @@ class GitDownloader extends VcsDownloader
/**
* Runs a command doing attempts for each protocol supported by github.
*
* @param callable $commandCallable A callable building the command for the given url
* @param string $url
* @param string $cwd
* @param bool $initialClone If true, the directory if cleared between every attempt
* @param callable $commandCallable A callable building the command for the given url
* @param string $url
* @param string $cwd
* @param bool $initialClone If true, the directory if cleared between every attempt
* @throws \InvalidArgumentException
* @throws \RuntimeException
*/

@ -63,11 +63,11 @@ class SvnDownloader extends VcsDownloader
* Execute an SVN command and try to fix up the process with credentials
* if necessary.
*
* @param string $baseUrl Base URL of the repository
* @param string $command SVN command to run
* @param string $url SVN url
* @param string $cwd Working directory
* @param string $path Target for a checkout
* @param string $baseUrl Base URL of the repository
* @param string $command SVN command to run
* @param string $url SVN url
* @param string $cwd Working directory
* @param string $path Target for a checkout
* @throws \RuntimeException
* @return string
*/

@ -328,8 +328,8 @@ class Factory
}
/**
* @param Config $config The configuration
* @param Downloader\DownloadManager $dm Manager use to download sources
* @param Config $config The configuration
* @param Downloader\DownloadManager $dm Manager use to download sources
*
* @return Archiver\ArchiveManager
*/

@ -23,8 +23,8 @@ use Symfony\Component\Console\Helper\HelperSet;
class BufferIO extends ConsoleIO
{
/**
* @param string $input
* @param int $verbosity
* @param string $input
* @param int $verbosity
* @param OutputFormatterInterface $formatter
*/
public function __construct($input = '', $verbosity = null, OutputFormatterInterface $formatter = null)

@ -104,7 +104,7 @@ interface IOInterface
*
* @param string|array $question The question to ask
* @param callback $validator A PHP callback
* @param bool|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

@ -742,7 +742,8 @@ class Installer
return false;
}
private function extractPlatformRequirements($links) {
private function extractPlatformRequirements($links)
{
$platformReqs = array();
foreach ($links as $link) {
if (preg_match(PlatformRepository::PLATFORM_PACKAGE_REGEX, $link->getTarget())) {
@ -857,8 +858,8 @@ class Installer
/**
* Create Installer
*
* @param IOInterface $io
* @param Composer $composer
* @param IOInterface $io
* @param Composer $composer
* @return Installer
*/
public static function create(IOInterface $io, Composer $composer)

@ -15,7 +15,6 @@ namespace Composer\Installer;
use Composer\Composer;
use Composer\Package\Package;
use Composer\IO\IOInterface;
use Composer\Autoload\AutoloadGenerator;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Package\PackageInterface;

@ -140,12 +140,14 @@ class LibraryInstaller implements InstallerInterface
public function getInstallPath(PackageInterface $package)
{
$targetDir = $package->getTargetDir();
return $this->getPackageBasePath($package) . ($targetDir ? '/'.$targetDir : '');
}
protected function getPackageBasePath(PackageInterface $package)
{
$this->initializeVendorDir();
return ($this->vendorDir ? $this->vendorDir.'/' : '') . $package->getPrettyName();
}

@ -40,8 +40,8 @@ class JsonFile
/**
* Initializes json file reader/parser.
*
* @param string $path path to a lockfile
* @param RemoteFilesystem $rfs required for loading http/https json files
* @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)
@ -98,8 +98,8 @@ class JsonFile
/**
* Writes 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 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)
@ -123,8 +123,8 @@ class JsonFile
/**
* Validates the schema of the current json file according to composer-schema.json rules
*
* @param int $schema a JsonFile::*_SCHEMA constant
* @return bool true on success
* @param int $schema a JsonFile::*_SCHEMA constant
* @return bool true on success
* @throws JsonValidationException
*/
public function validateSchema($schema = self::STRICT_SCHEMA)

@ -12,8 +12,6 @@
namespace Composer\Package\Archiver;
use Composer\Package\BasePackage;
use Composer\Package\PackageInterface;
use Composer\Util\Filesystem;
use Symfony\Component\Finder;
@ -36,8 +34,8 @@ class ArchivableFilesFinder extends \FilterIterator
/**
* Initializes the internal Symfony Finder with appropriate filters
*
* @param string $sources Path to source files to be archived
* @param array $excludes Composer's own exclude rules from composer.json
* @param string $sources Path to source files to be archived
* @param array $excludes Composer's own exclude rules from composer.json
*/
public function __construct($sources, array $excludes)
{
@ -64,6 +62,7 @@ class ArchivableFilesFinder extends \FilterIterator
foreach ($filters as $filter) {
$exclude = $filter->filter($relativePath, $exclude);
}
return !$exclude;
};

@ -13,8 +13,6 @@
namespace Composer\Package\Archiver;
use Composer\Downloader\DownloadManager;
use Composer\Factory;
use Composer\IO\NullIO;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackage;
use Composer\Util\Filesystem;
@ -60,6 +58,7 @@ class ArchiveManager
public function setOverwriteFiles($overwriteFiles)
{
$this->overwriteFiles = $overwriteFiles;
return $this;
}
@ -92,12 +91,12 @@ class ArchiveManager
/**
* Create an archive of the specified package.
*
* @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
* @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
* @return string The path of the created archive
*/
public function archive(PackageInterface $package, $format, $targetDir)
{

@ -12,8 +12,6 @@
namespace Composer\Package\Archiver;
use Composer\Package\PackageInterface;
/**
* @author Till Klampaeckel <till@php.net>
* @author Matthieu Moquet <matthieu@moquet.net>
@ -24,10 +22,10 @@ interface ArchiverInterface
/**
* Create an archive from the sources.
*
* @param string $sources The sources directory
* @param string $target The target file
* @param string $format The format used for archive
* @param array $excludes A list of patterns for files to exclude
* @param string $sources The sources directory
* @param string $target The target file
* @param string $format The format used for archive
* @param array $excludes A list of patterns for files to exclude
*
* @return string The path to the written archive file
*/

@ -44,7 +44,7 @@ abstract class BaseExcludeFilter
* Negated patterns overwrite exclude decisions of previous filters.
*
* @param string $relativePath The file's path relative to the sourcePath
* @param bool $exclude Whether a previous filter wants to exclude this file
* @param bool $exclude Whether a previous filter wants to exclude this file
*
* @return bool Whether the file should be excluded
*/
@ -63,13 +63,14 @@ abstract class BaseExcludeFilter
$exclude = !$negate;
}
}
return $exclude;
}
/**
* Processes a file containing exclude rules of different formats per line
*
* @param array $lines A set of lines to be parsed
* @param array $lines A set of lines to be parsed
* @param callback $lineParser The parser to be used on each line
*
* @return array Exclude patterns to be used in filter()
@ -89,6 +90,7 @@ abstract class BaseExcludeFilter
if ($line) {
return call_user_func($lineParser, $line);
}
return null;
}, $lines),
function ($pattern) {
@ -110,6 +112,7 @@ abstract class BaseExcludeFilter
foreach ($rules as $rule) {
$patterns[] = $this->generatePattern($rule);
}
return $patterns;
}
@ -138,6 +141,7 @@ abstract class BaseExcludeFilter
}
$pattern .= substr(Finder\Glob::toRegex($rule), 2, -2);
return array($pattern . '#', $negate, false);
}
}

@ -20,8 +20,8 @@ namespace Composer\Package\Archiver;
class ComposerExcludeFilter extends BaseExcludeFilter
{
/**
* @param string $sourcePath Directory containing sources to be filtered
* @param array $excludeRules An array of exclude rules from composer.json
* @param string $sourcePath Directory containing sources to be filtered
* @param array $excludeRules An array of exclude rules from composer.json
*/
public function __construct($sourcePath, array $excludeRules)
{

@ -64,6 +64,7 @@ class HgExcludeFilter extends BaseExcludeFilter
} else {
$this->patternMode = self::HG_IGNORE_REGEX;
}
return null;
}
@ -85,6 +86,7 @@ class HgExcludeFilter extends BaseExcludeFilter
{
$pattern = '#'.substr(Finder\Glob::toRegex($line), 2, -1).'#';
$pattern = str_replace('[^/]*', '.*', $pattern);
return array($pattern, false, true);
}
@ -99,6 +101,7 @@ class HgExcludeFilter extends BaseExcludeFilter
{
// WTF need to escape the delimiter safely
$pattern = '#'.preg_replace('/((?:\\\\\\\\)*)(\\\\?)#/', '\1\2\2\\#', $line).'#';
return array($pattern, false, true);
}
}

@ -12,9 +12,6 @@
namespace Composer\Package\Archiver;
use Composer\Package\BasePackage;
use Composer\Package\PackageInterface;
/**
* @author Till Klampaeckel <till@php.net>
* @author Nils Adermann <naderman@naderman.de>
@ -43,6 +40,7 @@ class PharArchiver implements ArchiverInterface
$phar = new \PharData($target, null, null, static::$formats[$format]);
$files = new ArchivableFilesFinder($sources, $excludes);
$phar->buildFromIterator($files, $sources);
return $target;
} catch (\UnexpectedValueException $e) {
$message = sprintf("Could not create archive '%s' from '%s': %s",

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

@ -123,7 +123,7 @@ class Locker
/**
* Returns the platform requirements stored in the lock file
*
* @param bool $withDevReqs if true, the platform requirements from the require-dev block are also returned
* @param bool $withDevReqs if true, the platform requirements from the require-dev block are also returned
* @return \Composer\Package\Link[]
*/
public function getPlatformRequirements($withDevReqs = false)
@ -306,7 +306,7 @@ class Locker
* Returns the packages's datetime for its source reference.
*
* @param PackageInterface $package The package to scan.
* @return string|null The formatted datetime or null if none was found.
* @return string|null The formatted datetime or null if none was found.
*/
private function getPackageTime(PackageInterface $package)
{

@ -12,9 +12,6 @@
namespace Composer\Package;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\Version\VersionParser;
/**
* @author Jordi Boggiano <j.boggiano@seld.be>
*/

@ -86,8 +86,8 @@ class VersionParser
/**
* Normalizes a version string to be able to perform comparisons on it
*
* @param string $version
* @param string $fullVersion optional complete version string to give more context
* @param string $version
* @param string $fullVersion optional complete version string to give more context
* @throws \UnexpectedValueException
* @return array
*/

@ -108,7 +108,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
* @return ReleaseInfo[] hash array with keys as version numbers
*/
private function readPackageReleases($baseUrl, $packageName)
{

@ -65,8 +65,8 @@ interface RepositoryInterface extends \Countable
/**
* Searches the repository for packages containing the query
*
* @param string $query search query
* @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only
* @param string $query search query
* @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only
* @return array[] an array of array('name' => '...', 'description' => '...')
*/
public function search($query, $mode = 0);

@ -85,8 +85,8 @@ class RepositoryManager
/**
* Returns a new repository for a specific installation type.
*
* @param string $type repository type
* @param string $config repository configuration
* @param string $type repository type
* @param string $config repository configuration
* @return RepositoryInterface
* @throws \InvalidArgumentException if repository for provided type is not registered
*/

@ -19,4 +19,4 @@ namespace Composer\Repository;
*/
class RepositorySecurityException extends \Exception
{
}
}

@ -289,8 +289,8 @@ class SvnDriver extends VcsDriver
* Execute an SVN command and try to fix up the process with credentials
* if necessary.
*
* @param string $command The svn command to run.
* @param string $url The SVN URL.
* @param string $command The svn command to run.
* @param string $url The SVN URL.
* @throws \RuntimeException
* @return string
*/
@ -316,8 +316,8 @@ class SvnDriver extends VcsDriver
/**
* Build the identifier respecting "package-path" config option
*
* @param string $baseDir The path to trunk/branch/tag
* @param int $revision The revision mark to add to identifier
* @param string $baseDir The path to trunk/branch/tag
* @param int $revision The revision mark to add to identifier
*
* @return string
*/
@ -326,4 +326,3 @@ class SvnDriver extends VcsDriver
return rtrim($baseDir, '/') . $this->packagePath . '/@' . $revision;
}
}

@ -44,13 +44,13 @@ abstract class VcsDriver implements VcsDriverInterface
*/
final public function __construct(array $repoConfig, IOInterface $io, Config $config, ProcessExecutor $process = null, RemoteFilesystem $remoteFilesystem = null)
{
if (self::isLocalUrl($repoConfig['url'])) {
$repoConfig['url'] = realpath(
preg_replace('/^file:\/\//', '', $repoConfig['url'])
);
}
$this->url = $repoConfig['url'];
$this->originUrl = $repoConfig['url'];
$this->repoConfig = $repoConfig;

@ -12,7 +12,6 @@
namespace Composer\Script;
use Composer\Autoload\AutoloadGenerator;
use Composer\IO\IOInterface;
use Composer\Composer;
use Composer\DependencyResolver\Operation\OperationInterface;
@ -54,8 +53,8 @@ class EventDispatcher
/**
* Dispatch a script event.
*
* @param string $eventName The constant in ScriptEvents
* @param Event $event
* @param string $eventName The constant in ScriptEvents
* @param Event $event
*/
public function dispatch($eventName, Event $event = null)
{
@ -92,7 +91,7 @@ class EventDispatcher
/**
* 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
*/

@ -191,9 +191,9 @@ class Filesystem
/**
* Returns the shortest path from $from to $to
*
* @param string $from
* @param string $to
* @param bool $directories if true, the source/target are considered to be directories
* @param string $from
* @param string $to
* @param bool $directories if true, the source/target are considered to be directories
* @throws \InvalidArgumentException
* @return string
*/
@ -233,9 +233,9 @@ class Filesystem
/**
* Returns PHP code that, when executed in $from, will return the path to $to
*
* @param string $from
* @param string $to
* @param bool $directories if true, the source/target are considered to be directories
* @param string $from
* @param string $to
* @param bool $directories if true, the source/target are considered to be directories
* @throws \InvalidArgumentException
* @return string
*/
@ -287,7 +287,7 @@ class Filesystem
* Returns size of a file or directory specified by path. If a directory is
* 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
*/
@ -307,7 +307,7 @@ class Filesystem
* Normalize a path. This replaces backslashes with slashes, removes ending
* slash and collapses redundant separators and up-level references.
*
* @param string $path Path to the file or directory
* @param string $path Path to the file or directory
* @return string
*/
public function normalizePath($path)

@ -68,11 +68,11 @@ class GitHub
/**
* Authorizes a GitHub domain interactively via OAuth
*
* @param string $originUrl The host this GitHub instance is located at
* @param string $message The reason this authorization is required
* @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
* @throws TransportException|\Exception
* @return bool true on success
*/
public function authorizeOAuthInteractively($originUrl, $message = null)
{

@ -86,7 +86,7 @@ class RemoteFilesystem
* @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
*/
@ -210,12 +210,12 @@ class RemoteFilesystem
/**
* Get notification action.
*
* @param integer $notificationCode The notification code
* @param integer $severity The severity level
* @param string $message The message
* @param integer $messageCode The message code
* @param integer $bytesTransferred The loaded size
* @param integer $bytesMax The total size
* @param integer $notificationCode The notification code
* @param integer $severity The severity level
* @param string $message The message
* @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)

@ -12,7 +12,7 @@
function includeIfExists($file)
{
return file_exists($file)===true ? include $file : false;
return file_exists($file) ? include $file : false;
}
if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../autoload.php'))) {

@ -67,6 +67,7 @@ class AutoloadGeneratorTest extends TestCase
->method('getInstallPath')
->will($this->returnCallback(function ($package) use ($that) {
$targetDir = $package->getTargetDir();
return $that->vendorDir.'/'.$package->getName() . ($targetDir ? '/'.$targetDir : '');
}));
$this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
@ -697,6 +698,7 @@ EOF;
->method('getInstallPath')
->will($this->returnCallback(function ($package) use ($vendorDir) {
$targetDir = $package->getTargetDir();
return $vendorDir.'/'.$package->getName() . ($targetDir ? '/'.$targetDir : '');
}));

@ -17,7 +17,7 @@ use Composer\Test\TestCase;
class InitCommandTest extends TestCase
{
function testParseValidAuthorString()
public function testParseValidAuthorString()
{
$command = new InitCommand;
$author = $command->parseAuthorString('John Smith <john@example.com>');
@ -25,14 +25,14 @@ class InitCommandTest extends TestCase
$this->assertEquals('john@example.com', $author['email']);
}
function testParseEmptyAuthorString()
public function testParseEmptyAuthorString()
{
$command = new InitCommand;
$this->setExpectedException('InvalidArgumentException');
$command->parseAuthorString('');
}
function testParseAuthorStringWithInvalidEmail()
public function testParseAuthorStringWithInvalidEmail()
{
$command = new InitCommand;
$this->setExpectedException('InvalidArgumentException');

@ -13,9 +13,7 @@
namespace Composer\Test\Package\Archiver;
use Composer\Factory;
use Composer\IO\NullIO;
use Composer\Package\Archiver;
use Composer\Package\Archiver\ArchiveManager;
use Composer\Package\PackageInterface;
class ArchiveManagerTest extends ArchiverTest

@ -13,7 +13,6 @@
namespace Composer\Test\Package;
use Composer\Package\Locker;
use Composer\Package\CompletePackage;
class LockerTest extends \PHPUnit_Framework_TestCase
{

Loading…
Cancel
Save