Skip to content

Commit

Permalink
Merge pull request #3 from widoz/develop
Browse files Browse the repository at this point in the history
Want to release the first version
  • Loading branch information
widoz committed Dec 1, 2018
2 parents a8cab14 + cc9c273 commit 4560f7d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/BemPrefixed.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
*/
final class BemPrefixed implements Bem, HasPrefix
{
const FILTER_VALUE = 'bem.value';

/**
* Block
*
Expand Down Expand Up @@ -101,12 +103,12 @@ public function value(): string
}

// Apply the element.
if (!$this->modifiers and $this->element) {
if (!$this->modifiers && $this->element) {
$bem .= "__{$this->element}";
}

// Allow to be used outside of WordPress.
if (function_exists('apply_filters')) {
if (\function_exists('apply_filters')) {
/**
* Bem Filter
*
Expand All @@ -115,7 +117,7 @@ public function value(): string
* @param string $bem The bem value.
* @param Bem $this The instance of the class.
*/
$bem = apply_filters('bem', $bem, $this);
$bem = apply_filters(self::FILTER_VALUE, $bem, $this);
}

// Sanitize the class name.
Expand Down Expand Up @@ -209,7 +211,7 @@ private function sanitizeHtmlClass(string $class): string
{
$classes = explode(' ', $class);

if (function_exists('sanitize_html_class')) {
if (\function_exists('sanitize_html_class')) {
return implode(' ', array_map('sanitize_html_class', $classes));
}

Expand Down

0 comments on commit 4560f7d

Please sign in to comment.