Completed
Push — feature/code-analysis ( 110b5c...ddc57d )
by Jonathan
03:27
created
src/Webtrees/Module/WelcomeBlock/Views/PiwikStatsView.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,20 +22,20 @@
 block discarded – undo
22 22
 	 * {@inhericDoc}
23 23
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
24 24
 	 */
25
-    protected function renderContent() {    
26
-        if($this->data->get('has_stats', false)) {
27
-            $html = I18N::translate('%1$s visits since the beginning of %2$s<br>(%3$s today)' ,
28
-                '<span class="odometer">' . I18N::number($this->data->get('visits_year')) . '</span>',
29
-                date('Y'),
30
-                '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>'
31
-                );
32
-        }
33
-        else {
34
-            $html = I18N::translate('No statistics could be retrieved from Piwik.');
35
-        }
25
+	protected function renderContent() {    
26
+		if($this->data->get('has_stats', false)) {
27
+			$html = I18N::translate('%1$s visits since the beginning of %2$s<br>(%3$s today)' ,
28
+				'<span class="odometer">' . I18N::number($this->data->get('visits_year')) . '</span>',
29
+				date('Y'),
30
+				'<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>'
31
+				);
32
+		}
33
+		else {
34
+			$html = I18N::translate('No statistics could be retrieved from Piwik.');
35
+		}
36 36
         
37
-        return $html;
38
-    }
37
+		return $html;
38
+	}
39 39
     
40 40
 
41 41
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/Views/WelcomeBlockConfigView.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -23,51 +23,51 @@
 block discarded – undo
23 23
 	 * {@inhericDoc}
24 24
 	 * @see \MyArtJaub\Webtrees\Mvc\View\AbstractView::renderContent()
25 25
 	 */
26
-    protected function renderContent() {     
26
+	protected function renderContent() {     
27 27
         
28
-        return '
28
+		return '
29 29
             <tr>
30 30
                 <td class="descriptionbox wrap width33">' .
31
-                I18N::translate('Enable Piwik Statistics') .
32
-                // Ideally, would like to add helpLink, but this does not work for modules...
33
-                // FunctionsPrint::helpLink('piwik_enabled', $this->getName());
34
-                '</td>
31
+				I18N::translate('Enable Piwik Statistics') .
32
+				// Ideally, would like to add helpLink, but this does not work for modules...
33
+				// FunctionsPrint::helpLink('piwik_enabled', $this->getName());
34
+				'</td>
35 35
                 <td class="optionbox">' .
36
-                FunctionsEdit::editFieldYesNo('piwik_enabled', $this->data->get('piwik_enabled', '0')) .
37
-                '</td>
36
+				FunctionsEdit::editFieldYesNo('piwik_enabled', $this->data->get('piwik_enabled', '0')) .
37
+				'</td>
38 38
             </tr>' .
39 39
             
40
-            '<tr>
40
+			'<tr>
41 41
                 <td class="descriptionbox wrap width33">' .
42
-                I18N::translate('Piwik URL') .
43
-                '</td>
42
+				I18N::translate('Piwik URL') .
43
+				'</td>
44 44
                 <td class="optionbox">
45 45
                     <input type="text" name="piwik_url" size="45" value="' . 
46
-                    $this->data->get('piwik_url', '') . '" />
46
+					$this->data->get('piwik_url', '') . '" />
47 47
                 </td>
48 48
             </tr>' .
49 49
             
50
-            '<tr>
50
+			'<tr>
51 51
                 <td class="descriptionbox wrap width33">' .
52
-                    I18N::translate('Piwik Token') .
53
-                '</td>
52
+					I18N::translate('Piwik Token') .
53
+				'</td>
54 54
                 <td class="optionbox">
55 55
                     <input type="text" name="piwik_token" size="45" value="' . 
56
-                    $this->data->get('piwik_token', '') . '" />
56
+					$this->data->get('piwik_token', '') . '" />
57 57
                 </td>
58 58
             </tr>' .
59 59
             
60
-            '<tr>
60
+			'<tr>
61 61
                 <td class="descriptionbox wrap width33">' .
62
-                    I18N::translate('Piwik Site ID') .
63
-                '</td>
62
+					I18N::translate('Piwik Site ID') .
63
+				'</td>
64 64
                 <td class="optionbox">
65 65
                     <input type="text" name="piwik_siteid" size="4" value="' . 
66
-                    $this->data->get('piwik_siteid', '') . '" />
66
+					$this->data->get('piwik_siteid', '') . '" />
67 67
                 </td>
68 68
             </tr>' ;
69 69
         
70
-    }
70
+	}
71 71
     
