1
0
Fork 0

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)
pull/5888/head
Rob Bast 2016-11-21 10:00:05 +01:00
parent de9f333ec6
commit 611d6a0364
No known key found for this signature in database
GPG Key ID: 73076E35E6165F39
1 changed files with 5 additions and 4 deletions

View File

@ -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();
}
/**