district09/php_package_dg-geopunt-geolocation

View on GitHub
src/Value/Locations.php

Summary

Maintainability
A
45 mins
Test Coverage
<?php

declare(strict_types=1);

namespace DigipolisGent\Geopunt\Geolocation\Value;

use DigipolisGent\Value\CollectionAbstract;

/**
 * A collection of location values.
 */
final class Locations extends CollectionAbstract
{
    /**
     * Create the collection from location objects.
     *
     * @param \DigipolisGent\Geopunt\Geolocation\Value\LocationInterface ...$locations
     */
    public function __construct(LocationInterface ...$locations)
    {
        $this->values = $locations;
    }

    /**
     * @inheritDoc
     */
    public function __toString(): string
    {
        return implode(PHP_EOL, $this->values);
    }
}