mirror of
https://github.com/Karaka-Management/oms-Organization.git
synced 2026-02-15 07:48:41 +00:00
rector fixes
This commit is contained in:
parent
16b2c5ee49
commit
9ef91d9ef9
|
|
@ -120,9 +120,9 @@ final class Installer extends InstallerAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$unitAttrType[$attribute['name']] = !\is_array($responseData['response'])
|
$unitAttrType[$attribute['name']] = \is_array($responseData['response'])
|
||||||
? $responseData['response']->toArray()
|
? $responseData['response']
|
||||||
: $responseData['response'];
|
: $responseData['response']->toArray();
|
||||||
|
|
||||||
$isFirst = true;
|
$isFirst = true;
|
||||||
foreach ($attribute['l11n'] as $language => $l11n) {
|
foreach ($attribute['l11n'] as $language => $l11n) {
|
||||||
|
|
@ -191,9 +191,9 @@ final class Installer extends InstallerAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$attrValue = !\is_array($responseData['response'])
|
$attrValue = \is_array($responseData['response'])
|
||||||
? $responseData['response']->toArray()
|
? $responseData['response']
|
||||||
: $responseData['response'];
|
: $responseData['response']->toArray();
|
||||||
|
|
||||||
$unitAttrValue[$attribute['name']][] = $attrValue;
|
$unitAttrValue[$attribute['name']][] = $attrValue;
|
||||||
|
|
||||||
|
|
@ -260,9 +260,9 @@ final class Installer extends InstallerAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$addressAttrType[$attribute['name']] = !\is_array($responseData['response'])
|
$addressAttrType[$attribute['name']] = \is_array($responseData['response'])
|
||||||
? $responseData['response']->toArray()
|
? $responseData['response']
|
||||||
: $responseData['response'];
|
: $responseData['response']->toArray();
|
||||||
|
|
||||||
$isFirst = true;
|
$isFirst = true;
|
||||||
foreach ($attribute['l11n'] as $language => $l11n) {
|
foreach ($attribute['l11n'] as $language => $l11n) {
|
||||||
|
|
@ -331,9 +331,9 @@ final class Installer extends InstallerAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$attrValue = !\is_array($responseData['response'])
|
$attrValue = \is_array($responseData['response'])
|
||||||
? $responseData['response']->toArray()
|
? $responseData['response']
|
||||||
: $responseData['response'];
|
: $responseData['response']->toArray();
|
||||||
|
|
||||||
$addressAttrValue[$attribute['name']][] = $attrValue;
|
$addressAttrValue[$attribute['name']][] = $attrValue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ final class ApiController extends Controller
|
||||||
$unit->description = Markdown::parse($request->getDataString('description') ?? $unit->descriptionRaw);
|
$unit->description = Markdown::parse($request->getDataString('description') ?? $unit->descriptionRaw);
|
||||||
|
|
||||||
$parent = (int) $request->getData('parent');
|
$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());
|
$unit->setStatus($request->getDataInt('status') ?? $unit->getStatus());
|
||||||
|
|
||||||
return $unit;
|
return $unit;
|
||||||
|
|
@ -514,10 +514,10 @@ final class ApiController extends Controller
|
||||||
$position->description = Markdown::parse($request->getDataString('description') ?? $position->descriptionRaw);
|
$position->description = Markdown::parse($request->getDataString('description') ?? $position->descriptionRaw);
|
||||||
|
|
||||||
$parent = (int) $request->getData('parent');
|
$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');
|
$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());
|
$position->setStatus($request->getDataInt('status') ?? $position->getStatus());
|
||||||
|
|
||||||
return $position;
|
return $position;
|
||||||
|
|
@ -668,11 +668,11 @@ final class ApiController extends Controller
|
||||||
$department->description = Markdown::parse($request->getDataString('description') ?? $department->descriptionRaw);
|
$department->description = Markdown::parse($request->getDataString('description') ?? $department->descriptionRaw);
|
||||||
|
|
||||||
$parent = (int) $request->getData('parent');
|
$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());
|
$department->setStatus($request->getDataInt('status') ?? $department->getStatus());
|
||||||
|
|
||||||
$unit = (int) $request->getData('unit');
|
$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;
|
return $department;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ function phpServe() : void
|
||||||
|
|
||||||
// Execute the command and store the process ID
|
// Execute the command and store the process ID
|
||||||
$output = [];
|
$output = [];
|
||||||
echo \sprintf('Starting server...') . \PHP_EOL;
|
echo 'Starting server...' . \PHP_EOL;
|
||||||
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
|
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
|
||||||
echo \sprintf(' %s', $command);
|
echo \sprintf(' %s', $command);
|
||||||
\exec($command, $output);
|
\exec($command, $output);
|
||||||
|
|
@ -406,7 +406,7 @@ function phpServe() : void
|
||||||
|
|
||||||
// Kill the web server when the process ends
|
// Kill the web server when the process ends
|
||||||
\register_shutdown_function(function() use ($killCommand, $pid) : void {
|
\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;
|
echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL;
|
||||||
\exec($killCommand . $pid);
|
\exec($killCommand . $pid);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user