From 611d6a036403f5f8511a36953dc9d9b66358e6ed Mon Sep 17 00:00:00 2001 From: Rob Bast Date: Mon, 21 Nov 2016 10:00:05 +0100 Subject: [PATCH] use array as default value rather than assigning empty array in constructor. the latter can cause issues with mocks in some scenarios (if constructor does not get called) --- src/Composer/Package/BasePackage.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index 3dd390aa0..6106f8dda 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -49,12 +49,14 @@ abstract class BasePackage implements PackageInterface * @var int */ public $id; - + /** @var string */ protected $name; + /** @var string */ protected $prettyName; - + /** @var RepositoryInterface */ protected $repository; - protected $transportOptions; + /** @var array */ + protected $transportOptions = array(); /** * All descendants' constructors should call this parent constructor @@ -66,7 +68,6 @@ abstract class BasePackage implements PackageInterface $this->prettyName = $name; $this->name = strtolower($name); $this->id = -1; - $this->transportOptions = array(); } /**