Skip to content

Commit e495d99

Browse files
committed
update phpstan & psalm & support PHP 8
1 parent ca5fc31 commit e495d99

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.travis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,23 @@ matrix:
1919
- php: 7.1
2020
env:
2121
- CODE_COVERAGE="1"
22+
- BENCHMARK="0"
2223
- php: 7.2
2324
env:
2425
- CODE_COVERAGE="1"
26+
- BENCHMARK="0"
2527
- php: 7.3
2628
env:
2729
- CODE_COVERAGE="1"
30+
- BENCHMARK="1"
2831
- php: 7.4
2932
env:
3033
- CODE_COVERAGE="1"
34+
- BENCHMARK="1"
3135
- php: nightly
36+
env:
37+
- CODE_COVERAGE="0"
38+
- BENCHMARK="0"
3239
allow_failures:
3340
- php: nightly
3441

@@ -39,6 +46,9 @@ install:
3946
- if [ "${CODE_COVERAGE}" == "1" ]; then
4047
wget -q -N -t 3 --retry-connrefused 'https://scrutinizer-ci.com/ocular.phar' || return 0;
4148
fi
49+
- if [ "${BENCHMARK}" == "0" ]; then
50+
composer remove --dev phpbench/phpbench --no-update;
51+
fi
4252
- composer install -n
4353

4454
script:
@@ -55,7 +65,9 @@ script:
5565
- php vendor/bin/psalm
5666

5767
# run benchmarks to make sure they are working fine
58-
- php vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100
68+
- if [ "${BENCHMARK}" == "1" ]; then
69+
php vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100;
70+
fi
5971

6072
after_script:
6173
- if [ "${CODE_COVERAGE}" == "1" ]; then

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
},
2323
"require-dev": {
2424
"phpbench/phpbench": "^0.16.10",
25-
"phpstan/phpstan": "^0.12.19",
25+
"phpstan/phpstan": "^0.12.42",
2626
"phpunit/phpunit": "^7.5.20",
27-
"vimeo/psalm": "^3.11.2"
27+
"vimeo/psalm": "^3.15.0"
2828
},
2929
"autoload": {
3030
"psr-4": {

src/EnumSet.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,8 @@ private function doSetBitInt($ordinal): void
476476
{
477477
/** @var int $thisBitset */
478478
$thisBitset = $this->bitset;
479-
$thisBitset = $thisBitset | (1 << $ordinal);
480479

481-
$this->bitset = $thisBitset;
480+
$this->bitset = $thisBitset | (1 << $ordinal);
482481
}
483482

484483
/**
@@ -514,7 +513,10 @@ private function doUnsetBitBin($ordinal): void
514513
*/
515514
private function doUnsetBitInt($ordinal): void
516515
{
517-
$this->bitset = $this->bitset & ~(1 << $ordinal);
516+
/** @var int $thisBitset */
517+
$thisBitset = $this->bitset;
518+
519+
$this->bitset = $thisBitset & ~(1 << $ordinal);
518520
}
519521

520522
/* write access (immutable) */

0 commit comments

Comments
 (0)