Skip to content

Commit 1c68205

Browse files
authored
Merge pull request #2 from HanashiDev/next
1.2.0
2 parents 2795d2e + fcbcb81 commit 1c68205

11 files changed

Lines changed: 286 additions & 52 deletions

File tree

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions"
9+
directory: "/"
10+
schedule:
11+
interval: "daily"
12+
target-branch: "main"
13+
reviewers:
14+
- "Hanashi"

.github/php-syntax.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "php -l",
5+
"pattern": [
6+
{
7+
"regexp": "^\\s*(PHP\\s+)?([a-zA-Z\\s]+):\\s+(.*)\\s+in\\s+(\\S+)\\s+on\\s+line\\s+(\\d+)$",
8+
"file": 4,
9+
"line": 5,
10+
"message": 3
11+
}
12+
]
13+
}
14+
]
15+
}

.github/workflows/codestyle.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ on:
44
push:
55

66
jobs:
7-
phpcs:
8-
name: PHPCS
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/checkout@v2
12-
- name: PHPCS check
13-
uses: chekalsky/phpcs-action@v1
7+
php:
8+
name: PHP
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Setup PHP with tools
13+
uses: shivammathur/setup-php@v2
14+
with:
15+
php-version: '8.0'
16+
extensions: ctype, dom, exif, gd, gmp, hash, intl, json, libxml, mbstring, opcache, pcre, pdo, pdo_mysql, zlib
17+
tools: cs2pr, phpcs, php-cs-fixer
18+
- name: phpcs
19+
run: phpcs -n -q --report=checkstyle | cs2pr
20+
- name: php-cs-fixer
21+
run: php-cs-fixer fix --dry-run --diff

.github/workflows/php.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: PHP
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
syntax:
9+
name: "Check Syntax (${{ matrix.php }})"
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php:
15+
- '8.1'
16+
- '8.2'
17+
steps:
18+
- name: Set up PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: ${{ matrix.php }}
22+
- uses: actions/checkout@v3
23+
- run: echo "::add-matcher::.github/php-syntax.json"
24+
- run: |
25+
! find . -type f -name '*.php' -exec php -l '{}' \; 2>&1 |grep -v '^No syntax errors detected'

.github/workflows/release.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['*']
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- uses: actions/checkout@v2.4.2
16+
17+
- uses: actions/setup-node@v3.5.0
18+
with:
19+
node-version: 16
20+
21+
- name: Create package
22+
run: |
23+
rm -rf *.tar.gz
24+
npx --yes wspackager@latest
25+
26+
- name: Check file existence
27+
id: check_files
28+
uses: andstor/file-existence-action@v1.1.0
29+
with:
30+
files: "*.tar.gz"
31+
32+
- name: On Build Failure
33+
if: steps.check_files.outputs.files_exists == 'false'
34+
run: |
35+
echo "Packaging FAILED" && exit 1
36+
37+
- name: Release
38+
uses: softprops/action-gh-release@v0.1.14
39+
if: startsWith(github.ref, 'refs/tags/') && steps.check_files.outputs.files_exists == 'true'
40+
with:
41+
files: "*.tar.gz"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
*.tar
2-
*.tar.gz
2+
*.tar.gz
3+
*.cache
4+
.phpcs-cache

