Skip to content

Commit 69c2809

Browse files
committed
Align with changes in dependencies.
1 parent fa0e25d commit 69c2809

8 files changed

+29
-16
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
/.phpunit.result.cache
33
/bin/
44
/composer.lock
5-
/custom.task.properties
6-
/custom.type.properties
75
/test/coverage.xml
86
/test/report/
97
/vendor/

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515
"psr/log": "^3.0.0",
1616
"setbased/exception": "^2.3.0",
1717
"setbased/helper-cast": "^3.0.0",
18-
"setbased/php-stratum-middle": "^5.11.0",
19-
"setbased/php-stratum-mysql": "^6.6.0",
18+
"setbased/php-stratum-middle": "^5.0.0",
19+
"setbased/php-stratum-mysql": "^7.0.0",
2020
"symfony/console": "^6.2.5"
2121
},
22-
"minimum-stability": "dev",
23-
"prefer-stable": true,
2422
"require-dev": {
25-
"phing/phing": "^3.0.0-RC4",
26-
"phpunit/phpunit": "^9.6.3",
23+
"phing/phing": "^3.0.0",
24+
"phpunit/phpunit": "^10.5.35",
2725
"setbased/error-handler": "^1.3.0"
2826
},
2927
"autoload": {

src/Command/ReferenceObfuscatorCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function compare(array $a, array $b): int
7575
/**
7676
* @inheritdoc
7777
*/
78-
protected function configure()
78+
protected function configure(): void
7979
{
8080
$this->setName('plaisio:reference-obfuscator-generator')
8181
->setDescription('Generates the keys and masks for the Reference Obfuscator')
@@ -179,7 +179,7 @@ private function extractLines(string $source): array
179179
// Step 1: Find doc comment with annotation.
180180
if (is_array($token) && $token[0]==T_DOC_COMMENT)
181181
{
182-
if (strpos($token[1], '@plaisio.obfuscator.labels')!==false)
182+
if (str_contains($token[1], '@plaisio.obfuscator.labels'))
183183
{
184184
$line1 = $token[2];
185185
$step = 2;

src/DevelopmentObfuscator.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class DevelopmentObfuscator implements Obfuscator
2121
private string $alias;
2222

2323
//--------------------------------------------------------------------------------------------------------------------
24+
2425
/**
2526
* Object constructor.
2627
*

src/DevelopmentObfuscatorFactory.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,12 @@ public static function create(string $alias): Obfuscator
2828
*/
2929
public static function decode(?string $code, string $alias): ?int
3030
{
31-
if ($code===null || $code==='') return null;
31+
if ($code===null || $code==='')
32+
{
33+
return null;
34+
}
3235

33-
if (substr($code, 0, strlen($alias))!=$alias)
36+
if (!str_starts_with($code, $alias))
3437
{
3538
throw new LogicException(sprintf("Labels '%s' and '%s' don't match.", substr($code, 0, strlen($alias)), $alias));
3639
}
@@ -51,7 +54,10 @@ public static function decode(?string $code, string $alias): ?int
5154
*/
5255
public static function encode(?int $id, string $alias): ?string
5356
{
54-
if ($id===null) return null;
57+
if ($id===null)
58+
{
59+
return null;
60+
}
5561

5662
return $alias.'_'.$id;
5763
}

src/IdentityObfuscatorFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ public static function create(string $alias): Obfuscator
2727
*/
2828
public static function decode(?string $code, string $alias): ?int
2929
{
30-
if ($code===null || $code==='') return null;
30+
if ($code===null || $code==='')
31+
{
32+
return null;
33+
}
3134

3235
if (preg_match('/^\d+$/', $code)!=1)
3336
{

src/ReferenceObfuscator.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ public function __construct(int $length, int $key, int $bitMask)
7171
*/
7272
public static function decrypt(?string $code, int $length, int $key, int $mask): ?int
7373
{
74-
if ($code===null || $code==='') return null;
74+
if ($code===null || $code==='')
75+
{
76+
return null;
77+
}
7578

7679
try
7780
{
@@ -111,7 +114,10 @@ public static function decrypt(?string $code, int $length, int $key, int $mask):
111114
*/
112115
public static function encrypt(?int $id, int $length, int $key, int $mask): ?string
113116
{
114-
if ($id===null) return null;
117+
if ($id===null)
118+
{
119+
return null;
120+
}
115121

116122
$val = $id ^ $mask;
117123
$result = 0;

src/ReferenceObfuscatorFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ReferenceObfuscatorFactory implements ObfuscatorFactory
2121
public static array $labels = [];
2222

2323
//--------------------------------------------------------------------------------------------------------------------
24+
2425
/**
2526
* @inheritdoc
2627
*

0 commit comments

Comments
 (0)