aspirecloud/app/Values/WpOrg/Plugins/PluginUpdateCheckResponse.php
Chuck Adams 07759e34bc
filter plugin update requests if they contain a non-matching update_uri
Signed-off-by: Chuck Adams <chaz@chaz.works>
2025-11-25 10:11:06 -07:00

28 lines
850 B
PHP

<?php
declare(strict_types=1);
namespace App\Values\WpOrg\Plugins;
use App\Values\DTO;
use Bag\Values\Optional;
use Illuminate\Support\Collection;
readonly class PluginUpdateCheckResponse extends DTO
{
/**
* @param Collection<string, PluginUpdateResponseItem> $plugins
* @param Optional|Collection<string, PluginUpdateResponseItem> $no_update
* @param Collection<array-key, mixed> $translations
*/
public function __construct(
public Collection $plugins,
public Optional|Collection $no_update,
public Collection $translations,
) {}
// not the best name for the method but that's what we get for a negative-named property. $no_tea anyone?
public function withoutNoUpdate(): self
{
return $this->with(no_update: new Optional());
}
}