original_string: public static function hasName( $name, $module_id = null ): bool
  	{
  		if( !self::isValidName($name) )
  		{
  			return false;
  		}
  
  		$builder = \DB::table("events")->where("name", $name);
  		if( is_numeric($module_id) )
  		{
  			$builder->where("module_id", (int) $module_id );
  		}
  
  		return $builder->count(["id"]) > 0;
  	}
code: public static function hasName( $name, $module_id = null ): bool
  	{
  		if( !self::isValidName($name) )
  		{
  			return false;
  		}
  
  		$builder = \DB::table("events")->where("name", $name);
  		if( is_numeric($module_id) )
  		{
  			$builder->where("module_id", (int) $module_id );
  		}
  
  		return $builder->count(["id"]) > 0;
  	}
code_tokens: public static function hasName ( $ name , $ module_id = null ) : bool { if ( ! self :: isValidName ( $ name ) ) { return false ; } $ builder = \ DB :: table ( "events" ) -> where ( "name" , $ name ) ; if ( is_numeric ( $ module_id ) ) { $ builder -> where ( "module_id" , ( int ) $ module_id ) ; } return $ builder -> count ( [ "id" ] ) > 0 ; }
docstring: Config name is exists
  
  @param string $name
  @param null | int $module_id
  @return bool
docstring_tokens: Config name is exists