72 72
 
73 73
 }
Please login to merge, or discard this patch.
src/Webtrees/Module/WelcomeBlock/WelcomeBlockController.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,30 +28,30 @@  discard block
 block discarded – undo
28 28
 class WelcomeBlockController extends MvcController
29 29
 {   
30 30
     
31
-    /**
32
-     * Pages
33
-     */
31
+	/**
32
+	 * Pages
33
+	 */
34 34
         
35
-    /**
36
-     * WelcomeBlock@index
37
-     * 
38
-     * @param PageController $parent_controller
39
-     * @param Tree $tree
40
-     * @param string $block_id
41
-     * @param string $template
42
-     * @return $string
43
-     */
44
-    public function index(PageController $parent_controller, Tree $tree, $block_id, $template) {        
45
-        $view_bag = new ViewBag();
35
+	/**
36
+	 * WelcomeBlock@index
37
+	 * 
38
+	 * @param PageController $parent_controller
39
+	 * @param Tree $tree
40
+	 * @param string $block_id
41
+	 * @param string $template
42
+	 * @return $string
43
+	 */
44
+	public function index(PageController $parent_controller, Tree $tree, $block_id, $template) {        
45
+		$view_bag = new ViewBag();
46 46
         
47
-        if($parent_controller && $tree) {
47
+		if($parent_controller && $tree) {
48 48
         
49
-            $view_bag->set('tree', $tree);
50
-            $view_bag->set('indi', $parent_controller->getSignificantIndividual());
49
+			$view_bag->set('tree', $tree);
50
+			$view_bag->set('indi', $parent_controller->getSignificantIndividual());
51 51
         
52
-            $id = $this->module->getName().$block_id;
53
-            $class = $this->module->getName().'_block';
54
-            $parent_controller->addInlineJavascript('
52
+			$id = $this->module->getName().$block_id;
53
+			$class = $this->module->getName().'_block';
54
+			$parent_controller->addInlineJavascript('
55 55
                 jQuery("#maj-new_passwd").hide();
56 56
                 jQuery("#maj-passwd_click").click(function()
57 57
                 {
@@ -62,62 +62,62 @@  discard block
 block discarded – undo
62 62
     				  });
63 63
     			');
64 64
     
65
-            if (Auth::isAdmin()) {
66
-                $title='<a class="icon-admin" title="'.I18N::translate('Configure').'" href="block_edit.php?block_id='.$block_id.'&amp;ged=' . $tree->getNameHtml() . '&amp;ctype=gedcom"></a>';
67
-            } else {
68
-                $title='';
69
-            }
70
-            $title .='<span dir="auto">'.$tree->getTitleHtml().'</span>';
65
+			if (Auth::isAdmin()) {
66
+				$title='<a class="icon-admin" title="'.I18N::translate('Configure').'" href="block_edit.php?block_id='.$block_id.'&amp;ged=' . $tree->getNameHtml() . '&amp;ctype=gedcom"></a>';
67
+			} else {
68
+				$title='';
69
+			}
70
+			$title .='<span dir="auto">'.$tree->getTitleHtml().'</span>';
71 71
     
72
-            $piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false);
73
-            $view_bag->set('piwik_enabled', $piwik_enabled);
74
-            if($piwik_enabled) {
75
-                $parent_controller->addInlineJavascript(
76
-                    '$("#piwik_stats")
72
+			$piwik_enabled = $this->module->getBlockSetting($block_id, 'piwik_enabled', false);
73
+			$view_bag->set('piwik_enabled', $piwik_enabled);
74
+			if($piwik_enabled) {
75
+				$parent_controller->addInlineJavascript(
76
+					'$("#piwik_stats")
77 77
                         .load("module.php?mod='.$this->module->getName().'&mod_action=Piwik&block_id='.$block_id.'");'
78
-                );
79
-            }
78
+				);
79
+			}
80 80
     
81
-            $content = ViewFactory::make('WelcomeBlock', $this,  new BaseController(), $view_bag)->getHtmlPartial();   
81
+			$content = ViewFactory::make('WelcomeBlock', $this,  new BaseController(), $view_bag)->getHtmlPartial();   
82 82
             
83
-            if ($template) {
84
-                return Theme::theme()->formatBlock($id, $title, $class, $content);
85
-            } else {
86
-                return $content;
87
-            }
88
-        }
89
-    }
83
+			if ($template) {
84
+				return Theme::theme()->formatBlock($id, $title, $class, $content);
85
+			} else {
86
+				return $content;
87
+			}
88
+		}
89
+	}
90 90
     
91 91
     
92 92
     
93
-    /**
94
-     * WelcomeBlock@config
95
-     * 
96
-     * @param string $block_id
97
-     */
98
-    public function config($block_id) {
93
+	/**
94
+	 * WelcomeBlock@config
95
+	 * 
96
+	 * @param string $block_id
97
+	 */
98
+	public function config($block_id) {
99 99
 
100
-        if (Filter::postBool('save') && Filter::checkCsrf()) {
101
-            $this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled'));
102
-            $this->module->setBlockSetting($block_id, 'piwik_url', trim(Filter::postUrl('piwik_url')));
103
-            $this->module->setBlockSetting($block_id, 'piwik_siteid', trim(Filter::post('piwik_siteid')));
104
-            $this->module->setBlockSetting($block_id, 'piwik_token', trim(Filter::post('piwik_token')));
105
-            exit;
106
-        }
100
+		if (Filter::postBool('save') && Filter::checkCsrf()) {
101
+			$this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled'));
102
+			$this->module->setBlockSetting($block_id, 'piwik_url', trim(Filter::postUrl('piwik_url')));
103
+			$this->module->setBlockSetting($block_id, 'piwik_siteid', trim(Filter::post('piwik_siteid')));
104
+			$this->module->setBlockSetting($block_id, 'piwik_token', trim(Filter::post('piwik_token')));
105
+			exit;
106
+		}
107 107
         
108
-        $view_bag = new ViewBag();
108
+		$view_bag = new ViewBag();
109 109
         
110
-        // Is Piwik Statistic Enabled ?
111
-        $view_bag->set('piwik_enabled', $this->module->getBlockSetting($block_id, 'piwik_enabled', '0'));
112
-        //Piwik Root Url
113
-        $view_bag->set('piwik_url', $this->module->getBlockSetting($block_id, 'piwik_url', ''));
114
-        // Piwik token
115
-        $view_bag->set('piwik_token', $this->module->getBlockSetting($block_id, 'piwik_token', ''));
116
-        // Piwik side id
117
-        $view_bag->set('piwik_siteid', $this->module->getBlockSetting($block_id, 'piwik_siteid', ''));
110
+		// Is Piwik Statistic Enabled ?
111
+		$view_bag->set('piwik_enabled', $this->module->getBlockSetting($block_id, 'piwik_enabled', '0'));
112
+		//Piwik Root Url
113
+		$view_bag->set('piwik_url', $this->module->getBlockSetting($block_id, 'piwik_url', ''));
114
+		// Piwik token
115
+		$view_bag->set('piwik_token', $this->module->getBlockSetting($block_id, 'piwik_token', ''));
116
+		// Piwik side id
117
+		$view_bag->set('piwik_siteid', $this->module->getBlockSetting($block_id, 'piwik_siteid', ''));
118 118
         
119
-        ViewFactory::make('WelcomeBlockConfig', $this, new BaseController(), $view_bag)->renderPartial();
120
-    }
119
+		ViewFactory::make('WelcomeBlockConfig', $this, new BaseController(), $view_bag)->renderPartial();
120
+	}
121 121
     
122 122
     
123 123
     
Please login to merge, or discard this patch.
src/Webtrees/Controller/JsonController.php 1 patch
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -17,41 +17,41 @@
 block discarded – undo
17 17
  */
18 18
 class JsonController extends BaseController {
19 19
     
20
-    /**
21
-     * {@inheritDoc}
22
-     * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader()
23
-     */
24
-    public function pageHeader() {        
25
-        header('Content-Type: application/json');
26
-        header('Cache-Control: no-cache, must-revalidate');
27
-        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
28
-        // We've displayed the header - display the footer automatically
29
-        register_shutdown_function(array($this, 'pageFooter'));
20
+	/**
21
+	 * {@inheritDoc}
22
+	 * @see \Fisharebest\Webtrees\Controller\BaseController::pageHeader()
23
+	 */
24
+	public function pageHeader() {        
25
+		header('Content-Type: application/json');
26
+		header('Cache-Control: no-cache, must-revalidate');
27
+		header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
28
+		// We've displayed the header - display the footer automatically
29
+		register_shutdown_function(array($this, 'pageFooter'));
30 30
         
31
-        return $this;
32
-    }
31
+		return $this;
32
+	}
33 33
     
34
-    /**
35
-     * {@inheritDoc}
36
-     * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter()
37
-     */
38
-    public function pageFooter() {
39
-        return $this;
40
-    }
34
+	/**
35
+	 * {@inheritDoc}
36
+	 * @see \Fisharebest\Webtrees\Controller\BaseController::pageFooter()
37
+	 */
38
+	public function pageFooter() {
39
+		return $this;
40
+	}
41 41
     
42
-    /**
43
-     * Restrict access.
44
-     *
45
-     * @param bool $condition
46
-     *
47
-     * @return $this
48
-     */
49
-    public function restrictAccess($condition) {
50
-        if ($condition !== true) {
51
-            http_response_code(403);
52
-            exit;
53
-        }
42
+	/**
43
+	 * Restrict access.
44
+	 *
45
+	 * @param bool $condition
46
+	 *
47
+	 * @return $this
48
+	 */
49
+	public function restrictAccess($condition) {
50
+		if ($condition !== true) {
51
+			http_response_code(403);
52
+			exit;
53
+		}
54 54
     
55
-        return $this;
56
-    }
55
+		return $this;
56
+	}
57 57
 }
Please login to merge, or discard this patch.
src/Webtrees/Fact.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -34,26 +34,26 @@
 block discarded – undo
34 34
 	protected $fact; 
35 35
 	
36 36
 	/**
37
-	* Contructor for the decorator
38
-	*
39
-	* @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40
-	*/
37
+	 * Contructor for the decorator
38
+	 *
39
+	 * @param \Fisharebest\Webtrees\Fact $fact_in The Fact to extend
40
+	 */
41 41
 	public function __construct(\Fisharebest\Webtrees\Fact $fact_in){
42 42
 		$this->fact = $fact_in;
43 43
 	}
44 44
 	
45 45
 	/**
46
-	* Check if a fact has a date and is sourced
47
-	* Values:
48
-	* 		- 0, if no date is found for the fact
49
-	* 		- -1, if the date is not precise
50
-	* 		- -2, if the date is precise, but no source is found
51
-	* 		- 1, if the date is precise, and a source is found
52
-	* 		- 2, if the date is precise, a source exists, and is supported by a certificate (requires _ACT usage)
53
-	* 		- 3, if the date is precise, a source exists, and the certificate supporting the fact is within an acceptable range of date
54
-	*
55
-	* @return int Level of sources
56
-	*/
46
+	 * Check if a fact has a date and is sourced
47
+	 * Values:
48
+	 * 		- 0, if no date is found for the fact
49
+	 * 		- -1, if the date is not precise
50
+	 * 		- -2, if the date is precise, but no source is found
51
+	 * 		- 1, if the date is precise, and a source is found
52
+	 * 		- 2, if the date is precise, a source exists, and is supported by a certificate (requires _ACT usage)
53
+	 * 		- 3, if the date is precise, a source exists, and the certificate supporting the fact is within an acceptable range of date
54
+	 *
55
+	 * @return int Level of sources
56
+	 */
57 57
 	public function isSourced(){
58 58
 		$isSourced=0;
59 59
 		$date = $this->fact->getDate(false);
Please login to merge, or discard this patch.
src/Webtrees/Cache.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class Cache{
18 18
 	
19
-    /**
20
-     * Underlying Zend Cache object
21
-     * @var \Zend_Cache_Core|\Zend_Cache_FrontEnd $cache
22
-     */
19
+	/**
20
+	 * Underlying Zend Cache object
21
+	 * @var \Zend_Cache_Core|\Zend_Cache_FrontEnd $cache
22
+	 */
23 23
 	protected $cache=null;
24 24
 	
25 25
 	/**
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	protected static function getInstance()
43 43
 	{
44
-	    if (null === static::$instance) {
45
-	        static::$instance = new static();
46
-	    }
44
+		if (null === static::$instance) {
45
+			static::$instance = new static();
46
+		}
47 47
 	
48
-	    return static::$instance;
48
+		return static::$instance;
49 49
 	}
50 50
 	
51 51
 	/**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 	 * @return string Cached key name
92 92
 	 */
93 93
 	protected function getKeyName($value, AbstractModule $mod = null){
94
-	    $this->checkInit();
94
+		$this->checkInit();
95 95
 		$mod_name = 'myartjaub';
96 96
 		if($mod != null) $mod_name = $mod->getName();
97 97
 		return $mod_name.'_'.$value;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 * @return bool True is cached
118 118
 	 */
119 119
 	public static function isCached($value, AbstractModule $mod = null) {
120
-	    self::getInstance()->isCachedI($value, $mod);
120
+		self::getInstance()->isCachedI($value, $mod);
121 121
 	}
122 122
 	
123 123
 	/**
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @return unknown_type Cached value
141 141
 	 */
142 142
 	public static function get($value, AbstractModule $mod = null){
143
-	    self::getInstance()->getI($value, $mod);
143
+		self::getInstance()->getI($value, $mod);
144 144
 	}
145 145
 	
146 146
 	/**
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 	 * @return unknown_type Cached value
167 167
 	 */
168 168
 	public static function save($value, $data, AbstractModule $mod = null){
169
-	    self::getInstance()->saveI($value, $data, $mod);
169
+		self::getInstance()->saveI($value, $data, $mod);
170 170
 	}
171 171
 	
172 172
 	/**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 	 *
175 175
 	 */
176 176
 	public function cleanI(){
177
-	    $this->checkInit();
177
+		$this->checkInit();
178 178
 		$this->cache->clean();
179 179
 	}
180 180
 	
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 	 * Static invocation of the *clean* method.
183 183
 	 */
184 184
 	public static function clean() {
185
-	    self::getInstance()->cleanI();
185
+		self::getInstance()->cleanI();
186 186
 	}
187 187
 	
188 188
 }
189 189
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Family.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@
 block discarded – undo
39 39
 	}
40 40
 	
41 41
 	/**
42
-	* Check if this family's marriages are sourced
43
-	*
44
-	* @return int Level of sources
45
-	* */
42
+	 * Check if this family's marriages are sourced
43
+	 *
44
+	 * @return int Level of sources
45
+	 * */
46 46
 	function isMarriageSourced(){
47 47
 		if($this->_ismarriagesourced != null) return $this->_ismarriagesourced;
48 48
 		$this->_ismarriagesourced = $this->isFactSourced(WT_EVENTS_MARR.'|MARC');
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Controller/MvcControllerInterface.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
  */
16 16
 interface MvcControllerInterface {
17 17
     
18
-    /**
19
-     * Return the module attached to this controller.
20
-     * 
21
-     * @return \Fisharebest\Webtrees\Module\AbstractModule
22
-     */
23
-    function getModule();
18
+	/**
19
+	 * Return the module attached to this controller.
20
+	 * 
21
+	 * @return \Fisharebest\Webtrees\Module\AbstractModule
22
+	 */
23
+	function getModule();
24 24
     
25 25
 }
26 26
  
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Webtrees/Mvc/Controller/MvcController.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -17,28 +17,28 @@
 block discarded – undo
17 17
  */
18 18
 class MvcController implements MvcControllerInterface 
19 19
 {
20
-    /**
21
-     * Reference module
22
-     * @var Fisharebest\Webtrees\Module\AbstractModule $module
23
-     */
24
-    protected $module;
20
+	/**
21
+	 * Reference module
22
+	 * @var Fisharebest\Webtrees\Module\AbstractModule $module
23
+	 */
24
+	protected $module;
25 25
     
26
-    /**
27
-     * Constructor for MvcController
28
-     * 
29
-     * @param AbstractModule $module
30
-     */
31
-    public function __construct(AbstractModule $module) {
32
-        $this->module = $module;
33
-    }
26
+	/**
27
+	 * Constructor for MvcController
28
+	 * 
29
+	 * @param AbstractModule $module
30
+	 */
31
+	public function __construct(AbstractModule $module) {
32
+		$this->module = $module;
33
+	}
34 34
     
35
-    /**
36
-     * {@inheritDoc}
37
-     * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule()
38
-     */
39
-    public function getModule() {
40
-        return $this->module;
41
-    }
35
+	/**
36
+	 * {@inheritDoc}
37
+	 * @see \MyArtJaub\Webtrees\Mvc\Controller\MvcControllerInterface::getModule()
38
+	 */
39
+	public function getModule() {
40
+		return $this->module;
41
+	}
42 42
         
43 43
 }
44 44
  
45 45
\ No newline at end of file
Please login to merge, or discard this patch.