Skip to content

Commit

Permalink
Merge 2b0dc24 into 72f04ad
Browse files Browse the repository at this point in the history
  • Loading branch information
scrutinizer-auto-fixer committed Jan 19, 2020
2 parents 72f04ad + 2b0dc24 commit b50a57b
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/Module/AncestorsChartModule.php
Expand Up @@ -45,7 +45,7 @@ class AncestorsChartModule extends AbstractModule implements ModuleChartInterfac
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/ancestors-{style}-{generations}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/ancestors-{style}-{generations}/{xref}';

// Chart styles
public const CHART_STYLE_TREE = 'tree';
Expand Down
2 changes: 1 addition & 1 deletion app/Module/CompactTreeChartModule.php
Expand Up @@ -43,7 +43,7 @@ class CompactTreeChartModule extends AbstractModule implements ModuleChartInterf
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/compact/{xref}';
protected const ROUTE_URL = '/tree/{tree}/compact/{xref}';

/** @var ChartService */
private $chart_service;
Expand Down
2 changes: 1 addition & 1 deletion app/Module/DescendancyChartModule.php
Expand Up @@ -45,7 +45,7 @@ class DescendancyChartModule extends AbstractModule implements ModuleChartInterf
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/descendants-{style}-{generations}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/descendants-{style}-{generations}/{xref}';

// Chart styles
public const CHART_STYLE_TREE = 'tree';
Expand Down
2 changes: 1 addition & 1 deletion app/Module/FamilyBookChartModule.php
Expand Up @@ -44,7 +44,7 @@ class FamilyBookChartModule extends AbstractModule implements ModuleChartInterfa
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/family-book-{book_size}-{generations}-{spouses}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/family-book-{book_size}-{generations}-{spouses}/{xref}';

// Defaults
public const DEFAULT_GENERATIONS = '2';
Expand Down
2 changes: 1 addition & 1 deletion app/Module/FanChartModule.php
Expand Up @@ -49,7 +49,7 @@ class FanChartModule extends AbstractModule implements ModuleChartInterface, Req
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}';

// Chart styles
private const STYLE_HALF_CIRCLE = '2';
Expand Down
2 changes: 1 addition & 1 deletion app/Module/HourglassChartModule.php
Expand Up @@ -45,7 +45,7 @@ class HourglassChartModule extends AbstractModule implements ModuleChartInterfac
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/hourglass-{generations}-{spouses}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/hourglass-{generations}-{spouses}/{xref}';

// Defaults
private const DEFAULT_GENERATIONS = '3';
Expand Down
2 changes: 1 addition & 1 deletion app/Module/LifespansChartModule.php
Expand Up @@ -46,7 +46,7 @@ class LifespansChartModule extends AbstractModule implements ModuleChartInterfac
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/lifespans';
protected const ROUTE_URL = '/tree/{tree}/lifespans';

// Defaults
protected const DEFAULT_PARAMETERS = [];
Expand Down
4 changes: 2 additions & 2 deletions app/Module/PedigreeChartModule.php
Expand Up @@ -47,7 +47,7 @@ class PedigreeChartModule extends AbstractModule implements ModuleChartInterface
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/pedigree-{style}-{generations}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/pedigree-{style}-{generations}/{xref}';

// Chart styles
public const STYLE_LEFT = 'left';
Expand Down Expand Up @@ -225,7 +225,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface

// Father’s ancestors link to the father’s pedigree
// Mother’s ancestors link to the mother’s pedigree..
$links = $ancestors->map(function (?Individual $individual, $sosa) use ($ancestors, $style, $generations): string {
$links = $ancestors->map(function (?Individual $individual, $sosa) use ($ancestors, $style, $generations) : string {
if ($individual instanceof Individual && $sosa >= 2 ** $generations / 2 && $individual->childFamilies()->isNotEmpty()) {
// The last row/column, and there are more generations.
if ($sosa >= 2 ** $generations * 3 / 4) {
Expand Down
2 changes: 1 addition & 1 deletion app/Module/PedigreeMapModule.php
Expand Up @@ -52,7 +52,7 @@ class PedigreeMapModule extends AbstractModule implements ModuleChartInterface,
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/pedigree-map-{generations}/{xref}';
protected const ROUTE_URL = '/tree/{tree}/pedigree-map-{generations}/{xref}';

// Defaults
public const DEFAULT_GENERATIONS = '4';
Expand Down
14 changes: 7 additions & 7 deletions app/Module/RelationshipsChartModule.php
Expand Up @@ -54,7 +54,7 @@ class RelationshipsChartModule extends AbstractModule implements ModuleChartInte
use ModuleChartTrait;
use ModuleConfigTrait;

protected const ROUTE_URL = '/tree/{tree}/relationships-{ancestors}-{recursion}/{xref}{/xref2}';
protected const ROUTE_URL = '/tree/{tree}/relationships-{ancestors}-{recursion}/{xref}{/xref2}';

/** It would be more correct to use PHP_INT_MAX, but this isn't friendly in URLs */
public const UNLIMITED_RECURSION = 99;
Expand Down Expand Up @@ -332,14 +332,14 @@ public function chart(Individual $individual1, Individual $individual2, int $rec
case 'sis':
case 'sib':
$table[$x + 1][$y] = '<div style="background:url(' . e(asset('css/images/hline.png')) . ') repeat-x center; width: 94px; text-align: center"><div class="hline-text" style="height: 32px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px;">' . view('icons/arrow-right') . '</div></div>';
$x += 2;
$x += 2;
break;
case 'son':
case 'dau':
case 'chi':
if ($n > 2 && preg_match('/fat|mot|par/', $relationships[$n - 2])) {
$table[$x + 1][$y - 1] = '<div style="background:url(' . $diagonal2 . '); width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: end;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px; text-align: start;">' . view('icons/arrow-down') . '</div></div>';
$x += 2;
$x += 2;
} else {
$table[$x][$y - 1] = '<div style="background:url(' . e('"' . asset('css/images/vline.png') . '"') . ') repeat-y center; height: 64px; text-align: center;"><div class="vline-text" style="display: inline-block; width:50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="display: inline-block; width:50%; line-height: 64px;">' . view('icons/arrow-down') . '</div></div>';
}
Expand All @@ -350,7 +350,7 @@ public function chart(Individual $individual1, Individual $individual2, int $rec
case 'par':
if ($n > 2 && preg_match('/son|dau|chi/', $relationships[$n - 2])) {
$table[$x + 1][$y + 1] = '<div style="background:url(' . $diagonal1 . '); background-position: top right; width: 64px; height: 64px; text-align: center;"><div style="height: 32px; text-align: start;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="height: 32px; text-align: end;">' . view('icons/arrow-down') . '</div></div>';
$x += 2;
$x += 2;
} else {
$table[$x][$y + 1] = '<div style="background:url(' . e('"' . asset('css/images/vline.png') . '"') . ') repeat-y center; height: 64px; text-align:center; "><div class="vline-text" style="display: inline-block; width: 50%; line-height: 64px;">' . Functions::getRelationshipNameFromPath($relationships[$n], Individual::getInstance($path[$n - 1], $tree), Individual::getInstance($path[$n + 1], $tree)) . '</div><div style="display: inline-block; width: 50%; line-height: 32px">' . view('icons/arrow-up') . '</div></div>';
}
Expand Down Expand Up @@ -648,17 +648,17 @@ private function excludeFamilies($xref1, $xref2, $tree_id): array
*/
private function oldStyleRelationshipPath(Tree $tree, array $path): array
{
$spouse_codes = [
$spouse_codes = [
'M' => 'hus',
'F' => 'wif',
'U' => 'spo',
];
$parent_codes = [
$parent_codes = [
'M' => 'fat',
'F' => 'mot',
'U' => 'par',
];
$child_codes = [
$child_codes = [
'M' => 'son',
'F' => 'dau',
'U' => 'chi',
Expand Down
6 changes: 3 additions & 3 deletions app/Module/TimelineChartModule.php
Expand Up @@ -45,7 +45,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface
{
use ModuleChartTrait;

protected const ROUTE_URL = '/tree/{tree}/timeline-{scale}';
protected const ROUTE_URL = '/tree/{tree}/timeline-{scale}';

// Defaults
protected const DEFAULT_SCALE = 10;
Expand All @@ -66,7 +66,7 @@ class TimelineChartModule extends AbstractModule implements ModuleChartInterface
'_TODO',
'CHAN',
];
protected const BHEIGHT = 30;
protected const BHEIGHT = 30;

// Box height

Expand Down Expand Up @@ -151,7 +151,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface

$params = (array) $request->getParsedBody();

$add = $params['add'] ?? '';
$add = $params['add'] ?? '';

Auth::checkComponentAccess($this, 'chart', $tree, $user);

Expand Down

0 comments on commit b50a57b

Please sign in to comment.