Skip to content

Commit e62b045

Browse files
committed
Update PartTrait.php
1 parent 3d4bf9a commit e62b045

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Discord/Parts/PartTrait.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,21 +492,21 @@ protected function attributeCollectionHelper($key, $class, ?string $discrim = 'i
492492
* @param string $class The attribute class.
493493
* @param string $key The attribute key.
494494
*
495-
* @return ExCollectionInterface<Component>|Component[]
495+
* @return ExCollectionInterface
496496
*/
497-
protected function attributeTypedCollectionHelper(string $class, string $key = 'components'): ExCollectionInterface
497+
protected function attributeTypedCollectionHelper(string $class, string $key): ExCollectionInterface
498498
{
499499
$collection = Collection::for($class);
500500

501501
if (empty($this->attributes[$key])) {
502502
return $collection;
503503
}
504504

505-
foreach ($this->attributes[$key] as &$component) {
506-
if (! $component instanceof $class) {
507-
$component = $this->createOf($class::TYPES[$component->type ?? 0], $component);
505+
foreach ($this->attributes[$key] as &$part) {
506+
if (! $part instanceof $class) {
507+
$part = $this->createOf($class::TYPES[$part->type ?? 0], $part);
508508
}
509-
$collection->pushItem($component);
509+
$collection->pushItem($part);
510510
}
511511

512512
return $collection;

0 commit comments

Comments
 (0)