.php-cs-fixer.dist.php

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
$finder = PhpCsFixer\Finder::create()
3+
->in(__DIR__.'/files/')
4+
->notPath('lib/system/api');
5+
6+
return (new PhpCsFixer\Config())
7+
->setRiskyAllowed(true)
8+
->setRules([
9+
'@PSR1' => true,
10+
'@PSR2' => true,
11+
12+
'array_push' => true,
13+
'backtick_to_shell_exec' => true,
14+
'no_alias_language_construct_call' => true,
15+
'no_mixed_echo_print' => true,
16+
'pow_to_exponentiation' => true,
17+
'random_api_migration' => true,
18+
19+
'array_syntax' => ['syntax' => 'short'],
20+
'no_multiline_whitespace_around_double_arrow' => true,
21+
'no_trailing_comma_in_singleline_array' => true,
22+
'no_whitespace_before_comma_in_array' => true,
23+
'normalize_index_brace' => true,
24+
'whitespace_after_comma_in_array' => true,
25+
26+
'non_printable_character' => ['use_escape_sequences_in_strings' => true],
27+
28+
'lowercase_static_reference' => true,
29+
'magic_constant_casing' => true,
30+
'magic_method_casing' => true,
31+
'native_function_casing' => true,
32+
'native_function_type_declaration_casing' => true,
33+
34+
'cast_spaces' => ['space' => 'none'],
35+
'lowercase_cast' => true,
36+
'no_unset_cast' => true,
37+
'short_scalar_cast' => true,
38+
39+
'class_attributes_separation' => true,
40+
'no_blank_lines_after_class_opening' => true,
41+
'no_null_property_initialization' => true,
42+
'self_accessor' => true,
43+
'single_class_element_per_statement' => true,
44+
'single_trait_insert_per_statement' => true,
45+
46+
'no_empty_comment' => true,
47+
'single_line_comment_style' => ['comment_types' => ['hash']],
48+
49+
'native_constant_invocation' => ['strict' => false],
50+
51+
'no_alternative_syntax' => true,
52+
'no_trailing_comma_in_list_call' => true,
53+
'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield', 'yield_from']],
54+
'no_unneeded_curly_braces' => ['namespaces' => true],
55+
'switch_continue_to_break' => true,
56+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
57+
58+
'function_typehint_space' => true,
59+
'lambda_not_used_import' => true,
60+
'native_function_invocation' => ['include' => ['@internal']],
61+
'no_unreachable_default_argument_value' => true,
62+
'nullable_type_declaration_for_default_null_value' => true,
63+
'return_type_declaration' => true,
64+
'static_lambda' => true,
65+
66+
'fully_qualified_strict_types' => true,
67+
'no_leading_import_slash' => true,
68+
'no_unused_imports' => true,
69+
'ordered_imports' => true,
70+
71+
'declare_equal_normalize' => true,
72+
'dir_constant' => true,
73+
'explicit_indirect_variable' => true,
74+
'function_to_constant' => true,
75+
'is_null' => true,
76+
'no_unset_on_property' => true,
77+
78+
'list_syntax' => ['syntax' => 'short'],
79+
80+
'clean_namespace' => true,
81+
'no_leading_namespace_whitespace' => true,
82+
'single_blank_line_before_namespace' => true,
83+
84+
'no_homoglyph_names' => true,
85+
86+
'binary_operator_spaces' => true,
87+
'concat_space' => ['spacing' => 'one'],
88+
'increment_style' => ['style' => 'post'],
89+
'logical_operators' => true,
90+
'object_operator_without_whitespace' => true,
91+
'operator_linebreak' => true,
92+
'standardize_increment' => true,
93+
'standardize_not_equals' => true,
94+
'ternary_operator_spaces' => true,
95+
'ternary_to_elvis_operator' => true,
96+
'ternary_to_null_coalescing' => true,
97+
'unary_operator_spaces' => true,
98+
99+
'no_useless_return' => true,
100+
'return_assignment' => true,
101+
102+
'multiline_whitespace_before_semicolons' => true,
103+
'no_empty_statement' => true,
104+
'no_singleline_whitespace_before_semicolons' => true,
105+
'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
106+
107+
'escape_implicit_backslashes' => true,
108+
'explicit_string_variable' => true,
109+
'heredoc_to_nowdoc' => true,
110+
'no_binary_string' => true,
111+
'simple_to_complex_string_variable' => true,
112+
113+
'array_indentation' => true,
114+
'blank_line_before_statement' => ['statements' => ['return', 'exit']],
115+
'compact_nullable_typehint' => true,
116+
'method_chaining_indentation' => true,
117+
'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']],
118+
'no_spaces_around_offset' => true,
119+
120+
'global_namespace_import' => [
121+
'import_classes' => true,
122+
'import_constants' => false,
123+
'import_functions' => false,
124+
],
125+
'ordered_imports' => [
126+
'imports_order' => ['class', 'function', 'const'],
127+
],
128+
])
129+
->setFinder($finder);

.php_cs.dist

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

.phpcs.xml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
2+
<ruleset>
33
<arg name="basepath" value="."/>
44
<arg name="cache" value=".phpcs-cache"/>
55
<arg name="colors"/>
@@ -15,12 +15,4 @@
1515

1616
<!-- Include all rules from the Zend Coding Standard -->
1717
<rule ref="PSR12"/>
18-
19-
<!-- TODO: auskommentieren -->
20-
<rule ref="Generic.Files.LineLength">
21-
<properties>
22-
<property name="lineLimit" value="N"/>
23-
<property name="absoluteLineLimit" value="M"/>
24-
</properties>
25-
</rule>
2618
</ruleset>

files/lib/system/exception/SteamException.class.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace wcf\system\exception;
44

5+
use Exception;
6+
57
/**
68
* Steam exception
79
*
@@ -10,6 +12,6 @@
1012
* @license Freie Lizenz (https://hanashi.eu/freie-lizenz/)
1113
* @package WoltLabSuite\Core\System\Exception
1214
*/
13-
class SteamException extends \Exception
15+
class SteamException extends Exception
1416
{
1517
}

0 commit comments

Comments
 (0)