Skip to content

Commit a94b97e

Browse files
authored
Merge pull request #103 from eymengunay/maintenance-work
2 parents 37157ec + 9c7c99d commit a94b97e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+548
-464
lines changed

.circleci/config.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [eymengunay, razvanphp]

.github/workflows/lint.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Code Quality
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- README.md
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
phpcs:
14+
runs-on: ubuntu-latest
15+
name: PHP_CodeSniffer
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.2'
23+
tools: cs2pr, phpcs
24+
25+
- name: Run phpcs
26+
run: phpcs -q --report=checkstyle . | cs2pr
27+
28+
phpstan:
29+
runs-on: ubuntu-latest
30+
name: PHPStan
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Setup PHP
35+
uses: shivammathur/setup-php@v2
36+
with:
37+
php-version: '8.2'
38+
tools: phpstan
39+
40+
- name: Get composer cache directory
41+
id: composer-cache
42+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
43+
44+
- name: Cache dependencies
45+
uses: actions/cache@v3
46+
with:
47+
path: ${{ steps.composer-cache.outputs.dir }}
48+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
49+
restore-keys: ${{ runner.os }}-composer-
50+
51+
- name: Install dependencies
52+
run: composer install --prefer-dist
53+
54+
- name: Run PHPStan
55+
run: phpstan analyse --level=3 src tests

.github/workflows/test.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: PHPUnit
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- README.md
9+
pull_request:
10+
workflow_dispatch:
11+
12+
jobs:
13+
run:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
php-version: ['7.4', '8.0', '8.1', '8.2']
18+
name: PHP ${{ matrix.php-version }}
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
tools: composer:v2
27+
28+
- name: Setup problem matchers for PHPUnit
29+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
30+
31+
- name: Get composer cache directory
32+
id: composer-cache
33+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
34+
35+
- name: Cache dependencies
36+
uses: actions/cache@v3
37+
with:
38+
path: ${{ steps.composer-cache.outputs.dir }}
39+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: ${{ runner.os }}-composer-
41+
42+
- name: Install dependencies
43+
run: composer install --prefer-dist
44+
45+
- name: Run PHPUnit
46+
run: vendor/bin/phpunit --color=always

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
vendor
22
.idea/
3+
.phpunit.result.cache

.scrutinizer.yml

