rector fixes

This commit is contained in:
Dennis Eichhorn 2023-09-24 14:56:44 +00:00
parent 16b2c5ee49
commit 9ef91d9ef9
3 changed files with 19 additions and 19 deletions

View File

@ -120,9 +120,9 @@ final class Installer extends InstallerAbstract
continue;
}
$unitAttrType[$attribute['name']] = !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
$unitAttrType[$attribute['name']] = \is_array($responseData['response'])
? $responseData['response']
: $responseData['response']->toArray();
$isFirst = true;
foreach ($attribute['l11n'] as $language => $l11n) {
@ -191,9 +191,9 @@ final class Installer extends InstallerAbstract
continue;
}
$attrValue = !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
$attrValue = \is_array($responseData['response'])
? $responseData['response']
: $responseData['response']->toArray();
$unitAttrValue[$attribute['name']][] = $attrValue;
@ -260,9 +260,9 @@ final class Installer extends InstallerAbstract
continue;
}
$addressAttrType[$attribute['name']] = !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
$addressAttrType[$attribute['name']] = \is_array($responseData['response'])
? $responseData['response']
: $responseData['response']->toArray();
$isFirst = true;
foreach ($attribute['l11n'] as $language => $l11n) {
@ -331,9 +331,9 @@ final class Installer extends InstallerAbstract
continue;
}
$attrValue = !\is_array($responseData['response'])
? $responseData['response']->toArray()
: $responseData['response'];
$attrValue = \is_array($responseData['response'])
? $responseData['response']
: $responseData['response']->toArray();
$addressAttrValue[$attribute['name']][] = $attrValue;

View File

@ -138,7 +138,7 @@ final class ApiController extends Controller
$unit->description = Markdown::parse($request->getDataString('description') ?? $unit->descriptionRaw);
$parent = (int) $request->getData('parent');
$unit->parent = !empty($parent) ? new NullUnit($parent) : $unit->parent;
$unit->parent = empty($parent) ? $unit->parent : new NullUnit($parent);
$unit->setStatus($request->getDataInt('status') ?? $unit->getStatus());
return $unit;
@ -514,10 +514,10 @@ final class ApiController extends Controller
$position->description = Markdown::parse($request->getDataString('description') ?? $position->descriptionRaw);
$parent = (int) $request->getData('parent');
$position->parent = !empty($parent) ? new NullPosition($parent) : $position->parent;
$position->parent = empty($parent) ? $position->parent : new NullPosition($parent);
$department = (int) $request->getData('department');
$position->department = !empty($department) ? new NullDepartment($department) : $position->department;
$position->department = empty($department) ? $position->department : new NullDepartment($department);
$position->setStatus($request->getDataInt('status') ?? $position->getStatus());
return $position;
@ -668,11 +668,11 @@ final class ApiController extends Controller
$department->description = Markdown::parse($request->getDataString('description') ?? $department->descriptionRaw);
$parent = (int) $request->getData('parent');
$department->parent = !empty($parent) ? new NullDepartment($parent) : $department->parent;
$department->parent = empty($parent) ? $department->parent : new NullDepartment($parent);
$department->setStatus($request->getDataInt('status') ?? $department->getStatus());
$unit = (int) $request->getData('unit');
$department->unit = !empty($unit) ? new NullUnit($unit) : $department->unit;
$department->unit = empty($unit) ? $department->unit : new NullUnit($unit);
return $department;
}

View File

@ -381,7 +381,7 @@ function phpServe() : void
// Execute the command and store the process ID
$output = [];
echo \sprintf('Starting server...') . \PHP_EOL;
echo 'Starting server...' . \PHP_EOL;
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
echo \sprintf(' %s', $command);
\exec($command, $output);
@ -406,7 +406,7 @@ function phpServe() : void
// Kill the web server when the process ends
\register_shutdown_function(function() use ($killCommand, $pid) : void {
echo \PHP_EOL . \sprintf('Stopping server...') . \PHP_EOL;
echo \PHP_EOL . 'Stopping server...' . \PHP_EOL;
echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL;
\exec($killCommand . $pid);
});