AuthApache   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setRealm() 0 3 1
A challenge() 0 3 1
1
<?php
2
/*
3
 * SPDX-License-Identifier: AGPL-3.0-or-later
4
 * SPDX-FileCopyrightText: 2025 grommunio GmbH
5
 *
6
 * Use this class when the HTTP server is in charge of authentication.
7
 */
8
9
namespace grommunio\DAV;
10
11
use Sabre\DAV\Auth\Backend\Apache;
12
use Sabre\HTTP\RequestInterface;
13
use Sabre\HTTP\ResponseInterface;
14
15
class AuthApache extends Apache {
16
	protected $stored_realm;
17
	public function setRealm($r)
18
	{
19
		$stored_realm = $r;
0 ignored issues
show
Unused Code introduced by
The assignment to $stored_realm is dead and can be removed.
Loading history...
20
	}
21
	public function challenge(RequestInterface $rq, ResponseInterface $rs)
22
	{
23
		$rs->addHeader("WWW-Authenticate", "Basic realm=$stored_realm");
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $stored_realm seems to be never defined.
Loading history...
24
	}
25
}
26