Total Complexity | 2 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | class UnitsController extends Controller |
||
23 | { |
||
24 | // Properties |
||
25 | // ========================================================================= |
||
26 | |||
27 | /** |
||
28 | * @inheritdoc |
||
29 | */ |
||
30 | protected array|bool|int $allowAnonymous = [ |
||
31 | 'all-available-units', |
||
32 | 'available-units', |
||
33 | ]; |
||
34 | |||
35 | // Public Methods |
||
36 | // ========================================================================= |
||
37 | |||
38 | /** |
||
39 | * Return all the available units as JSON |
||
40 | * |
||
41 | * @param bool $includeAliases whether to include aliases or not |
||
42 | * |
||
43 | * @return Response |
||
44 | */ |
||
45 | public function actionAllAvailableUnits(bool $includeAliases = false): Response |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Return the available units for a given AbstractPhysicalQuantity as JSON |
||
52 | * |
||
53 | * @param string $unitsClass |
||
54 | * @param bool $includeAliases whether to include aliases or not |
||
55 | * |
||
56 | * @return Response |
||
57 | */ |
||
58 | public function actionAvailableUnits(string $unitsClass, bool $includeAliases = false): Response |
||
63 |