Passed
Branch feature/2.0 (d2af8f)
by Jonathan
13:07
created
src/Webtrees/Mvc/View/ViewFactory.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -17,87 +17,87 @@
 block discarded – undo
17 17
  */
18 18
 class ViewFactory {
19 19
     
20
-    /**
21
-     * @var ViewFactory $instance Singleton pattern instance
22
-     */
23
-    private static $instance = null;
20
+	/**
21
+	 * @var ViewFactory $instance Singleton pattern instance
22
+	 */
23
+	private static $instance = null;
24 24
     
25
-    /**
26
-     * Returns the *ViewFactory* instance of this class.
27
-     *
28
-     * @return ViewFactory The *Singleton* instance.
29
-     */
30
-    public static function getInstance()
31
-    {
32
-        if (null === static::$instance) {
33
-            static::$instance = new static();
34
-        }
25
+	/**
26
+	 * Returns the *ViewFactory* instance of this class.
27
+	 *
28
+	 * @return ViewFactory The *Singleton* instance.
29
+	 */
30
+	public static function getInstance()
31
+	{
32
+		if (null === static::$instance) {
33
+			static::$instance = new static();
34
+		}
35 35
     
36
-        return static::$instance;
37
-    }
36
+		return static::$instance;
37
+	}
38 38
     
39
-    /**
40
-     * Protected constructor
41
-     */
42
-    protected function __construct() {}
39
+	/**
40
+	 * Protected constructor
41
+	 */
42
+	protected function __construct() {}
43 43
               
44
-    /**
45
-     * Return the view specified by the controller and view name, using data from the ViewBag
46
-     * 
47
-     * @param string $view_name
48
-     * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
49
-     * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
50
-     * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
51
-     * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
52
-     * @throws \Exception
53
-     */
54
-    public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
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');
44
+	/**
45
+	 * Return the view specified by the controller and view name, using data from the ViewBag
46
+	 * 
47
+	 * @param string $view_name
48
+	 * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
49
+	 * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
50
+	 * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
51
+	 * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
52
+	 * @throws \Exception
53
+	 */
54
+	public function makeView($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
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');
59 59
         
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');
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');
63 63
         
64
-        return new $view_class($ctrl, $data);
65
-    }
64
+		return new $view_class($ctrl, $data);
65
+	}
66 66
     
67
-    /**
68
-     * Static invocation of the makeView method
69
-     * 
70
-     * @param string $view_name
71
-     * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
72
-     * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
73
-     * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
74
-     * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
75
-     * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle()
76
-     */
77
-    public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
78
-    {
79
-        return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data);
80
-    }
67
+	/**
68
+	 * Static invocation of the makeView method
69
+	 * 
70
+	 * @param string $view_name
71
+	 * @param \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface $mvc_ctrl
72
+	 * @param \Fisharebest\Webtrees\Controller\BaseController $ctrl
73
+	 * @param \MyArtJaub\Webtrees\Mvc\View\ViewBag $data
74
+	 * @return \MyArtJaub\Webtrees\Mvc\View\AbstractView View
75
+	 * @see \MyArtJaub\Webtrees\Mvc\View\ViewFactory::handle()
76
+	 */
77
+	public static function make($view_name, MvcController $mvc_ctrl, BaseController $ctrl, ViewBag $data) 
78
+	{
79
+		return self::getInstance()->makeView($view_name, $mvc_ctrl, $ctrl, $data);
80
+	}
81 81
     
82
-    /**
83
-     * Private clone method to prevent cloning of the instance of the
84
-     * *Dispatcher* instance.
85
-     *
86
-     * @return void
87
-     */
88
-    private function __clone()
89
-    {
90
-    }
82
+	/**
83
+	 * Private clone method to prevent cloning of the instance of the
84
+	 * *Dispatcher* instance.
85
+	 *
86
+	 * @return void
87
+	 */
88
+	private function __clone()
89
+	{
90
+	}
91 91
     
92
-    /**
93
-     * Private unserialize method to prevent unserializing of the *Dispatcher*
94
-     * instance.
95
-     *
96
-     * @return void
97
-     */
98
-    private function __wakeup()
99
-    {
100
-    }
92
+	/**
93
+	 * Private unserialize method to prevent unserializing of the *Dispatcher*
94
+	 * instance.
95
+	 *
96
+	 * @return void
97
+	 */
98
+	private function __wakeup()
99
+	{
100
+	}
101 101
     
102 102
 }
103 103
  
104 104
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookSubscriberInterface.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,13 +15,13 @@
 block discarded – undo
15 15
  */
16 16
 interface HookSubscriberInterface {
17 17
 	
18
-    /**
18
+	/**
19 19
 	 * Return the list of functions implementented in the class which needs to be registered as hooks.
20 20
 	 * The format is either { function1, function 2,...} in which case the priority is the default one
21 21
 	 * or { function1 => priority1, function2 => priority2, ...}
22 22
 	 * 
23 23
 	 * @return array Array of hooks
24 24
 	 */
25
-    public function getSubscribedHooks();
25
+	public function getSubscribedHooks();
26 26
     
27 27
 }
