Skip to content

Commit 45f0c0d

Browse files
committed
Add initial project structure with configuration files and example class.
0 parents  commit 45f0c0d

31 files changed

Lines changed: 9402 additions & 0 deletions

.dockerignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Docker
7+
.docker
8+
docker-compose.yml
9+
docker-compose.override.yml
10+
Dockerfile
11+
.dockerignore
12+
13+
# IDE
14+
.idea
15+
.vscode
16+
*.sublime-project
17+
*.sublime-workspace
18+
19+
# Logs
20+
*.log
21+
22+
# Cache
23+
/cache
24+
25+
# Documentation
26+
README.md
27+
CHANGELOG.md
28+
CONTRIBUTING.md
29+
LICENSE.md

.github/workflows/php.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: checks
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: '8.2.16'
24+
extensions: mbstring, intl
25+
26+
- name: Validate composer.json and composer.lock
27+
run: composer validate --strict
28+
29+
- name: Cache Composer packages
30+
id: composer-cache
31+
uses: actions/cache@v3
32+
with:
33+
path: vendor
34+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-php-
37+
38+
- name: Install dependencies
39+
run: composer install --prefer-dist --no-progress --ignore-platform-reqs
40+
41+
- name: Run style fixer
42+
run: composer run-script cs
43+
44+
- name: Run psalm
45+
run: composer run-script sca
46+
47+
- name: Run tests
48+
run: composer run-script test
49+
50+
- name: Run type coverage
51+
run: composer run-script type
52+
53+
- name: Run test coverage
54+
run: composer run-script coverage

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
vendor
2+
cache
3+
.idea
4+
5+
# Docker related
6+
.docker/data
7+
docker-compose.override.yml
8+
*.log

.php-cs-fixer.dist.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
$finder = PhpCsFixer\Finder::create()
4+
->exclude('vendor')
5+
->exclude('public')
6+
->exclude('app')
7+
->exclude('var')
8+
->exclude('node_modules')
9+
->exclude('cache')
10+
->in(__DIR__);
11+
12+
$config = new PhpCsFixer\Config();
13+
14+
return $config->setUsingCache(true)
15+
->setCacheFile(sprintf('%s/cache/.php-cs-fixer.cache', __DIR__))
16+
->setRiskyAllowed(true)
17+
->setRules([
18+
'@PSR12' => true,
19+
'@PHP56Migration:risky' => true,
20+
'@PHP70Migration' => true,
21+
'@PHP70Migration:risky' => true,
22+
'@PHP71Migration' => true,
23+
'@PHP71Migration:risky' => true,
24+
'@PHP73Migration' => true,
25+
'@PHP74Migration' => true,
26+
'@PHP74Migration:risky' => true,
27+
'@PHP80Migration' => true,
28+
'@PHP80Migration:risky' => true,
29+
'@PhpCsFixer' => true,
30+
'@PhpCsFixer:risky' => false,
31+
'@Symfony' => true,
32+
'@Symfony:risky' => true,
33+
'@DoctrineAnnotation' => true,
34+
'function_declaration' => ['closure_fn_spacing' => 'none'],
35+
'list_syntax' => ['syntax' => 'short'],
36+
'single_line_empty_body' => false,
37+
'strict_comparison' => false,
38+
'binary_operator_spaces' => [
39+
'operators' => [
40+
'=' => 'single_space',
41+
'=>' => 'single_space',
42+
'+=' => 'single_space',
43+
'-=' => 'single_space',
44+
'*=' => 'single_space',
45+
'%=' => 'single_space',
46+
'.=' => 'single_space',
47+
'^=' => 'single_space',
48+
],
49+
],
50+
'concat_space' => ['spacing' => 'one'],
51+
'yoda_style' => false,
52+
'class_definition' => [
53+
'single_line' => false,
54+
],
55+
'native_function_invocation' => true,
56+
'native_function_casing' => true,
57+
'native_constant_invocation' => true,
58+
'object_operator_without_whitespace' => false,
59+
'operator_linebreak' => true,
60+
'multiline_whitespace_before_semicolons' => [
61+
'strategy' => 'no_multi_line',
62+
],
63+
'phpdoc_to_comment' => false,
64+
'php_unit_test_case_static_method_calls' => false,
65+
'global_namespace_import' => [
66+
'import_classes' => true,
67+
'import_constants' => true,
68+
'import_functions' => true,
69+
],
70+
'ordered_imports' => [
71+
'sort_algorithm' => 'alpha',
72+
'imports_order' => [
73+
'const',
74+
'class',
75+
'function',
76+
]
77+
],
78+
])
79+
->setFinder($finder);

DEVELOPMENT.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Development
2+
3+
This document contains instructions for setting up the development environment and contributing to the Retry package.
4+
5+
## Docker Setup
6+
7+
This project includes a Docker setup for development. It provides a PHP 8.2 environment with Xdebug enabled.
8+
9+
### Prerequisites
10+
11+
- Docker
12+
- Docker Compose
13+
14+
### Getting Started
15+
16+
1. Clone the repository:
17+
18+
```bash
19+
git clone https://github.com/georgii-web/retry.git
20+
cd retry
21+
```
22+
23+
2. Build Docker container
24+
25+
```bash
26+
docker-compose up
27+
```
28+
29+
3. Install dependencies:
30+
31+
```bash
32+
composer install
33+
```
34+
35+
### Docker Environment Features
36+
37+
- PHP 8.2 CLI
38+
- Xdebug 3 for debugging and code coverage
39+
- Composer for dependency management
40+
- Custom PHP configuration optimized for development
41+
42+
## Testing
43+
44+
Be sure that all tests are passed by running:
45+
46+
```bash
47+
composer oncommit
48+
```
49+
50+
## Contribution Guidelines
51+
52+
1. Fork the repository
53+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
54+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
55+
4. Push to the branch (`git push origin feature/amazing-feature`)
56+
5. Open a Pull Request
57+
58+
Please make sure your code follows the project's coding standards and is covered by tests.

0 commit comments

Comments
 (0)