/** * @param string $key * @param string $channel * @return array */ protected function getAuthenticationParameters($key, $channel) { if (!StrUtil::contains($key, '*')) { return []; } $pattern = str_replace('\\*', '([^\\.]+)', preg_quote($key)); if (preg_match('/^' . $pattern . '/', $channel, $keys)) { array_shift($keys); return $keys; } return []; }
public function testStringNotContains() { $result = StrUtil::contains('string', 'foo'); $this->assertFalse($result); }