Skip to content
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
71 changes: 31 additions & 40 deletions psalm_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,40 @@

require __DIR__ . '/system/util_bootstrap.php';

$helperDirs = [
$directories = [
'system/Helpers',
];

foreach ($helperDirs as $dir) {
$dir = __DIR__ . '/' . $dir;
if (! is_dir($dir)) {
continue;
}

chdir($dir);

foreach (glob('*_helper.php') as $filename) {
$filePath = realpath($dir . '/' . $filename);

require_once $filePath;
}
}

$dirs = [
'tests/_support/_controller',
'tests/_support/Controllers',
'tests/_support/Entity',
'tests/_support/Entity/Cast',
'tests/_support/Models',
'tests/_support/Validation',
'tests/_support/View',
'tests/_support',
'tests/system/Config/fixtures',
];
$excludeDirs = [
'tests/_support/Config',
'tests/_support/View/Cells',
'tests/_support/View/Views',
];

foreach ($dirs as $dir) {
$dir = __DIR__ . '/' . $dir;
if (! is_dir($dir)) {
continue;
}

chdir($dir);

foreach (glob('*.php') as $filename) {
$filePath = realpath($dir . '/' . $filename);

require_once $filePath;
foreach ($directories as $directory) {
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(
$directory,
RecursiveDirectoryIterator::UNIX_PATHS | RecursiveDirectoryIterator::CURRENT_AS_FILEINFO,
),
RecursiveIteratorIterator::CHILD_FIRST,
);

/** @var SplFileInfo $file */
foreach ($iterator as $file) {
if (! $file->isFile()) {
continue;
}

if (in_array($file->getPath(), $excludeDirs, true)) {
continue;
}

if ($file->getExtension() !== 'php') {
continue;
}

require_once $file->getPathname();
}
}

chdir(__DIR__);
4 changes: 1 addition & 3 deletions system/BaseModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,7 @@ public function updateBatch(?array $set = null, ?string $index = null, int $batc
$row = $this->doProtectFields($row);

// Restore updateIndex value in case it was wiped out
if ($updateIndex !== null) {
$row[$index] = $updateIndex;
}
$row[$index] = $updateIndex;

$row = $this->setUpdatedField($row, $this->setDate());
}
Expand Down
3 changes: 1 addition & 2 deletions utils/phpstan-baseline/loader.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# total 3271 errors
# total 3270 errors
includes:
- argument.type.neon
- assign.propertyType.neon
Expand All @@ -19,7 +19,6 @@ includes:
- missingType.iterableValue.neon
- missingType.parameter.neon
- missingType.property.neon
- notIdentical.alwaysTrue.neon
- nullCoalesce.property.neon
- offsetAccess.notFound.neon
- property.defaultValue.neon
Expand Down
8 changes: 0 additions & 8 deletions utils/phpstan-baseline/notIdentical.alwaysTrue.neon

This file was deleted.

Loading