Your project uses non-strict array lookups 2
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
- exit;
- }
- // Validate feedback_type
- $validTypes = ['positive', 'negative', 'correction'];
- if (!in_array($input['feedback_type'], $validTypes)) {
- echo json_encode([
- 'success' => false,
- 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
- ]);
- exit;
Your project should always define methods and properties visibility explicitly 7
- Read doc
- Productivity
- Info
More information: https://insight.symfony.com/what-we-analyse/php.method_or_property_missing_visibility
- return $value;
- }
- }
- // Give the line height for a given font size
- function _Get_Height_Chars($pt) {
- $a = array(6=>2, 7=>2.5, 8=>3, 9=>4, 10=>5, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10);
- if (!isset($a[$pt]))
- $this->Error('Invalid font size: '.$pt);
- return $this->_Convert_Metric($a[$pt], 'mm');
- }
- 'L7163'=> array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>5, 'marginTop'=>15, 'NX'=>2, 'NY'=>7, 'SpaceX'=>25, 'SpaceY'=>0, 'width'=>99.1, 'height'=>38.1, 'font-size'=>9),
- '3422' => array('paper-size'=>'A4', 'metric'=>'mm', 'marginLeft'=>0, 'marginTop'=>8.5, 'NX'=>3, 'NY'=>8, 'SpaceX'=>0, 'SpaceY'=>0, 'width'=>70, 'height'=>35, 'font-size'=>9)
- );
- // Constructor
- function __construct($format, $unit='mm', $posX=1, $posY=1) {
- if (is_array($format)) {
- // Custom format
- $Tformat = $format;
- } else {
- // Built-in format
- $this->_Line_Height = $this->_Get_Height_Chars($pt);
- $this->SetFontSize($pt);
- }
- // Print a label
- function Add_Label($text) {
- $this->_COUNTX++;
- if ($this->_COUNTX == $this->_X_Number) {
- // Row full, we start a new one
- $this->_COUNTX=0;
- $this->_COUNTY++;
- return $this->_Convert_Metric($a[$pt], 'mm');
- }
- // Set the character size
- // This changes the line height too
- function Set_Font_Size($pt) {
- $this->_Line_Height = $this->_Get_Height_Chars($pt);
- $this->SetFontSize($pt);
- }
- // Print a label
- $this->_Padding = $this->_Convert_Metric(3, 'mm');
- }
- // convert units (in to mm, mm to in)
- // $src must be 'in' or 'mm'
- function _Convert_Metric($value, $src) {
- $dest = $this->_Metric_Doc;
- if ($src != $dest) {
- $a['in'] = 39.37008;
- $a['mm'] = 1000;
- return $value * $a[$dest] / $a[$src];
- $this->SetAutoPageBreak(false);
- $this->_COUNTX = $posX-2;
- $this->_COUNTY = $posY-1;
- }
- function _Set_Format($format) {
- $this->_Margin_Left = $this->_Convert_Metric($format['marginLeft'], $format['metric']);
- $this->_Margin_Top = $this->_Convert_Metric($format['marginTop'], $format['metric']);
- $this->_X_Space = $this->_Convert_Metric($format['SpaceX'], $format['metric']);
- $this->_Y_Space = $this->_Convert_Metric($format['SpaceY'], $format['metric']);
- $this->_X_Number = $format['NX'];
- $_PosY = $this->_Margin_Top + $this->_COUNTY*($this->_Height+$this->_Y_Space) + $this->_Padding;
- $this->SetXY($_PosX, $_PosY);
- $this->MultiCell($this->_Width - $this->_Padding, $this->_Line_Height, $text, 0, 'L');
- }
- function _putcatalog()
- {
- parent::_putcatalog();
- // Disable the page scaling option in the printing dialog
- $this->_put('/ViewerPreferences <</PrintScaling /None>>');
- }