original_string: public static function verify($categoryId = null, $id = null, $slug = null, $guest = true)
      {
          if (!is_numeric($categoryId) || $categoryId < 1 || !is_numeric($id) || $id < 1 || empty($slug)) {
              return null;
          }
          return static::find()->joinWith(['category' => function ($query) use ($guest) {
                  if ($guest) {
                      $query->andWhere([Category::tableName() . '.visible' => 1]);
                  }
              }])->where([
                  static::tableName() . '.id' => $id,
                  static::tableName() . '.slug' => $slug,
                  static::tableName() . '.category_id' => $categoryId,
              ])->limit(1)->one();
      }
code: public static function verify($categoryId = null, $id = null, $slug = null, $guest = true)
      {
          if (!is_numeric($categoryId) || $categoryId < 1 || !is_numeric($id) || $id < 1 || empty($slug)) {
              return null;
          }
          return static::find()->joinWith(['category' => function ($query) use ($guest) {
                  if ($guest) {
                      $query->andWhere([Category::tableName() . '.visible' => 1]);
                  }
              }])->where([
                  static::tableName() . '.id' => $id,
                  static::tableName() . '.slug' => $slug,
                  static::tableName() . '.category_id' => $categoryId,
              ])->limit(1)->one();
      }
code_tokens: public static function verify ( $ categoryId = null , $ id = null , $ slug = null , $ guest = true ) { if ( ! is_numeric ( $ categoryId ) || $ categoryId < 1 || ! is_numeric ( $ id ) || $ id < 1 || empty ( $ slug ) ) { return null ; } return static :: find ( ) -> joinWith ( [ 'category' => function ( $ query ) use ( $ guest ) { if ( $ guest ) { $ query -> andWhere ( [ Category :: tableName ( ) . '.visible' => 1 ] ) ; } } ] ) -> where ( [ static :: tableName ( ) . '.id' => $ id , static :: tableName ( ) . '.slug' => $ slug , static :: tableName ( ) . '.category_id' => $ categoryId , ] ) -> limit ( 1 ) -> one ( ) ; }
docstring: Returns the verified forum.
  @param int $categoryId forum category ID
  @param int $id forum ID
  @param string $slug forum slug
  @param bool $guest whether caller is guest or registered user
  @return Forum
  @since 0.2
docstring_tokens: Returns the verified forum .