Lines changed: 37 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,151 +1,38 @@
1+
checks:
2+
php: true
3+
14
filter:
2-
excluded_paths:
3-
- ./tests
4-
- ./www
5-
paths: { }
6-
before_commands:
7-
- 'composer install --dev --prefer-source --no-interaction'
8-
tools:
9-
php_mess_detector:
10-
enabled: true
11-
extensions:
12-
- php
13-
filter:
14-
excluded_paths:
15-
- ./tests
16-
- ./www
17-
paths: { }
18-
config:
19-
ruleset: null
20-
code_size_rules:
21-
cyclomatic_complexity: false
22-
npath_complexity: false
23-
excessive_method_length: false
24-
excessive_class_length: false
25-
excessive_parameter_list: false
26-
excessive_public_count: false
27-
too_many_fields: false
28-
too_many_methods: false
29-
excessive_class_complexity: false
30-
design_rules:
31-
exit_expression: true
32-
eval_expression: true
33-
goto_statement: true
34-
number_of_class_children: false
35-
depth_of_inheritance: false
36-
coupling_between_objects: false
37-
unused_code_rules:
38-
unused_private_field: true
39-
unused_local_variable: false
40-
unused_private_method: false
41-
unused_formal_parameter: false
42-
naming_rules:
43-
short_variable: false
44-
long_variable: false
45-
short_method: false
46-
constructor_conflict: true
47-
constant_naming: false
48-
boolean_method_name: false
49-
controversial_rules:
50-
superglobals: true
51-
camel_case_class_name: false
52-
camel_case_property_name: false
53-
camel_case_method_name: false
54-
camel_case_parameter_name: false
55-
camel_case_variable_name: false
56-
path_configs: { }
57-
php_cs_fixer:
58-
enabled: true
59-
config:
60-
level: all
61-
fixers:
62-
indentation: false
63-
linefeed: false
64-
trailing_spaces: false
65-
unused_use: false
66-
phpdoc_params: false
67-
visibility: false
68-
return: false
69-
short_tag: false
70-
braces: false
71-
include: false
72-
php_closing_tag: false
73-
extra_empty_lines: false
74-
controls_spaces: false
75-
elseif: false
76-
eof_ending: false
77-
extensions:
78-
- php
79-
filter:
80-
excluded_paths:
81-
- ./tests
82-
- ./www
83-
paths: { }
84-
php_code_sniffer:
85-
enabled: true
86-
config:
87-
sniffs:
88-
generic: { php: { disallow_short_open_tag_sniff: true, sapi_usage_sniff: false, no_silenced_errors_sniff: false, deprecated_functions_sniff: true, upper_case_constant_sniff: false, closing_php_tag_sniff: false, forbidden_functions_sniff: false, lower_case_constant_sniff: false, character_before_php_opening_tag_sniff: true, lower_case_keyword_sniff: false }, functions: { function_call_argument_spacing_sniff: true, opening_function_brace_kernighan_ritchie_sniff: false, opening_function_brace_bsd_allman_sniff: false, call_time_pass_by_reference_sniff: false }, code_analysis: { unused_function_parameter_sniff: false, for_loop_with_test_function_call_sniff: true, unconditional_if_statement_sniff: false, empty_statement_sniff: true, unnecessary_final_modifier_sniff: true, for_loop_should_be_while_loop_sniff: false, useless_overriding_method_sniff: true, jumbled_incrementer_sniff: true }, classes: { duplicate_class_name_sniff: false }, white_space: { disallow_tab_indent_sniff: false, scope_indent_sniff: false, disallow_space_indent_sniff: false }, formatting: { multiple_statement_alignment_sniff: false, no_space_after_cast_sniff: false, space_after_cast_sniff: false, disallow_multiple_statements_sniff: false }, files: { one_interface_per_file_sniff: false, end_file_newline_sniff: false, line_length_sniff: false, inline_html_sniff: false, byte_order_mark_sniff: false, end_file_no_newline_sniff: false, one_class_per_file_sniff: false, line_endings_sniff: false }, version_control: { subversion_properties_sniff: false }, commenting: { fixme_sniff: false, todo_sniff: false }, control_structures: { inline_control_structure_sniff: false }, strings: { unnecessary_string_concat_sniff: false }, naming_conventions: { camel_caps_function_name_sniff: false, constructor_name_sniff: false, upper_case_constant_name_sniff: false }, metrics: { cyclomatic_complexity_sniff: false, nesting_level_sniff: false } }
89-
psr2: { classes: { property_declaration_sniff: true, class_declaration_sniff: false }, methods: { method_declaration_sniff: false }, namespaces: { namespace_declaration_sniff: false, use_declaration_sniff: false }, files: { end_file_newline_sniff: false }, control_structures: { control_structure_spacing_sniff: false, switch_declaration_sniff: false, else_if_declaration_sniff: false } }
90-
psr1: { classes: { class_declaration_sniff: false }, files: { side_effects_sniff: true } }
91-
zend: { debug: { code_analyzer_sniff: false }, files: { closing_tag_sniff: false }, naming_conventions: { valid_variable_name_sniff: false } }
92-
squiz: { scope: { static_this_usage_sniff: true, method_scope_sniff: true, member_var_scope_sniff: true }, code_analysis: { empty_statement_sniff: false }, classes: { lowercase_class_keywords_sniff: false, valid_class_name_sniff: false, class_file_name_sniff: false, self_member_reference_sniff: true, class_declaration_sniff: false }, arrays: { array_bracket_spacing_sniff: false, array_declaration_sniff: false }, objects: { object_instantiation_sniff: false }, white_space: { logical_operator_spacing_sniff: false, language_construct_spacing_sniff: false, operator_spacing_sniff: false, control_structure_spacing_sniff: false, function_opening_brace_space_sniff: false, function_spacing_sniff: false, superfluous_whitespace_sniff: false, member_var_spacing_sniff: false, scope_closing_brace_sniff: false, scope_keyword_spacing_sniff: false, function_closing_brace_space_sniff: false, semicolon_spacing_sniff: false, cast_spacing_sniff: false, object_operator_spacing_sniff: false }, php: { disallow_comparison_assignment_sniff: false, disallow_size_functions_in_loops_sniff: false, heredoc_sniff: false, disallow_ob_end_flush_sniff: false, inner_functions_sniff: false, forbidden_functions_sniff: false, eval_sniff: false, lowercase_p_h_p_functions_sniff: false, discouraged_functions_sniff: false, embedded_php_sniff: false, commented_out_code_sniff: false, disallow_inline_if_sniff: false, disallow_multiple_assignments_sniff: false, global_keyword_sniff: false, non_executable_code_sniff: true }, formatting: { operator_bracket_sniff: false }, functions: { lowercase_function_keywords_sniff: false, global_function_sniff: false, function_duplicate_argument_sniff: false, multi_line_function_declaration_sniff: false, function_declaration_argument_spacing_sniff: false, function_declaration_sniff: false }, files: { file_extension_sniff: false }, commenting: { inline_comment_sniff: false, post_statement_comment_sniff: false, class_comment_sniff: false, doc_comment_alignment_sniff: false, block_comment_sniff: false, function_comment_sniff: false, function_comment_throw_tag_sniff: false, variable_comment_sniff: false, empty_catch_comment_sniff: false, file_comment_sniff: false, long_condition_closing_comment_sniff: false, closing_declaration_comment_sniff: false }, control_structures: { control_signature_sniff: false, lowercase_declaration_sniff: false, inline_if_declaration_sniff: false, for_each_loop_declaration_sniff: false, for_loop_declaration_sniff: false, switch_declaration_sniff: false, else_if_declaration_sniff: false }, strings: { echoed_strings_sniff: false, concatenation_spacing_sniff: false, double_quote_usage_sniff: false }, naming_conventions: { valid_function_name_sniff: false, valid_variable_name_sniff: false, constant_case_sniff: false }, operators: { increment_decrement_usage_sniff: false, valid_logical_operators_sniff: false, comparison_operator_usage_sniff: false } }
93-
my_source: { php: { return_function_value_sniff: false, eval_object_factory_sniff: false }, debug: { debug_code_sniff: false }, commenting: { function_comment_sniff: false } }
94-
pear: { classes: { class_declaration_sniff: false }, white_space: { object_operator_indent_sniff: false, scope_indent_sniff: false, scope_closing_brace_sniff: false }, formatting: { multi_line_assignment_sniff: false }, functions: { function_call_signature_sniff: false, function_declaration_sniff: false, valid_default_value_sniff: false }, files: { including_file_sniff: false }, commenting: { inline_comment_sniff: false, class_comment_sniff: false, function_comment_sniff: false, file_comment_sniff: false }, control_structures: { control_signature_sniff: false, multi_line_condition_sniff: false }, naming_conventions: { valid_function_name_sniff: false, valid_variable_name_sniff: false, valid_class_name_sniff: false } }
95-
wordpress: { arrays: { array_declaration_sniff: false }, classes: { valid_class_name_sniff: false }, files: { file_name_sniff: false }, formatting: { multiple_statement_alignment_sniff: false }, functions: { function_call_signature_sniff: false, function_declaration_argument_spacing_sniff: false }, naming_conventions: { valid_function_name_sniff: false }, objects: { object_instantiation_sniff: false }, php: { discouraged_functions_sniff: false }, strings: { double_quote_usage_sniff: false }, white_space: { control_structure_spacing_sniff: false, operator_spacing_sniff: false, php_indent_sniff: false }, xss: { escape_output_sniff: false } }
96-
tab_width: 0
97-
encoding: utf8
98-
standard: custom
99-
extensions:
100-
- php
101-
filter:
102-
excluded_paths:
103-
- ./tests
104-
- ./www
105-
paths: { }
106-
sensiolabs_security_checker:
107-
enabled: true
108-
filter:
109-
excluded_paths:
110-
- ./tests
111-
- ./www
112-
paths: { }
113-
php_code_coverage:
114-
enabled: true
115-
test_command: phpunit
116-
config_path: null
117-
only_changesets: false
118-
filter:
119-
excluded_paths:
120-
- ./tests
121-
- ./www
122-
paths: { }
123-
php_cpd:
124-
excluded_dirs:
125-
- ./tests
126-
- ./www
127-
min_lines: '10'
128-
enabled: true
129-
names:
130-
- '*.php'
131-
min_tokens: 70
132-
filter:
133-
excluded_paths:
134-
- ./tests
135-
- ./www
136-
paths: { }
137-
php_loc:
138-
excluded_dirs:
139-
- ./tests
140-
- ./www
141-
enabled: true
142-
names:
143-
- '*.php'
144-
changetracking:
145-
bug_patterns:
146-
- '\bfix(?:es|ed)?\b'
147-
feature_patterns:
148-
- '\badd(?:s|ed)?\b'
149-
- '\bimplement(?:s|ed)?\b'
150-
after_commands: { }
151-
artifacts: { }
5+
paths:
6+
- src/*
7+
- tests/*
8+
excluded_paths:
9+
- www/*
10+
11+
build:
12+
image: default-bionic
13+
14+
environment:
15+
php:
16+
version: 8.2
17+
ini:
18+
xdebug.mode: coverage
19+
20+
nodes:
21+
analysis:
22+
tests:
23+
override:
24+
- php-scrutinizer-run
25+
26+
phpunit:
27+
dependencies:
28+
override:
29+
- composer self-update
30+
- composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
31+
32+
tests:
33+
override:
34+
- command: ./vendor/bin/phpunit --coverage-clover ./coverage.xml
35+
on_node: 1
36+
coverage:
37+
file: coverage.xml
38+
format: php-clover

.travis.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# PHP PASSBOOK LIBRARY
22

3-
[![CircleCI](https://circleci.com/gh/eymengunay/php-passbook.svg?style=shield)](https://circleci.com/gh/eymengunay/php-passbook)
3+
[![Code Coverage](https://scrutinizer-ci.com/g/eymengunay/php-passbook/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/php-passbook/?branch=master)
4+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eymengunay/php-passbook/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eymengunay/php-passbook/?branch=master)
5+
[![PHPUnit](https://github.com/eymengunay/php-passbook/actions/workflows/test.yml/badge.svg)](https://github.com/eymengunay/php-passbook/actions/workflows/test.yml)
46
[![Total Downloads](https://img.shields.io/packagist/dt/eo/passbook.svg)](https://packagist.org/packages/eo/passbook)
57
[![Latest Stable Version](https://img.shields.io/packagist/v/eo/passbook.svg)](https://packagist.org/packages/eo/passbook)
68

@@ -49,7 +51,7 @@ This example will create a pass of type Ticket and will save the pkpass file in
4951
* [Obtain a Pass Type Identifier and Team Identifier from Apple](#obtaining-the-pass-type-identifier-and-team-id)
5052
* Get an icon (29x29 png file) for the pass
5153
* Specify a name for your organization
52-
* Specify the output path where the pass will be saved
54+
* Specify the output path where the pass will be saved
5355

5456
```php
5557
<?php
@@ -198,9 +200,18 @@ The output should display OK. If not, you need to figure out what's going on and
198200
## Reporting an issue or a feature request
199201
Issues and feature requests related to this library are tracked in the Github issue tracker: https://github.com/eymengunay/php-passbook/issues
200202

203+
## Contributing
204+
205+
Contributions are welcome and will be fully credited. We accept contributions via Pull Requests here on GitHub.
206+
207+
Please note that this project adhered to [PSR-12 Extended Coding Style Guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md), so your changes need to:
208+
- Have PHPUnit-test coverage and tests must pass with all supported PHP versions
209+
- Pass PHPStan & PHP_CodeSniffer static analysis checks
210+
- Be documented in `README.md` for any change in behaviour
211+
201212
## Donating
202213

203-
If you want to support the project, please consider to donate a small amount using my [Gratipay](https://gratipay.com/eymengunay) or [Changetip](http://eymengunay.tip.me) page. Thank you for your support!
214+
If you want to support the project, please consider to donate a small amount using GitHub Sponsors button. Thank you for your support!
204215

205216
## See also
206217
[PassbookBundle](https://github.com/eymengunay/PassbookBundle): PHP-Passbook library integration for Symfony2

0 commit comments

Comments
 (0)