Whitespace, coding standards/conventions, etc.

This commit is contained in:
Michael Stenta 2020-08-27 08:34:07 -04:00
parent 5a0833aca7
commit bd429d45dd
2 changed files with 17 additions and 15 deletions

View File

@ -46,7 +46,8 @@ function farm_livestock_weight($asset) {
* The animal asset to get weight for.
*
* @return array
* Returns an array of arrays with the following information from each weight log ('weight', value, units, label, log)
* Returns an array of arrays with the following information from each weight log:
* weight, value, units, label, log
* Newest is the first, oldest last.
*/
function farm_livestock_weight_all($asset) {
@ -64,8 +65,8 @@ function farm_livestock_weight_all($asset) {
// Check that there are some logs!
if (!empty($logs)) {
foreach ($logs as $log) {
// Get weight quantity data from log.
$data = farm_quantity_log_data($log, 'weight');
foreach ($data as $quantity) {
@ -112,7 +113,7 @@ function farm_livestock_weight_dlwg($asset) {
if (count($weights) > 1) {
// Make sure logs use the same units.
if (($weights[0]['units']) == ($weights[1]['units'])){
if ($weights[0]['units'] == $weights[1]['units']) {
// Save latest weight info.
$latest_weight = $weights[0];

View File

@ -23,7 +23,8 @@ function farm_livestock_weight_individual_report(FarmAsset $farm_asset) {
// Check if the asset has a weight recorded.
if (empty($current_weight)) {
$output .= '<p>' . t('No weight recorded for asset') . '</p>';
} else {
}
else {
$output .= '<p><strong>' . t('Current weight') . ':</strong> ' . $current_weight['value'] . ' ' . $current_weight['units'] . '</p>';
// Load the daily live weight gain.