Passed
Branch feature/2.0 (2da243)
by Jonathan
05:05
created
Webtrees/Module/GeoDispersion/Views/AbstractGeoAnalysisTabGeneralView.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,26 +34,26 @@
 block discarded – undo
34 34
         $html = '<div id="geodispersion_summary">
35 35
         	<div class="maj-table center">
36 36
         		<div class="maj-row">
37
-        			<div class="label">' . I18N::translate('Places found'). '</div>
38
-        			<div class="value">' . I18N::translate('%1$d (%2$s)',$nb_found - $nb_other, I18N::percentage($perc_known)). '</div>
37
+        			<div class="label">' . I18N::translate('Places found').'</div>
38
+        			<div class="value">' . I18N::translate('%1$d (%2$s)', $nb_found - $nb_other, I18N::percentage($perc_known)).'</div>
39 39
         		</div>';
40
-        if($nb_other > 0){
40
+        if ($nb_other > 0) {
41 41
             $perc_other = Functions::safeDivision($nb_other, $nb_found + $nb_unknown);
42 42
             $html .=
43 43
         		'<div class="maj-row">
44
-        			<div class="label">' . I18N::translate('Other places'). '</div>
45
-        			<div class="value">' . I18N::translate('%1$d (%2$s)',$nb_other, I18N::percentage($perc_other)). '</div>
44
+        			<div class="label">' . I18N::translate('Other places').'</div>
45
+        			<div class="value">' . I18N::translate('%1$d (%2$s)', $nb_other, I18N::percentage($perc_other)).'</div>
46 46
         		</div>';
47 47
         }
48 48
         $html .= '<div class="maj-row">
49
-        			<div class="label">' . I18N::translate('Places not found'). '</div>
50
-        			<div class="value">' . I18N::translate('%1$d (%2$s)',$nb_unknown, I18N::percentage(1 - $perc_known)). '</div>
49
+        			<div class="label">' . I18N::translate('Places not found').'</div>
50
+        			<div class="value">' . I18N::translate('%1$d (%2$s)', $nb_unknown, I18N::percentage(1 - $perc_known)).'</div>
51 51
         		</div>
52 52
         	</div>
53 53
         </div>
54 54
         <br/>
55 55
 		<div id="geodispersion_data">
56
-		' . $this->htmlAnalysisData(). '
56
+		' . $this->htmlAnalysisData().'
57 57
 		</div>';
58 58
         
59 59
         return $html;
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGeneralTableView.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -29,34 +29,34 @@
 block discarded – undo
29 29
         $nb_found = $this->data->get('stats_gen_nb_found');
30 30
         $nb_other = $this->data->get('stats_gen_nb_other');
31 31
         
32
-        $i=1;
33
-        $previous_nb=0;        
32
+        $i = 1;
33
+        $previous_nb = 0;        
34 34
         
35
-        $html='<div class="maj-table center">';        
36
-        foreach($results as $place => $nb){
35
+        $html = '<div class="maj-table center">';        
36
+        foreach ($results as $place => $nb) {
37 37
             $perc = Functions::safeDivision($nb, $nb_found - $nb_other);
38
-            if($nb!=$previous_nb){
39
-                $j= I18N::number($i);
38
+            if ($nb != $previous_nb) {
39
+                $j = I18N::number($i);
40 40
             }
41
-            else{
42
-                $j='&nbsp;';
41
+            else {
42
+                $j = '&nbsp;';
43 43
             }
44 44
             	
45
-            $levels = array_map('trim',explode(',', $place));
46
-            $placename = $levels[$analysis_level-1];
47
-            if($placename == '' && $analysis_level > 1) $placename = I18N::translate('Unknown (%s)', $levels[$analysis_level-2]);
48
-            $html.=
45
+            $levels = array_map('trim', explode(',', $place));
46
+            $placename = $levels[$analysis_level - 1];
47
+            if ($placename == '' && $analysis_level > 1) $placename = I18N::translate('Unknown (%s)', $levels[$analysis_level - 2]);
48
+            $html .=
49 49
             '<div class="maj-row">
50 50
                 <div class="label"><strong>'.$j.'</strong></div>
51 51
                 <div class="label">'.$placename.'</div>
52
-                <div class="value">'.I18N::translate('%d',$nb).'</div>
53
-                <div class="value">'.I18N::percentage($perc,1).'</div>
52
+                <div class="value">'.I18N::translate('%d', $nb).'</div>
53
+                <div class="value">'.I18N::percentage($perc, 1).'</div>
54 54
              </div>';
55 55
             $i++;
56
-            $previous_nb=$nb;
56
+            $previous_nb = $nb;
57 57
         }
58 58
         
59
-        $html.='</div>';
59
+        $html .= '</div>';
60 60
         
61 61
         return $html;
62 62
     }
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Model/CertificateProviderInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * Interface for providers of certificates
17 17
  */
18
-interface CertificateProviderInterface  {
18
+interface CertificateProviderInterface {
19 19
     
20 20
     /**
21 21
      * Returns the certificates directory path as it is really (within the firewall directory).
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Views/CertificateView.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         <div id="maj-cert-page" class="center">
31 31
 			<h2><?php echo $this->data->get('title'); ?></h2>
32 32
 			
33
-    		<?php if($this->data->get('has_certif', false)) { 
33
+    		<?php if ($this->data->get('has_certif', false)) { 
34 34
     		    /** @var Certificate $certificate   */
35 35
     		  $certificate = $this->data->get('certificate');
36 36
     		  $has_linked_indis = $this->data->get('has_linked_indis', false);
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
     				<div id="certificate-edit">
50 50
     					<?php echo $certificate->displayImage(); ?>
51 51
     				</div>
52
-    				<?php if($has_linked_indis || $has_linked_fams) { ?>
52
+    				<?php if ($has_linked_indis || $has_linked_fams) { ?>
53 53
     				<ul>
54
-    					<?php if($has_linked_indis) { ?>
54
+    					<?php if ($has_linked_indis) { ?>
55 55
     					<li>
56 56
     						<a href="#indi-certificate">
57 57
     							<span id="indisource"><?php echo I18N::translate('Individuals'); ?></span>
58 58
     						</a>
59 59
     					</li>
60 60
     					<?php } ?>
61
-    					<?php if($has_linked_fams) { ?>
61
+    					<?php if ($has_linked_fams) { ?>
62 62
     					<li>
63 63
     						<a href="#fam-certificate">
64 64
     							<span id="famsource"><?php echo I18N::translate('Families'); ?></span>
@@ -67,13 +67,13 @@  discard block
 block discarded – undo
67 67
     					<?php } ?>
68 68
     				</ul>
69 69
     				
70
-    				<?php if($has_linked_indis) { ?>
70
+    				<?php if ($has_linked_indis) { ?>
71 71
     				<div id="indi-certificate">
72 72
     					<?php echo FunctionsPrintLists::individualTable($this->data->get('linked_indis')); ?>
73 73
     				</div>
74 74
 					<?php } ?>
75 75
 					
76
-					<?php if($has_linked_fams) { ?>
76
+					<?php if ($has_linked_fams) { ?>
77 77
     				<div id="fam-certificate">
78 78
     					<?php echo FunctionsPrintLists::familyTable($this->data->get('linked_fams')); ?>
79 79
     				</div>
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/ViewFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,13 +53,13 @@
 block discarded – undo
53 53
      */
54 54
     public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
55 55
     {
56
-        if(!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
57
-        if(!$ctrl) throw new \Exception('Base Controller not defined');
58
-        if(!$view_name) throw new \Exception('View not defined');
56
+        if (!$mvc_ctrl) throw new \Exception('Mvc Controller not defined');
57
+        if (!$ctrl) throw new \Exception('Base Controller not defined');
58
+        if (!$view_name) throw new \Exception('View not defined');
59 59
         
60 60
         $mvc_ctrl_refl = new \ReflectionObject($mvc_ctrl);
61
-        $view_class = $mvc_ctrl_refl->getNamespaceName() . '\\Views\\' . $view_name . 'View';       
62
-        if(!class_exists($view_class)) throw new \Exception('View does not exist');
61
+        $view_class = $mvc_ctrl_refl->getNamespaceName().'\\Views\\'.$view_name.'View';       
62
+        if (!class_exists($view_class)) throw new \Exception('View does not exist');
63 63
         
64 64
         return new $view_class($ctrl, $data);
65 65
     }
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/ViewBag.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
      * @param bool $override
74 74
      */
75 75
     public function set($key, $value, $override = true) {
76
-        if(is_null($key)) return;
77
-        if(!$override && array_key_exists($key, $this->data)) return;
76
+        if (is_null($key)) return;
77
+        if (!$override && array_key_exists($key, $this->data)) return;
78 78
         $this->data[$key] = $value;        
79 79
     }
80 80
     
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
      * @param string $key
108 108
      */
109 109
     public function __unset($key) {
110
-        unset($this->data[$key]);;
110
+        unset($this->data[$key]); ;
111 111
     }
112 112
     
113 113
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Model/CertificateFileProvider.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -52,24 +52,24 @@  discard block
 block discarded – undo
52 52
      * {@inhericDoc}
53 53
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory()
54 54
      */
55
-    public function getRealCertificatesDirectory(){
56
-        return WT_DATA_DIR . $this->root_path;
55
+    public function getRealCertificatesDirectory() {
56
+        return WT_DATA_DIR.$this->root_path;
57 57
     }
58 58
     
59 59
     /**
60 60
      * {@inhericDoc}
61 61
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList()
62 62
      */
63
-    public function getCitiesList(){
64
-        if(!isset($this->cities_list) || is_null($this->cities_list)){
63
+    public function getCitiesList() {
64
+        if (!isset($this->cities_list) || is_null($this->cities_list)) {
65 65
             $certdir = $this->getRealCertificatesDirectory();
66 66
             $this->cities_list = array();
67 67
     
68 68
             $dir = opendir($certdir);
69 69
             
70
-            while($entry = readdir($dir)){
71
-                if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){
72
-                    $this->cities_list[]= Functions::encodeFileSystemToUtf8($entry);
70
+            while ($entry = readdir($dir)) {
71
+                if ($entry != '.' && $entry != '..' && is_dir($certdir.$entry)) {
72
+                    $this->cities_list[] = Functions::encodeFileSystemToUtf8($entry);
73 73
                 }
74 74
             }
75 75
             sort($this->cities_list);
@@ -81,21 +81,21 @@  discard block
 block discarded – undo
81 81
      * {@inhericDoc}
82 82
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList()
83 83
      */
84
-    public function getCertificatesList($selCity){
84
+    public function getCertificatesList($selCity) {
85 85
     
86 86
         $selCity = Functions::encodeUtf8ToFileSystem($selCity);
87 87
     
88 88
         $certdir = $this->getRealCertificatesDirectory();
89
-        $tabCertif= array();
89
+        $tabCertif = array();
90 90
     
91
-        if(is_dir($certdir.$selCity)){
92
-            $dir=opendir($certdir.$selCity);
93
-            while($entry = readdir($dir)){
94
-                if($entry!='.' && $entry!='..' && !is_dir($certdir.$entry.'/')){
91
+        if (is_dir($certdir.$selCity)) {
92
+            $dir = opendir($certdir.$selCity);
93
+            while ($entry = readdir($dir)) {
94
+                if ($entry != '.' && $entry != '..' && !is_dir($certdir.$entry.'/')) {
95 95
                     $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry);
96 96
                     $certificate = new Certificate($path, $this->tree, $this);
97
-                    if(Functions::isImageTypeSupported($certificate->extension())){
98
-                        $tabCertif[] = 	$certificate;
97
+                    if (Functions::isImageTypeSupported($certificate->extension())) {
98
+                        $tabCertif[] = $certificate;
99 99
                     }
100 100
                 }
101 101
             }
@@ -107,17 +107,17 @@  discard block
 block discarded – undo
107 107
      * {@inhericDoc}
108 108
      * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith()
109 109
      */
110
-    public function getCertificatesListBeginWith($city, $contains, $limit= 9999){
111
-        $tabFiles= array();
112
-        $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/';
110
+    public function getCertificatesListBeginWith($city, $contains, $limit = 9999) {
111
+        $tabFiles = array();
112
+        $dirPath = $this->getRealCertificatesDirectory().Functions::encodeUtf8ToFileSystem($city).'/';
113 113
         $contains = utf8_decode($contains);
114 114
         $nbCert = 0;
115 115
     
116
-        if(is_dir($dirPath)){
117
-            $dir=opendir($dirPath);
118
-            while(($entry = readdir($dir)) && $nbCert < $limit){
119
-                if($entry!='.' && $entry!='..' && $entry!='Thumbs.db' &&!is_dir($dirPath.$entry.'/') && stripos($entry, $contains)!== false){
120
-                    $tabFiles[]= Functions::encodeFileSystemToUtf8($entry);
116
+        if (is_dir($dirPath)) {
117
+            $dir = opendir($dirPath);
118
+            while (($entry = readdir($dir)) && $nbCert < $limit) {
119
+                if ($entry != '.' && $entry != '..' && $entry != 'Thumbs.db' && !is_dir($dirPath.$entry.'/') && stripos($entry, $contains) !== false) {
120
+                    $tabFiles[] = Functions::encodeFileSystemToUtf8($entry);
121 121
                     $nbCert++;
122 122
                 }
123 123
             }
Please login to merge, or discard this patch.
src/Webtrees/Place.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 *
28 28
 	 * @param \Fisharebest\Webtrees\Place $place_in The Place to extend
29 29
 	 */
30
-	public function __construct(\Fisharebest\Webtrees\Place $place){
30
+	public function __construct(\Fisharebest\Webtrees\Place $place) {
31 31
 		$this->place = $place;
32 32
 	}
33 33
 
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 	 * @param \Fisharebest\Webtrees\Tree $tree
40 40
 	 * @return \MyArtJaub\Webtrees\Place|null Instance of \MyArtJaub\Webtrees\Place, if relevant
41 41
 	 */
42
-	public static function getIntance($place_str, Tree $tree){
42
+	public static function getIntance($place_str, Tree $tree) {
43 43
 		$dplace = null;
44
-		if(is_string($place_str) && strlen($place_str) > 0){
44
+		if (is_string($place_str) && strlen($place_str) > 0) {
45 45
 			$dplace = new Place(new \Fisharebest\Webtrees\Place($place_str, $tree));
46 46
 		}
47 47
 		return $dplace;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return \Fisharebest\Webtrees\Place Embedded place record
54 54
 	 */
55
-	public function getDerivedPlace(){
55
+	public function getDerivedPlace() {
56 56
 		return $this->place;
57 57
 	}
58 58
 	
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	 * @param bool $anchor Option to print a link to placelist
66 66
 	 * @return string HTML code for formatted place
67 67
 	 */
68
-	public function htmlFormattedName($format, $anchor = false){		
69
-		$html='';
68
+	public function htmlFormattedName($format, $anchor = false) {		
69
+		$html = '';
70 70
 		
71 71
 		$levels = array_map('trim', explode(',', $this->place->getGedcomName()));
72 72
 		$nbLevels = count($levels);
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 		preg_match_all('/%[^%]/', $displayPlace, $matches);
75 75
 		foreach ($matches[0] as $match2) {
76 76
 			$index = str_replace('%', '', $match2);
77
-			if(is_numeric($index) && $index >0 && $index <= $nbLevels){
78
-				$displayPlace = str_replace($match2, $levels[$index-1] , $displayPlace);
77
+			if (is_numeric($index) && $index > 0 && $index <= $nbLevels) {
78
+				$displayPlace = str_replace($match2, $levels[$index - 1], $displayPlace);
79 79
 			}
80
-			else{
81
-				$displayPlace = str_replace($match2, '' , $displayPlace);
80
+			else {
81
+				$displayPlace = str_replace($match2, '', $displayPlace);
82 82
 			}
83 83
 		}
84 84
 		if ($anchor && !Auth::isSearchEngine()) {
85
-			$html .='<a href="' . $this->place->getURL() . '">' . $displayPlace . '</a>';
85
+			$html .= '<a href="'.$this->place->getURL().'">'.$displayPlace.'</a>';
86 86
 		} else {
87 87
 			$html .= $displayPlace;
88 88
 		}
Please login to merge, or discard this patch.
src/Webtrees/Family.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 	 * @param string $gedcom
31 31
 	 * @return NULL|\MyArtJaub\Webtrees\Family
32 32
 	 */
33
-	public static function getIntance($xref, Tree $tree, $gedcom = null){
33
+	public static function getIntance($xref, Tree $tree, $gedcom = null) {
34 34
 		$dfam = null;
35 35
 		$fam = fw\Family::getInstance($xref, $tree, $gedcom);
36
-		if($fam){
36
+		if ($fam) {
37 37
 			$dfam = new Family($fam);
38 38
 		}
39 39
 		return $dfam;
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 	*
45 45
 	* @return int Level of sources
46 46
 	* */
47
-	function isMarriageSourced(){
48
-		if($this->is_marriage_sourced !== null) return $this->is_marriage_sourced;
47
+	function isMarriageSourced() {
48
+		if ($this->is_marriage_sourced !== null) return $this->is_marriage_sourced;
49 49
 		$this->is_marriage_sourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC');
50 50
 		return $this->is_marriage_sourced;
51 51
 	}
Please login to merge, or discard this patch.