Your project uses non-strict array lookups

More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup

  1. exit;
  2. }
  3. // Validate feedback_type
  4. $validTypes = ['positive', 'negative', 'correction'];
  5. if (!in_array($input['feedback_type'], $validTypes)) {
    in_array() should be called with the third parameter set to true to enable strict comparison and avoid type juggling bugs.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. echo json_encode([
  7. 'success' => false,
  8. 'error' => 'feedback_type must be one of: ' . implode(', ', $validTypes)
  9. ]);
  10. exit;

Your project should always define methods and properties visibility explicitly 7

More information: https://insight.symfony.com/what-we-analyse/php.method_or_property_missing_visibility

  1. '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),
  2. '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)
  3. );
  4. // Constructor
  5. function __construct($format, $unit='mm', $posX=1, $posY=1) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. if (is_array($format)) {
  7. // Custom format
  8. $Tformat = $format;
  9. } else {
  10. // Built-in format
  1. $this->SetAutoPageBreak(false);
  2. $this->_COUNTX = $posX-2;
  3. $this->_COUNTY = $posY-1;
  4. }
  5. function _Set_Format($format) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $this->_Margin_Left = $this->_Convert_Metric($format['marginLeft'], $format['metric']);
  7. $this->_Margin_Top = $this->_Convert_Metric($format['marginTop'], $format['metric']);
  8. $this->_X_Space = $this->_Convert_Metric($format['SpaceX'], $format['metric']);
  9. $this->_Y_Space = $this->_Convert_Metric($format['SpaceY'], $format['metric']);
  10. $this->_X_Number = $format['NX'];
  1. $this->_Padding = $this->_Convert_Metric(3, 'mm');
  2. }
  3. // convert units (in to mm, mm to in)
  4. // $src must be 'in' or 'mm'
  5. function _Convert_Metric($value, $src) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $dest = $this->_Metric_Doc;
  7. if ($src != $dest) {
  8. $a['in'] = 39.37008;
  9. $a['mm'] = 1000;
  10. return $value * $a[$dest] / $a[$src];
  1. return $value;
  2. }
  3. }
  4. // Give the line height for a given font size
  5. function _Get_Height_Chars($pt) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $a = array(6=>2, 7=>2.5, 8=>3, 9=>4, 10=>5, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10);
  7. if (!isset($a[$pt]))
  8. $this->Error('Invalid font size: '.$pt);
  9. return $this->_Convert_Metric($a[$pt], 'mm');
  10. }
  1. return $this->_Convert_Metric($a[$pt], 'mm');
  2. }
  3. // Set the character size
  4. // This changes the line height too
  5. function Set_Font_Size($pt) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $this->_Line_Height = $this->_Get_Height_Chars($pt);
  7. $this->SetFontSize($pt);
  8. }
  9. // Print a label
  1. $this->_Line_Height = $this->_Get_Height_Chars($pt);
  2. $this->SetFontSize($pt);
  3. }
  4. // Print a label
  5. function Add_Label($text) {
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. $this->_COUNTX++;
  7. if ($this->_COUNTX == $this->_X_Number) {
  8. // Row full, we start a new one
  9. $this->_COUNTX=0;
  10. $this->_COUNTY++;
  1. $_PosY = $this->_Margin_Top + $this->_COUNTY*($this->_Height+$this->_Y_Space) + $this->_Padding;
  2. $this->SetXY($_PosX, $_PosY);
  3. $this->MultiCell($this->_Width - $this->_Padding, $this->_Line_Height, $text, 0, 'L');
  4. }
  5. function _putcatalog()
    This method has no explicit visibility which may lead to maintainability issues. You should always declare a visibility for methods and properties.
    Time to fix: about 15 minutes
    Read doc Open Issue Permalink Copy Prompt
    Last edited by clicshopping
  6. {
  7. parent::_putcatalog();
  8. // Disable the page scaling option in the printing dialog
  9. $this->_put('/ViewerPreferences <</PrintScaling /None>>');
  10. }