-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OC\Security\Ip; | ||
|
||
use OCP\Security\Ip\IAddress; | ||
use OCP\Security\Ip\IFactory; | ||
use OCP\Security\Ip\IRange; | ||
|
||
class Factory implements IFactory { | ||
public function rangeFromString(string $range): IRange { | ||
return new Range($range); | ||
} | ||
|
||
public function addressFromString(string $ip): IAddress { | ||
return new Address($ip); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCP\Security\Ip; | ||
|
||
/** | ||
* @since 30.0.0 | ||
*/ | ||
interface IFactory { | ||
/** | ||
* Creates a range from string | ||
* | ||
* @since 30.0.0 | ||
* @throws on invalid range | ||
Check failure on line 19 in lib/public/Security/Ip/IFactory.php GitHub Actions / static-code-analysis-ocpUndefinedDocblockClass
Check failure Code scanning / Psalm UndefinedDocblockClass Error
Docblock-defined class, interface or enum named OCP\Security\Ip\on does not exist
Check failure on line 19 in lib/public/Security/Ip/IFactory.php GitHub Actions / static-code-analysisUndefinedDocblockClass
|
||
*/ | ||
public function rangeFromString(string $range): IRange; | ||
|
||
/** | ||
* Creates a address from string | ||
* | ||
* @since 30.0.0 | ||
* @throws on invalid IP | ||
Check failure on line 27 in lib/public/Security/Ip/IFactory.php GitHub Actions / static-code-analysis-ocpUndefinedDocblockClass
Check failure Code scanning / Psalm UndefinedDocblockClass Error
Docblock-defined class, interface or enum named OCP\Security\Ip\on does not exist
Check failure on line 27 in lib/public/Security/Ip/IFactory.php GitHub Actions / static-code-analysisUndefinedDocblockClass
|
||
*/ | ||
public function addressFromString(string $ip): IAddress; | ||
} |