Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Yii Framework 2 Change Log
- Bug #20576: Fix `@var` annotation for `StringValidator::$length` (mspirkov)
- Enh #20579: Add PHPStan/Psalm annotations for `HeaderCollection::get` (mspirkov)
- Bug #20583: Fix return value in `Request::getServerPort` (mspirkov)
- Bug #20585: Fix `@return` annotation for `CompositeUrlRule::createRules()` (mspirkov)
- Bug #20587: Fix `@var` annotation for `yii\rbac\Item::$ruleName` (mspirkov)
- Bug #20589: Fix `@var` annotations for `yii\rbac\DbManager` properties (mspirkov)

Expand Down
2 changes: 1 addition & 1 deletion framework/web/CompositeUrlRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class CompositeUrlRule extends BaseObject implements UrlRuleInterface

/**
* Creates the URL rules that should be contained within this composite rule.
* @return UrlRuleInterface[] the URL rules
* @return UrlRuleInterface[]|UrlRuleInterface[][] the URL rules
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is in the structure with additional array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an array of the form array<string, UrlRuleInterface[]>. It contains several sets of rules grouped by URL name.

$rules[$urlName][] = $this->createRule($pattern, $prefix, $controller . '/' . $action);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is always like that or UrlRuleInterface[] is valid as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UrlRuleInterface[] is valid as well

$rule = Yii::createObject(array_merge($this->ruleConfig, $rule));
if (!$rule instanceof UrlRuleInterface) {
throw new InvalidConfigException('URL rule class must implement UrlRuleInterface.');
}
$rules[] = $rule;
}
return $rules;

*/
abstract protected function createRules();

Expand Down
Loading