Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
UksusoFF committed Dec 3, 2024
1 parent 6ccd884 commit 44c6619
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Helpers/AppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public static function get(string $class)

throw new Exception('Can not find container resolver');
}
}
}
8 changes: 4 additions & 4 deletions src/Helpers/ExifHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ public function getMediaMap(string $file): ?array

private function getCoordinates($face, $width, $height): ?array
{
$x = (int)round($width * ($face['stArea:x'] - $face['stArea:w'] / 2));
$y = (int)round($height * ($face['stArea:y'] - $face['stArea:h'] / 2));
$w = (int)round($width * $face['stArea:w']);
$h = (int)round($height * $face['stArea:h']);
$x = (int) round($width * ($face['stArea:x'] - $face['stArea:w'] / 2));
$y = (int) round($height * ($face['stArea:y'] - $face['stArea:h'] / 2));
$w = (int) round($width * $face['stArea:w']);
$h = (int) round($height * $face['stArea:h']);

return $face['stArea:unit'] === 'normalized' ? [
$x,
Expand Down
9 changes: 4 additions & 5 deletions src/Http/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Fisharebest\Webtrees\Media;
use Fisharebest\Webtrees\MediaFile;
use Fisharebest\Webtrees\Registry;
use Fisharebest\Webtrees\Services\LinkedRecordService;
use Fisharebest\Webtrees\Services\TreeService;
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface;
Expand Down Expand Up @@ -155,9 +154,9 @@ private function prepareRow($row): array

if (
$row->m_file === null ||
($tree = $this->trees->find((int)$row->m_file)) === null ||
($tree = $this->trees->find((int) $row->m_file)) === null ||
($media = Registry::mediaFactory()->make($row->f_m_id, $tree)) === null ||
($file = $this->module->media->getMediaImageFileByOrder($media, (int)$row->f_m_order)) === null
($file = $this->module->media->getMediaImageFileByOrder($media, (int) $row->f_m_order)) === null
) {
return $this->rowMissed($row, $pids);
}
Expand Down Expand Up @@ -271,9 +270,9 @@ private function settingTab(): Response
private function destroy(Request $request): Response
{
$count = $this->module->query->setMediaMap(
(int)$request->getQueryParams()['tid'],
(int) $request->getQueryParams()['tid'],
$request->getQueryParams()['mid'],
(int)$request->getQueryParams()['order'],
(int) $request->getQueryParams()['order'],
null,
null
);
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/DataController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private function attach(Request $request, Media $media, string $fact): Response

$map = $this->getMediaMap($media, $fact);

$map[] = (object)[
$map[] = (object) [
'pid' => $pid,
'coords' => $coords,
];
Expand Down Expand Up @@ -179,7 +179,7 @@ private function getMediaMapForTree(Media $media, string $fact): array
$priorFact = $this->getMediaFacts($media)->first();

foreach ($areas as $area) {
$pid = (string)$area['pid'];
$pid = (string) $area['pid'];
$result[$pid] = [
'link' => null,
'pid' => $pid,
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/FacesModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ public function settingToggle(string $key): bool
{
$state = !$this->settingEnabled($key);

$this->setPreference($key, (string)$state);
$this->setPreference($key, (string) $state);

return $state;
}

public function settingEnabled(string $key): bool
{
return (bool)$this->getPreference($key, (string)false);
return (bool) $this->getPreference($key, (string) false);
}

public function getConfigLink(): string
Expand Down

0 comments on commit 44c6619

Please sign in to comment.