0 && $raisedMinor >= (int) $goal['target_minor']; } /** True for a goal that is closed to donors because it reached its target (flag on + complete). */ public static function isClosedAtTarget( array $goal ): bool { return ! empty( $goal['close_at_target'] ) && 'complete' === ( $goal['status'] ?? '' ); } /** Checkbox value from a raw form field: 1 when ticked, else 0. */ public static function flagFromPost( mixed $raw ): int { if ( is_array( $raw ) || null === $raw ) { return 0; } return in_array( strtolower( trim( (string) $raw ) ), array( '1', 'on', 'true', 'yes' ), true ) ? 1 : 0; } }