for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Disqus Helper package.
*
* Copyright (c) Nikola Posa <[email protected]>
* For full copyright and license information, please refer to the LICENSE file,
* located at the package root folder.
*/
namespace DisqusHelper\Widget;
* @author Nikola Posa <[email protected]>
abstract class BaseWidget implements WidgetInterface
{
protected function htmlAttribsToString(array $attribs) : string
$html = '';
foreach ($attribs as $key => $val) {
$key = htmlspecialchars($key, ENT_QUOTES);
if (is_array($val)) {
$val = implode(' ', $val);
}
if (strpos($val, '"') !== false) {
$html .= " $key='$val'";
} else {
$html .= " $key=\"$val\"";
return $html;