Skip to content

Commit

Permalink
Updates (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogervila authored Oct 29, 2022
1 parent b3bf202 commit fe48863
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 29 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ clone_folder: C:\projects\app

environment:
matrix:
- php_ver: 8.1
- php_ver: 8.0
- php_ver: 7.4
- php_ver: 7.3
- php_ver: 7.2
Expand Down Expand Up @@ -33,7 +35,7 @@ install:
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_sqlite3.dll >> php.ini
- echo extension=php_pdo_sqlite.dll >> php.ini
- IF NOT EXIST C:\tools\composer.phar (cd C:\tools && appveyor DownloadFile https://getcomposer.org/download/2.0.7/composer.phar)
- IF NOT EXIST C:\tools\composer.phar (cd C:\tools && appveyor DownloadFile https://getcomposer.org/download/2.0.14/composer.phar)
- php C:\tools\composer.phar --version
- cd C:\projects\app

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
php: [8.0, 7.4, 7.3, 7.2, 7.1, 7.0]
php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0']

name: PHP ${{ matrix.php }} - ${{ matrix.os }}

Expand All @@ -27,9 +27,6 @@ jobs:
extensions: zip, curl, xdebug
coverage: xdebug

- name: Update composer
run: composer selfupdate

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
php: [8.0, 7.4, 7.3, 7.2, 7.1, 7.0]
php: ['8.1', '8.0', '7.4', '7.3', '7.2', '7.1', '7.0']

name: PHP ${{ matrix.php }} - ${{ matrix.os }}

Expand All @@ -24,9 +24,6 @@ jobs:
extensions: zip, curl, xdebug
coverage: xdebug

- name: Update composer
run: composer selfupdate

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sonar*
junit-logfile.xml
clover.xml
composer.lock
.phpunit.result.cache
.phpdoc*
.php_cs.cache
*.cache
.idea
4 changes: 0 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"php": "^7.0|^8.0"
},
"require-dev": {
"dancryer/php-docblock-checker": "^1.10",
"phpstan/phpstan": "0.*.*",
"phpunit/phpunit": "^6.0|^7.0|^8.0|^9.0",
"rogervila/php-sonarqube-scanner": "^1.0"
},
Expand All @@ -41,8 +39,6 @@
"scripts": {
"test": [
"composer validate",
"vendor/bin/phpdoccheck",
"vendor/bin/phpstan analyse --level 7 src tests",
"vendor/bin/phpunit"
]
}
Expand Down
2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,7 @@
<?php endfor; ?>
</table>
</div>

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4739670084306482" crossorigin="anonymous"></script>
</body>
</html>
4 changes: 0 additions & 4 deletions phpdoccheck.yml

This file was deleted.

4 changes: 3 additions & 1 deletion src/Algorithm.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class Algorithm implements AlgorithmInterface

/**
* @param string $value
*
* @throws InvalidAlgorithmException
*/
public function __construct(string $value)
{
Expand All @@ -21,7 +23,7 @@ public function __construct(string $value)
}

/**
* @throws \ProvablyFair\Exceptions\InvalidAlgorithmException
* @throws InvalidAlgorithmException
*
* @return void
*/
Expand Down
4 changes: 3 additions & 1 deletion src/Seed.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Seed implements SeedInterface

/**
* @param string $value
*
* @throws InvalidSeedException
*/
public function __construct(string $value)
{
Expand All @@ -26,7 +28,7 @@ public function __construct(string $value)
}

/**
* @throws \ProvablyFair\Exceptions\InvalidSeedException
* @throws InvalidSeedException
*
* @return void
*/
Expand Down
14 changes: 7 additions & 7 deletions src/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
class System implements SystemInterface
{
/**
* @var \ProvablyFair\Contracts\AlgorithmInterface
* @var AlgorithmInterface
*/
private $algorithm;

/**
* @param \ProvablyFair\Contracts\AlgorithmInterface $algorithm
* @param AlgorithmInterface $algorithm
*/
public function __construct(AlgorithmInterface $algorithm)
{
$this->algorithm = $algorithm;
}

/**
* @param \ProvablyFair\Contracts\SeedInterface $seed
* @param SeedInterface $seed
*
* @return \ProvablyFair\Contracts\SeedInterface
* @return SeedInterface
*/
public function generateServerSeed(SeedInterface $seed): SeedInterface
{
Expand Down Expand Up @@ -63,15 +63,15 @@ private static function divisible(string $hash, int $mod): bool
$index = $hash_mod > 0 ? $hash_mod - 4 : 0;

for ($index; $index < $hash_length; $index += 4) {
$value = (($value << 16) + intval(substr($hash, $index, $index + 4), 16)) % $mod;
$value = intval(intval($value << 16) + intval(substr($hash, $index, $index + 4), 16)) % $mod;
}

return $value === 0;
}

/**
* @param \ProvablyFair\Contracts\SeedInterface $serverSeed
* @param \ProvablyFair\Contracts\SeedInterface $clientSeed
* @param SeedInterface $serverSeed
* @param SeedInterface $clientSeed
*
* @return float
*/
Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"functions": {
"api/index.php": { "runtime": "vercel-php@0.3.1" }
"api/index.php": { "runtime": "vercel-php@0.5.2" }
},
"routes": [{
"src": "/(.*)",
Expand Down

1 comment on commit fe48863

@vercel
Copy link

@vercel vercel bot commented on fe48863 Oct 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

provably-fair – ./

provably-fair.vercel.app
provably-fair-git-master-rogervila.vercel.app
provably-fair-rogervila.vercel.app

Please sign in to comment.