@@ -21,47 +21,47 @@ |
||
21 | 21 | */ |
22 | 22 | interface PlaceMapperInterface |
23 | 23 | { |
24 | - /** |
|
25 | - * Boot the Place mapper |
|
26 | - */ |
|
27 | - function boot(): void; |
|
24 | + /** |
|
25 | + * Boot the Place mapper |
|
26 | + */ |
|
27 | + function boot(): void; |
|
28 | 28 | |
29 | - /** |
|
30 | - * Get the configuration associated to the mapper |
|
31 | - * |
|
32 | - * @return PlaceMapperConfigInterface |
|
33 | - */ |
|
34 | - function config(): PlaceMapperConfigInterface; |
|
29 | + /** |
|
30 | + * Get the configuration associated to the mapper |
|
31 | + * |
|
32 | + * @return PlaceMapperConfigInterface |
|
33 | + */ |
|
34 | + function config(): PlaceMapperConfigInterface; |
|
35 | 35 | |
36 | - /** |
|
37 | - * Set the configured associated to the mapper |
|
38 | - * |
|
39 | - * @param PlaceMapperConfigInterface $config |
|
40 | - */ |
|
41 | - function setConfig(PlaceMapperConfigInterface $config): void; |
|
36 | + /** |
|
37 | + * Set the configured associated to the mapper |
|
38 | + * |
|
39 | + * @param PlaceMapperConfigInterface $config |
|
40 | + */ |
|
41 | + function setConfig(PlaceMapperConfigInterface $config): void; |
|
42 | 42 | |
43 | - /** |
|
44 | - * Get the data associated to the mapper, for a specific key |
|
45 | - * |
|
46 | - * @param string $key |
|
47 | - * @return null|mixed |
|
48 | - */ |
|
49 | - function data(string $key); |
|
43 | + /** |
|
44 | + * Get the data associated to the mapper, for a specific key |
|
45 | + * |
|
46 | + * @param string $key |
|
47 | + * @return null|mixed |
|
48 | + */ |
|
49 | + function data(string $key); |
|
50 | 50 | |
51 | - /** |
|
52 | - * Set the data associated to the mapper, for a specific key |
|
53 | - * |
|
54 | - * @param string $key |
|
55 | - * @param mixed $data |
|
56 | - */ |
|
57 | - function setData(string $key, $data): void; |
|
51 | + /** |
|
52 | + * Set the data associated to the mapper, for a specific key |
|
53 | + * |
|
54 | + * @param string $key |
|
55 | + * @param mixed $data |
|
56 | + */ |
|
57 | + function setData(string $key, $data): void; |
|
58 | 58 | |
59 | - /** |
|
60 | - * Return the property value of the feature identifying a place in a GeoJson map. |
|
61 | - * |
|
62 | - * @param Place $place |
|
63 | - * @param string $feature_property |
|
64 | - * @return string|NULL |
|
65 | - */ |
|
66 | - function map(Place $place, string $feature_property) : ?string; |
|
59 | + /** |
|
60 | + * Return the property value of the feature identifying a place in a GeoJson map. |
|
61 | + * |
|
62 | + * @param Place $place |
|
63 | + * @param string $feature_property |
|
64 | + * @return string|NULL |
|
65 | + */ |
|
66 | + function map(Place $place, string $feature_property) : ?string; |
|
67 | 67 | } |
68 | 68 | \ No newline at end of file |
@@ -19,10 +19,10 @@ |
||
19 | 19 | */ |
20 | 20 | interface ModuleMapDefinitionProviderInterface |
21 | 21 | { |
22 | - /** |
|
23 | - * List map definitions provided by the module as an array. |
|
24 | - * |
|
25 | - * @return MapDefinitionInterface[] List of map definitions |
|
26 | - */ |
|
27 | - public function listMapDefinition(): array; |
|
22 | + /** |
|
23 | + * List map definitions provided by the module as an array. |
|
24 | + * |
|
25 | + * @return MapDefinitionInterface[] List of map definitions |
|
26 | + */ |
|
27 | + public function listMapDefinition(): array; |
|
28 | 28 | } |
@@ -20,28 +20,28 @@ |
||
20 | 20 | */ |
21 | 21 | interface PlaceMapperConfigInterface extends JsonSerializable |
22 | 22 | { |
23 | - /** |
|
24 | - * Deserialise the mapper configuration from a string or an array |
|
25 | - * |
|
26 | - * @param mixed $config |
|
27 | - * @return self |
|
28 | - */ |
|
29 | - function jsonDeserialize($config): self; |
|
23 | + /** |
|
24 | + * Deserialise the mapper configuration from a string or an array |
|
25 | + * |
|
26 | + * @param mixed $config |
|
27 | + * @return self |
|
28 | + */ |
|
29 | + function jsonDeserialize($config): self; |
|
30 | 30 | |
31 | - /** |
|
32 | - * Check if the configuration contains a specific key |
|
33 | - * |
|
34 | - * @param string $key |
|
35 | - * @return bool |
|
36 | - */ |
|
37 | - function has(string $key): bool; |
|
31 | + /** |
|
32 | + * Check if the configuration contains a specific key |
|
33 | + * |
|
34 | + * @param string $key |
|
35 | + * @return bool |
|
36 | + */ |
|
37 | + function has(string $key): bool; |
|
38 | 38 | |
39 | - /** |
|
40 | - * Return the configuration associated with a key, or a default value if none found. |
|
41 | - * |
|
42 | - * @param string $key |
|
43 | - * @param mixed|null $default |
|
44 | - * @return mixed|null |
|
45 | - */ |
|
46 | - function get(string $key, $default = null); |
|
39 | + /** |
|
40 | + * Return the configuration associated with a key, or a default value if none found. |
|
41 | + * |
|
42 | + * @param string $key |
|
43 | + * @param mixed|null $default |
|
44 | + * @return mixed|null |
|
45 | + */ |
|
46 | + function get(string $key, $default = null); |
|
47 | 47 | } |
48 | 48 | \ No newline at end of file |
@@ -20,10 +20,10 @@ |
||
20 | 20 | interface ModuleGeoAnalysisProviderInterface |
21 | 21 | { |
22 | 22 | |
23 | - /** |
|
24 | - * List geographical analyses provided by the module as an array. |
|
25 | - * |
|
26 | - * @return string[] List of tasks |
|
27 | - */ |
|
28 | - public function listGeoAnalyses(): array; |
|
23 | + /** |
|
24 | + * List geographical analyses provided by the module as an array. |
|
25 | + * |
|
26 | + * @return string[] List of tasks |
|
27 | + */ |
|
28 | + public function listGeoAnalyses(): array; |
|
29 | 29 | } |
@@ -21,26 +21,26 @@ |
||
21 | 21 | */ |
22 | 22 | interface GeoAnalysisInterface |
23 | 23 | { |
24 | - /** |
|
25 | - * Get the geographical dispersion analysis title |
|
26 | - * |
|
27 | - * @return string |
|
28 | - */ |
|
29 | - function title(): string; |
|
24 | + /** |
|
25 | + * Get the geographical dispersion analysis title |
|
26 | + * |
|
27 | + * @return string |
|
28 | + */ |
|
29 | + function title(): string; |
|
30 | 30 | |
31 | - /** |
|
32 | - * Gets the function to translate |
|
33 | - * |
|
34 | - * @return callable(int $count): string |
|
35 | - */ |
|
36 | - function itemsDescription(): callable; |
|
31 | + /** |
|
32 | + * Gets the function to translate |
|
33 | + * |
|
34 | + * @return callable(int $count): string |
|
35 | + */ |
|
36 | + function itemsDescription(): callable; |
|
37 | 37 | |
38 | - /** |
|
39 | - * Get the results of the geographical dispersion analysis |
|
40 | - * |
|
41 | - * @param Tree $tree |
|
42 | - * @param int $depth |
|
43 | - * @return GeoAnalysisResults |
|
44 | - */ |
|
45 | - function results(Tree $tree, int $depth): GeoAnalysisResults; |
|
38 | + /** |
|
39 | + * Get the results of the geographical dispersion analysis |
|
40 | + * |
|
41 | + * @param Tree $tree |
|
42 | + * @param int $depth |
|
43 | + * @return GeoAnalysisResults |
|
44 | + */ |
|
45 | + function results(Tree $tree, int $depth): GeoAnalysisResults; |
|
46 | 46 | } |
47 | 47 | \ No newline at end of file |
@@ -18,24 +18,24 @@ |
||
18 | 18 | */ |
19 | 19 | interface MapDefinitionInterface |
20 | 20 | { |
21 | - /** |
|
22 | - * Get the map ID |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - function id(): string; |
|
21 | + /** |
|
22 | + * Get the map ID |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + function id(): string; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Get the map title |
|
30 | - * |
|
31 | - * @return string |
|
32 | - */ |
|
33 | - function title(): string; |
|
28 | + /** |
|
29 | + * Get the map title |
|
30 | + * |
|
31 | + * @return string |
|
32 | + */ |
|
33 | + function title(): string; |
|
34 | 34 | |
35 | - /** |
|
36 | - * Get the features in the map |
|
37 | - * |
|
38 | - * @return \Brick\Geo\IO\GeoJSON\Feature[] |
|
39 | - */ |
|
40 | - function features(): array; |
|
35 | + /** |
|
36 | + * Get the features in the map |
|
37 | + * |
|
38 | + * @return \Brick\Geo\IO\GeoJSON\Feature[] |
|
39 | + */ |
|
40 | + function features(): array; |
|
41 | 41 | } |
42 | 42 | \ No newline at end of file |
@@ -18,17 +18,17 @@ |
||
18 | 18 | */ |
19 | 19 | interface MapViewConfigInterface |
20 | 20 | { |
21 | - /** |
|
22 | - * Get the feature property to be used for mapping the map feature with the analysis results |
|
23 | - * |
|
24 | - * @return string |
|
25 | - */ |
|
26 | - function mapMappingProperty(): string; |
|
21 | + /** |
|
22 | + * Get the feature property to be used for mapping the map feature with the analysis results |
|
23 | + * |
|
24 | + * @return string |
|
25 | + */ |
|
26 | + function mapMappingProperty(): string; |
|
27 | 27 | |
28 | - /** |
|
29 | - * Get the config of the mapper associated with the map view |
|
30 | - * |
|
31 | - * @return PlaceMapperConfigInterface |
|
32 | - */ |
|
33 | - function mapperConfig(): PlaceMapperConfigInterface; |
|
28 | + /** |
|
29 | + * Get the config of the mapper associated with the map view |
|
30 | + * |
|
31 | + * @return PlaceMapperConfigInterface |
|
32 | + */ |
|
33 | + function mapperConfig(): PlaceMapperConfigInterface; |
|
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -30,43 +30,43 @@ |
||
30 | 30 | */ |
31 | 31 | class AuthTreePreference implements MiddlewareInterface |
32 | 32 | { |
33 | - /** |
|
34 | - * {@inheritDoc} |
|
35 | - * @see \Psr\Http\Server\MiddlewareInterface::process() |
|
36 | - */ |
|
37 | - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
38 | - { |
|
39 | - $tree = $request->getAttribute('tree'); |
|
40 | - assert($tree instanceof Tree); |
|
41 | - /** @var Tree $tree */ |
|
33 | + /** |
|
34 | + * {@inheritDoc} |
|
35 | + * @see \Psr\Http\Server\MiddlewareInterface::process() |
|
36 | + */ |
|
37 | + public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
|
38 | + { |
|
39 | + $tree = $request->getAttribute('tree'); |
|
40 | + assert($tree instanceof Tree); |
|
41 | + /** @var Tree $tree */ |
|
42 | 42 | |
43 | - $route = $request->getAttribute('route'); |
|
44 | - assert($route instanceof \Aura\Router\Route); |
|
45 | - /** @var \Aura\Router\Route $route */ |
|
43 | + $route = $request->getAttribute('route'); |
|
44 | + assert($route instanceof \Aura\Router\Route); |
|
45 | + /** @var \Aura\Router\Route $route */ |
|
46 | 46 | |
47 | - $user = $request->getAttribute('user'); |
|
47 | + $user = $request->getAttribute('user'); |
|
48 | 48 | |
49 | - $permission_preference = $route->extras['permission_preference'] ?? ''; |
|
50 | - $permission_level = $permission_preference === '' ? '' : $tree->getPreference($permission_preference); |
|
49 | + $permission_preference = $route->extras['permission_preference'] ?? ''; |
|
50 | + $permission_level = $permission_preference === '' ? '' : $tree->getPreference($permission_preference); |
|
51 | 51 | |
52 | - // Permissions are configured |
|
53 | - if (is_numeric($permission_level)) { |
|
54 | - // Logged in with the correct role? |
|
55 | - if (Auth::accessLevel($tree, $user) <= (int) $permission_level) { |
|
56 | - return $handler->handle($request); |
|
57 | - } |
|
52 | + // Permissions are configured |
|
53 | + if (is_numeric($permission_level)) { |
|
54 | + // Logged in with the correct role? |
|
55 | + if (Auth::accessLevel($tree, $user) <= (int) $permission_level) { |
|
56 | + return $handler->handle($request); |
|
57 | + } |
|
58 | 58 | |
59 | - // Logged in, but without the correct role? |
|
60 | - if ($user instanceof User) { |
|
61 | - throw new HttpAccessDeniedException(); |
|
62 | - } |
|
63 | - } |
|
59 | + // Logged in, but without the correct role? |
|
60 | + if ($user instanceof User) { |
|
61 | + throw new HttpAccessDeniedException(); |
|
62 | + } |
|
63 | + } |
|
64 | 64 | |
65 | - // Permissions no configured, or not logged in |
|
66 | - if ($request->getMethod() === RequestMethodInterface::METHOD_POST) { |
|
67 | - throw new HttpAccessDeniedException(); |
|
68 | - } |
|
65 | + // Permissions no configured, or not logged in |
|
66 | + if ($request->getMethod() === RequestMethodInterface::METHOD_POST) { |
|
67 | + throw new HttpAccessDeniedException(); |
|
68 | + } |
|
69 | 69 | |
70 | - return redirect(route(LoginPage::class, ['tree' => $tree->name(), 'url' => $request->getUri()])); |
|
71 | - } |
|
70 | + return redirect(route(LoginPage::class, ['tree' => $tree->name(), 'url' => $request->getUri()])); |
|
71 | + } |
|
72 | 72 | } |
@@ -52,7 +52,7 @@ |
||
52 | 52 | // Permissions are configured |
53 | 53 | if (is_numeric($permission_level)) { |
54 | 54 | // Logged in with the correct role? |
55 | - if (Auth::accessLevel($tree, $user) <= (int) $permission_level) { |
|
55 | + if (Auth::accessLevel($tree, $user) <= (int)$permission_level) { |
|
56 | 56 | return $handler->handle($request); |
57 | 57 | } |
58 | 58 |
@@ -105,29 +105,29 @@ |
||
105 | 105 | * @return string|array Estimated birth place if found, null otherwise |
106 | 106 | */ |
107 | 107 | public function getSignificantPlace(){ |
108 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
109 | - return $bplace; |
|
110 | - } |
|
108 | + if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
109 | + return $bplace; |
|
110 | + } |
|
111 | 111 | |
112 | - foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) { |
|
113 | - if ($rplace) { |
|
114 | - return $rplace; |
|
115 | - } |
|
116 | - } |
|
112 | + foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) { |
|
113 | + if ($rplace) { |
|
114 | + return $rplace; |
|
115 | + } |
|
116 | + } |
|
117 | 117 | |
118 | - if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
119 | - return $dplace; |
|
120 | - } |
|
118 | + if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
119 | + return $dplace; |
|
120 | + } |
|
121 | 121 | |
122 | - foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
123 | - foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
|
124 | - if ($rplace) { |
|
125 | - return $rplace; |
|
126 | - } |
|
127 | - } |
|
128 | - } |
|
122 | + foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
123 | + foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
|
124 | + if ($rplace) { |
|
125 | + return $rplace; |
|
126 | + } |
|
127 | + } |
|
128 | + } |
|
129 | 129 | |
130 | - return null; |
|
130 | + return null; |
|
131 | 131 | } |
132 | 132 | } |
133 | 133 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | class Individual extends GedcomRecord { |
22 | 22 | |
23 | 23 | /** @var array|null List of titles the individal holds */ |
24 | - protected $titles=null; |
|
24 | + protected $titles = null; |
|
25 | 25 | |
26 | 26 | /** @var string|null Individual's primary surname, without any privacy applied to it */ |
27 | 27 | protected $unprotected_prim_surname = null; |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @param null|string $gedcom |
36 | 36 | * @return null|Individual |
37 | 37 | */ |
38 | - public static function getIntance($xref, Tree $tree, $gedcom = null){ |
|
38 | + public static function getIntance($xref, Tree $tree, $gedcom = null) { |
|
39 | 39 | $indi = \Fisharebest\Webtrees\Individual::getInstance($xref, $tree, $gedcom); |
40 | - if($indi){ |
|
40 | + if ($indi) { |
|
41 | 41 | return new Individual($indi); |
42 | 42 | } |
43 | 43 | return null; |
@@ -48,18 +48,18 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return array Array of titles |
50 | 50 | */ |
51 | - public function getTitles(){ |
|
52 | - if(is_null($this->titles) && $module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME)){ |
|
51 | + public function getTitles() { |
|
52 | + if (is_null($this->titles) && $module = Module::getModuleByName(Constants::MODULE_MAJ_MISC_NAME)) { |
|
53 | 53 | $pattern = '/(.*) (('.$module->getSetting('MAJ_TITLE_PREFIX', '').')(.*))/'; |
54 | - $this->titles=array(); |
|
54 | + $this->titles = array(); |
|
55 | 55 | $titlefacts = $this->gedcomrecord->getFacts('TITL'); |
56 | - foreach($titlefacts as $titlefact){ |
|
56 | + foreach ($titlefacts as $titlefact) { |
|
57 | 57 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
58 | - if($ct2>0){ |
|
59 | - $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
|
58 | + if ($ct2 > 0) { |
|
59 | + $this->titles[$match2[1][0]][] = trim($match2[2][0]); |
|
60 | 60 | } |
61 | - else{ |
|
62 | - $this->titles[$titlefact->getValue()][]=''; |
|
61 | + else { |
|
62 | + $this->titles[$titlefact->getValue()][] = ''; |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | * @return string Primary surname |
74 | 74 | */ |
75 | 75 | public function getUnprotectedPrimarySurname() { |
76 | - if(!$this->unprotected_prim_surname){ |
|
77 | - $tmp=$this->gedcomrecord->getAllNames(); |
|
76 | + if (!$this->unprotected_prim_surname) { |
|
77 | + $tmp = $this->gedcomrecord->getAllNames(); |
|
78 | 78 | $this->unprotected_prim_surname = $tmp[$this->gedcomrecord->getPrimaryName()]['surname']; |
79 | 79 | } |
80 | 80 | return $this->unprotected_prim_surname; |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | * @param boolean $perc Should the coefficient of reliability be returned |
87 | 87 | * @return string|array Estimated birth place if found, null otherwise |
88 | 88 | */ |
89 | - public function getEstimatedBirthPlace($perc=false){ |
|
90 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
91 | - if($perc){ |
|
92 | - return array ($bplace, 1); |
|
89 | + public function getEstimatedBirthPlace($perc = false) { |
|
90 | + if ($bplace = $this->gedcomrecord->getBirthPlace()) { |
|
91 | + if ($perc) { |
|
92 | + return array($bplace, 1); |
|
93 | 93 | } |
94 | - else{ |
|
94 | + else { |
|
95 | 95 | return $bplace; |
96 | 96 | } |
97 | 97 | } |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @param boolean $perc Should the coefficient of reliability be returned |
105 | 105 | * @return string|array Estimated birth place if found, null otherwise |
106 | 106 | */ |
107 | - public function getSignificantPlace(){ |
|
108 | - if($bplace = $this->gedcomrecord->getBirthPlace()){ |
|
107 | + public function getSignificantPlace() { |
|
108 | + if ($bplace = $this->gedcomrecord->getBirthPlace()) { |
|
109 | 109 | return $bplace; |
110 | 110 | } |
111 | 111 | |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
118 | - if($dplace = $this->gedcomrecord->getDeathPlace()){ |
|
118 | + if ($dplace = $this->gedcomrecord->getDeathPlace()) { |
|
119 | 119 | return $dplace; |
120 | 120 | } |
121 | 121 | |
122 | - foreach($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
122 | + foreach ($this->gedcomrecord->getSpouseFamilies() as $fams) { |
|
123 | 123 | foreach ($fams->getAllEventPlaces('RESI') as $rplace) { |
124 | 124 | if ($rplace) { |
125 | 125 | return $rplace; |
@@ -57,8 +57,7 @@ discard block |
||
57 | 57 | $ct2 = preg_match_all($pattern, $titlefact->getValue(), $match2); |
58 | 58 | if($ct2>0){ |
59 | 59 | $this->titles[$match2[1][0]][]= trim($match2[2][0]); |
60 | - } |
|
61 | - else{ |
|
60 | + } else{ |
|
62 | 61 | $this->titles[$titlefact->getValue()][]=''; |
63 | 62 | } |
64 | 63 | } |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | if($bplace = $this->gedcomrecord->getBirthPlace()){ |
91 | 90 | if($perc){ |
92 | 91 | return array ($bplace, 1); |
93 | - } |
|
94 | - else{ |
|
92 | + } else{ |
|
95 | 93 | return $bplace; |
96 | 94 | } |
97 | 95 | } |