Skip to content

Commit 7a70b57

Browse files
authored
Merge pull request #813 from PHPOffice/develop
Release 1.1.0
2 parents 732d029 + 020a389 commit 7a70b57

File tree

269 files changed

+6833
-5078
lines changed

Some content is hidden

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

269 files changed

+6833
-5078
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
4+
5+
Fixes # (issue)
6+
7+
### Checklist:
8+
9+
- [ ] My CI is :green_circle:
10+
- [ ] I have covered by unit tests my new code (check build/coverage for coverage report)
11+
- [ ] I have updated the [documentation](https://github.com/PHPOffice/PHPPresentation/tree/develop/docs) to describe the changes
12+
- [ ] I have updated the [changelog](https://github.com/PHPOffice/PHPPresentation/blob/develop/docs/changes/1.1.0.md)

.github/workflows/deploy.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Setup PHP
2626
uses: shivammathur/setup-php@v2
2727
with:
28-
php-version: '7.4'
28+
php-version: '8.1'
2929
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv
3030
coverage: xdebug
3131
- name: Create directory public/coverage
@@ -39,7 +39,7 @@ jobs:
3939
- name: Build Coverage Report
4040
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit -c ./ --coverage-text --coverage-html ./public/coverage
4141
- name: Build Documentation
42-
run: ./phpDocumentor.phar -d ./src -t ./public/docs
42+
run: ./phpDocumentor.phar run -d ./src -t ./public/docs
4343

4444
### Deploy
4545
- name: Deploy

.github/workflows/php.yml

+10-5
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
strategy:
4848
fail-fast: false
4949
matrix:
50-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
50+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
5151
steps:
5252
- name: Setup PHP
5353
uses: shivammathur/setup-php@v2
@@ -63,26 +63,31 @@ jobs:
6363
run: ./vendor/bin/phpstan analyse -c phpstan.neon.dist
6464

6565
phpunit:
66-
name: PHPUnit
66+
name: PHPUnit ${{ matrix.php }}
6767
runs-on: ubuntu-latest
6868
strategy:
6969
fail-fast: false
7070
matrix:
71-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
71+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
7272
steps:
7373
- name: Setup PHP
7474
uses: shivammathur/setup-php@v2
7575
with:
7676
php-version: ${{ matrix.php }}
7777
extensions: gd, xml, zip
78-
coverage: xdebug
78+
coverage: ${{ (matrix.php == '7.3') && 'xdebug' || 'none' }}
7979

8080
- uses: actions/checkout@v2
8181

8282
- name: Composer Install
8383
run: composer install --ansi --prefer-dist --no-interaction --no-progress
8484

8585
- name: Run phpunit
86+
if: matrix.php != '7.3'
87+
run: ./vendor/bin/phpunit -c phpunit.xml.dist --no-coverage
88+
89+
- name: Run phpunit
90+
if: matrix.php == '7.3'
8691
run: ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-clover build/clover.xml
8792

8893
- name: Upload coverage results to Coveralls
@@ -100,7 +105,7 @@ jobs:
100105
strategy:
101106
fail-fast: false
102107
matrix:
103-
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
108+
php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
104109
steps:
105110
- name: Setup PHP
106111
uses: shivammathur/setup-php@v2

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Desktop.ini
99
### Continuous Integration
1010
build/
1111
phpunit.xml
12+
php-cs-fixer.phar
1213
.php-cs-fixer.cache
1314
.phpunit.result.cache
1415
composer.phar

.php-cs-fixer.dist.php

+205-26
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,215 @@
66
->setUsingCache(true)
77
->setRiskyAllowed(true)
88
->setRules([
9-
'@Symfony' => true,
9+
'align_multiline_comment' => true,
1010
'array_indentation' => true,
11-
'cast_spaces' => [
12-
'space' => 'single',
13-
],
11+
'array_syntax' => ['syntax' => 'short'],
12+
'backtick_to_shell_exec' => true,
13+
'binary_operator_spaces' => true,
14+
'blank_line_after_namespace' => true,
15+
'blank_line_after_opening_tag' => true,
16+
'blank_line_before_statement' => true,
17+
'braces' => true,
18+
'cast_spaces' => true,
19+
'class_attributes_separation' => ['elements' => ['method' => 'one', 'property' => 'one']], // const are often grouped with other related const
20+
'class_definition' => false,
21+
'class_keyword_remove' => false, // ::class keyword gives us better support in IDE
1422
'combine_consecutive_issets' => true,
15-
'concat_space' => [
16-
'spacing' => 'one',
17-
],
18-
'error_suppression' => [
19-
'mute_deprecation_error' => false,
20-
'noise_remaining_usages' => false,
21-
'noise_remaining_usages_exclude' => [],
22-
],
23-
'function_to_constant' => false,
23+
'combine_consecutive_unsets' => true,
24+
'combine_nested_dirname' => true,
25+
'comment_to_phpdoc' => false, // interferes with annotations
26+
'compact_nullable_typehint' => true,
27+
'concat_space' => ['spacing' => 'one'],
28+
'constant_case' => true,
29+
'date_time_immutable' => false, // Break our unit tests
30+
'declare_equal_normalize' => true,
31+
'declare_strict_types' => false, // Too early to adopt strict types
32+
'dir_constant' => true,
33+
'doctrine_annotation_array_assignment' => true,
34+
'doctrine_annotation_braces' => true,
35+
'doctrine_annotation_indentation' => true,
36+
'doctrine_annotation_spaces' => true,
37+
'elseif' => true,
38+
'encoding' => true,
39+
'ereg_to_preg' => true,
40+
'escape_implicit_backslashes' => true,
41+
'explicit_indirect_variable' => false, // I feel it makes the code actually harder to read
42+
'explicit_string_variable' => false, // I feel it makes the code actually harder to read
43+
'final_class' => false, // We need non-final classes
44+
'final_internal_class' => true,
45+
'final_public_method_for_abstract_class' => false, // We need non-final methods
46+
'fopen_flag_order' => true,
47+
'fopen_flags' => true,
48+
'full_opening_tag' => true,
49+
'fully_qualified_strict_types' => true,
50+
'function_declaration' => true,
51+
'function_to_constant' => true,
52+
'function_typehint_space' => true,
53+
'general_phpdoc_annotation_remove' => ['annotations' => ['access', 'category', 'copyright', 'throws']],
54+
'global_namespace_import' => true,
55+
'header_comment' => false, // We don't use common header in all our files
56+
'heredoc_indentation' => false, // Requires PHP >= 7.3
57+
'heredoc_to_nowdoc' => false, // Not sure about this one
58+
'implode_call' => true,
59+
'include' => true,
60+
'increment_style' => true,
61+
'indentation_type' => true,
62+
'is_null' => true,
63+
'line_ending' => true,
64+
'linebreak_after_opening_tag' => true,
65+
'list_syntax' => ['syntax' => 'short'],
66+
'logical_operators' => true,
67+
'lowercase_cast' => true,
68+
'lowercase_keywords' => true,
69+
'lowercase_static_reference' => true,
70+
'magic_constant_casing' => true,
71+
'magic_method_casing' => true,
72+
'mb_str_functions' => false, // No, too dangerous to change that
73+
'method_argument_space' => true,
2474
'method_chaining_indentation' => true,
25-
'no_alias_functions' => false,
26-
'no_superfluous_phpdoc_tags' => false,
27-
'non_printable_character' => [
28-
'use_escape_sequences_in_strings' => true,
29-
],
30-
'phpdoc_align' => [
31-
'align' => 'left',
32-
],
33-
'phpdoc_summary' => false,
34-
'protected_to_private' => false,
35-
'self_accessor' => false,
75+
'modernize_types_casting' => true,
76+
'multiline_comment_opening_closing' => true,
77+
'multiline_whitespace_before_semicolons' => true,
78+
'native_constant_invocation' => false, // Micro optimization that look messy
79+
'native_function_casing' => true,
80+
'native_function_invocation' => false, // I suppose this would be best, but I am still unconvinced about the visual aspect of it
81+
'native_function_type_declaration_casing' => true,
82+
'new_with_braces' => true,
83+
'no_alias_functions' => true,
84+
'no_alternative_syntax' => true,
85+
'no_binary_string' => true,
86+
'no_blank_lines_after_class_opening' => true,
87+
'no_blank_lines_after_phpdoc' => true,
88+
'no_blank_lines_before_namespace' => false, // we want 1 blank line before namespace
89+
'no_break_comment' => true,
90+
'no_closing_tag' => true,
91+
'no_empty_comment' => true,
92+
'no_empty_phpdoc' => true,
93+
'no_empty_statement' => true,
94+
'no_extra_blank_lines' => true,
95+
'no_homoglyph_names' => true,
96+
'no_leading_import_slash' => true,
97+
'no_leading_namespace_whitespace' => true,
98+
'no_mixed_echo_print' => true,
99+
'no_multiline_whitespace_around_double_arrow' => true,
100+
'no_null_property_initialization' => true,
101+
'no_php4_constructor' => true,
102+
'no_short_bool_cast' => true,
103+
'echo_tag_syntax' => ['format' => 'long'],
104+
'no_singleline_whitespace_before_semicolons' => true,
105+
'no_spaces_after_function_name' => true,
106+
'no_spaces_around_offset' => true,
107+
'no_spaces_inside_parenthesis' => true,
108+
'no_superfluous_elseif' => false, // Might be risky on a huge code base
109+
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
110+
'no_trailing_comma_in_list_call' => true,
111+
'no_trailing_comma_in_singleline_array' => true,
112+
'no_trailing_whitespace' => true,
113+
'no_trailing_whitespace_in_comment' => true,
114+
'no_unneeded_control_parentheses' => true,
115+
'no_unneeded_curly_braces' => true,
116+
'no_unneeded_final_method' => true,
117+
'no_unreachable_default_argument_value' => true,
118+
'no_unset_cast' => true,
119+
'no_unset_on_property' => true,
120+
'no_unused_imports' => true,
121+
'no_useless_else' => true,
122+
'no_useless_return' => true,
123+
'no_whitespace_before_comma_in_array' => true,
124+
'no_whitespace_in_blank_line' => true,
125+
'non_printable_character' => true,
126+
'normalize_index_brace' => true,
127+
'not_operator_with_space' => false, // No we prefer to keep '!' without spaces
128+
'not_operator_with_successor_space' => false, // idem
129+
'nullable_type_declaration_for_default_null_value' => true,
130+
'object_operator_without_whitespace' => true,
131+
'ordered_class_elements' => false, // We prefer to keep some freedom
132+
'ordered_imports' => true,
133+
'ordered_interfaces' => true,
134+
'php_unit_construct' => true,
135+
'php_unit_dedicate_assert' => true,
136+
'php_unit_dedicate_assert_internal_type' => true,
137+
'php_unit_expectation' => true,
138+
'php_unit_fqcn_annotation' => true,
139+
'php_unit_internal_class' => false, // Because tests are excluded from package
140+
'php_unit_method_casing' => true,
141+
'php_unit_mock' => true,
142+
'php_unit_mock_short_will_return' => true,
143+
'php_unit_namespaced' => true,
144+
'php_unit_no_expectation_annotation' => true,
145+
'phpdoc_order_by_value' => ['annotations' => ['covers']],
146+
'php_unit_set_up_tear_down_visibility' => true,
147+
'php_unit_size_class' => false, // That seems extra work to maintain for little benefits
148+
'php_unit_strict' => false, // We sometime actually need assertEquals
149+
'php_unit_test_annotation' => true,
150+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
151+
'php_unit_test_class_requires_covers' => false, // We don't care as much as we should about coverage
152+
'phpdoc_add_missing_param_annotation' => false, // Don't add things that bring no value
153+
'phpdoc_align' => false, // Waste of time
154+
'phpdoc_annotation_without_dot' => true,
155+
'phpdoc_indent' => true,
156+
//'phpdoc_inline_tag' => true,
157+
'phpdoc_line_span' => false, // Unfortunately our old comments turn even uglier with this
158+
'phpdoc_no_access' => true,
159+
'phpdoc_no_alias_tag' => true,
160+
'phpdoc_no_empty_return' => true,
161+
'phpdoc_no_package' => true,
162+
'phpdoc_no_useless_inheritdoc' => true,
163+
'phpdoc_order' => true,
164+
'phpdoc_return_self_reference' => true,
165+
'phpdoc_scalar' => true,
166+
'phpdoc_separation' => true,
167+
'phpdoc_single_line_var_spacing' => true,
168+
'phpdoc_summary' => true,
169+
'phpdoc_to_comment' => false, // interferes with annotations
170+
'phpdoc_to_param_type' => false, // Because experimental, but interesting for one shot use
171+
'phpdoc_to_return_type' => false, // idem
172+
'phpdoc_trim' => true,
173+
'phpdoc_trim_consecutive_blank_line_separation' => true,
174+
'phpdoc_types' => true,
175+
'phpdoc_types_order' => true,
176+
'phpdoc_var_annotation_correct_order' => true,
177+
'phpdoc_var_without_name' => true,
178+
'pow_to_exponentiation' => true,
179+
'protected_to_private' => true,
180+
'psr_autoloading' => true,
181+
'random_api_migration' => true,
182+
'return_assignment' => false, // Sometimes useful for clarity or debug
183+
'return_type_declaration' => true,
184+
'self_accessor' => true,
185+
'self_static_accessor' => true,
186+
'semicolon_after_instruction' => false, // Buggy in `samples/index.php`
187+
'set_type_to_cast' => true,
188+
'short_scalar_cast' => true,
189+
'simple_to_complex_string_variable' => false, // Would differ from TypeScript without obvious advantages
190+
'simplified_null_return' => false, // Even if technically correct we prefer to be explicit
191+
'single_blank_line_at_eof' => true,
192+
'single_blank_line_before_namespace' => true,
193+
'single_class_element_per_statement' => true,
194+
'single_import_per_statement' => true,
195+
'single_line_after_imports' => true,
196+
'single_line_comment_style' => true,
197+
'single_line_throw' => false, // I don't see any reason for having a special case for Exception
198+
'single_quote' => true,
199+
'single_trait_insert_per_statement' => true,
200+
'space_after_semicolon' => true,
201+
'standardize_increment' => true,
202+
'standardize_not_equals' => true,
203+
'static_lambda' => false, // Risky if we can't guarantee nobody use `bindTo()`
204+
'strict_comparison' => false, // No, too dangerous to change that
205+
'strict_param' => false, // No, too dangerous to change that
206+
'string_line_ending' => true,
207+
'switch_case_semicolon_to_colon' => true,
208+
'switch_case_space' => true,
209+
'ternary_operator_spaces' => true,
210+
'ternary_to_null_coalescing' => true,
211+
'trailing_comma_in_multiline' => true,
212+
'trim_array_spaces' => true,
213+
'unary_operator_spaces' => true,
214+
'visibility_required' => ['elements' => ['property', 'method']], // not const
215+
'void_return' => true,
216+
'whitespace_after_comma_in_array' => true,
36217
'yoda_style' => false,
37-
'single_line_throw' => false,
38-
'no_alias_language_construct_call' => false,
39218
])
40219
->getFinder()
41220
->in(__DIR__)

composer.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"require-dev": {
2929
"phpunit/phpunit": ">=7.0",
3030
"phpmd/phpmd": "2.*",
31-
"phpstan/phpstan": "^0.12.88"
31+
"phpstan/phpstan": "^0.12.88 || ^1.0.0"
3232
},
3333
"suggest": {
3434
"ext-gd": "Required to add images"
@@ -61,7 +61,9 @@
6161
"php samples/Sample_17_Comment.php",
6262
"php samples/Sample_18_Animation.php",
6363
"php samples/Sample_19_SlideMaster.php",
64-
"php samples/Sample_20_ExternalSlide.php"
64+
"php samples/Sample_20_SlideLayout.php",
65+
"php samples/Sample_21_AutoShape.php",
66+
"php samples/Sample_22_ExternalSlide.php"
6567
]
6668
}
6769
}

docs/changes/1.0.0.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# 1.0.0 - WIP
1+
# 1.0.0
22

33
## Bugfix
4-
- PowerPoint2007 Writer : Text is subscripted when set superscript to false - [[@qmachard]](https://github.com/qmachard])(https://github.com/qmachard) GH-360
5-
- Core : Defining width & height of a shape don't return any error if width & height were equal to 0 - [[@surger]](https://github.com/surger])(https://github.com/surger) GH-555
6-
- ODPresentation Writer : Display axis title depending the visibility - [[@Progi1984]](https://github.com/Progi1984])(https://github.com/Progi1984) GH-410
4+
- PowerPoint2007 Writer : Text is subscripted when set superscript to false - [@qmachard](https://github.com/qmachard) GH-360
5+
- Core : Defining width & height of a shape don't return any error if width & height were equal to 0 - [@surger](https://github.com/surger) GH-555
6+
- ODPresentation Writer : Display axis title depending the visibility - [@Progi1984](https://github.com/Progi1984) GH-410
77

88
## Changes
99
- Dropped support for HHVM - [@sunspikes](https://github.com/sunspikes) GH-556

0 commit comments

Comments
 (0)