28 28
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/Certificates/Model/CertificateFileProvider.php 1 patch
Indentation   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -20,111 +20,111 @@
 block discarded – undo
20 20
  */
21 21
 class CertificateFileProvider implements CertificateProviderInterface {
22 22
     
23
-    /**
24
-     * Relative path to the root certificate folder
25
-     * @var string $root_path
26
-     */
27
-    protected $root_path;
23
+	/**
24
+	 * Relative path to the root certificate folder
25
+	 * @var string $root_path
26
+	 */
27
+	protected $root_path;
28 28
     
29
-    /**
30
-     * Reference tree
31
-     * @var Tree $tree
32
-     */
33
-    protected $tree;
29
+	/**
30
+	 * Reference tree
31
+	 * @var Tree $tree
32
+	 */
33
+	protected $tree;
34 34
     
35
-    /**
36
-     * Cached list of certificates' cities.
37
-     * @var (null|array) $cities_list
38
-     */
39
-    protected $cities_list = null;
35
+	/**
36
+	 * Cached list of certificates' cities.
37
+	 * @var (null|array) $cities_list
38
+	 */
39
+	protected $cities_list = null;
40 40
     
41
-    /**
42
-     * Constructor for the File Provider
43
-     * @param string $root_path
44
-     * @param Tree $tree
45
-     */
46
-    public function __construct($root_path, Tree $tree) {
47
-        $this->root_path = $root_path;
48
-        $this->tree = $tree;
49
-    }
41
+	/**
42
+	 * Constructor for the File Provider
43
+	 * @param string $root_path
44
+	 * @param Tree $tree
45
+	 */
46
+	public function __construct($root_path, Tree $tree) {
47
+		$this->root_path = $root_path;
48
+		$this->tree = $tree;
49
+	}
50 50
         
51
-    /**
52
-     * {@inhericDoc}
53
-     * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory()
54
-     */
55
-    public function getRealCertificatesDirectory(){
56
-        return WT_DATA_DIR . $this->root_path;
57
-    }
51
+	/**
52
+	 * {@inhericDoc}
53
+	 * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getRealCertificatesDirectory()
54
+	 */
55
+	public function getRealCertificatesDirectory(){
56
+		return WT_DATA_DIR . $this->root_path;
57
+	}
58 58
     
59
-    /**
60
-     * {@inhericDoc}
61
-     * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList()
62
-     */
63
-    public function getCitiesList(){
64
-        if(!isset($this->cities_list) || is_null($this->cities_list)){
65
-            $certdir = $this->getRealCertificatesDirectory();
66
-            $this->cities_list = array();
59
+	/**
60
+	 * {@inhericDoc}
61
+	 * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCitiesList()
62
+	 */
63
+	public function getCitiesList(){
64
+		if(!isset($this->cities_list) || is_null($this->cities_list)){
65
+			$certdir = $this->getRealCertificatesDirectory();
66
+			$this->cities_list = array();
67 67
     
68
-            $dir = opendir($certdir);
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);
73
-                }
74
-            }
75
-            sort($this->cities_list);
76
-        }
77
-        return $this->cities_list;
78
-    }
70
+			while($entry = readdir($dir)){
71
+				if($entry != '.' && $entry != '..' && is_dir($certdir.$entry)){
72
+					$this->cities_list[]= Functions::encodeFileSystemToUtf8($entry);
73
+				}
74
+			}
75
+			sort($this->cities_list);
76
+		}
77
+		return $this->cities_list;
78
+	}
79 79
     
80
-    /**
81
-     * {@inhericDoc}
82
-     * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList()
83
-     */
84
-    public function getCertificatesList($selCity){
80
+	/**
81
+	 * {@inhericDoc}
82
+	 * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesList()
83
+	 */
84
+	public function getCertificatesList($selCity){
85 85
     
86
-        $selCity = Functions::encodeUtf8ToFileSystem($selCity);
86
+		$selCity = Functions::encodeUtf8ToFileSystem($selCity);
87 87
     
88
-        $certdir = $this->getRealCertificatesDirectory();
89
-        $tabCertif= array();
88
+		$certdir = $this->getRealCertificatesDirectory();
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.'/')){
95
-                    $path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry);
96
-                    $certificate = new Certificate($path, $this->tree, $this);
97
-                    if(Functions::isImageTypeSupported($certificate->extension())){
98
-                        $tabCertif[] = 	$certificate;
99
-                    }
100
-                }
101
-            }
102
-        }
103
-        return $tabCertif;
104
-    }
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
+					$path = Functions::encodeFileSystemToUtf8($selCity.'/'.$entry);
96
+					$certificate = new Certificate($path, $this->tree, $this);
97
+					if(Functions::isImageTypeSupported($certificate->extension())){
98
+						$tabCertif[] = 	$certificate;
99
+					}
100
+				}
101
+			}
102
+		}
103
+		return $tabCertif;
104
+	}
105 105
     
