-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRedistributeMatchFunds.php
More file actions
32 lines (26 loc) · 1007 Bytes
/
RedistributeMatchFunds.php
File metadata and controls
32 lines (26 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
namespace MatchBot\Application\Commands;
use MatchBot\Application\Matching\MatchFundsRedistributor;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
#[AsCommand(
name: 'matchbot:redistribute-match-funds',
description: 'Moves match funding allocations from lower to higher priority funds where possible'
)]
class RedistributeMatchFunds extends LockingCommand
{
public function __construct(
private MatchFundsRedistributor $matchFundsRedistributor,
) {
parent::__construct();
}
#[\Override]
protected function doExecute(InputInterface $input, OutputInterface $output): int
{
[$numberChecked, $donationsAmended] = $this->matchFundsRedistributor->redistributeMatchFunds();
$output->writeln("Checked $numberChecked donations and redistributed matching for $donationsAmended");
return 0;
}
}