Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DeliveryDeleteAction | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| __invoke | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2020 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | declare(strict_types=1); |
| 23 | |
| 24 | namespace oat\taoDeliveryRdf\model\Delete; |
| 25 | |
| 26 | use oat\oatbox\extension\AbstractAction; |
| 27 | |
| 28 | /** |
| 29 | * Usage example: |
| 30 | * sudo -u www-data php index.php '\oat\taoDeliveryRdf\model\Delete\DeliveryDeleteAction' |
| 31 | * 'http://tao.local/tao.rdf#i5ec66a0a167263604f8a6c91908fa8ab3' |
| 32 | * |
| 33 | * Class DeliveryDeleteAction |
| 34 | * @package oat\taoDeliveryRdf\model\Delete |
| 35 | */ |
| 36 | class DeliveryDeleteAction extends AbstractAction |
| 37 | { |
| 38 | /** |
| 39 | * @param $params |
| 40 | * @return \common_report_Report |
| 41 | * @throws \Exception |
| 42 | */ |
| 43 | public function __invoke($params) |
| 44 | { |
| 45 | if (!isset($params[0])) { |
| 46 | throw new \common_exception_MissingParameter( |
| 47 | 'Missing `deliveryId` as a first parameter in ' . static::class |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | $task = $this->propagate(new DeliveryDeleteTask()); |
| 52 | return $task(['deliveryId' => $params[0]]); |
| 53 | } |
| 54 | } |