Skip to content

Commit 0cce8cf

Browse files
committed
Fixed CI
1 parent 1d5b988 commit 0cce8cf

File tree

246 files changed

+3729
-4244
lines changed

Some content is hidden

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

246 files changed

+3729
-4244
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
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

.php-cs-fixer.dist.php

Lines changed: 205 additions & 26 deletions
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__)

docs/changes/1.1.0.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# 1.0.0 - WIP
1+
# 1.1.0 - WIP
22

33
## Features
44

5-
- Support for axis options - [@mindline](https://github.com/mindline-analytics) GH-676
5+
- Support for axis options - [@mindline](https://github.com/mindline-analytics) in [#676](https://github.com/PHPOffice/PHPPresentatio /pull/676)
66
- Axis intersection point (axis crossing) through `setCrossesAt`/ `getCrossesAt`
77
- Reverse axis order through `setIsReversedOrder`/ `isReversedOrder`
88
- PowerPoint2007 Writer
9-
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) GH-682
9+
- Support for Hyperlink Text Color - [@MartynasJanu](https://github.com/MartynasJanu) & [@Progi1984](https://github.com/Progi1984) in [#682](https://github.com/PHPOffice/PHPPresentatio /pull/682)
1010
- PowerPoint2007 Reader
1111
- PowerPoint2007 Writer
12+
13+
## Bugfixes
14+
15+
- Fixed CI - [@Progi1984](https://github.com/Progi1984) in [#766](https://github.com/PHPOffice/PHPPresentatio /pull/766)

phpunit.xml.dist

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
1-
<phpunit backupGlobals="false"
2-
backupStaticAttributes="false"
3-
bootstrap="./tests/bootstrap.php"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
processIsolation="false"
9-
stopOnFailure="false">
10-
<testsuites>
11-
<testsuite name="PHPPresentation Test Suite">
12-
<directory>./tests/PhpPresentation</directory>
13-
</testsuite>
14-
</testsuites>
15-
<filter>
16-
<whitelist>
17-
<directory suffix=".php">./src</directory>
18-
</whitelist>
19-
</filter>
20-
<logging>
21-
<log type="coverage-html" target="./build/coverage" />
22-
<log type="coverage-clover" target="./build/logs/clover.xml" />
23-
</logging>
24-
</phpunit>
1+
<?xml version="1.0"?>
2+
<phpunit
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
6+
bootstrap="./tests/bootstrap.php"
7+
colors="true"
8+
convertErrorsToExceptions="true"
9+
convertNoticesToExceptions="true"
10+
convertWarningsToExceptions="true"
11+
convertDeprecationsToExceptions="false"
12+
processIsolation="false"
13+
stopOnFailure="false"
14+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
15+
<coverage>
16+
<include>
17+
<directory suffix=".php">./src</directory>
18+
</include>
19+
<report>
20+
<clover outputFile="./build/logs/clover.xml"/>
21+
<html outputDirectory="./build/coverage"/>
22+
</report>
23+
</coverage>
24+
<php>
25+
<ini name="error_reporting" value="E_ALL"/>
26+
</php>
27+
<testsuites>
28+
<testsuite name="PhpWord Test Suite">
29+
<directory>./tests/PhpPresentation/Tests</directory>
30+
</testsuite>
31+
</testsuites>
32+
<logging/>
33+
</phpunit>

samples/Sample_03_Image.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
// Generate an image
1919
echo date('H:i:s') . ' Generate an image' . EOL;
20-
$gdImage = @imagecreatetruecolor(140, 20) or exit('Cannot Initialize new GD image stream');
20+
$gdImage = imagecreatetruecolor(140, 20);
2121
$textColor = imagecolorallocate($gdImage, 255, 255, 255);
2222
imagestring($gdImage, 1, 5, 5, 'Created with PHPPresentation', $textColor);
2323

0 commit comments

Comments
 (0)