Skip to content

Commit

Permalink
refactor: Apply Coding Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanowak committed Dec 19, 2024
1 parent fb59896 commit 017ef21
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 104 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ updates:
- package-ecosystem: composer
directory: /
schedule:
interval: daily
interval: daily
16 changes: 4 additions & 12 deletions .github/workflows/apply-coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: 'Setup PHP'
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
php-version-file: '.phprc'
tools: composer

- name: 'Get Composer Cache Directory'
Expand Down Expand Up @@ -65,19 +65,11 @@ jobs:
run: composer test:functional

- name: 'Create pull-request'
id: cpr
uses: peter-evans/create-pull-request@v7.0.3
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "[automated] Apply Coding Standard"
base: 'main'
commit-message: 'refactor: Apply Coding Standard'
branch: 'automated-apply-coding-standards'
title: '[automated] Apply Coding Standard'
labels: 'automated'
delete-branch: true

- name: 'Enable Pull Request Merge when ready'
if: steps.cpr.outputs.pull-request-operation == 'created'
run: gh pr merge --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ 8.3, 8.4 ]
php: [8.3, 8.4]

steps:
- name: 'Checkout code'
Expand Down
1 change: 1 addition & 0 deletions .phprc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.3
26 changes: 13 additions & 13 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"arrowParens": "avoid",
"quoteProps": "consistent",
"printWidth": 180,
"singleQuote": true,
"overrides": [
{
"files": ["*.php"],
"options": {
"printWidth": 115,
"plugins": ["@prettier/plugin-php"]
}
}
]
"arrowParens": "avoid",
"quoteProps": "consistent",
"printWidth": 180,
"singleQuote": true,
"overrides": [
{
"files": ["*.php"],
"options": {
"printWidth": 115,
"plugins": ["@prettier/plugin-php"]
}
}
]
}
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@
# Installation

Via composer :

```shell script
composer require netlogix/nxsimplecdn
```

That's all !

# Add cdn domain to your site configuration

```yaml
base: 'https://www.example.com/'
cdnBase: 'https://cdn.example.com/'
errorHandling:
...
languages:
...
settings:
...
errorHandling: ...
languages: ...
settings: ...
```
108 changes: 54 additions & 54 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
{
"name": "netlogix/nxsimplecdn",
"description": "Simple cdn extension for TYPO3",
"license": "MIT",
"type": "typo3-cms-extension",
"require": {
"typo3/cms-core": "^13.4"
},
"require-dev": {
"ext-sqlite3": "*",
"name": "netlogix/nxsimplecdn",
"description": "Simple cdn extension for TYPO3",
"license": "MIT",
"type": "typo3-cms-extension",
"require": {
"typo3/cms-core": "^13.4"
},
"require-dev": {
"ext-sqlite3": "*",
"ergebnis/composer-normalize": "^2.45",
"ssch/typo3-rector": "^3.0",
"typo3/testing-framework": "^9.0",
"phpunit/phpcov": "^10.0"
},
"autoload": {
"psr-4": {
"Netlogix\\Nxsimplecdn\\": "Classes/"
}
},
"autoload-dev": {
"psr-4": {
"Netlogix\\Nxsimplecdn\\Tests\\": "Tests/"
}
},
"extra": {
"typo3/cms": {
"extension-key": "nxsimplecdn",
"web-dir": ".Build/public"
}
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin",
"allow-plugins": {
"ergebnis/composer-normalize": true,
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true
}
},
"scripts": {
"composer:normalize": "@composer normalize --no-check-lock --dry-run",
"composer:normalize:fix": "@composer normalize --no-check-lock",
"composer:psr-verify": "@composer dumpautoload --optimize --strict-psr --no-plugins",
"php:lint": "find src -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l",
"rector": "rector process --dry-run",
"rector:fix": "rector process",
"test:unit": "phpunit -c phpunit.xml",
"test:functional": "phpunit -c phpunit_functional.xml",
"post-autoload-dump": [
"@prepare-extension-test-structure"
],
"prepare-extension-test-structure": [
"Nimut\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare"
]
}
"ssch/typo3-rector": "^3.0",
"typo3/testing-framework": "^9.0",
"phpunit/phpcov": "^10.0"
},
"autoload": {
"psr-4": {
"Netlogix\\Nxsimplecdn\\": "Classes/"
}
},
"autoload-dev": {
"psr-4": {
"Netlogix\\Nxsimplecdn\\Tests\\": "Tests/"
}
},
"extra": {
"typo3/cms": {
"extension-key": "nxsimplecdn",
"web-dir": ".Build/public"
}
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin",
"allow-plugins": {
"ergebnis/composer-normalize": true,
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true
}
},
"scripts": {
"composer:normalize": "@composer normalize --no-check-lock --dry-run",
"composer:normalize:fix": "@composer normalize --no-check-lock",
"composer:psr-verify": "@composer dumpautoload --optimize --strict-psr --no-plugins",
"php:lint": "find src -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l",
"rector": "rector process --dry-run",
"rector:fix": "rector process",
"test:unit": "phpunit -c phpunit.xml",
"test:functional": "phpunit -c phpunit_functional.xml",
"post-autoload-dump": [
"@prepare-extension-test-structure"
],
"prepare-extension-test-structure": [
"Nimut\\TestingFramework\\Composer\\ExtensionTestEnvironment::prepare"
]
}
}
22 changes: 5 additions & 17 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,17 @@
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;

return RectorConfig::configure()
->withPaths([
__DIR__ . '/Classes',
__DIR__ . '/Configuration',
__DIR__ . '/Tests',
])
->withPaths([__DIR__ . '/Classes', __DIR__ . '/Configuration', __DIR__ . '/Tests'])
->withPhpSets(true)
->withAttributesSets(
doctrine: true,
phpunit: true,
)
->withAttributesSets(doctrine: true, phpunit: true)
->withPreparedSets(
deadCode: true,
codeQuality: true,
codingStyle: true,
typeDeclarations: true,
instanceOf: true,
earlyReturn: true,
strictBooleans: true,
strictBooleans: true
)
->withImportNames(removeUnusedImports: true)
->withSets([
Expand All @@ -48,10 +41,7 @@
])
# To have a better analysis from PHPStan, we teach it here some more things
->withPHPStanConfigs([Typo3Option::PHPSTAN_FOR_RECTOR_PATH])
->withRules([
ConvertImplicitVariablesToExplicitGlobalsRector::class,
DeclareStrictTypesRector::class,
])
->withRules([ConvertImplicitVariablesToExplicitGlobalsRector::class, DeclareStrictTypesRector::class])
# If you use withImportNames(), you should consider excluding some TYPO3 files.
->withSkip([
// @see https://github.com/sabbelasichon/typo3-rector/issues/2536
Expand All @@ -61,7 +51,5 @@
__DIR__ . '/public/*',
__DIR__ . '/.github/*',
__DIR__ . '/.Build/*',
FirstClassCallableRector::class => [
__DIR__ . '/Configuration/Services.php',
],
FirstClassCallableRector::class => [__DIR__ . '/Configuration/Services.php'],
]);

0 comments on commit 017ef21

Please sign in to comment.