mirror of
https://github.com/composer/composer
synced 2025-05-10 17:12:51 +00:00
Fix CS (#11003)
This commit is contained in:
parent
6e205a0c84
commit
131da999ac
357 changed files with 5943 additions and 9174 deletions
|
@ -31,32 +31,32 @@ class RuleSetIteratorTest extends TestCase
|
|||
{
|
||||
$this->pool = new Pool();
|
||||
|
||||
$this->rules = array(
|
||||
RuleSet::TYPE_REQUEST => array(
|
||||
new GenericRule(array(), Rule::RULE_ROOT_REQUIRE, array('packageName' => '', 'constraint' => new MatchAllConstraint)),
|
||||
new GenericRule(array(), Rule::RULE_ROOT_REQUIRE, array('packageName' => '', 'constraint' => new MatchAllConstraint)),
|
||||
),
|
||||
RuleSet::TYPE_LEARNED => array(
|
||||
new GenericRule(array(), Rule::RULE_LEARNED, 1),
|
||||
),
|
||||
RuleSet::TYPE_PACKAGE => array(),
|
||||
);
|
||||
$this->rules = [
|
||||
RuleSet::TYPE_REQUEST => [
|
||||
new GenericRule([], Rule::RULE_ROOT_REQUIRE, ['packageName' => '', 'constraint' => new MatchAllConstraint]),
|
||||
new GenericRule([], Rule::RULE_ROOT_REQUIRE, ['packageName' => '', 'constraint' => new MatchAllConstraint]),
|
||||
],
|
||||
RuleSet::TYPE_LEARNED => [
|
||||
new GenericRule([], Rule::RULE_LEARNED, 1),
|
||||
],
|
||||
RuleSet::TYPE_PACKAGE => [],
|
||||
];
|
||||
}
|
||||
|
||||
public function testForeach(): void
|
||||
{
|
||||
$ruleSetIterator = new RuleSetIterator($this->rules);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($ruleSetIterator as $rule) {
|
||||
$result[] = $rule;
|
||||
}
|
||||
|
||||
$expected = array(
|
||||
$expected = [
|
||||
$this->rules[RuleSet::TYPE_REQUEST][0],
|
||||
$this->rules[RuleSet::TYPE_REQUEST][1],
|
||||
$this->rules[RuleSet::TYPE_LEARNED][0],
|
||||
);
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
@ -65,16 +65,16 @@ class RuleSetIteratorTest extends TestCase
|
|||
{
|
||||
$ruleSetIterator = new RuleSetIterator($this->rules);
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
foreach ($ruleSetIterator as $key => $rule) {
|
||||
$result[] = $key;
|
||||
}
|
||||
|
||||
$expected = array(
|
||||
$expected = [
|
||||
RuleSet::TYPE_REQUEST,
|
||||
RuleSet::TYPE_REQUEST,
|
||||
RuleSet::TYPE_LEARNED,
|
||||
);
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue