Skip to content

Commit eed1523

Browse files
authored
Merge pull request #11 from cgauge/update-contract
Update contract implementantion
2 parents 191e7fe + e3b5364 commit eed1523

File tree

5 files changed

+53
-17
lines changed

5 files changed

+53
-17
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
composer.phar
33
composer.lock
44
/vendor/
5-
.phpunit.result.cache
5+
.phpunit.result.cache
6+
.phpunit.cache/

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"minimum-stability": "dev",
1414
"prefer-stable": true,
1515
"require": {
16-
"php": ">=7.3",
16+
"php": ">=8.1",
1717
"illuminate/auth": ">=7.28",
1818
"illuminate/contracts": ">=7.28"
1919
},

phpunit.xml.dist

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">./src</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
83
<testsuites>
94
<testsuite name="Unit Tests">
105
<directory suffix="Test.php">./tests</directory>
116
</testsuite>
127
</testsuites>
8+
<source>
9+
<include>
10+
<directory suffix=".php">./src</directory>
11+
</include>
12+
</source>
1313
</phpunit>

src/NativeSessionUserProvider.php

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace CustomerGauge\Session;
44

5+
use BadMethodCallException;
56
use CustomerGauge\Session\Contracts\UserFactory;
67
use Illuminate\Contracts\Auth\Authenticatable as LaravelAuthenticatable;
78
use Illuminate\Contracts\Auth\UserProvider;
@@ -20,18 +21,48 @@ public function retrieveByCredentials(array $session)
2021
return $this->factory->make($session);
2122
}
2223

23-
/** @phpstan-ignore-next-line */
24+
/**
25+
* @inheritdoc
26+
* @phpstan ignore
27+
*/
28+
public function validateCredentials(LaravelAuthenticatable $user, array $credentials)
29+
{
30+
throw new BadMethodCallException('Not implemented');
31+
}
32+
33+
/**
34+
* @inheritdoc
35+
* @phpstan ignore
36+
*/
2437
public function retrieveById($identifier)
25-
{}
38+
{
39+
throw new BadMethodCallException('Not implemented');
40+
}
2641

27-
/** @phpstan-ignore-next-line */
42+
/**
43+
* @inheritdoc
44+
* @phpstan ignore
45+
*/
2846
public function retrieveByToken($identifier, $token)
29-
{}
47+
{
48+
throw new BadMethodCallException('Not implemented');
49+
}
3050

51+
/**
52+
* @inheritdoc
53+
* @phpstan ignore
54+
*/
3155
public function updateRememberToken(LaravelAuthenticatable $user, $token)
32-
{}
56+
{
57+
throw new BadMethodCallException('Not implemented');
58+
}
3359

34-
/** @phpstan-ignore-next-line */
35-
public function validateCredentials(LaravelAuthenticatable $user, array $credentials)
36-
{}
37-
}
60+
/**
61+
* @inheritdoc
62+
* @phpstan ignore
63+
*/
64+
public function rehashPasswordIfRequired(LaravelAuthenticatable $user, array $credentials, bool $force = false)
65+
{
66+
throw new BadMethodCallException('Not implemented');
67+
}
68+
}

tests/Fixtures/MyUser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ public function setRememberToken($value)
2929
public function getRememberTokenName()
3030
{
3131
}
32+
33+
public function getAuthPasswordName()
34+
{
35+
}
3236
}

0 commit comments

Comments
 (0)