-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from artemeon/feat/#23382-rector
#23382 feat(*): run rector over source
- Loading branch information
Showing
27 changed files
with
820 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Pest | ||
|
||
on: | ||
- pull_request | ||
|
||
jobs: | ||
type-coverage: | ||
name: Type-Coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.4 | ||
coverage: xdebug | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Composer install | ||
run: composer install --no-interaction --no-ansi --no-progress | ||
- name: Run Type-Coverage | ||
run: composer test:type-coverage | ||
unit-tests: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.4 | ||
coverage: xdebug | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Composer install | ||
run: composer install --no-interaction --no-ansi --no-progress | ||
- name: Run Tests | ||
run: composer test:coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: PHPStan | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 1.x | ||
jobs: | ||
phpstan: | ||
uses: artemeon/.shared/.github/workflows/phpstan-php84-upwards.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Pint | ||
|
||
on: | ||
- pull_request | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pint: | ||
name: Pint (PHP-CS-Fixer) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.4 | ||
coverage: none | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Composer install | ||
run: composer install --no-interaction --no-ansi --no-progress | ||
- name: Run Pint | ||
run: ./vendor/bin/pint --test -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/.idea/ | ||
/vendor/ | ||
composer.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Stream-Context | ||
|
||
## 0.1.1 | ||
- The enforcement of valid file extensions has been deactivated for file URLs without an explicit file extension such as ‘http://example.com/fetch_some_stream’. | ||
|
||
## 0.1.0 | ||
- Initial release | ||
|
||
## 0.1.1 | ||
- The enforcement of valid file extensions has been deactivated for file URLs without an explicit file extension such as ‘http://example.com/fetch_some_stream’. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
includes: | ||
- phar://phpstan.phar/conf/bleedingEdge.neon | ||
|
||
parameters: | ||
level: 10 | ||
paths: | ||
- src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory suffix="Test.php">./tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<source> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{ | ||
"preset": "psr12", | ||
"rules": { | ||
"align_multiline_comment": true, | ||
"array_indentation": true, | ||
"array_push": true, | ||
"array_syntax": { | ||
"syntax": "short" | ||
}, | ||
"assign_null_coalescing_to_coalesce_equal": true, | ||
"binary_operator_spaces": true, | ||
"blank_line_before_statement": true, | ||
"cast_spaces": true, | ||
"clean_namespace": true, | ||
"combine_consecutive_issets": true, | ||
"combine_consecutive_unsets": true, | ||
"compact_nullable_typehint": true, | ||
"concat_space": { | ||
"spacing": "one" | ||
}, | ||
"fully_qualified_strict_types": true, | ||
"function_to_constant": true, | ||
"general_phpdoc_annotation_remove": { | ||
"annotations": [ | ||
"since" | ||
], | ||
"case_sensitive": false | ||
}, | ||
"get_class_to_class_keyword": true, | ||
"is_null": true, | ||
"lambda_not_used_import": true, | ||
"logical_operators": true, | ||
"method_chaining_indentation": true, | ||
"modernize_types_casting": true, | ||
"multiline_whitespace_before_semicolons": true, | ||
"no_empty_comment": true, | ||
"no_empty_phpdoc": true, | ||
"no_empty_statement": true, | ||
"no_extra_blank_lines": { | ||
"tokens": [ | ||
"attribute", | ||
"break", | ||
"case", | ||
"continue", | ||
"curly_brace_block", | ||
"default", | ||
"extra", | ||
"parenthesis_brace_block", | ||
"return", | ||
"square_brace_block", | ||
"switch", | ||
"throw", | ||
"use", | ||
"use_trait" | ||
] | ||
}, | ||
"no_multiline_whitespace_around_double_arrow": true, | ||
"no_short_bool_cast": true, | ||
"no_singleline_whitespace_before_semicolons": true, | ||
"no_superfluous_elseif": false, | ||
"no_superfluous_phpdoc_tags": true, | ||
"no_trailing_comma_in_singleline": true, | ||
"no_unneeded_control_parentheses": true, | ||
"no_useless_concat_operator": true, | ||
"no_useless_else": true, | ||
"no_useless_nullsafe_operator": true, | ||
"no_useless_return": true, | ||
"no_whitespace_before_comma_in_array": true, | ||
"nullable_type_declaration": true, | ||
"object_operator_without_whitespace": true, | ||
"ordered_imports": { | ||
"imports_order": [ | ||
"class", | ||
"function", | ||
"const" | ||
], | ||
"sort_algorithm": "alpha" | ||
}, | ||
"ordered_interfaces": true, | ||
"ordered_types": { | ||
"null_adjustment": "always_last" | ||
}, | ||
"phpdoc_align": { | ||
"align": "left" | ||
}, | ||
"phpdoc_indent": true, | ||
"phpdoc_no_useless_inheritdoc": true, | ||
"phpdoc_order": true, | ||
"phpdoc_scalar": true, | ||
"phpdoc_single_line_var_spacing": true, | ||
"phpdoc_summary": true, | ||
"phpdoc_tag_casing": true, | ||
"phpdoc_trim": true, | ||
"phpdoc_trim_consecutive_blank_line_separation": true, | ||
"phpdoc_var_without_name": true, | ||
"php_unit_construct": true, | ||
"php_unit_dedicate_assert": true, | ||
"php_unit_dedicate_assert_internal_type": true, | ||
"php_unit_internal_class": true, | ||
"php_unit_method_casing": true, | ||
"return_assignment": true, | ||
"return_type_declaration": true, | ||
"short_scalar_cast": true, | ||
"single_line_comment_spacing": true, | ||
"single_line_comment_style": true, | ||
"single_quote": true, | ||
"single_space_around_construct": true, | ||
"ternary_to_null_coalescing": true, | ||
"trailing_comma_in_multiline": { | ||
"elements": [ | ||
"arguments", | ||
"arrays", | ||
"match", | ||
"parameters" | ||
] | ||
}, | ||
"trim_array_spaces": true, | ||
"type_declaration_spaces": true, | ||
"types_spaces": { | ||
"space": "single" | ||
}, | ||
"use_arrow_functions": false, | ||
"void_return": true, | ||
"whitespace_after_comma_in_array": { | ||
"ensure_single_space": true | ||
}, | ||
"yoda_style": { | ||
"equal": false, | ||
"identical": false, | ||
"less_and_greater": false, | ||
"always_move_variable": false | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\Config\RectorConfig; | ||
|
||
return RectorConfig::configure() | ||
->withPhpSets() | ||
->withRules([ | ||
Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, | ||
Rector\CodeQuality\Rector\NullsafeMethodCall\CleanupUnneededNullsafeOperatorRector::class, | ||
Rector\CodeQuality\Rector\ClassMethod\InlineArrayReturnAssignRector::class, | ||
Rector\CodeQuality\Rector\Ternary\UnnecessaryTernaryExpressionRector::class, | ||
Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictFluentReturnRector::class, | ||
Rector\Php80\Rector\Class_\StringableForToStringRector::class, | ||
Rector\CodingStyle\Rector\ArrowFunction\StaticArrowFunctionRector::class, | ||
Rector\CodingStyle\Rector\Closure\StaticClosureRector::class, | ||
Rector\DeadCode\Rector\Node\RemoveNonExistingVarAnnotationRector::class, | ||
Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictScalarReturnsRector::class, | ||
Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector::class, | ||
Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class, | ||
Rector\CodeQuality\Rector\Foreach_\ForeachItemsAssignToEmptyArrayToAssignRector::class, | ||
Rector\CodeQuality\Rector\Foreach_\ForeachToInArrayRector::class, | ||
Rector\CodeQuality\Rector\BooleanAnd\RemoveUselessIsObjectCheckRector::class, | ||
]) | ||
->withPaths([ | ||
__DIR__ . '/src', | ||
]) | ||
->withTypeCoverageLevel(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Artemeon\StreamContext\Context; | ||
|
||
enum HttpMethod: string | ||
{ | ||
case GET = 'GET'; | ||
case POST = 'POST'; | ||
case PUT = 'PUT'; | ||
} |
Oops, something went wrong.