Completed
Pull Request — master (#286)
by Frank
07:37
created
plugins/phile/testPlugin/Classes/Plugin.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * test class used in Phile's unit tests
4
- */
3
+     * test class used in Phile's unit tests
4
+     */
5 5
 
6 6
 namespace Phile\Plugin\Phile\TestPlugin;
7 7
 
@@ -9,24 +9,24 @@  discard block
 block discarded – undo
9 9
 
10 10
 class Plugin extends AbstractPlugin {
11 11
 
12
-	protected $events = [
13
-		'phile\testPlugin.testEvent' => 'onTestEvent',
14
-		'phile\testPlugin.testEvent-missingMethod' => 'missingMethod'
15
-	];
16
-
17
-	protected $settings = ['A' => 'X', 'B' => 'X', 'C' => 'C'];
18
-
19
-	/**
20
-	 * accessor for easy testing
21
-	 *
22
-	 * @param string $path
23
-	 * @return null|string
24
-	 */
25
-	public function getPluginPath($path = '') {
26
-		return parent::getPluginPath($path);
27
-	}
28
-
29
-	protected function onTestEvent() {
30
-	}
12
+    protected $events = [
13
+        'phile\testPlugin.testEvent' => 'onTestEvent',
14
+        'phile\testPlugin.testEvent-missingMethod' => 'missingMethod'
15
+    ];
16
+
17
+    protected $settings = ['A' => 'X', 'B' => 'X', 'C' => 'C'];
18
+
19
+    /**
20
+     * accessor for easy testing
21
+     *
22
+     * @param string $path
23
+     * @return null|string
24
+     */
25
+    public function getPluginPath($path = '') {
26
+        return parent::getPluginPath($path);
27
+    }
28
+
29
+    protected function onTestEvent() {
30
+    }
31 31
 
32 32
 }
Please login to merge, or discard this patch.
plugins/phile/setupCheck/Classes/Plugin.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Plugin class
4
- */
3
+     * Plugin class
4
+     */
5 5
 namespace Phile\Plugin\Phile\SetupCheck;
6 6
 
7 7
 use Phile\Core\Utility;
@@ -18,79 +18,79 @@  discard block
 block discarded – undo
18 18
  */
19 19
 class Plugin extends AbstractPlugin {
20 20
 
21
-	/** @var global Phile config */
22
-	protected $config;
21
+    /** @var global Phile config */
22
+    protected $config;
23 23
 
24
-	/** @var bool Phile installation needs setup */
25
-	protected $needsSetup = true;
24
+    /** @var bool Phile installation needs setup */
25
+    protected $needsSetup = true;
26 26
 
27
-	/** @var array event subscription */
28
-	protected $events = [
29
-		'config_loaded' => 'onConfigLoaded',
30
-		'setup_check' => 'onSetupCheck',
31
-		'after_render_template' => 'onAfterRenderTemplate'
32
-	];
27
+    /** @var array event subscription */
28
+    protected $events = [
29
+        'config_loaded' => 'onConfigLoaded',
30
+        'setup_check' => 'onSetupCheck',
31
+        'after_render_template' => 'onAfterRenderTemplate'
32
+    ];
33 33
 
34
-	/**
35
-	 * get global config
36
-	 *
37
-	 * @param array $eventData
38
-	 */
39
-	protected function onConfigLoaded(array $eventData) {
40
-		$this->config = $eventData['config'];
41
-	}
34
+    /**
35
+     * get global config
36
+     *
37
+     * @param array $eventData
38
+     */
39
+    protected function onConfigLoaded(array $eventData) {
40
+        $this->config = $eventData['config'];
41
+    }
42 42
 
43
-	/**
44
-	 * perform setup check
45
-	 */
46
-	protected function onSetupCheck() {
47
-		if (empty($this->config['encryptionKey'])) {
48
-			return;
49
-		}
50
-		$this->needsSetup = false;
51
-	}
43
+    /**
44
+     * perform setup check
45
+     */
46
+    protected function onSetupCheck() {
47
+        if (empty($this->config['encryptionKey'])) {
48
+            return;
49
+        }
50
+        $this->needsSetup = false;
51
+    }
52 52
 
53
-	/**
54
-	 * render setup message
55
-	 *
56
-	 * @param array $eventData
57
-	 */
58
-	protected function onAfterRenderTemplate(array $eventData) {
59
-		if (!$this->needsSetup) {
60
-			return;
61
-		}
62
-		$engine = $eventData['templateEngine'];
53
+    /**
54
+     * render setup message
55
+     *
56
+     * @param array $eventData
57
+     */
58
+    protected function onAfterRenderTemplate(array $eventData) {
59
+        if (!$this->needsSetup) {
60
+            return;
61
+        }
62
+        $engine = $eventData['templateEngine'];
63 63
 
64
-		$page = new Page($this->getPluginPath('setup.md'));
65
-		$vars = ['encryption_key' => $this->generateToken()];
66
-		$this->insertVars($page, $vars);
64
+        $page = new Page($this->getPluginPath('setup.md'));
65
+        $vars = ['encryption_key' => $this->generateToken()];
66
+        $this->insertVars($page, $vars);
67 67
 
68
-		$engine->setCurrentPage($page);
69
-		$eventData['output'] = $engine->render();
70
-	}
68
+        $engine->setCurrentPage($page);
69
+        $eventData['output'] = $engine->render();
70
+    }
71 71
 
72
-	/**
73
-	 * replace twig like variables in page content
74
-	 *
75
-	 * @param Page $page
76
-	 * @param array $vars
77
-	 */
78
-	protected function insertVars(Page $page, array $vars) {
79
-		$content = $page->getRawContent();
80
-		foreach ($vars as $key => $value) {
81
-			$regex = '/\{\{(\s*?)' . $key . '(\s*?)\}\}/';
82
-			$content = preg_replace($regex, $value, $content);
83
-		}
84
-		$page->setContent($content);
85
-	}
72
+    /**
73
+     * replace twig like variables in page content
74
+     *
75
+     * @param Page $page
76
+     * @param array $vars
77
+     */
78
+    protected function insertVars(Page $page, array $vars) {
79
+        $content = $page->getRawContent();
80
+        foreach ($vars as $key => $value) {
81
+            $regex = '/\{\{(\s*?)' . $key . '(\s*?)\}\}/';
82
+            $content = preg_replace($regex, $value, $content);
83
+        }
84
+        $page->setContent($content);
85
+    }
86 86
 
87
-	/**
88
-	 * generate encryption key
89
-	 *
90
-	 * @return string
91
-	 */
92
-	protected function generateToken() {
93
-		return Utility::generateSecureToken(64);
94
-	}
87
+    /**
88
+     * generate encryption key
89
+     *
90
+     * @return string
91
+     */
92
+    protected function generateToken() {
93
+        return Utility::generateSecureToken(64);
94
+    }
95 95
 
96 96
 }
Please login to merge, or discard this patch.