Ignore Infection for mutations that causes error or timeout
Disable log verbosity Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
3f2577212b
commit
8d769908e6
7
.github/workflows/mutation-tests.yml
vendored
7
.github/workflows/mutation-tests.yml
vendored
@ -13,6 +13,7 @@ on:
|
||||
- master
|
||||
paths:
|
||||
- '*/classes/**.php'
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
|
||||
@ -52,7 +53,6 @@ jobs:
|
||||
with:
|
||||
php-version: ${{ matrix.php-version }}
|
||||
coverage: pcov
|
||||
ini-values: memory_limit=-1
|
||||
tools: composer:v2, infection
|
||||
|
||||
- name: Install Composer dependencies
|
||||
@ -70,8 +70,7 @@ jobs:
|
||||
--logger-github --ignore-msi-with-no-mutations --only-covered --no-interaction --no-progress
|
||||
|
||||
- name: Run Infection for all files
|
||||
if: github.event_name == 'schedule'
|
||||
timeout-minutes: 360
|
||||
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
||||
env:
|
||||
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
|
||||
run: infection --threads=max --no-interaction --no-progress --only-covering-test-cases
|
||||
run: infection --threads=max --no-interaction --log-verbosity=none --logger-github=false
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -60,8 +60,7 @@ composer.lock
|
||||
/node_modules/
|
||||
phpstan.neon
|
||||
# Infection
|
||||
infection.json
|
||||
infection.log
|
||||
infection.json5
|
||||
/public/build/
|
||||
/js/dist/
|
||||
/setup/
|
||||
|
||||
@ -13,6 +13,6 @@
|
||||
"mutators": {
|
||||
"@default": true
|
||||
},
|
||||
"minMsi": 33,
|
||||
"minCoveredMsi": 59
|
||||
"minMsi": 29,
|
||||
"minCoveredMsi": 51
|
||||
}
|
||||
@ -228,6 +228,8 @@ class Bookmark
|
||||
* @param string|false $db the current database name or false
|
||||
*
|
||||
* @return Bookmark[] the bookmarks list
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public static function getList(
|
||||
BookmarkFeature $bookmarkFeature,
|
||||
|
||||
@ -78,6 +78,7 @@ class TwigLintCommand extends Command
|
||||
|
||||
$foundFiles = [];
|
||||
|
||||
/** @infection-ignore-all */
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if ($file === '.' || $file === '..') {
|
||||
continue;
|
||||
@ -262,6 +263,7 @@ class TwigLintCommand extends Command
|
||||
$result = [];
|
||||
while ($position < $max) {
|
||||
$result[$position + 1] = $lines[$position];
|
||||
/** @infection-ignore-all */
|
||||
++$position;
|
||||
}
|
||||
|
||||
|
||||
@ -430,6 +430,7 @@ class ConfigFile
|
||||
|
||||
$lastServer = $this->getServerCount();
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = $server; $i < $lastServer; $i++) {
|
||||
$_SESSION[$this->id]['Servers'][$i] = $_SESSION[$this->id]['Servers'][$i + 1];
|
||||
}
|
||||
|
||||
@ -120,6 +120,7 @@ class ServerConfigChecks
|
||||
|
||||
$serverCnt = $this->cfg->getServerCount();
|
||||
$isCookieAuthUsed = 0;
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 1; $i <= $serverCnt; $i++) {
|
||||
$cookieAuthServer = ($this->cfg->getValue('Servers/' . $i . '/auth_type') === 'cookie');
|
||||
$isCookieAuthUsed |= (int) $cookieAuthServer;
|
||||
|
||||
@ -1247,6 +1247,7 @@ final class Server
|
||||
*/
|
||||
private function setAuthType(array $server): string
|
||||
{
|
||||
/** @infection-ignore-all */
|
||||
if (isset($server['auth_type']) && in_array($server['auth_type'], ['config', 'http', 'signon'], true)) {
|
||||
return $server['auth_type'];
|
||||
}
|
||||
|
||||
@ -379,6 +379,7 @@ class Relation
|
||||
);
|
||||
$this->dbi->tryMultiQuery($query, Connection::TYPE_CONTROL);
|
||||
// skips result sets of query as we are not interested in it
|
||||
/** @infection-ignore-all */
|
||||
do {
|
||||
$hasResult = (
|
||||
$this->dbi->moreResults(Connection::TYPE_CONTROL)
|
||||
|
||||
@ -157,6 +157,7 @@ final class SaveController extends AbstractController
|
||||
$changedToBlob = [];
|
||||
// While changing the Column Collation
|
||||
// First change to BLOB
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $fieldCnt; $i++) {
|
||||
if (
|
||||
isset($_POST['field_collation'][$i], $_POST['field_collation_orig'][$i])
|
||||
|
||||
@ -214,6 +214,7 @@ class ZoomSearchController extends AbstractController
|
||||
|
||||
$criteriaColumnNames = $_POST['criteriaColumnNames'] ?? null;
|
||||
$keys = [];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < 4; $i++) {
|
||||
if (! isset($criteriaColumnNames[$i])) {
|
||||
continue;
|
||||
|
||||
@ -474,6 +474,7 @@ class Core
|
||||
}
|
||||
|
||||
// remove empty nested arrays
|
||||
/** @infection-ignore-all */
|
||||
for (; $depth >= 0; $depth--) {
|
||||
if (isset($path[$depth + 1]) && count($path[$depth + 1]) !== 0) {
|
||||
break;
|
||||
@ -700,6 +701,7 @@ class Core
|
||||
public static function sanitizeMySQLHost(string $name): string
|
||||
{
|
||||
while (strtolower(substr($name, 0, 2)) === 'p:') {
|
||||
/** @infection-ignore-all */
|
||||
$name = substr($name, 2);
|
||||
}
|
||||
|
||||
|
||||
@ -513,6 +513,7 @@ class Results
|
||||
$deleteLink = $displayParts->deleteLink;
|
||||
$hasPrintLink = $displayParts->hasPrintLink;
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $numberOfColumns; $i++) {
|
||||
$isLink = $hasEditLink || $deleteLink !== DeleteLinkEnum::NO_DELETE || $displayParts->hasSortLink;
|
||||
|
||||
@ -2159,6 +2160,7 @@ class Results
|
||||
$added = [];
|
||||
$relationParameters = $this->relation->getRelationParameters();
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($currentColumn = 0; $currentColumn < $this->properties['fields_cnt']; ++$currentColumn) {
|
||||
$meta = $fieldsMeta[$currentColumn];
|
||||
$orgFullTableName = $this->properties['db'] . '.' . $meta->orgtable;
|
||||
|
||||
@ -408,6 +408,8 @@ class Error extends Message
|
||||
*
|
||||
* @param mixed $arg argument to process
|
||||
* @param string $function function name
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public static function getArg(mixed $arg, string $function): string
|
||||
{
|
||||
@ -499,6 +501,7 @@ class Error extends Message
|
||||
$destParts = explode(DIRECTORY_SEPARATOR, $dest);
|
||||
|
||||
$result = '.';
|
||||
/** @infection-ignore-all */
|
||||
while (implode(DIRECTORY_SEPARATOR, $destParts) !== implode(DIRECTORY_SEPARATOR, $hereParts)) {
|
||||
if (count($hereParts) > count($destParts)) {
|
||||
array_pop($hereParts);
|
||||
|
||||
@ -277,6 +277,7 @@ class GisGeometryCollection extends GisGeometry
|
||||
{
|
||||
$geomCount = $gisData['GEOMETRYCOLLECTION']['geom_count'] ?? 1;
|
||||
$wkt = 'GEOMETRYCOLLECTION(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $geomCount; $i++) {
|
||||
if (! isset($gisData[$i]['gis_type'])) {
|
||||
continue;
|
||||
|
||||
@ -242,6 +242,7 @@ class GisLineString extends GisGeometry
|
||||
}
|
||||
|
||||
$wkt = 'LINESTRING(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$wkt .= (isset($gisData[$index]['LINESTRING'][$i]['x'])
|
||||
&& trim((string) $gisData[$index]['LINESTRING'][$i]['x']) != ''
|
||||
@ -271,6 +272,7 @@ class GisLineString extends GisGeometry
|
||||
|
||||
$noOfPoints = count($pointsArr);
|
||||
$coords = ['no_of_points' => $noOfPoints];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$coords[$i] = ['x' => $pointsArr[$i][0], 'y' => $pointsArr[$i][1]];
|
||||
}
|
||||
|
||||
@ -275,6 +275,7 @@ class GisMultiLineString extends GisGeometry
|
||||
}
|
||||
|
||||
$wkt = 'MULTILINESTRING(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfLines; $i++) {
|
||||
$noOfPoints = $dataRow[$i]['no_of_points'] ?? 2;
|
||||
if ($noOfPoints < 2) {
|
||||
@ -310,6 +311,7 @@ class GisMultiLineString extends GisGeometry
|
||||
public function getShape(array $rowData): string
|
||||
{
|
||||
$wkt = 'MULTILINESTRING(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $rowData['numparts']; $i++) {
|
||||
$wkt .= '(';
|
||||
foreach ($rowData['parts'][$i]['points'] as $point) {
|
||||
@ -343,6 +345,7 @@ class GisMultiLineString extends GisGeometry
|
||||
$points = $this->extractPoints1d($wktLinestring, null);
|
||||
$noOfPoints = count($points);
|
||||
$coords[$j] = ['no_of_points' => $noOfPoints];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$coords[$j][$i] = ['x' => $points[$i][0], 'y' => $points[$i][1]];
|
||||
}
|
||||
|
||||
@ -260,6 +260,7 @@ class GisMultiPoint extends GisGeometry
|
||||
}
|
||||
|
||||
$wkt = 'MULTIPOINT(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$wkt .= (isset($gisData[$index]['MULTIPOINT'][$i]['x'])
|
||||
&& trim((string) $gisData[$index]['MULTIPOINT'][$i]['x']) != ''
|
||||
@ -284,6 +285,7 @@ class GisMultiPoint extends GisGeometry
|
||||
public function getShape(array $rowData): string
|
||||
{
|
||||
$wkt = 'MULTIPOINT(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $rowData['numpoints']; $i++) {
|
||||
$wkt .= $rowData['points'][$i]['x'] . ' '
|
||||
. $rowData['points'][$i]['y'] . ',';
|
||||
@ -309,6 +311,7 @@ class GisMultiPoint extends GisGeometry
|
||||
|
||||
$noOfPoints = count($points);
|
||||
$coords = ['no_of_points' => $noOfPoints];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$coords[$i] = ['x' => $points[$i][0], 'y' => $points[$i][1]];
|
||||
}
|
||||
|
||||
@ -305,6 +305,7 @@ class GisMultiPolygon extends GisGeometry
|
||||
}
|
||||
|
||||
$wkt = 'MULTIPOLYGON(';
|
||||
/** @infection-ignore-all */
|
||||
for ($k = 0; $k < $noOfPolygons; $k++) {
|
||||
$noOfLines = $dataRow[$k]['no_of_lines'] ?? 1;
|
||||
if ($noOfLines < 1) {
|
||||
@ -452,6 +453,7 @@ class GisMultiPolygon extends GisGeometry
|
||||
$points = $this->extractPoints1d($wktRing, null);
|
||||
$noOfPoints = count($points);
|
||||
$coords[$k][$j] = ['no_of_points' => $noOfPoints];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$coords[$k][$j][$i] = ['x' => $points[$i][0], 'y' => $points[$i][1]];
|
||||
}
|
||||
|
||||
@ -266,6 +266,7 @@ class GisPolygon extends GisGeometry
|
||||
}
|
||||
|
||||
$wkt = 'POLYGON(';
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfLines; $i++) {
|
||||
$noOfPoints = $gisData[$index]['POLYGON'][$i]['no_of_points'] ?? 4;
|
||||
if ($noOfPoints < 4) {
|
||||
@ -309,6 +310,7 @@ class GisPolygon extends GisGeometry
|
||||
$points = $this->extractPoints1d($wktRing, null);
|
||||
$noOfPoints = count($points);
|
||||
$coords[$j] = ['no_of_points' => $noOfPoints];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $noOfPoints; $i++) {
|
||||
$coords[$j][$i] = ['x' => $points[$i][0], 'y' => $points[$i][1]];
|
||||
}
|
||||
|
||||
@ -443,6 +443,7 @@ class Import
|
||||
$capitalA = 65; // ASCII value for capital "A"
|
||||
$colName = '';
|
||||
|
||||
/** @infection-ignore-all */
|
||||
if ($num > 26) {
|
||||
$div = (int) ($num / 26);
|
||||
$remain = $num % 26;
|
||||
|
||||
@ -73,6 +73,7 @@ class IpAllowDeny
|
||||
|
||||
$maskl = 0;
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < 31; $i++) {
|
||||
if ($i >= $regs[5] - 1) {
|
||||
continue;
|
||||
@ -194,6 +195,7 @@ class IpAllowDeny
|
||||
$lastHex = substr_replace($lastHex, $new, $pos, 1);
|
||||
|
||||
// We processed one nibble, move to previous position
|
||||
/** @infection-ignore-all */
|
||||
$flexbits -= 4;
|
||||
--$pos;
|
||||
}
|
||||
|
||||
@ -756,6 +756,7 @@ class LanguageManager
|
||||
}
|
||||
|
||||
/* Process all files */
|
||||
/** @infection-ignore-all */
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$path = LOCALE_PATH
|
||||
. '/' . $file
|
||||
|
||||
@ -53,6 +53,7 @@ class Linter
|
||||
$len = $str->length();
|
||||
|
||||
$lines = [0];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $len; ++$i) {
|
||||
if ($str[$i] !== "\n") {
|
||||
continue;
|
||||
|
||||
@ -612,6 +612,7 @@ class Message implements Stringable
|
||||
$message = $this->getString();
|
||||
}
|
||||
|
||||
/** @infection-ignore-all */
|
||||
if ($this->isDisplayed()) {
|
||||
$message = $this->getMessageWithIcon($message);
|
||||
}
|
||||
@ -695,6 +696,8 @@ class Message implements Stringable
|
||||
* sets and returns whether the message was displayed or not
|
||||
*
|
||||
* @param bool $isDisplayed whether to set displayed flag
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function isDisplayed(bool $isDisplayed = false): bool
|
||||
{
|
||||
|
||||
@ -124,6 +124,7 @@ class Normalization
|
||||
}
|
||||
|
||||
$commentsMap = $this->relation->getComments($db, $table);
|
||||
/** @infection-ignore-all */
|
||||
for ($columnNumber = 0; $columnNumber < $numFields; $columnNumber++) {
|
||||
$contentCells[$columnNumber] = [
|
||||
'column_number' => $columnNumber,
|
||||
|
||||
@ -95,6 +95,7 @@ final class TablePartitionDefinition
|
||||
// when number of partitions have been reduced
|
||||
array_splice($partitions, $partitionCount);
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $partitionCount; $i++) {
|
||||
if (! isset($partitions[$i])) { // Newly added partition
|
||||
$partitions[$i] = [
|
||||
@ -151,6 +152,7 @@ final class TablePartitionDefinition
|
||||
// when number of subpartitions have been reduced
|
||||
array_splice($subpartitions, $subpartitionCount);
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($j = 0; $j < $subpartitionCount; $j++) {
|
||||
if (! isset($subpartitions[$j])) { // Newly added subpartition
|
||||
$subpartitions[$j] = [
|
||||
|
||||
@ -43,6 +43,8 @@ class Pdf extends TCPDF
|
||||
* @param false|int $pdfa If not false, set the document to PDF/A mode and the good version (1 or 3)
|
||||
*
|
||||
* @throws Exception
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function __construct(
|
||||
string $orientation = 'P',
|
||||
|
||||
@ -263,6 +263,7 @@ class ExportJson extends ExportPlugin
|
||||
|
||||
$data = [];
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $columnsCnt; $i++) {
|
||||
// 63 is the binary charset, see: https://dev.mysql.com/doc/internals/en/charsets.html
|
||||
$isBlobAndIsBinaryCharset = isset($fieldsMeta[$i])
|
||||
|
||||
@ -366,6 +366,7 @@ class ExportLatex extends ExportPlugin
|
||||
while ($record = $result->fetchAssoc()) {
|
||||
$buffer = '';
|
||||
// print each row
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $columnsCnt; $i++) {
|
||||
if ($record[$columns[$i]] !== null) {
|
||||
$columnValue = self::texEscape($record[$columns[$i]]);
|
||||
|
||||
@ -156,6 +156,8 @@ class ExportMediawiki extends ExportPlugin
|
||||
* @param bool $doMime whether to include mime comments
|
||||
* @param bool $dates whether to include creation/update/check dates
|
||||
* @param mixed[] $aliases Aliases of db/table/columns
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function exportStructure(
|
||||
string $db,
|
||||
@ -307,6 +309,7 @@ class ExportMediawiki extends ExportPlugin
|
||||
$output .= '|-' . $this->exportCRLF();
|
||||
|
||||
// Use '|' for separating table columns
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $fieldsCnt; ++$i) {
|
||||
$output .= ' | ' . $row[$i] . $this->exportCRLF();
|
||||
}
|
||||
|
||||
@ -232,6 +232,7 @@ class ExportOds extends ExportPlugin
|
||||
// Format the data
|
||||
while ($row = $result->fetchRow()) {
|
||||
$GLOBALS['ods_buffer'] .= '<table:table-row>';
|
||||
/** @infection-ignore-all */
|
||||
for ($j = 0; $j < $fieldsCnt; $j++) {
|
||||
if ($fieldsMeta[$j]->isMappedTypeGeometry) {
|
||||
// export GIS types as hex
|
||||
|
||||
@ -266,6 +266,7 @@ class ExportOdt extends ExportPlugin
|
||||
// Format the data
|
||||
while ($row = $result->fetchRow()) {
|
||||
$GLOBALS['odt_buffer'] .= '<table:table-row>';
|
||||
/** @infection-ignore-all */
|
||||
for ($j = 0; $j < $fieldsCnt; $j++) {
|
||||
if ($fieldsMeta[$j]->isMappedTypeGeometry) {
|
||||
// export GIS types as hex
|
||||
|
||||
@ -207,6 +207,7 @@ class ExportPhparray extends ExportPlugin
|
||||
$buffer .= ',' . "\n" . ' array(';
|
||||
}
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $columnsCnt; $i++) {
|
||||
$buffer .= var_export($columns[$i], true)
|
||||
. ' => ' . var_export($record[$i], true)
|
||||
|
||||
@ -2070,6 +2070,7 @@ class ExportSql extends ExportPlugin
|
||||
$fieldsMeta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
|
||||
$fieldSet = [];
|
||||
/** @infection-ignore-all */
|
||||
for ($j = 0; $j < $fieldsCnt; $j++) {
|
||||
$colAs = $fieldsMeta[$j]->name;
|
||||
if (! empty($aliases[$db]['tables'][$table]['columns'][$colAs])) {
|
||||
@ -2233,6 +2234,7 @@ class ExportSql extends ExportPlugin
|
||||
// should we make update?
|
||||
if (isset($GLOBALS['sql_type']) && $GLOBALS['sql_type'] === 'UPDATE') {
|
||||
$insertLine = $schemaInsert;
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $fieldsCnt; $i++) {
|
||||
if ($i == 0) {
|
||||
$insertLine .= ' ';
|
||||
@ -2557,6 +2559,7 @@ class ExportSql extends ExportPlugin
|
||||
|| $statement->options->has('VIEW')
|
||||
) {
|
||||
// Replacing the body.
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0, $count = count((array) $statement->body); $i < $count; ++$i) {
|
||||
|
||||
/**
|
||||
|
||||
@ -159,6 +159,7 @@ class ExportYaml extends ExportPlugin
|
||||
$buffer = '-' . "\n";
|
||||
}
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $columnsCnt; $i++) {
|
||||
if (! array_key_exists($i, $record)) {
|
||||
continue;
|
||||
|
||||
@ -151,6 +151,8 @@ class ImportCsv extends AbstractImportCsv
|
||||
* Handles the whole import logic
|
||||
*
|
||||
* @return string[]
|
||||
*
|
||||
* @infection-ignore-all
|
||||
*/
|
||||
public function doImport(File|null $importHandle = null): array
|
||||
{
|
||||
@ -747,6 +749,7 @@ class ImportCsv extends AbstractImportCsv
|
||||
|
||||
if ((isset($columnNames) && count($columnNames) != $maxCols) || ! isset($columnNames)) {
|
||||
// Fill out column names
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $maxCols; ++$i) {
|
||||
$columnNames[] = 'COL ' . ($i + 1);
|
||||
}
|
||||
|
||||
@ -97,6 +97,7 @@ class ImportMediawiki extends ImportPlugin
|
||||
|
||||
$inTableHeader = false;
|
||||
|
||||
/** @infection-ignore-all */
|
||||
while (! $GLOBALS['finished'] && ! $GLOBALS['error'] && ! $GLOBALS['timeout_passed']) {
|
||||
$data = $this->import->getNextChunk($importHandle);
|
||||
|
||||
@ -402,6 +403,7 @@ class ImportMediawiki extends ImportPlugin
|
||||
$partialSeparator = false;
|
||||
|
||||
// Parse text char by char
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0, $iMax = strlen($subject); $i < $iMax; $i++) {
|
||||
$curChar = $subject[$i];
|
||||
// Check for separators
|
||||
|
||||
@ -419,12 +419,14 @@ class ImportOds extends ImportPlugin
|
||||
*/
|
||||
|
||||
/* Fill out column names */
|
||||
/** @infection-ignore-all */
|
||||
for ($i = count($colNames); $i < $maxCols; ++$i) {
|
||||
$colNames[] = $this->import->getColumnAlphaName($i + 1);
|
||||
}
|
||||
|
||||
/* Fill out all rows */
|
||||
$numRows = count($tempRows);
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $numRows; ++$i) {
|
||||
for ($j = count($tempRows[$i]); $j < $maxCols; ++$j) {
|
||||
$tempRows[$i][] = 'NULL';
|
||||
|
||||
@ -128,6 +128,7 @@ class ImportSql extends ImportPlugin
|
||||
// Checking if the input buffer has finished.
|
||||
if ($newData === true) {
|
||||
$GLOBALS['finished'] = true;
|
||||
/** @infection-ignore-all */
|
||||
break;
|
||||
}
|
||||
|
||||
@ -143,6 +144,7 @@ class ImportSql extends ImportPlugin
|
||||
}
|
||||
|
||||
// Extracting remaining statements.
|
||||
/** @infection-ignore-all */
|
||||
while (! $GLOBALS['error'] && ! $GLOBALS['timeout_passed'] && ! empty($bq->query)) {
|
||||
$statement = $bq->extract(true);
|
||||
if ($statement === false || $statement === '') {
|
||||
|
||||
@ -66,6 +66,7 @@ class ImportXml extends ImportPlugin
|
||||
* Read in the file via Import::getNextChunk so that
|
||||
* it can process compressed files
|
||||
*/
|
||||
/** @infection-ignore-all */
|
||||
while (! $GLOBALS['finished'] && ! $GLOBALS['error'] && ! $GLOBALS['timeout_passed']) {
|
||||
$data = $this->import->getNextChunk($importHandle);
|
||||
if ($data === false) {
|
||||
|
||||
@ -392,6 +392,7 @@ class PdfRelationSchema extends ExportRelationSchema
|
||||
$this->diagram->setDrawColor(200, 200, 200);
|
||||
// Draws horizontal lines
|
||||
$innerHeight = $this->diagram->getPageHeight() - $topSpace - $bottomSpace;
|
||||
/** @infection-ignore-all */
|
||||
for ($l = 0, $size = intval($innerHeight / $gridSize); $l <= $size; $l++) {
|
||||
$this->diagram->line(
|
||||
0,
|
||||
@ -410,6 +411,7 @@ class PdfRelationSchema extends ExportRelationSchema
|
||||
}
|
||||
|
||||
// Draws vertical lines
|
||||
/** @infection-ignore-all */
|
||||
for ($j = 0, $size = intval($this->diagram->getPageWidth() / $gridSize); $j <= $size; $j++) {
|
||||
$this->diagram->line(
|
||||
$j * $gridSize,
|
||||
|
||||
@ -1820,6 +1820,7 @@ class Privileges
|
||||
public function getHtmlForInitials(array $arrayInitials): string
|
||||
{
|
||||
// initialize to false the letters A-Z
|
||||
/** @infection-ignore-all */
|
||||
for ($letterCounter = 1; $letterCounter < 27; $letterCounter++) {
|
||||
if (isset($arrayInitials[mb_chr($letterCounter + 64)])) {
|
||||
continue;
|
||||
|
||||
@ -159,6 +159,7 @@ class ConfigGenerator
|
||||
|
||||
// more than 4 values - value per line
|
||||
$imax = count($retv);
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $imax; $i++) {
|
||||
$ret .= ($i > 0 ? ',' : '') . $eol . ' ' . $retv[$i];
|
||||
}
|
||||
|
||||
@ -85,6 +85,7 @@ class SystemDatabase
|
||||
$columnCount = 0;
|
||||
$addComma = false;
|
||||
|
||||
/** @infection-ignore-all */
|
||||
while ($dataRow = $transformationData->fetchAssoc()) {
|
||||
foreach ($columnMap as $column) {
|
||||
if (
|
||||
|
||||
@ -137,6 +137,7 @@ final class ColumnsDefinition
|
||||
$childReferences = $this->relation->getChildReferences($GLOBALS['db'], $GLOBALS['table']);
|
||||
}
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($columnNumber = 0; $columnNumber < $numFields; $columnNumber++) {
|
||||
$type = '';
|
||||
$length = '';
|
||||
|
||||
@ -183,6 +183,7 @@ class Tracker
|
||||
// int indices to reduce size
|
||||
$columns = array_values($columns);
|
||||
// remove Privileges to reduce size
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0, $nb = count($columns); $i < $nb; $i++) {
|
||||
unset($columns[$i]['Privileges']);
|
||||
}
|
||||
|
||||
@ -85,6 +85,7 @@ class Transformations
|
||||
// '...,
|
||||
$trimmed = ltrim($option);
|
||||
$rtrimmed = '';
|
||||
/** @infection-ignore-all */
|
||||
while (($option = array_shift($transformOptions)) !== null) {
|
||||
// ...,
|
||||
$trimmed .= ',' . $option;
|
||||
|
||||
@ -317,6 +317,7 @@ class Util
|
||||
$li = 10 ** $limes;
|
||||
$unit = $byteUnits[0];
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($d = 6, $ex = 15; $d >= 1; $d--, $ex -= 3) {
|
||||
$unitSize = $li * 10 ** $ex;
|
||||
if (isset($byteUnits[$d]) && $value >= $unitSize) {
|
||||
@ -720,6 +721,7 @@ class Util
|
||||
$uniqueKeyArray = [];
|
||||
$nonPrimaryConditionArray = [];
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $fieldsCount; ++$i) {
|
||||
$meta = $fieldsMeta[$i];
|
||||
|
||||
@ -1635,6 +1637,7 @@ class Util
|
||||
$inString = false;
|
||||
$buffer = '';
|
||||
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0, $length = mb_strlen($valuesString); $i < $length; $i++) {
|
||||
$curr = mb_substr($valuesString, $i, 1);
|
||||
$next = $i == mb_strlen($valuesString) - 1
|
||||
@ -2136,6 +2139,7 @@ class Util
|
||||
{
|
||||
$result = '';
|
||||
|
||||
/** @infection-ignore-all */
|
||||
while (strlen($result) < $length) {
|
||||
// Get random byte and strip highest bit
|
||||
// to get ASCII only range
|
||||
|
||||
@ -155,6 +155,7 @@ class VersionInformation
|
||||
$phpConditions = explode(',', $phpVersions);
|
||||
foreach ($phpConditions as $phpCondition) {
|
||||
if (! $this->evaluateVersionCondition('PHP', $phpCondition)) {
|
||||
/** @infection-ignore-all */
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,6 +126,7 @@ final class CBORDecoder
|
||||
private function getList(DataStream $stream, int $value): array
|
||||
{
|
||||
$list = [];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $value; $i++) {
|
||||
/** @psalm-suppress MixedAssignment */
|
||||
$list[] = $this->wellFormed($stream);
|
||||
@ -142,6 +143,7 @@ final class CBORDecoder
|
||||
private function getMap(DataStream $stream, int $value): array
|
||||
{
|
||||
$map = [];
|
||||
/** @infection-ignore-all */
|
||||
for ($i = 0; $i < $value; $i++) {
|
||||
/** @psalm-suppress MixedAssignment, MixedArrayOffset */
|
||||
$map[$this->wellFormed($stream)] = $this->wellFormed($stream);
|
||||
|
||||
@ -191,6 +191,7 @@ final class WebauthnLibServer implements Server
|
||||
return $publicKeyCredentialSource->jsonSerialize();
|
||||
}
|
||||
|
||||
/** @infection-ignore-all */
|
||||
private function createPublicKeyCredentialSourceRepository(): PublicKeyCredentialSourceRepository
|
||||
{
|
||||
return new class ($this->twofactor) implements PublicKeyCredentialSourceRepository {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user