106
-    /**
107
-     * {@inhericDoc}
108
-     * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith()
109
-     */
110
-    public function getCertificatesListBeginWith($city, $contains, $limit= 9999){
111
-        $tabFiles= array();
112
-        $dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/';
113
-        $contains = utf8_decode($contains);
114
-        $nbCert = 0;
106
+	/**
107
+	 * {@inhericDoc}
108
+	 * @see \MyArtJaub\Webtrees\Module\Certificates\Model\CertificateProviderInterface::getCertificatesListBeginWith()
109
+	 */
110
+	public function getCertificatesListBeginWith($city, $contains, $limit= 9999){
111
+		$tabFiles= array();
112
+		$dirPath= $this->getRealCertificatesDirectory() . Functions::encodeUtf8ToFileSystem($city).'/';
113
+		$contains = utf8_decode($contains);
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);
121
-                    $nbCert++;
122
-                }
123
-            }
124
-        }
125
-        sort($tabFiles);
126
-        return $tabFiles;
127
-    }
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
+					$nbCert++;
122
+				}
123
+			}
124
+		}
125
+		sort($tabFiles);
126
+		return $tabFiles;
127
+	}
128 128
     
129 129
 }
130 130
 
Please login to merge, or discard this patch.
src/Webtrees/Functions/FunctionsPrint.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return string HTML code of the inserted flag
80 80
 	 */
81 81
 	public static function htmlPlaceIcon(\Fisharebest\Webtrees\Place $place, $icon_path , $size = 50) {
82
-	    return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
82
+		return '<img class="flag_gm_h'. $size . '" src="' . $icon_path . '" title="' . $place->getGedcomName() . '" alt="' . $place->getGedcomName() . '" />';
83 83
 	}
84 84
 	
85 85
 	/**
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 	 * @return boolean
356 356
 	 */
357 357
 	public static function isDateWithinChartsRange(Date $date) {
358
-	    return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030;
358
+		return $date->gregorianYear() >= 1550 && $date->gregorianYear() < 2030;
359 359
 	}
360 360
 
361 361
 }
Please login to merge, or discard this patch.
src/Webtrees/Mvc/View/ViewBag.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -18,97 +18,97 @@
 block discarded – undo
18 18
 	/**
19 19
 	 * @var array $data Container for data
20 20
 	 */
21
-    protected $data = array();
21
+	protected $data = array();
22 22
     
23
-    /**
24
-     * Constructor for ViewBag
25
-     * @param array $data_in
26
-     */
27
-    public function __construct(array $data_in = array()) {
28
-        $this->data = $data_in;
29
-    }
23
+	/**
24
+	 * Constructor for ViewBag
25
+	 * @param array $data_in
26
+	 */
27
+	public function __construct(array $data_in = array()) {
28
+		$this->data = $data_in;
29
+	}
30 30
     
31
-    /**
32
-     * Get the keys present in the view bag.
33
-     *
34
-     * @return array
35
-     */
36
-    public function keys()
37
-    {
38
-        return array_keys($this->data);
39
-    }
31
+	/**
32
+	 * Get the keys present in the view bag.
33
+	 *
34
+	 * @return array
35
+	 */
36
+	public function keys()
37
+	{
38
+		return array_keys($this->data);
39
+	}
40 40
     
41
-    /**
42
-     * Get all the data from the bag for a given key.
43
-     *
44
-     * @param  string  $key
45
-     * @param  string  $format
46
-     * @return unknown
47
-     */
48
-    public function get($key, $default = null)
49
-    {
50
-        if (array_key_exists($key, $this->data)) {
51
-            return $this->data[$key];
52
-        }
53
-        return $default;
54
-    }
41
+	/**
42
+	 * Get all the data from the bag for a given key.
43
+	 *
44
+	 * @param  string  $key
45
+	 * @param  string  $format
46
+	 * @return unknown
47
+	 */
48
+	public function get($key, $default = null)
49
+	{
50
+		if (array_key_exists($key, $this->data)) {
51
+			return $this->data[$key];
52
+		}
53
+		return $default;
54
+	}
55 55
     
56
-    /**
57
-     * Magic getter.
58
-     * Returns the value associated with the key.
59
-     * 
60
-     * @param string $key
61
-     * @return unknown
62
-     */
63
-    public function __get($key) {
64
-        return $this->get($key, null);
65
-    }
56
+	/**
57
+	 * Magic getter.
58
+	 * Returns the value associated with the key.
59
+	 * 
60
+	 * @param string $key
61
+	 * @return unknown
62
+	 */
63
+	public function __get($key) {
64
+		return $this->get($key, null);
65
+	}
66 66
     
