Skip to content

Commit

Permalink
New codestyle and PHP 8.1+ (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis authored Mar 9, 2023
1 parent 3228eba commit 705c8df
Show file tree
Hide file tree
Showing 29 changed files with 353 additions and 646 deletions.
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - Retry
# JBZoo Toolbox - Retry.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Retry
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Retry
# @see https://github.com/JBZoo/Retry
#

# EditorConfig is awesome: http://EditorConfig.org
Expand Down
5 changes: 2 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - Retry
# JBZoo Toolbox - Retry.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Retry
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Retry
# @see https://github.com/JBZoo/Retry
#

/.github export-ignore
Expand Down
39 changes: 22 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - Retry
# JBZoo Toolbox - Retry.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Retry
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Retry
# @see https://github.com/JBZoo/Retry
#

name: CI
Expand All @@ -21,7 +20,7 @@ on:
branches:
- 'master'
schedule:
- cron: '30 */8 * * *'
- cron: '37 */8 * * *'

env:
COLUMNS: 120
Expand All @@ -35,20 +34,22 @@ jobs:
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
php-version: [ 8.1, 8.2 ]
coverage: [ xdebug, none ]
composer_flags: [ "--prefer-lowest", "" ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
php-version: '${{ matrix.php-version }}'
coverage: '${{ matrix.coverage }}'
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory
Expand All @@ -57,12 +58,14 @@ jobs:
run: make test --no-print-directory

- name: Uploading coverage to coveralls
if: "${{ matrix.coverage == 'xdebug' }}"
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make report-coveralls --no-print-directory || true

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
Expand All @@ -74,19 +77,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ast
php-version: '${{ matrix.php-version }}'
coverage: none
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory
Expand All @@ -95,7 +99,7 @@ jobs:
run: make codestyle --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Linters - ${{ matrix.php-version }}
Expand All @@ -107,10 +111,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 7.4, 8.0, 8.1 ]
php-version: [ 8.1, 8.2 ]
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -120,6 +124,7 @@ jobs:
php-version: ${{ matrix.php-version }}
coverage: xdebug
tools: composer
extensions: ast

- name: Build the Project
run: make update --no-print-directory
Expand All @@ -128,7 +133,7 @@ jobs:
run: make report-all --no-print-directory

- name: Upload Artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: Reports - ${{ matrix.php-version }}
Expand Down
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - Retry
# JBZoo Toolbox - Retry.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Retry
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Retry
# @see https://github.com/JBZoo/Retry
#

.idea
Expand Down
16 changes: 5 additions & 11 deletions .phan.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
<?php

/**
* JBZoo Toolbox - Retry
* JBZoo Toolbox - Retry.
*
* This file is part of the JBZoo Toolbox project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Retry
* @license MIT
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @link https://github.com/JBZoo/Retry
* @see https://github.com/JBZoo/Retry
*/

declare(strict_types=1);

$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan.php';

$config = array_merge($default, [
return \array_merge($default, [
'directory_list' => [
'src',
]
],
]);

$config['plugins'][] = 'NotFullyQualifiedUsagePlugin';
$config['plugins'][] = 'UnknownElementTypePlugin';

return $config;
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#
# JBZoo Toolbox - Retry
# JBZoo Toolbox - Retry.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @package Retry
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @link https://github.com/JBZoo/Retry
# @see https://github.com/JBZoo/Retry
#


Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# JBZoo / Retry

[![Coverage Status](https://coveralls.io/repos/JBZoo/Retry/badge.svg)](https://coveralls.io/github/JBZoo/Retry) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Retry/coverage.svg)](https://shepherd.dev/github/JBZoo/Retry) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/retry/badge)](https://www.codefactor.io/repository/github/jbzoo/retry/issues) [![PHP Strict Types](https://img.shields.io/badge/strict__types-%3D1-brightgreen)](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
[![Stable Version](https://poser.pugx.org/jbzoo/retry/version)](https://packagist.org/packages/jbzoo/retry) [![Latest Unstable Version](https://poser.pugx.org/jbzoo/retry/v/unstable)](https://packagist.org/packages/jbzoo/retry) [![Dependents](https://poser.pugx.org/jbzoo/retry/dependents)](https://packagist.org/packages/jbzoo/retry/dependents?order_by=downloads) [![GitHub Issues](https://img.shields.io/github/issues/jbzoo/retry)](https://github.com/JBZoo/Retry/issues) [![Total Downloads](https://poser.pugx.org/jbzoo/retry/downloads)](https://packagist.org/packages/jbzoo/retry/stats) [![GitHub License](https://img.shields.io/github/license/jbzoo/retry)](https://github.com/JBZoo/Retry/blob/master/LICENSE)
[![CI](https://github.com/JBZoo/Retry/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Retry/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Retry/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Retry?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Retry/coverage.svg)](https://shepherd.dev/github/JBZoo/Retry) [![Psalm Level](https://shepherd.dev/github/JBZoo/Retry/level.svg)](https://shepherd.dev/github/JBZoo/Retry) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/retry/badge)](https://www.codefactor.io/repository/github/jbzoo/retry/issues)
[![Stable Version](https://poser.pugx.org/jbzoo/retry/version)](https://packagist.org/packages/jbzoo/retry/) [![Total Downloads](https://poser.pugx.org/jbzoo/retry/downloads)](https://packagist.org/packages/jbzoo/retry/stats) [![Dependents](https://poser.pugx.org/jbzoo/retry/dependents)](https://packagist.org/packages/jbzoo/retry/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.retry)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/retry)](https://github.com/JBZoo/Retry/blob/master/LICENSE)


1. 4 retry strategies (plus the ability to use your own)
Expand Down
66 changes: 37 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,69 @@
{
"name" : "jbzoo/retry",
"type" : "library",
"description" : "Tiny PHP library providing retry functionality with multiple backoff strategies and jitter support",
"license" : "MIT",
"keywords" : [
"jbzoo", "jitter", "retry", "backoff", "middleware",
"back-off", "retry-after", "failure", "restart", "retryable"
"name" : "jbzoo/retry",
"type" : "library",
"description" : "Tiny PHP library providing retry functionality with multiple backoff strategies and jitter support",
"license" : "MIT",
"keywords" : [
"jbzoo",
"jitter",
"retry",
"backoff",
"middleware",
"back-off",
"retry-after",
"failure",
"restart",
"retryable"
],

"authors" : [
"authors" : [
{
"name" : "Joseph Szobody",
"email" : "joseph@stechstudio.com",
"name" : "Denis Smetannikov",
"email" : "admin@jbzoo.com",
"role" : "lead"
},
{
"name" : "Denis Smetannikov",
"email" : "[email protected]"
"name" : "Joseph Szobody",
"email" : "[email protected]",
"role" : "author"
}
],

"require" : {
"php" : ">=7.4"
"minimum-stability" : "dev",
"prefer-stable" : true,

"require" : {
"php" : "^8.1"
},

"require-dev" : {
"jbzoo/toolbox-dev" : "^4.0.1"
"require-dev" : {
"jbzoo/toolbox-dev" : "7.x-dev"
},

"replace" : {
"replace" : {
"stechstudio/backoff" : "*"
},

"autoload" : {
"psr-4" : {
"JBZoo\\Retry\\" : "src"
},
"autoload" : {
"psr-4" : {"JBZoo\\Retry\\" : "src"},
"files" : [
"src/defines.php",
"src/aliases.php"
]
},

"autoload-dev" : {
"classmap" : ["tests"]
"autoload-dev" : {
"psr-4" : {"JBZoo\\PHPUnit\\" : "tests"}
},

"config" : {
"config" : {
"optimize-autoloader" : true,
"allow-plugins" : {
"composer/package-versions-deprecated" : true
}
"allow-plugins" : {"composer/package-versions-deprecated" : true}
},

"extra" : {
"extra" : {
"branch-alias" : {
"dev-master" : "2.x-dev"
"dev-master" : "7.x-dev"
}
}
}
9 changes: 2 additions & 7 deletions src/Exception.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
<?php

/**
* JBZoo Toolbox - Retry
* JBZoo Toolbox - Retry.
*
* This file is part of the JBZoo Toolbox project.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @package Retry
* @license MIT
* @copyright Copyright (C) JBZoo.com, All rights reserved.
* @link https://github.com/JBZoo/Retry
* @see https://github.com/JBZoo/Retry
*/

declare(strict_types=1);

namespace JBZoo\Retry;

/**
* Class Exception
* @package JBZoo\Retry
*/
class Exception extends \RuntimeException
{
}
Loading

0 comments on commit 705c8df

Please sign in to comment.