Passed
Push — master ( f617b1...a2b844 )
by Alain
03:39
created
src/Mail/HTMLMail.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,27 +22,27 @@
 block discarded – undo
22 22
 class HTMLMail extends AbstractMail
23 23
 {
24 24
 
25
-    /**
26
-     * Set the format of the mail.
27
-     *
28
-     * @since 1.0.0
29
-     */
30
-    protected function setFormat()
31
-    {
32
-        $this->format = 'html';
33
-    }
25
+	/**
26
+	 * Set the format of the mail.
27
+	 *
28
+	 * @since 1.0.0
29
+	 */
30
+	protected function setFormat()
31
+	{
32
+		$this->format = 'html';
33
+	}
34 34
 
35
-    /**
36
-     * Set the context of the renderer.
37
-     *
38
-     * @since 1.0.0
39
-     *
40
-     * @param array $context Context to set/modify.
41
-     *
42
-     * @return array Updated context.
43
-     */
44
-    protected function setContext(array $context)
45
-    {
46
-        return $context;
47
-    }
35
+	/**
36
+	 * Set the context of the renderer.
37
+	 *
38
+	 * @since 1.0.0
39
+	 *
40
+	 * @param array $context Context to set/modify.
41
+	 *
42
+	 * @return array Updated context.
43
+	 */
44
+	protected function setContext(array $context)
45
+	{
46
+		return $context;
47
+	}
48 48
 }
Please login to merge, or discard this patch.
src/Mail/TextMail.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,27 +22,27 @@
 block discarded – undo
22 22
 class TextMail extends AbstractMail
23 23
 {
24 24
 
25
-    /**
26
-     * Set the format of the mail.
27
-     *
28
-     * @since 1.0.0
29
-     */
30
-    protected function setFormat()
31
-    {
32
-        $this->format = 'text';
33
-    }
25
+	/**
26
+	 * Set the format of the mail.
27
+	 *
28
+	 * @since 1.0.0
29
+	 */
30
+	protected function setFormat()
31
+	{
32
+		$this->format = 'text';
33
+	}
34 34
 
35
-    /**
36
-     * Set the context of the renderer.
37
-     *
38
-     * @since 1.0.0
39
-     *
40
-     * @param array $context Context to set/modify.
41
-     *
42
-     * @return array Updated context.
43
-     */
44
-    protected function setContext(array $context)
45
-    {
46
-        return $context;
47
-    }
35
+	/**
36
+	 * Set the context of the renderer.
37
+	 *
38
+	 * @since 1.0.0
39
+	 *
40
+	 * @param array $context Context to set/modify.
41
+	 *
42
+	 * @return array Updated context.
43
+	 */
44
+	protected function setContext(array $context)
45
+	{
46
+		return $context;
47
+	}
48 48
 }
Please login to merge, or discard this patch.
src/MailInterface.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,36 +24,36 @@
 block discarded – undo
24 24
 interface MailInterface extends Renderable
25 25
 {
26 26
 
27
-    /**
28
-     * Set the template that the email will use.
29
-     *
30
-     * @since 1.0.0
31
-     *
32
-     * @param string|TemplateInterface $template Template to use.
33
-     *
34
-     * @return void
35
-     */
36
-    public function setTemplate($template);
27
+	/**
28
+	 * Set the template that the email will use.
29
+	 *
30
+	 * @since 1.0.0
31
+	 *
32
+	 * @param string|TemplateInterface $template Template to use.
33
+	 *
34
+	 * @return void
35
+	 */
36
+	public function setTemplate($template);
37 37
 
38
-    /**
39
-     * Get the instance of the template.
40
-     *
41
-     * @since 1.0.0
42
-     *
43
-     * @return TemplateInterface
44
-     */
45
-    public function getTemplate();
38
+	/**
39
+	 * Get the instance of the template.
40
+	 *
41
+	 * @since 1.0.0
42
+	 *
43
+	 * @return TemplateInterface
44
+	 */
45
+	public function getTemplate();
46 46
 
47
-    /**
48
-     * Add a section to the Mail.
49
-     *
50
-     * @since 1.0.0
51
-     *
52
-     * @param string $type    Type of section to add.
53
-     * @param string $content Content of the section.
54
-     *
55
-     * @return void
56
-     * @throws RuntimeException
57
-     */
58
-    public function addSection($type, $content);
47
+	/**
48
+	 * Add a section to the Mail.
49
+	 *
50
+	 * @since 1.0.0
51
+	 *
52
+	 * @param string $type    Type of section to add.
53
+	 * @param string $content Content of the section.
54
+	 *
55
+	 * @return void
56
+	 * @throws RuntimeException
57
+	 */
58
+	public function addSection($type, $content);
59 59
 }
