Skip to content

Commit 8dfc852

Browse files
Merge pull request #7 from dutchenkoOleg/master
3.0.1
2 parents 3a89397 + 7d54c36 commit 8dfc852

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/WezomAgency/Browserizr.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,13 @@ public function isChrome()
335335
$chromeAgent = !!preg_match('/ Chrome\/\d/', $this->getUserAgent());
336336
$this->is_chrome = (
337337
$chromeAgent &&
338-
!$this->isOpera() &&
339-
!$this->isSafari() &&
340-
!$this->isEdgeIOS() &&
341-
!$this->isEdgeAndroid() &&
342-
!$this->isEdgeIOS()
338+
!(
339+
$this->isOpera() ||
340+
$this->isSafari() ||
341+
$this->isEdgeIOS() ||
342+
$this->isEdgeAndroid() ||
343+
$this->isEdgeIOS()
344+
)
343345
);
344346
}
345347
return $this->is_chrome;
@@ -392,8 +394,10 @@ public function cssClasses($tests, $cssPrefix = '', $toString = true)
392394
$classes = [];
393395
foreach ($tests as $test) {
394396
$key = 'is' . $test;
395-
$prefix = $this->$key ? 'is-' : 'is-not-';
396-
array_push($classes, $cssPrefix . $prefix . strtolower($test));
397+
if (method_exists($this, $key)) {
398+
$prefix = $this->$key() ? 'is-' : 'is-not-';
399+
array_push($classes, $cssPrefix . $prefix . strtolower($test));
400+
}
397401
}
398402

399403
if ($toString) {

0 commit comments

Comments
 (0)