@@ -48,7 +48,7 @@ |
||
| 48 | 48 | public function setHref($href) |
| 49 | 49 | { |
| 50 | 50 | if (StringHelper::startsWith($href, '//')) { |
| 51 | - $this->_href = Url::base(true) . str_replace('//', '/', $href); |
|
| 51 | + $this->_href = Url::base(true).str_replace('//', '/', $href); |
|
| 52 | 52 | } elseif (StringHelper::startsWith($href, '#')) { |
| 53 | 53 | // When an anchor link is given, do not modify the link. This can be usefull for one pagers |
| 54 | 54 | $this->_href = $href; |
@@ -102,25 +102,25 @@ discard block |
||
| 102 | 102 | public function run() |
| 103 | 103 | { |
| 104 | 104 | // Cache generated code |
| 105 | - return $this->getOrSetHasCache(['svg', $this->folder, $this->file, $this->cssClass, $this->symbolName], function () { |
|
| 105 | + return $this->getOrSetHasCache(['svg', $this->folder, $this->file, $this->cssClass, $this->symbolName], function() { |
|
| 106 | 106 | |
| 107 | 107 | // Check if file ends with .svg, if not add the extension |
| 108 | - $svgFile = StringHelper::endsWith($this->file, '.svg') ? $this->file : $this->file . '.svg'; |
|
| 108 | + $svgFile = StringHelper::endsWith($this->file, '.svg') ? $this->file : $this->file.'.svg'; |
|
| 109 | 109 | |
| 110 | 110 | if ($this->symbolMode) { |
| 111 | - $svgPath = Yii::$app->view->publicHtml . '/' . $svgFile; |
|
| 111 | + $svgPath = Yii::$app->view->publicHtml.'/'.$svgFile; |
|
| 112 | 112 | |
| 113 | - return '<svg class="symbol symbol--' . $this->symbolName . '' . ($this->cssClass ? ' ' . $this->cssClass : '') . '"><use class="symbol__use" xlink:href="' . $svgPath . '#' . $this->symbolName . '" /></svg>'; |
|
| 113 | + return '<svg class="symbol symbol--'.$this->symbolName.''.($this->cssClass ? ' '.$this->cssClass : '').'"><use class="symbol__use" xlink:href="'.$svgPath.'#'.$this->symbolName.'" /></svg>'; |
|
| 114 | 114 | } else { |
| 115 | 115 | // Build the full svg file path |
| 116 | - $svgPath = $this->folder . DIRECTORY_SEPARATOR . $svgFile; |
|
| 116 | + $svgPath = $this->folder.DIRECTORY_SEPARATOR.$svgFile; |
|
| 117 | 117 | |
| 118 | 118 | // Get the svg contents |
| 119 | 119 | $content = FileHelper::getFileContent($svgPath); |
| 120 | 120 | |
| 121 | 121 | // If a cssClass string is given, add it to the <svg> tag |
| 122 | 122 | if ($this->cssClass && is_string($this->cssClass)) { |
| 123 | - $content = preg_replace('/<svg/', '<svg class="' . $this->cssClass . '"', $content); |
|
| 123 | + $content = preg_replace('/<svg/', '<svg class="'.$this->cssClass.'"', $content); |
|
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | if ($content) { |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - throw new Exception('Unable to access SVG File: ' . $svgPath); |
|
| 131 | + throw new Exception('Unable to access SVG File: '.$svgPath); |
|
| 132 | 132 | }); |
| 133 | 133 | } |
| 134 | 134 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $this->_mailer->isSMTP(); |
| 143 | 143 | $this->_mailer->SMTPSecure = $this->smtpSecure; |
| 144 | 144 | $this->_mailer->Host = (string) $this->host; |
| 145 | - $this->_mailer->SMTPAuth= $this->smtpAuth; |
|
| 145 | + $this->_mailer->SMTPAuth = $this->smtpAuth; |
|
| 146 | 146 | $this->_mailer->Username = $this->username; |
| 147 | 147 | $this->_mailer->Password = $this->password; |
| 148 | 148 | $this->_mailer->Port = $this->port; |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | return true; |
| 503 | 503 | } else { |
| 504 | 504 | $data = [$this->host, $this->port, $this->smtpSecure, $this->username]; |
| 505 | - throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply() . PHP_EOL . print_r($smtp->getError(), true)); |
|
| 505 | + throw new Exception('Authentication failed ('.implode(',', $data).'): '.$smtp->getLastReply().PHP_EOL.print_r($smtp->getError(), true)); |
|
| 506 | 506 | } |
| 507 | 507 | } else { |
| 508 | 508 | throw new Exception('HELO failed: '.$smtp->getLastReply()); |