67
-    /**
68
-     * Set the value for the specified key.
69
-     * Can define whether to override an existing value;
70
-     * 
71
-     * @param string $key
72
-     * @param mixed $value
73
-     * @param bool $override
74
-     */
75
-    public function set($key, $value, $override = true) {
76
-        if(is_null($key)) return;
77
-        if(!$override && array_key_exists($key, $this->data)) return;
78
-        $this->data[$key] = $value;        
79
-    }
67
+	/**
68
+	 * Set the value for the specified key.
69
+	 * Can define whether to override an existing value;
70
+	 * 
71
+	 * @param string $key
72
+	 * @param mixed $value
73
+	 * @param bool $override
74
+	 */
75
+	public function set($key, $value, $override = true) {
76
+		if(is_null($key)) return;
77
+		if(!$override && array_key_exists($key, $this->data)) return;
78
+		$this->data[$key] = $value;        
79
+	}
80 80
     
81
-    /**
82
-     * Magic setter.
83
-     * Set the value for the specified key.
84
-     * 
85
-     * @param string $key
86
-     * @param mixed $value
87
-     */
88
-    public function __set($key, $value) {
89
-        $this->set($key, $value);
90
-    }
81
+	/**
82
+	 * Magic setter.
83
+	 * Set the value for the specified key.
84
+	 * 
85
+	 * @param string $key
86
+	 * @param mixed $value
87
+	 */
88
+	public function __set($key, $value) {
89
+		$this->set($key, $value);
90
+	}
91 91
     
92
-    /**
93
-     * Magic isset
94
-     * Checks whether the ViewBag contains the specified key
95
-     * 
96
-     * @param string $key
97
-     * @return bool
98
-     */
99
-    public function __isset($key) {
100
-        return isset($this->data[$key]);
101
-    }
92
+	/**
93
+	 * Magic isset
94
+	 * Checks whether the ViewBag contains the specified key
95
+	 * 
96
+	 * @param string $key
97
+	 * @return bool
98
+	 */
99
+	public function __isset($key) {
100
+		return isset($this->data[$key]);
101
+	}
102 102
     
103
-    /**
104
-     * Magic unset
105
-     * Unset the specified key from the ViewBag
106
-     * 
107
-     * @param string $key
108
-     */
109
-    public function __unset($key) {
110
-        unset($this->data[$key]);;
111
-    }
103
+	/**
104
+	 * Magic unset
105
+	 * Unset the specified key from the ViewBag
106
+	 * 
107
+	 * @param string $key
108
+	 */
109
+	public function __unset($key) {
110
+		unset($this->data[$key]);;
111
+	}
112 112
     
113 113
 }
114 114
  
115 115
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Individual.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -113,29 +113,29 @@  discard block
 block discarded – undo
113 113
 	 * @return string|array Estimated birth place if found, null otherwise
114 114
 	 */
115 115
 	public function getSignificantPlace(){
116
-	    if($bplace = $this->gedcomrecord->getBirthPlace()){
117
-	        return $bplace;
118
-	    }
116
+		if($bplace = $this->gedcomrecord->getBirthPlace()){
117
+			return $bplace;
118
+		}
119 119
 	
120
-	    foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) {
121
-	        if ($rplace) {
122
-	            return $rplace;
123
-	        }
124
-	    }
120
+		foreach ($this->gedcomrecord->getAllEventPlaces('RESI') as $rplace) {
121
+			if ($rplace) {
122
+				return $rplace;
123
+			}
124
+		}
125 125
 	
126
-	    if($dplace = $this->gedcomrecord->getDeathPlace()){
127
-	        return $dplace;
128
-	    }
126
+		if($dplace = $this->gedcomrecord->getDeathPlace()){
127
+			return $dplace;
128
+		}
129 129
 	
130
-	    foreach($this->gedcomrecord->getSpouseFamilies() as $fams) {
131
-	        foreach ($fams->getAllEventPlaces('RESI') as $rplace) {
132
-	            if ($rplace) {
133
-	                return $rplace;
134
-	            }
135
-	        }
136
-	    }
130
+		foreach($this->gedcomrecord->getSpouseFamilies() as $fams) {
131
+			foreach ($fams->getAllEventPlaces('RESI') as $rplace) {
132
+				if ($rplace) {
133
+					return $rplace;
134
+				}
135
+			}
136
+		}
137 137
 	
138
-	    return null;
138
+		return null;
139 139
 	}
140 140
 	
141 141
 	/**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 * @return boolean Is the individual a Sosa ancestor
145 145
 	 */
146 146
 	public function isSosa(){
147
-	    return count($this->getSosaNumbers()) > 0;
147
+		return count($this->getSosaNumbers()) > 0;
148 148
 	}
149 149
 	
150 150
 	/**
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
 	 * @return array List of Sosa numbers
156 156
 	 */
157 157
 	public function getSosaNumbers(){
158
-	    if($this->sosa === null) {
159
-	        $provider = new SosaProvider($this->gedcomrecord->getTree());
160
-	        $this->sosa = $provider->getSosaNumbers($this->gedcomrecord);	        
161
-	    }
162
-	    return $this->sosa;
158
+		if($this->sosa === null) {
159
+			$provider = new SosaProvider($this->gedcomrecord->getTree());
160
+			$this->sosa = $provider->getSosaNumbers($this->gedcomrecord);	        
161
+		}
162
+		return $this->sosa;
163 163
 	}
