Inheritance: extends AbstractProvider
コード例 #1
0
 /** @test */
 public function there_are_no_regex_collisions()
 {
     $crawlers = new Crawlers();
     foreach ($crawlers->getAll() as $key1 => $regex) {
         foreach ($crawlers->getAll() as $key2 => $compare) {
             // Dont check this regex against itself
             if ($key1 != $key2) {
                 preg_match('/' . $regex . '/i', stripslashes($compare), $matches);
                 $this->assertEmpty($matches, $regex . ' collided with ' . $compare);
             }
         }
     }
 }
コード例 #2
0
 /**
  * Build the user agent regex.
  *
  * @return string
  */
 public function getRegex()
 {
     return '(' . implode('|', $this->crawlers->getAll()) . ')';
 }