Please login to merge, or discard this patch.
src/ValidatorInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@
 block discarded – undo
22 22
 interface ValidatorInterface
23 23
 {
24 24
 
25
-    /**
26
-     * Validate the content for a given context.
27
-     *
28
-     * @since 1.0.0
29
-     *
30
-     * @param string $content Content to validate.
31
-     * @param array  $context Context in which to validate.
32
-     *
33
-     * @return string Validated content.
34
-     */
35
-    public function validate($content, array $context);
25
+	/**
26
+	 * Validate the content for a given context.
27
+	 *
28
+	 * @since 1.0.0
29
+	 *
30
+	 * @param string $content Content to validate.
31
+	 * @param array  $context Context in which to validate.
32
+	 *
33
+	 * @return string Validated content.
34
+	 */
35
+	public function validate($content, array $context);
36 36
 }
Please login to merge, or discard this patch.
src/Sanitizer/HTMLSanitizer.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -22,18 +22,18 @@
 block discarded – undo
22 22
 class HTMLSanitizer extends AbstractSanitizer
23 23
 {
24 24
 
25
-    /**
26
-     * Sanitize the content for a given context.
27
-     *
28
-     * @since 1.0.0
29
-     *
30
-     * @param string $content Content to sanitize.
31
-     * @param array  $context Context in which to sanitize.
32
-     *
33
-     * @return string Sanitized content.
34
-     */
35
-    public function sanitize($content, array $context)
36
-    {
37
-        return $content;
38
-    }
25
+	/**
26
+	 * Sanitize the content for a given context.
27
+	 *
28
+	 * @since 1.0.0
29
+	 *
30
+	 * @param string $content Content to sanitize.
31
+	 * @param array  $context Context in which to sanitize.
32
+	 *
33
+	 * @return string Sanitized content.
34
+	 */
35
+	public function sanitize($content, array $context)
36
+	{
37
+		return $content;
38
+	}
39 39
 }
Please login to merge, or discard this patch.
src/Support/Factory.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -26,75 +26,75 @@
 block discarded – undo
26 26
 class Factory
