Commit 1f89e55e authored by Jakub Konečný's avatar Jakub Konečný

use PHP 8 functions

use polyfill until we require that version of PHP
parent 535488a5
......@@ -27,7 +27,7 @@ final class ConditionPermission implements IBookPageCondition {
public function isAllowed($parameter = null): bool {
if(!is_string($parameter)) {
throw new \InvalidArgumentException("Method " . __METHOD__ . " expects string as parameter.");
} elseif(!Strings::contains($parameter, ":")) {
} elseif(!str_contains($parameter, ":")) {
throw new \OutOfBoundsException("Method " . __METHOD__ . " expects parameter in format resource:privilege.");
}
return $this->user->isAllowed(Strings::before($parameter, ":"), Strings::after($parameter, ":"));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment