Alan Lam 5 роки тому
батько
коміт
456d7bc7a2

+ 10 - 0
template_processing/age_verification/test_pdf.php

@@ -2,7 +2,16 @@
 
 /**
  * @var Template $template
+ * @var Test $test
  * @var array $values
+ * @var string $location_text
+ * @var Customer $customer
+ * @var Location $location
+ * @var User $tester
+ * @var string $date_start
+ * @var string $time_start
+ * @var string $time_end
+ * @var string $duration_text
  */
 
 $pass_image = $test->pass ? "pass.png" : "fail.png";
@@ -171,6 +180,7 @@ $covid_19 = in_array("COVID-19", $template->getKeys());
 			break;
 		case 4:
 		case 5:
+		default:
 			$challenge_colour = "red";
 			break;
 	}

+ 15 - 0
template_processing/age_verification_mitchells_butlers/test_pdf.php

@@ -1,5 +1,19 @@
 <?php
 
+/**
+ * @var Template $template
+ * @var Test $test
+ * @var array $values
+ * @var string $location_text
+ * @var Customer $customer
+ * @var Location $location
+ * @var User $tester
+ * @var string $date_start
+ * @var string $time_start
+ * @var string $time_end
+ * @var string $duration_text
+ */
+
 $pass_image = $test->pass ? "pass.png" : "fail.png";
 
 // COVID-19
@@ -252,6 +266,7 @@ $covid_19 = in_array("COVID-19", $template->getKeys());
 			break;
 		case 4:
 		case 5:
+		default:
 			$challenge_colour = "red";
 			break;
 	}

+ 19 - 5
template_processing/mystery_shop/test_pdf.php

@@ -1,13 +1,28 @@
 <?php
 
+use Mpdf\Mpdf;
+
 /**
  * @var Template $template
  * @var array $values
+ * @var Test $test
+ * @var Mpdf $mpdf
+ * @var string $location_text
+ * @var Customer $customer
+ * @var Location $location
+ * @var User $tester
+ * @var string $date_start
+ * @var string $time_start
+ * @var string $time_end
+ * @var string $duration_text
+ * @var string[] $field_name_label_map
  */
 
 // Values
+
 $cleanliness = $values["cleanliness"];
 switch($cleanliness) {
+	default:
 	case 1: $cleanliness = "Very dirty"; break;
 	case 2: $cleanliness = "Dirty"; break;
 	case 3: $cleanliness = "Adequate"; break;
@@ -16,8 +31,8 @@ switch($cleanliness) {
 }
 
 $staff_badge_worn = $values["staff_badge_worn"] ?? "";
-if(strlen($staff_badge_worn) == 0) $staff_badge_worn = "Don't know/Not approached";
-else $staff_badge_worn = ($staff_badge_worn == 0) ? "No" : "Yes";
+if(strlen($staff_badge_worn) === 0) $staff_badge_worn = "Don't know/Not approached";
+else $staff_badge_worn = !$staff_badge_worn ? "No" : "Yes";
 
 $staff_offered_drink = $values["staff_offered_drink"] ?? "";
 $staff_offered_drink = $staff_offered_drink ? "Yes" : "No";
@@ -50,8 +65,7 @@ if(!file_exists($location_photo_path)) {
 	$location_photo_path = "public/img/no_image_4_3.png";
 }
 
-$size = getimagesize($location_photo_path);
-list($image_width, $image_height) = $size;
+[$image_width, $image_height] = getimagesize($location_photo_path);
 
 $width = "";
 $height = "";
@@ -202,7 +216,7 @@ $mpdf->imageVars["location_photo"] = file_get_contents($location_photo_path);
 	<div class="subheader">
 		<strong>Location Photo</strong>
 	</div>
-	<img src="var:location_photo" width="<?=$width?>" height="<?=$height?>" />
+	<img src="var:location_photo" width="<?=$width?>" height="<?=$height?>" alt="" />
 </div>
 
 <div style="float: right; width: 49.5%">