Skip to content

Commit 28676c4

Browse files
author
Greg Bowler
committed
WIP work with URI classes
1 parent 6bfc481 commit 28676c4

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

src/Authenticator.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Authwave\ProviderUri\AbstractProviderUri;
55
use Authwave\ProviderUri\AdminUri;
66
use Authwave\ProviderUri\AuthUri;
7+
use Authwave\ProviderUri\ProfileUri;
78
use Gt\Http\Uri;
89
use Gt\Session\SessionContainer;
910
use Psr\Http\Message\UriInterface;
@@ -123,22 +124,12 @@ public function getAuthUri(
123124
);
124125
}
125126

126-
public function getAdminUri(
127-
string $path = AdminUri::PATH_ADMIN
128-
):UriInterface {
129-
return new AdminUri(
130-
$this->authwaveHost,
131-
$path
132-
);
127+
public function getAdminUri():UriInterface {
128+
return new AdminUri($this->authwaveHost);
133129
}
134130

135-
public function getProfileUri(
136-
string $path = ProfileUri::PATH_PROFILE
137-
):UriInterface {
138-
return new ProfileUri(
139-
$this->authwaveHost,
140-
$path
141-
);
131+
public function getProfileUri():UriInterface {
132+
return new ProfileUri($this->authwaveHost);
142133
}
143134

144135
private function completeAuth():void {

src/ProviderUri/AdminUri.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
namespace Authwave\ProviderUri;
33

44
class AdminUri extends AbstractProviderUri {
5-
const PATH_ADMIN = "/admin";
6-
const PATH_SETTINGS = "/settings";
7-
85
public function __construct(
9-
string $baseRemoteUri,
10-
string $path
6+
string $baseRemoteUri
117
) {
128
$baseRemoteUri = $this->normaliseBaseUri($baseRemoteUri);
139
parent::__construct($baseRemoteUri);
14-
$this->path = $path;
10+
$this->path = "/admin";
1511
}
1612
}

src/ProviderUri/ProfileUri.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,11 @@
22
namespace Authwave\ProviderUri;
33

44
class ProfileUri extends AbstractProviderUri {
5-
5+
public function __construct(
6+
string $baseRemoteUri
7+
) {
8+
$baseRemoteUri = $this->normaliseBaseUri($baseRemoteUri);
9+
parent::__construct($baseRemoteUri);
10+
$this->path = "/profile";
11+
}
612
}

0 commit comments

Comments
 (0)