mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 06:54:04 +00:00
[4.x] General code cleanup (#1278)
* Declare sensitive parameters as sensitive ... just so that they don't show up in logs * Remove unnecessary null-coalescing * Simplify return * Merge isset() calls * Inline return * Use nullsafe operator * Simplify if-else branches * Use direct empty string comparison instead of strlen() * Add missing type * Change interface as events expect a TenantWithDatabase not just a Tenant * Narrow typehint * Remove redundant type casts * Fix style with php-cs-fixer * Fix typos * Revert unwanted if-else simplification * fix phpstan errors * narrow type --------- Co-authored-by: Samuel Štancl <samuel@archte.ch>
This commit is contained in:
parent
05b602e37f
commit
79f740d057
24 changed files with 45 additions and 53 deletions
|
|
@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputOption;
|
|||
|
||||
trait ParallelCommand
|
||||
{
|
||||
public const MAX_PROCESSES = 24;
|
||||
public const int MAX_PROCESSES = 24;
|
||||
protected bool $runningConcurrently = false;
|
||||
|
||||
abstract protected function childHandle(mixed ...$args): bool;
|
||||
|
|
@ -70,7 +70,7 @@ trait ParallelCommand
|
|||
// perflevel0 refers to P-cores on M-series, and the entire CPU on Intel Macs
|
||||
if ($darwin && $ffi->sysctlbyname('hw.perflevel0.logicalcpu', FFI::addr($cores), FFI::addr($size), null, 0) === 0) {
|
||||
return $cores->cdata;
|
||||
} else if ($darwin) {
|
||||
} elseif ($darwin) {
|
||||
// Reset the size in case the pointer got written to (likely shouldn't happen)
|
||||
$size->cdata = FFI::sizeof($cores);
|
||||
}
|
||||
|
|
@ -109,7 +109,7 @@ trait ParallelCommand
|
|||
if ($processes === null) {
|
||||
// This is used when the option is set but *without* a value (-p).
|
||||
$processes = $this->getLogicalCoreCount();
|
||||
} else if ((int) $processes === -1) {
|
||||
} elseif ((int) $processes === -1) {
|
||||
// Default value we set for the option -- this is used when the option is *not set*.
|
||||
$processes = 1;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue