From ebbc807de044dff0ba870bb589cb06310319c09c Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Mon, 12 Dec 2011 10:57:57 +0100 Subject: [PATCH] Fix whitespaces and add strict return code checking --- src/Composer/Repository/ComposerRepository.php | 2 +- src/Composer/Repository/Vcs/HgDriver.php | 4 ++-- src/Composer/Repository/Vcs/SvnDriver.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index d57201f9f..be1fd469b 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -27,7 +27,7 @@ class ComposerRepository extends ArrayRepository public function __construct(array $config) { if (!preg_match('{^\w+://}', $config['url'])) { - // assume http as the default protocol + // assume http as the default protocol $config['url'] = 'http://'.$config['url']; } $config['url'] = rtrim($config['url'], '/'); diff --git a/src/Composer/Repository/Vcs/HgDriver.php b/src/Composer/Repository/Vcs/HgDriver.php index ffd2d3100..23a4ebebc 100644 --- a/src/Composer/Repository/Vcs/HgDriver.php +++ b/src/Composer/Repository/Vcs/HgDriver.php @@ -175,12 +175,12 @@ class HgDriver implements VcsDriverInterface if (preg_match('#(^(?:https?|ssh)://(?:[^@]@)?bitbucket.org|https://(?:.*?)\.kilnhg.com)#i', $url)) { return true; } - + if (!$deep) { return false; } exec(sprintf('hg identify %s', escapeshellarg($url)), $ignored, $exit); - return $exit == 0; + return $exit === 0; } } diff --git a/src/Composer/Repository/Vcs/SvnDriver.php b/src/Composer/Repository/Vcs/SvnDriver.php index 9d8d555ad..c968dfab7 100644 --- a/src/Composer/Repository/Vcs/SvnDriver.php +++ b/src/Composer/Repository/Vcs/SvnDriver.php @@ -177,8 +177,8 @@ class SvnDriver implements VcsDriverInterface if (!$deep) { return false; } - + exec(sprintf('svn info --non-interactive %s 2>/dev/null', escapeshellarg($url)), $ignored, $exit); - return $exit == 0; + return $exit === 0; } }