164 164
 		
165 165
 	/** 
@@ -174,10 +174,10 @@  discard block
 block discarded – undo
174 174
 	}
175 175
 	
176 176
 	/**
177
-	* Check if this individual's death is sourced
178
-	*
179
-	* @return int Level of sources
180
-	* */
177
+	 * Check if this individual's death is sourced
178
+	 *
179
+	 * @return int Level of sources
180
+	 * */
181 181
 	public function isDeathSourced(){
182 182
 		if($this->is_death_sourced !== null) return $this->is_death_sourced;
183 183
 		$this->is_death_sourced = $this->isFactSourced(WT_EVENTS_DEAT);
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Model/GeoDisplayOptions.php 1 patch
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -15,58 +15,58 @@  discard block
 block discarded – undo
15 15
  */
16 16
 class GeoDisplayOptions {
17 17
     
18
-    /**
18
+	/**
19 19
 	 * Outline map to be used for diaplay
20
-     * @var (null|OutlineMap) $map
21
-     */
22
-    protected $map;
20
+	 * @var (null|OutlineMap) $map
21
+	 */
22
+	protected $map;
23 23
     
24 24
 	/**
25 25
 	 * Level in the Gedcom hierarchy of the parent level of the outline map.
26 26
 	 * @var int $map_level
27 27
 	 */
28
-    protected $map_level;
28
+	protected $map_level;
29 29
     
30 30
 	/**
31 31
 	 * Option to use flags in places display, instead of or in addition to the name.
32 32
 	 * @var bool $use_flags
33 33
 	 */
34
-    protected $use_flags;
34
+	protected $use_flags;
35 35
     
36 36
 	/**
37 37
 	 * Option to define the number of top places to display in the generation view.
38 38
 	 * @var int $max_details_in_gen
39 39
 	 */
40
-    protected $max_details_in_gen;
40
+	protected $max_details_in_gen;
41 41
     
42
-    /**
42
+	/**
43 43
 	 * Get the outline map to use for display.
44 44
 	 *
45
-     * @return (OutlineMap|null)
46
-     */
47
-    public function getMap(){
48
-        return $this->map;
49
-    }
45
+	 * @return (OutlineMap|null)
46
+	 */
47
+	public function getMap(){
48
+		return $this->map;
49
+	}
50 50
     
51 51
 	/**
52 52
 	 * Set the outline map to use for display.
53 53
 	 *
54
-     * @param (OutlineMap|null) $map
54
+	 * @param (OutlineMap|null) $map
55 55
 	 * @return self Enable method-chaining
56
-     */
57
-    public function setMap(OutlineMap $map = null) {
58
-        $this->map = $map;
59
-        return $this;
60
-    }
56
+	 */
57
+	public function setMap(OutlineMap $map = null) {
58
+		$this->map = $map;
59
+		return $this;
60
+	}
61 61
     
62 62
 	/**
63 63
 	 * Get the level of the map parent place
64 64
 	 *
65 65
 	 * @return int
66 66
 	 */
67
-    public function getMapLevel(){
68
-        return $this->map_level;
69
-    }
67
+	public function getMapLevel(){
68
+		return $this->map_level;
69
+	}
70 70
     
71 71
 	/**
72 72
 	 * Set the level of the map parent place
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
 	 * @param int $maplevel
75 75
 	 * @return self Enable method-chaining
76 76
 	 */
77
-    public function setMapLevel($maplevel) {
78
-        $this->map_level = $maplevel;
79
-        return $this;
80
-    }
77
+	public function setMapLevel($maplevel) {
78
+		$this->map_level = $maplevel;
79
+		return $this;
80
+	}
81 81
     
82 82
 	/**
83 83
 	 * Get whether flags should be used in places display
84 84
 	 *
85 85
 	 * @return bool
86 86
 	 */
87
-    public function isUsingFlags(){
88
-        return $this->use_flags;
89
-    }
87
+	public function isUsingFlags(){
88
+		return $this->use_flags;
89
+	}
90 90
     
91 91
 	/**
92 92
 	 * Set whether flags should be used in places display
@@ -94,19 +94,19 @@  discard block
 block discarded – undo
94 94
 	 * @param bool $use_flags
95 95
 	 * @return self Enable method-chaining
96 96
 	 */
97
-    public function setUsingFlags($use_flags) {
98
-        $this->use_flags = $use_flags;
99
-        return $this;
100
-    }
97
+	public function setUsingFlags($use_flags) {
98
+		$this->use_flags = $use_flags;
99
+		return $this;
100
+	}
101 101
     
102 102
 	/**
103 103
 	 * Get the number of Top Places in the generation view
104 104
 	 *
105 105
 	 * @return int
106 106
 	 */
107
-    public function getMaxDetailsInGen(){
108
-        return $this->max_details_in_gen;
109
-    }
107
+	public function getMaxDetailsInGen(){
108
+		return $this->max_details_in_gen;
109
+	}
110 110
     
111 111
 	/**
112 112
 	 * Set the number of Top Places in the generation view
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
 	 * @param int $max_details_in_gen
115 115
 	 * @return self Enable method-chaining
116 116
 	 */
117
-    public function setMaxDetailsInGen($max_details_in_gen) {
118
-        $this->max_details_in_gen = $max_details_in_gen;
119
-        return $this;
120
-    }
117
+	public function setMaxDetailsInGen($max_details_in_gen) {
118
+		$this->max_details_in_gen = $max_details_in_gen;
119
+		return $this;
120
+	}
121 121
                    
122 122
 }
123 123
  
124 124
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Hook/HookProviderInterface.php 1 patch
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -16,51 +16,51 @@
 block discarded – undo
16 16
  */
17 17
 interface HookProviderInterface {
18 18
 
19
-    /**
20
-     * Return an instance of the hook linked to the specifed function / context
21
-     *
22
-     * @param string $hook_function
23
-     * @param string $hook_context
24
-     * @return Hook
25
-     */
26
-    public function get($hook_function, $hook_context = null);
19
+	/**
20
+	 * Return an instance of the hook linked to the specifed function / context
21
+	 *
22
+	 * @param string $hook_function
23
+	 * @param string $hook_context
24
+	 * @return Hook
25
+	 */
26
+	public function get($hook_function, $hook_context = null);
27 27
     
28
-    /**
29
-     * Return whether the Hook module is active and the table has been created.
30
-     *
31
-     * @uses \MyArtJaub\Webtrees\Module\ModuleManager to check if the module is operational
32
-     * @return bool True if module active and table created, false otherwise
33
-     */
34
-    public function isModuleOperational();
28
+	/**
29
+	 * Return whether the Hook module is active and the table has been created.
30
+	 *
31
+	 * @uses \MyArtJaub\Webtrees\Module\ModuleManager to check if the module is operational
32
+	 * @return bool True if module active and table created, false otherwise
33
+	 */
34
+	public function isModuleOperational();
35 35
     
36
-    /**
37
-     * Get the list of possible hooks in the list of modules files.
38
-     * A hook will be registered:
39
-     * 		- for all modules already registered in Webtrees
40
-     * 		- if the module implements HookSubscriberInterface
41
-     * 		- if the method exist within the module
42
-     *
43
-     * @return Array List of possible hooks, with the priority
44
-     */
45
-    public function getPossibleHooks();
36
+	/**
37
+	 * Get the list of possible hooks in the list of modules files.
38
+	 * A hook will be registered:
39
+	 * 		- for all modules already registered in Webtrees
40
+	 * 		- if the module implements HookSubscriberInterface
41
+	 * 		- if the method exist within the module
42
+	 *
43
+	 * @return Array List of possible hooks, with the priority
44
+	 */
45
+	public function getPossibleHooks();
46 46
     
47
-    /**
48
-     * Get the list of hooks intalled in webtrees, with their id, status and priority.
49
-     *
50
-     * @return array List of installed hooks
51
-     */
52
-    public function getRawInstalledHooks();
47
+	/**
48
+	 * Get the list of hooks intalled in webtrees, with their id, status and priority.
49
+	 *
50
+	 * @return array List of installed hooks
51
+	 */
52
+	public function getRawInstalledHooks();
53 53
     
54
-    /**
55
-     * Get the list of hooks intalled in webtrees, with their id, status and priority.
56
-     *
57
-     * @return Array List of installed hooks, with id, status and priority
58
-     */
59
-    public function getInstalledHooks();
54
+	/**
55
+	 * Get the list of hooks intalled in webtrees, with their id, status and priority.
56
+	 *
57
+	 * @return Array List of installed hooks, with id, status and priority
58
+	 */
59
+	public function getInstalledHooks();
60 60
     
61
-    /**
62
-     * Update the list of hooks, identifying missing ones and removed ones.
63
-     */
64
-    public function updateHooks();
61
+	/**
62
+	 * Update the list of hooks, identifying missing ones and removed ones.
63
+	 */
64
+	public function updateHooks();
65 65
     
66 66
 }
67 67
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Module/GeoDispersion/Views/GeoAnalysisTabGenerationsView.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -24,89 +24,89 @@  discard block
 block discarded – undo
24 24
 	 * {@inhericDoc}
25 25
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
26 26
 	 */
27
-    protected function renderContent() {       
27
+	protected function renderContent() {       
28 28
 
29
-        $max_details_gen = $this->data->get('max_details_gen');
30
-        $analysis_level = $this->data->get('analysis_level');
31
-        $results_by_gen = $this->data->get('results_by_generations');
32
-        $display_all_places = $this->data->get('display_all_places', true);
29
+		$max_details_gen = $this->data->get('max_details_gen');
30
+		$analysis_level = $this->data->get('analysis_level');
31
+		$results_by_gen = $this->data->get('results_by_generations');
32
+		$display_all_places = $this->data->get('display_all_places', true);
33 33
         
34
-        $html = 
35
-        '<div id="geodispersion_gen">
34
+		$html = 
35
+		'<div id="geodispersion_gen">
36 36
         	<table id="geodispersion_gentable" class="center">';
37 37
             
38
-        foreach($results_by_gen as $gen => $genData){
39
-            $html .= 
40
-            '<tr>
38
+		foreach($results_by_gen as $gen => $genData){
39
+			$html .= 
40
+			'<tr>
41 41
                 <td class="descriptionbox">' .
42
-                    I18N::translate("Generation %s", I18N::number($gen)).
43
-                    ($display_all_places ? '<br />' : ' ').
44
-                    I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']),1)) . 
45
-                '</td>
42
+					I18N::translate("Generation %s", I18N::number($gen)).
43
+					($display_all_places ? '<br />' : ' ').
44
+					I18N::translate('(%s)', I18N::percentage(Functions::safeDivision($genData['sum'] + $genData['other'], $genData['sum'] + $genData['other'] + $genData['unknown']),1)) . 
45
+				'</td>
46 46
                  <td class="optionbox left">'.
47
-                    ($display_all_places ? 
48
-                        $this->htmlGenerationAllPlacesRow($genData, $analysis_level) :
49
-                        $this->htmlGenerationTopPlacesRow($genData, $analysis_level)
50
-                     ) .
51
-                '</ditdv>
47
+					($display_all_places ? 
48
+						$this->htmlGenerationAllPlacesRow($genData, $analysis_level) :
49
+						$this->htmlGenerationTopPlacesRow($genData, $analysis_level)
50
+					 ) .
51
+				'</ditdv>
52 52
             </tr>';
53
-        }       
53
+		}       
54 54
         
55
-        $html.= 
56
-            '</table>
55
+		$html.= 
56
+			'</table>
57 57
             <div class="left">
58 58
                 <strong>' . I18N::translate('Interpretation help:') . '</strong>
59 59
                 <br />'.
60
-                I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.') . 
61
-                '<br />';
62
-        if(!is_null($max_details_gen) && $max_details_gen == 0){
63
-            $html .= I18N::translate('<strong><em>Place</em> or <em>Flag</em> aa (bb %%)</strong>: The first number indicates the total number of ancestors born in this place, the percentage relates this count to the total number of found places. No percentage means it is less than 10%%.').'<br />';
64
-            $html .= I18N::translate('If any, the darker area indicates the number of unknown places within the generation or places outside the analysed area, and its percentage compared to the number of ancestors. No percentage means it is less than 10%%.');
65
-        }
66
-        else{
67
-            $html .= I18N::translate('<strong><em>Place</em> [aa - bb %%]</strong>: The first number indicates the total number of ancestors born in this place, the percentage compares this count to the total number of found places.').'<br />';
68
-            $html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen);
69
-        }
70
-        $html.= 
71
-            '</div>
60
+				I18N::translate('<strong>Generation X (yy %%)</strong>: The percentage indicates the number of found places compared to the total number of ancestors in this generation.') . 
61
+				'<br />';
62
+		if(!is_null($max_details_gen) && $max_details_gen == 0){
63
+			$html .= I18N::translate('<strong><em>Place</em> or <em>Flag</em> aa (bb %%)</strong>: The first number indicates the total number of ancestors born in this place, the percentage relates this count to the total number of found places. No percentage means it is less than 10%%.').'<br />';
64
+			$html .= I18N::translate('If any, the darker area indicates the number of unknown places within the generation or places outside the analysed area, and its percentage compared to the number of ancestors. No percentage means it is less than 10%%.');
65
+		}
66
+		else{
67
+			$html .= I18N::translate('<strong><em>Place</em> [aa - bb %%]</strong>: The first number indicates the total number of ancestors born in this place, the percentage compares this count to the total number of found places.').'<br />';
68
+			$html .= I18N::translate('Only the %d more frequent places for each generation are displayed.', $max_details_gen);
69
+		}
70
+		$html.= 
71
+			'</div>
72 72
         </div>';
73 73
         
74
-        return $html;
75
-    }
74
+		return $html;
75
+	}
76 76
     