27 27
 {
28 28
 
29
-    /**
30
-     * Configuration Settings.
31
-     *
32
-     * @since 1.0.0
33
-     *
34
-     * @var ConfigInterface
35
-     */
36
-    protected $config;
29
+	/**
30
+	 * Configuration Settings.
31
+	 *
32
+	 * @since 1.0.0
33
+	 *
34
+	 * @var ConfigInterface
35
+	 */
36
+	protected $config;
37 37
 
38
-    /**
39
-     * Type of element the factory wants to create.
40
-     *
41
-     * @since 1.0.0
42
-     *
43
-     * @var string
44
-     */
45
-    protected $element;
38
+	/**
39
+	 * Type of element the factory wants to create.
40
+	 *
41
+	 * @since 1.0.0
42
+	 *
43
+	 * @var string
44
+	 */
45
+	protected $element;
46 46
 
47
-    /**
48
-     * Instantiate a Factory object.
49
-     *
50
-     * @since 1.0.0
51
-     *
52
-     * @param ConfigInterface $config  Configuration settings.
53
-     * @param string          $element The type of element to instantiate a factory for.
54
-     *
55
-     * @throws FailedToInstantiateFactoryException When an unknown element type is requested.
56
-     */
57
-    public function __construct(ConfigInterface $config, $element)
58
-    {
47
+	/**
48
+	 * Instantiate a Factory object.
49
+	 *
50
+	 * @since 1.0.0
51
+	 *
52
+	 * @param ConfigInterface $config  Configuration settings.
53
+	 * @param string          $element The type of element to instantiate a factory for.
54
+	 *
55
+	 * @throws FailedToInstantiateFactoryException When an unknown element type is requested.
56
+	 */
57
+	public function __construct(ConfigInterface $config, $element)
58
+	{
59 59
 
60
-        $this->config = $config;
60
+		$this->config = $config;
61 61
 
62
-        if (! $this->config->hasKey($element)) {
63
-            throw new FailedToInstantiateFactoryException(sprintf(
64
-                'Could not instantiate Factory for unknown Element Type "%1$s".',
65
-                $element
66
-            ));
67
-        }
62
+		if (! $this->config->hasKey($element)) {
63
+			throw new FailedToInstantiateFactoryException(sprintf(
64
+				'Could not instantiate Factory for unknown Element Type "%1$s".',
65
+				$element
66
+			));
67
+		}
68 68
 
69
-        $this->element = $element;
70
-    }
69
+		$this->element = $element;
70
+	}
71 71
 
72
-    /**
73
-     * Create and return a new instance of an element.
74
-     *
75
-     * @since 1.0.0
76
-     *
77
-     * @param string $type      Type of element to create.
78
-     * @param mixed  $arguments Optional. Arguments to pass to the object.
79
-     *
80
-     * @return object New instance of the requested class.
81
-     * @throws FailedToInstantiateClassException If an unknown element type is requested.
82
-     */
83
-    public function create($type, $arguments = null)
84
-    {
72
+	/**
73
+	 * Create and return a new instance of an element.
74
+	 *
75
+	 * @since 1.0.0
76
+	 *
77
+	 * @param string $type      Type of element to create.
78
+	 * @param mixed  $arguments Optional. Arguments to pass to the object.
79
+	 *
80
+	 * @return object New instance of the requested class.
81
+	 * @throws FailedToInstantiateClassException If an unknown element type is requested.
82
+	 */
83
+	public function create($type, $arguments = null)
84
+	{
85 85
 
86
-        $classMap = $this->config[$this->element];
86
+		$classMap = $this->config[$this->element];
87 87
 
88
-        if (! array_key_exists($type, $classMap)) {
89
-            throw new FailedToInstantiateClassException(sprintf(
90
-                'Could not create object, unknown Type "%1$s" for "%2$s" elements.',
91
-                $type,
92
-                $this->element
93
-            ));
94
-        }
88
+		if (! array_key_exists($type, $classMap)) {
89
+			throw new FailedToInstantiateClassException(sprintf(
90
+				'Could not create object, unknown Type "%1$s" for "%2$s" elements.',
91
+				$type,
92
+				$this->element
93
+			));
94
+		}
95 95
 
96
-        $className = $classMap[$type]['class_name'];
96
+		$className = $classMap[$type]['class_name'];
97 97
 
98
-        return new $className($this->config, $arguments);
99
-    }
98
+		return new $className($this->config, $arguments);
99
+	}
100 100
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         $this->config = $config;
61 61
 
62
-        if (! $this->config->hasKey($element)) {
62
+        if ( ! $this->config->hasKey($element)) {
63 63
             throw new FailedToInstantiateFactoryException(sprintf(
64 64
                 'Could not instantiate Factory for unknown Element Type "%1$s".',
65 65
                 $element
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         $classMap = $this->config[$this->element];
87 87
 
88
-        if (! array_key_exists($type, $classMap)) {
88
+        if ( ! array_key_exists($type, $classMap)) {
89 89
             throw new FailedToInstantiateClassException(sprintf(
90 90
                 'Could not create object, unknown Type "%1$s" for "%2$s" elements.',
91 91
                 $type,
Please login to merge, or discard this patch.
src/TemplateInterface.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,21 +22,21 @@
 block discarded – undo
22 22
 interface TemplateInterface extends Renderable
23 23
 {
24 24
 
25
-    /**
26
-     * Get an array of Sections that are used by this template.
27
-     *
28
-     * @since 1.0.0
29
-     *
30
-     * @return array Sections that are used by this template.
31
-     */
32
-    public function getUsedSections();
25
+	/**
26
+	 * Get an array of Sections that are used by this template.
27
+	 *
28
+	 * @since 1.0.0
29
+	 *
30
+	 * @return array Sections that are used by this template.
31
+	 */
32
+	public function getUsedSections();
33 33
 
34
-    /**
35
-     * Get the name of the Template.
36
-     *
37
-     * @since 1.0.0
38
-     *
39
-     * @return string Name of the template.
40
-     */
41
-    public function getTemplateName();
34
+	/**
35
+	 * Get the name of the Template.
36
+	 *
37
+	 * @since 1.0.0
38
+	 *
39
+	 * @return string Name of the template.
40
+	 */
41
+	public function getTemplateName();
42 42
 }
Please login to merge, or discard this patch.
src/ChainMail.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 class ChainMail
27 27
 {
28 28
 
29
-    const DEFAULT_CONFIG = __DIR__ . '/../config/defaults.php';
29
+    const DEFAULT_CONFIG = __DIR__.'/../config/defaults.php';
30 30
 
31 31
     /**
32 32
      * Configuration Settings.
@@ -49,15 +49,15 @@  discard block
 block discarded – undo
49 49
 
50 50
         $defaults = ConfigFactory::create(include(self::DEFAULT_CONFIG));
51 51
 
52
-        if (! $config) {
52
+        if ( ! $config) {
53 53
             $this->config = $defaults;
54 54
 
55 55
             return;
56 56
         }
57 57
 
58 58
         $this->config = ConfigFactory::create(array_merge(
59
-                (array)$defaults,
60
-                (array)$config)
59
+                (array) $defaults,
60
+                (array) $config)
61 61
         );
62 62
     }
63 63
 
Please login to merge, or discard this patch.
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -26,115 +26,115 @@
 block discarded – undo
26 26
 class ChainMail
27 27
 {
28 28
 
29
-    const DEFAULT_CONFIG = __DIR__ . '/../config/defaults.php';
30
-
31
-    /**
32
-     * Configuration Settings.
33
-     *
34
-     * @since 1.0.0
35
-     *
36
-     * @var ConfigInterface
37
-     */
38
-    protected $config;
39
-
40
-    /**
41
-     * Instantiate a ChainMail object.
42
-     *
43
-     * @since 1.0.0
44
-     *
45
-     * @param ConfigInterface|null $config Optional. Configuration settings.
46
-     */
47
-    public function __construct(ConfigInterface $config = null)
48
-    {
49
-
50
-        $defaults = ConfigFactory::create(include(self::DEFAULT_CONFIG));
51
-
52
-        if (! $config) {
53
-            $this->config = $defaults;
54
-
55
-            return;
56
-        }
57
-
58
-        $this->config = ConfigFactory::create(array_merge(
59
-                (array)$defaults,
60
-                (array)$config)
61
-        );
62
-    }
63
-
64
-    /**
65
-     * Render a specific section.
66
-     *
67
-     * @since 1.0.0
68
-     *
69
-     * @param string $sectionType Type of section to render.
70
-     * @param array  $context     The context in which to render the section.
71
-     *
72
-     * @return string Rendered HTML.
73
-     */
74
-    public static function renderSection($sectionType, array $context)
75
-    {
76
-        /** @var SectionInterface $section */
77
-        $section = $context['sections'][$sectionType];
78
-
79
-        return $section->render($context);
80
-    }
81
-
82
-    /**
83
-     * Get an array of strings representing the sections that are used by the
84
-     * template.
85
-     *
86
-     * @since 1.0.0
87
-     *
88
-     * @param array $context The context in which to render the section.
89
-     *
90
-     * @return array Array of strings with section types.
91
-     */
92
-    public static function getUsedSections(array $context)
93
-    {
94
-        /** @var TemplateInterface $template */
95
-        $template = $context['template'];
96
-
97
-        return $template->getUsedSections();
98
-    }
99
-
100
-    /**
101
-     * Render all used sections.
102
-     *
103
-     * @since 1.0.0
104
-     *
105
-     * @param array $context The context in which to render the section.
106
-     *
107
-     * @return string Rendered HTML.
108
-     */
109
-    public static function renderSections(array $context)
110
-    {
111
-        $output = '';
112
-
113
-        foreach (self::getUsedSections($context) as $section) {
114
-            $output .= self::renderSection($section, $context);
115
-        }
116
-
117
-        return $output;
118
-    }
119
-
120
-    /**
121
-     * Create a new mail object.
122
-     *
123
-     * @since 1.0.0
124
-     *
125
-     * @param string                   $format        Optional. Format to use.
126
-     * @param string|TemplateInterface $template      Optional. Template to be
127
-     *                                                used.
128
-     *
129
-     * @return MailInterface
130
-     */
131
-    public function createMail($format = 'html', $template = 'BasicTemplate')
132
-    {
133
-        $mail_factory = new Factory($this->config, 'mails');
134
-        $mail_class   = $this->config->getKey('formats')[$format]['mail'];
135
-        $mail         = $mail_factory->create($mail_class);
136
-        $mail->setTemplate($template);
137
-
138
-        return $mail;
139
-    }
29
+	const DEFAULT_CONFIG = __DIR__ . '/../config/defaults.php';
30
+
31
+	/**
32
+	 * Configuration Settings.
33
+	 *
34
+	 * @since 1.0.0
35
+	 *
36
+	 * @var ConfigInterface
37
+	 */
38
+	protected $config;
39
+
40
+	/**
41
+	 * Instantiate a ChainMail object.
42
+	 *
43
+	 * @since 1.0.0
44
+	 *
45
+	 * @param ConfigInterface|null $config Optional. Configuration settings.
46
+	 */
47
+	public function __construct(ConfigInterface $config = null)
48
+	{
49
+
50
+		$defaults = ConfigFactory::create(include(self::DEFAULT_CONFIG));
51
+
52
+		if (! $config) {
53
+			$this->config = $defaults;
54
+
55
+			return;
56
+		}
57
+
58
+		$this->config = ConfigFactory::create(array_merge(
59
+				(array)$defaults,
60
+				(array)$config)
61
+		);
62
+	}
63
+
64
+	/**
65
+	 * Render a specific section.
66
+	 *
67
+	 * @since 1.0.0
68
+	 *
69
+	 * @param string $sectionType Type of section to render.
70
+	 * @param array  $context     The context in which to render the section.
71
+	 *
72
+	 * @return string Rendered HTML.
73
+	 */
74
+	public static function renderSection($sectionType, array $context)
75
+	{
76
+		/** @var SectionInterface $section */
77
+		$section = $context['sections'][$sectionType];
78
+
79
+		return $section->render($context);
80
+	}
81
+
82
+	/**
83
+	 * Get an array of strings representing the sections that are used by the
84
+	 * template.
85
+	 *
86
+	 * @since 1.0.0
87
+	 *
88
+	 * @param array $context The context in which to render the section.
89
+	 *
90
+	 * @return array Array of strings with section types.
91
+	 */
92
+	public static function getUsedSections(array $context)
93
+	{
94
+		/** @var TemplateInterface $template */
95
+		$template = $context['template'];
96
+
97
+		return $template->getUsedSections();
98
+	}
99
+
100
+	/**
101
+	 * Render all used sections.
102
+	 *
103
+	 * @since 1.0.0
104
+	 *
105
+	 * @param array $context The context in which to render the section.
106
+	 *
107
+	 * @return string Rendered HTML.
108
+	 */
109
+	public static function renderSections(array $context)
110
+	{
111
+		$output = '';
112
+
113
+		foreach (self::getUsedSections($context) as $section) {
114
+			$output .= self::renderSection($section, $context);
115
+		}
116
+
117
+		return $output;
118
+	}
119
+
120
+	/**
121
+	 * Create a new mail object.
122
+	 *
123
+	 * @since 1.0.0
124
+	 *
125
+	 * @param string                   $format        Optional. Format to use.
126
+	 * @param string|TemplateInterface $template      Optional. Template to be
127
+	 *                                                used.
128
+	 *
129
+	 * @return MailInterface
130
+	 */
131
+	public function createMail($format = 'html', $template = 'BasicTemplate')
132
+	{
133
+		$mail_factory = new Factory($this->config, 'mails');
134
+		$mail_class   = $this->config->getKey('formats')[$format]['mail'];
135
+		$mail         = $mail_factory->create($mail_class);
136
+		$mail->setTemplate($template);
137
+
138
+		return $mail;
139
+	}
140 140
 }
Please login to merge, or discard this patch.
src/Renderable.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@
 block discarded – undo
22 22
 interface Renderable
23 23
 {
24 24
 
25
-    /**
26
-     * Render the current Renderable for a given context.
27
-     *
28
-     * @since 1.0.0
29
-     *
30
-     * @param array $context The context in which to render the Renderable.
31
-     *
32
-     * @return string Rendered output of the Renderable.
33
-     */
34
-    public function render(array $context);
25
+	/**
26
+	 * Render the current Renderable for a given context.
27
+	 *
28
+	 * @since 1.0.0
29
+	 *
30
+	 * @param array $context The context in which to render the Renderable.
31
+	 *
32
+	 * @return string Rendered output of the Renderable.
33
+	 */
34
+	public function render(array $context);
35 35
 }
Please login to merge, or discard this patch.