From 5c0efdcaa2f5b77673bd3d13c0172e8f05a836f1 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 1 Dec 2014 18:25:22 +0100 Subject: [PATCH] Move public properties to top and document them --- src/Composer/DependencyResolver/Rule.php | 12 ++++++++++-- src/Composer/Package/BasePackage.php | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index e592e3c16..922aa5735 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -29,6 +29,16 @@ class Rule const RULE_LEARNED = 12; const RULE_PACKAGE_ALIAS = 13; + /** + * The literals this rule consists of. + * + * Each element is a package id either positive for installation or + * negative meaning removal. + * + * @var array + */ + public $literals; + protected $pool; protected $disabled; @@ -41,8 +51,6 @@ class Rule protected $ruleHash; - public $literals; - public function __construct(Pool $pool, array $literals, $reason, $reasonData, $job = null) { $this->pool = $pool; diff --git a/src/Composer/Package/BasePackage.php b/src/Composer/Package/BasePackage.php index 0590a6931..e0f0eb22c 100644 --- a/src/Composer/Package/BasePackage.php +++ b/src/Composer/Package/BasePackage.php @@ -44,13 +44,19 @@ abstract class BasePackage implements PackageInterface 'dev' => self::STABILITY_DEV, ); + /** + * The package id, public for fast access in dependency solver + * Use getId() unless called extremely frequently. + * @var int + */ + public $id; + protected $name; protected $prettyName; protected $repository; protected $transportOptions; - public $id; /** * All descendants' constructors should call this parent constructor