77 77
     
78
-    /**
79
-     * Return the HTML code to display a row with all places found in a generation.
80
-     *
81
-     * @param array $data Data array
82
-     * @param int $analysis_level Level of subdivision of analysis
83
-     * @return string HTML code for all places row
84
-     */
85
-    protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
86
-        $html =
87
-        '<table class="geodispersion_bigrow">
78
+	/**
79
+	 * Return the HTML code to display a row with all places found in a generation.
80
+	 *
81
+	 * @param array $data Data array
82
+	 * @param int $analysis_level Level of subdivision of analysis
83
+	 * @return string HTML code for all places row
84
+	 */
85
+	protected function htmlGenerationAllPlacesRow($data, $analysis_level) {
86
+		$html =
87
+		'<table class="geodispersion_bigrow">
88 88
             <tr>';
89 89
         
90
-        $sum_gen = $data['sum'];
91
-        $unknownother = $data['unknown'] + $data['other'];
92
-        foreach($data['places'] as $placename=> $dataplace){
93
-            $levels = array_map('trim',explode(',', $placename));
94
-            $content = '';
95
-            if(isset($dataplace['flag'])){
96
-                $content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>';
97
-            }
98
-            else{
99
-                $content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>';
100
-            }
101
-            $count = $dataplace['count'];
102
-            $content .= I18N::number($count);
103
-            $perc = Functions::safeDivision($count, $sum_gen + $unknownother);
104
-            $perc2= Functions::safeDivision($count, $sum_gen);
105
-            if($perc2>=0.1) 
106
-                $content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
107
-            $content .= '</td>';
90
+		$sum_gen = $data['sum'];
91
+		$unknownother = $data['unknown'] + $data['other'];
92
+		foreach($data['places'] as $placename=> $dataplace){
93
+			$levels = array_map('trim',explode(',', $placename));
94
+			$content = '';
95
+			if(isset($dataplace['flag'])){
96
+				$content .= '<td class="geodispersion_flag">'. FunctionsPrint::htmlPlaceIcon($dataplace['place'], $dataplace['flag']) .'</td><td>';
97
+			}
98
+			else{
99
+				$content .= '<td><span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span><br/>';
100
+			}
101
+			$count = $dataplace['count'];
102
+			$content .= I18N::number($count);
103
+			$perc = Functions::safeDivision($count, $sum_gen + $unknownother);
104
+			$perc2= Functions::safeDivision($count, $sum_gen);
105
+			if($perc2>=0.1) 
106
+				$content.= '<br/><span class="small">('.I18N::percentage($perc2, 1).')</span>';
107
+			$content .= '</td>';
108 108
                
109
-            $html .= '
109
+			$html .= '
110 110
                 <td class="geodispersion_rowitem" width="'.max(round(100*$perc, 0),1).'%">
111 111
                     <table>
112 112
                         <tr>
@@ -118,46 +118,46 @@  discard block
 block discarded – undo
118 118
                         </tr>
119 119
                     </table>
120 120
                 </td>';
121
-        }
121
+		}
122 122
         
123
-        if($unknownother>0){
124
-            $perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother);
125
-            $html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
126
-            if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
127
-            $html .='</td>';
128
-        }
123
+		if($unknownother>0){
124
+			$perc= Functions::safeDivision($unknownother, $sum_gen + $unknownother);
125
+			$html .='<td class="geodispersion_unknownitem left" >'.I18N::number($unknownother);
126
+			if($perc>=0.1) $html.= '<br/><span class="small">('.I18N::percentage($perc, 1).')</span>';
127
+			$html .='</td>';
128
+		}
129 129
         
