Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrutinizer Samples/Tests #3733

Merged
merged 3 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/Basic/25_In_memory_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
$drawing = new MemoryDrawing();
$drawing->setName('Sample image');
$drawing->setDescription('Sample image');
$drawing->setImageResource($gdImage);
$drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage);
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG);
$drawing->setMimeType(MemoryDrawing::MIMETYPE_DEFAULT);
$drawing->setHeight(36);
Expand All @@ -56,7 +56,7 @@
$drawing = new MemoryDrawing();
$drawing->setName('Sample image');
$drawing->setDescription('Sample image');
$drawing->setImageResource($gdImage);
$drawing->setImageResource(/** @scrutinizer ignore-type */ $gdImage);
$drawing->setRenderingFunction(MemoryDrawing::RENDERING_JPEG);
$drawing->setMimeType(MemoryDrawing::MIMETYPE_DEFAULT);
$drawing->setHeight(36);
Expand Down
2 changes: 2 additions & 0 deletions samples/Calculations/DateTime/DAYS360.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
));
$helper->log(sprintf(
'Days: %d (US) %d (European)',
/** @scrutinizer ignore-type */
$worksheet->getCell('G' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('H' . $row)->getCalculatedValue()
));
}
1 change: 1 addition & 0 deletions samples/Calculations/DateTime/EDATE.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'%s and %d months is %d (%s)',
$worksheet->getCell('B' . $row)->getFormattedValue(),
$worksheet->getCell('C' . $row)->getFormattedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
$worksheet->getCell('D' . $row)->getFormattedValue()
));
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/DateTime/EOMONTH.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'%s and %d months is %d (%s)',
$worksheet->getCell('B' . $row)->getFormattedValue(),
$worksheet->getCell('C' . $row)->getFormattedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
$worksheet->getCell('D' . $row)->getFormattedValue()
));
Expand Down
2 changes: 2 additions & 0 deletions samples/Calculations/DateTime/NETWORKDAYS.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@
'Between %s and %s is %d working days; %d with public holidays',
$worksheet->getCell('A1')->getFormattedValue(),
$worksheet->getCell('B' . $row)->getFormattedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue()
));
}
1 change: 1 addition & 0 deletions samples/Calculations/DateTime/NOW.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// Test the formulae
$helper->log(sprintf(
'Today is %f (%s)',
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue(),
$worksheet->getCell('A1')->getFormattedValue()
));
1 change: 1 addition & 0 deletions samples/Calculations/DateTime/TODAY.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
// Test the formulae
$helper->log(sprintf(
'Today is %d (%s)',
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue(),
$worksheet->getCell('A1')->getFormattedValue()
));
2 changes: 2 additions & 0 deletions samples/Calculations/DateTime/WEEKDAY.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
$helper->log(sprintf('(E%d): %s', $row, $worksheet->getCell('E' . $row)->getFormattedValue()));
$helper->log(sprintf(
'Weekday is: %d (1-7 = Sun-Sat)',
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue()
));
$helper->log(sprintf(
'Weekday is: %d (1-7 = Mon-Sun)',
/** @scrutinizer ignore-type */
$worksheet->getCell('G' . $row)->getCalculatedValue()
));
}
5 changes: 5 additions & 0 deletions samples/Calculations/DateTime/YEARFRAC.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,27 @@
));
$helper->log(sprintf(
'Days: %f - US (NASD) 30/360',
/** @scrutinizer ignore-type */
$worksheet->getCell('G' . $row)->getCalculatedValue()
));
$helper->log(sprintf(
'Days: %f - Actual',
/** @scrutinizer ignore-type */
$worksheet->getCell('H' . $row)->getCalculatedValue()
));
$helper->log(sprintf(
'Days: %f - Actual/360',
/** @scrutinizer ignore-type */
$worksheet->getCell('I' . $row)->getCalculatedValue()
));
$helper->log(sprintf(
'Days: %f - Actual/365',
/** @scrutinizer ignore-type */
$worksheet->getCell('J' . $row)->getCalculatedValue()
));
$helper->log(sprintf(
'Days: %f - European 30/360',
/** @scrutinizer ignore-type */
$worksheet->getCell('K' . $row)->getCalculatedValue()
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BESSELI.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$helper->log(sprintf(
'%s = %f',
$worksheet->getCell('A1')->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue()
));
}
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BESSELJ.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$helper->log(sprintf(
'%s = %f',
$worksheet->getCell('A1')->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue()
));
}
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BESSELK.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$helper->log(sprintf(
'%s = %f',
$worksheet->getCell('A1')->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue()
));
}
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BESSELY.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$helper->log(sprintf(
'%s = %f',
$worksheet->getCell('A1')->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('A1')->getCalculatedValue()
));
}
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BIN2DEC.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'(B%d): Binary %s is decimal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BIN2HEX.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'(B%d): Binary %s is hexadecimal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/BIN2OCT.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'(B%d): Binary %s is octal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
4 changes: 4 additions & 0 deletions samples/Calculations/Engineering/BITAND.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
'(E%d): Bitwise AND of %d (%s) and %d (%s) is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('E' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue(),
));
}
9 changes: 9 additions & 0 deletions samples/Calculations/Engineering/BITLSHIFT.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,33 @@
'(E%d): Bitwise Left Shift of %d (%s) by 1 bit is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
));
$helper->log(sprintf(
'(E%d): Bitwise Left Shift of %d (%s) by 2 bits is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('E' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue(),
));
$helper->log(sprintf(
'(E%d): Bitwise Left Shift of %d (%s) by 3 bits is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('G' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('H' . $row)->getCalculatedValue(),
));
}
4 changes: 4 additions & 0 deletions samples/Calculations/Engineering/BITOR.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
'(E%d): Bitwise OR of %d (%s) and %d (%s) is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('E' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue(),
));
}
9 changes: 9 additions & 0 deletions samples/Calculations/Engineering/BITRSHIFT.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,33 @@
'(E%d): Bitwise Right Shift of %d (%s) by 1 bit is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
));
$helper->log(sprintf(
'(E%d): Bitwise Right Shift of %d (%s) by 2 bits is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('E' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue(),
));
$helper->log(sprintf(
'(E%d): Bitwise Right Shift of %d (%s) by 3 bits is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('G' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('H' . $row)->getCalculatedValue(),
));
}
4 changes: 4 additions & 0 deletions samples/Calculations/Engineering/BITXOR.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@
'(E%d): Bitwise XOR of %d (%s) and %d (%s) is %d (%s)',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('E' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('F' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/COMPLEX.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
'(A%d): Formula %s result is %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('A' . $row)->getCalculatedValue()
));
}
2 changes: 2 additions & 0 deletions samples/Calculations/Engineering/CONVERT.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$worksheet->getCell('D' . $row)->getValue(),
$worksheet->getCell('A' . $row)->getValue(),
trim($worksheet->getCell('B' . $row)->getValue(), '"'),
/** @scrutinizer ignore-type */
$worksheet->getCell('D' . $row)->getCalculatedValue(),
trim($worksheet->getCell('C' . $row)->getValue(), '"')
));
Expand All @@ -54,5 +55,6 @@
'(A%d): Unit of Measure Conversion Formula %s result is %s',
$row,
$worksheet->getCell('H1')->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('H1')->getCalculatedValue()
));
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/DEC2BIN.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
'(B%d): Decimal %s is binary %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/DEC2HEX.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'(B%d): Decimal %s is hexadecimal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/DEC2OCT.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'(B%d): Decimal %s is octal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
2 changes: 2 additions & 0 deletions samples/Calculations/Engineering/DELTA.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
$row,
$worksheet->getCell('A' . $row)->getValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
/** @scrutinizer ignore-type */
$comparison[$worksheet->getCell('C' . $row)->getCalculatedValue()]
));
}
2 changes: 2 additions & 0 deletions samples/Calculations/Engineering/ERF.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
$row,
$worksheet->getCell('C' . $row)->getValue(),
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
));
}
Expand All @@ -62,6 +63,7 @@
$worksheet->getCell('C' . $row)->getValue(),
$worksheet->getCell('A' . $row)->getValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/ERFC.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
$row,
$worksheet->getCell('C' . $row)->getValue(),
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
));
}
2 changes: 2 additions & 0 deletions samples/Calculations/Engineering/GESTEP.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@
$row,
$worksheet->getCell('A' . $row)->getValue(),
$worksheet->getCell('B' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('C' . $row)->getCalculatedValue(),
sprintf(
/** @scrutinizer ignore-type */
$comparison[$worksheet->getCell('C' . $row)->getCalculatedValue()],
$worksheet->getCell('A' . $row)->getValue(),
$worksheet->getCell('B' . $row)->getValue(),
Expand Down
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/HEX2BIN.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'(B%d): Hexadecimal %s is binary %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/HEX2DEC.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'(B%d): Hexadecimal %s is decimal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
1 change: 1 addition & 0 deletions samples/Calculations/Engineering/HEX2OCT.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
'(B%d): Hexadecimal %s is octal %s',
$row,
$worksheet->getCell('A' . $row)->getValue(),
/** @scrutinizer ignore-type */
$worksheet->getCell('B' . $row)->getCalculatedValue(),
));
}
Loading