@@ -43,10 +43,10 @@ protected function setUp(): void {
4343 $ this ->crypto = $ this ->createMock (ICrypto::class);
4444
4545 $ this ->crypto ->method ('encrypt ' )->willReturnCallback (
46- fn ($ input ) => '# ' . $ input . '# '
46+ fn ($ input ) => '# ' . $ input . '# '
4747 );
4848 $ this ->crypto ->method ('decrypt ' )->willReturnCallback (
49- fn ($ input ) => ($ input === '' || strlen ($ input ) < 2 ) ? '' : substr ($ input , 1 , -1 )
49+ fn ($ input ) => ($ input === '' || strlen ($ input ) < 2 ) ? '' : substr ($ input , 1 , -1 )
5050 );
5151
5252 $ this ->session = new Memory ();
@@ -59,7 +59,7 @@ protected function setUp(): void {
5959 public function testSessionDataStoredEncrypted (): void {
6060 $ keyName = 'secret ' ;
6161 $ unencryptedValue = 'superSecretValue123 ' ;
62-
62+
6363 $ this ->instance ->set ($ keyName , $ unencryptedValue );
6464 $ this ->instance ->close ();
6565
@@ -89,11 +89,11 @@ public function testRoundTripValue($key, $value): void {
8989
9090 public static function roundTripValuesProvider (): array {
9191 return [
92- 'simple string ' => ['foo ' , 'bar ' ],
93- 'unicode value ' => ['uni ' , "héllo 🌍 " ],
94- 'large value ' => ['big ' , str_repeat ('x ' , 4096 )],
95- 'large array ' => ['thousand ' , json_encode (self ::makeLargeArray ())],
96- 'empty string ' => ['' , '' ],
92+ 'simple string ' => ['foo ' , 'bar ' ],
93+ 'unicode value ' => ['uni ' , "héllo 🌍 " ],
94+ 'large value ' => ['big ' , str_repeat ('x ' , 4096 )],
95+ 'large array ' => ['thousand ' , json_encode (self ::makeLargeArray ())],
96+ 'empty string ' => ['' , '' ],
9797 ];
9898 }
9999
@@ -166,11 +166,11 @@ public function testWrongPassphraseGivesNoAccess(): void {
166166 private function createPassphraseAwareCryptoMock (): ICrypto {
167167 $ crypto = $ this ->createMock (ICrypto::class);
168168
169- $ crypto ->method ('encrypt ' )->willReturnCallback (function ($ plain , $ passphrase = null ) {
169+ $ crypto ->method ('encrypt ' )->willReturnCallback (function ($ plain , $ passphrase = null ) {
170170 // Set up: store a value with the passphrase embedded (fake encryption)
171171 return $ passphrase . '# ' . $ plain . '# ' . $ passphrase ;
172172 });
173- $ crypto ->method ('decrypt ' )->willReturnCallback (function ($ input , $ passphrase = null ) {
173+ $ crypto ->method ('decrypt ' )->willReturnCallback (function ($ input , $ passphrase = null ) {
174174 // Only successfully decrypt if the embedded passphrase matches
175175 if (strpos ($ input , $ passphrase . '# ' ) === 0 && strrpos ($ input , '# ' . $ passphrase ) === strlen ($ input ) - strlen ('# ' . $ passphrase )) {
176176 // Strip off passphrase markers and return the "decrypted" string
0 commit comments