wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/rest-api/src/Domain/ReadModel/Sitelinks.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php declare( strict_types = 1 );

namespace Wikibase\Repo\RestApi\Domain\ReadModel;

use ArrayObject;

/**
 * @license GPL-2.0-or-later
 */
class Sitelinks extends ArrayObject {

    public function __construct( Sitelink ...$sitelinks ) {
        parent::__construct(
            array_combine(
                array_map( fn( Sitelink $sitelink ) => $sitelink->getSiteId(), $sitelinks ),
                $sitelinks
            )
        );
    }

}