Skip to content

Commit

Permalink
CS fixes, some refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed Jan 18, 2024
1 parent f871867 commit 3e5cc42
Show file tree
Hide file tree
Showing 10 changed files with 262 additions and 234 deletions.
20 changes: 11 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
* text eol=lf

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/composer.lock export-ignore
/mkdocs.yml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/composer.lock export-ignore
/mkdocs.yml export-ignore
/phpstan.neon export-ignore
/phpunit.xml export-ignore
/rector.php export-ignore
/.php-cs-fixer.dist.php export-ignore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ build/
dochtml/
composer.phar
.phpunit.result.cache
.php-cs-fixer.cache
*.iws
out/
.idea_modules/
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"php":"8.3.0","version":"3.45.1-DEV:dev-master#f1500e460413475949e2e8f6389be90454b4dc65","indent":" ","lineEnding":"\n","rules":{"cast_spaces":true,"concat_space":{"spacing":"one"},"function_declaration":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"single_line_empty_body":true,"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"}},"hashes":{"src\\Exception\\RateLimitExceededException.php":"e6495d0f8b47e12fa0686b5a0b61efbe","src\\LibrariesIO.php":"c7c659a157c46e5b3e9eadf49c2b860a","tests\\src\\LibrariesIOTest.php":"c506921621966dc82be76901d58ab37d"}}
{"php":"8.3.1","version":"3.46.1-DEV:dev-master#04e351301e5a406b8a2732b9f6d98632abfe2067","indent":" ","lineEnding":"\n","rules":{"cast_spaces":true,"concat_space":{"spacing":"one"},"function_declaration":true,"method_argument_space":{"attribute_placement":"ignore","on_multiline":"ensure_fully_multiline"},"single_line_empty_body":true,"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"}},"hashes":{"src\\Client.php":"e2ca4deb9c509326923622a980908d22","src\\Exception\\RateLimitExceededException.php":"368fd10d62d923bd1960df37a86d781c","src\\LibrariesIO.php":"a2cf6dd9f95ea205b732f7d4083ea04b","src\\LibrariesIONew.php":"48352c2b95088f9873627e1977425aaf","tests\\src\\LibrariesIOTest.php":"8e54eda8308bcd75fe4c283cd303f420"}}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ you can use the following url: https://github.com/ericsizemore/librariesio/compa

Simply replace the version numbers depending on which set of changes you wish to see.

### 1.1.1 ()

* Added Rector and PHP-CS-Fixer to dev dependencies
* Updated/refactored some code to reduce duplicate checks/etc. throughout
*

### 1.1.0 (2023-12-29)

* Added `subscription()` to handle adding, updating, checking and removing a subscription to a project.
Expand Down
9 changes: 6 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"phpstan/phpstan": "^1.11 <2.0",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^10.5"
"phpunit/phpunit": "^10.5",
"rector/rector": "dev-main"
},
"minimum-stability": "dev",
"autoload": {
Expand All @@ -55,8 +56,10 @@
},
"scripts": {
"phpcs-fix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
"phpcs-nofix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run",
"phpcs-nofix": "vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --dry-run --diff",
"phpstan": "vendor/bin/phpstan analyse -c phpstan.neon",
"test": "vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --coverage-html=build/logs/coverage --display-deprecations --display-warnings --globals-backup"
"rector-dry": "vendor/bin/rector process --dry-run",
"rector": "php vendor/bin/rector process",
"test": "phpunit"
}
}
127 changes: 93 additions & 34 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="true"
executionOrder="random"
resolveDependencies="true"
bootstrap="vendor/autoload.php"
cacheDirectory="build/phpunit/cache"
beStrictAboutOutputDuringTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
colors="true"
>
<testsuite name="Test Suite">
<directory suffix="Test.php">tests</directory>
Expand All @@ -11,4 +21,11 @@
<directory>src</directory>
</include>
</source>
<coverage pathCoverage="false"
cacheDirectory="build/phpunit/cache">
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/logs/coverage" lowUpperBound="50" highLowerBound="90"/>
</report>
</coverage>
</phpunit>
Loading

0 comments on commit 3e5cc42

Please sign in to comment.