130
-        $html .= 
131
-            '</tr>
130
+		$html .= 
131
+			'</tr>
132 132
         </table>';
133
-        return $html;
134
-    }
133
+		return $html;
134
+	}
135 135
     
136 136
 	/**
137 137
 	 * Returns the HTML code fo display a row of the Top Places found for a generation.
138 138
 	 *
139 139
 	 * @param array $data Data array
140
-     * @param int $analysis_level Level of subdivision of analysis
140
+	 * @param int $analysis_level Level of subdivision of analysis
141 141
 	 * @return string HTML code for Top Places row
142 142
 	 */
143
-    protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
144
-        $tmp_places = array();
145
-        $sum_gen = $data['sum'];
146
-        $other = $data['other'];
143
+	protected function htmlGenerationTopPlacesRow($data, $analysis_level) {
144
+		$tmp_places = array();
145
+		$sum_gen = $data['sum'];
146
+		$other = $data['other'];
147 147
         
148
-        foreach($data['places'] as $placename => $count) {
149
-            if($placename != 'other'){
150
-                $levels = array_map('trim',explode(',', $placename));
151
-                $placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>';
152
-            }
153
-            else{
154
-                $placename = I18N::translate('Other places');
155
-            }
156
-            $tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1));         	
157
-        }
148
+		foreach($data['places'] as $placename => $count) {
149
+			if($placename != 'other'){
150
+				$levels = array_map('trim',explode(',', $placename));
151
+				$placename = '<span title="'.implode(I18N::$list_separator, array_reverse($levels)).'">'.$levels[$analysis_level-1].'</span>';
152
+			}
153
+			else{
154
+				$placename = I18N::translate('Other places');
155
+			}
156
+			$tmp_places[] = I18N::translate('<strong>%s</strong> [%d - %s]', $placename, $count, I18N::percentage(Functions::safeDivision($count, $sum_gen + $other), 1));         	
157
+		}
158 158
         
159
-        return implode(I18N::$list_separator, $tmp_places);
160
-    }
159
+		return implode(I18N::$list_separator, $tmp_places);
160
+	}
161 161
     
162 162
 }
163 163
  
164 164
\ No newline at end of file
Please login to merge, or discard this patch.