Skip to content

Commit 0a8f7ef

Browse files
committed
Fixed #139
1 parent 6cda2b6 commit 0a8f7ef

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
10+
jobs:
11+
phpcs:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup PHP environment
16+
uses: shivammathur/setup-php@v2
17+
- name: Install dependencies
18+
run: composer install
19+
- name: PHPCSFixer check
20+
run: composer check-style
21+
phpunit:
22+
strategy:
23+
matrix:
24+
php_version: [7.2, 7.3, 7.4]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- name: Setup PHP environment
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php_version }}
32+
coverage: xdebug
33+
- name: Install dependencies
34+
run: composer install
35+
- name: PHPUnit check
36+
run: ./vendor/bin/phpunit --coverage-text

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ composer.lock
44
.php_cs.cache
55
/coverage/
66
.phpunit.result.cache
7+
cghooks.lock
8+

src/Followable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function hasRequestedToFollow(Model $user): bool
9090
/* @var \Illuminate\Database\Eloquent\Model $this */
9191
if ($this->relationLoaded('followings')) {
9292
return $this->followings
93-
->whereNull('pivot.accepted_at')
93+
->whereStrict('pivot.accepted_at', null)
9494
->contains($user);
9595
}
9696

@@ -114,7 +114,7 @@ public function isFollowing($user)
114114
/* @var \Illuminate\Database\Eloquent\Model $this */
115115
if ($this->relationLoaded('followings')) {
116116
return $this->followings
117-
->whereNotNull('pivot.accepted_at')
117+
->where('pivot.accepted_at', '!==', null)
118118
->contains($user);
119119
}
120120

@@ -138,7 +138,7 @@ public function isFollowedBy($user)
138138
/* @var \Illuminate\Database\Eloquent\Model $this */
139139
if ($this->relationLoaded('followers')) {
140140
return $this->followers
141-
->whereNotNull('pivot.accepted_at')
141+
->where('pivot.accepted_at', '!==', null)
142142
->contains($user);
143143
}
144144

0 commit comments

Comments
 (0)