Skip to content

Commit

Permalink
[TASK] Allow TYPO3 v13 installation
Browse files Browse the repository at this point in the history
  • Loading branch information
derhansen committed May 19, 2024
1 parent 4dc9535 commit 51302f4
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 127 deletions.
65 changes: 65 additions & 0 deletions .Build/php-cs-fixer/.php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

$header = <<<'EOF'
This file is part of the TYPO3 extension add_pwd_policy.
(c) Torben Hansen <[email protected]>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

return (new \PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PER-CS:risky' => true,
'@PHP80Migration:risky' => true,
'@PHP81Migration' => true,
'declare_strict_types' => true,
'fully_qualified_strict_types' => true,
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => false,
'import_functions' => false,
],
'no_unneeded_import_alias' => true,
'ordered_imports' => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha',
],
'phpdoc_align' => true,
'phpdoc_annotation_without_dot' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag_normalizer' => true,
'phpdoc_line_span' => true,
'phpdoc_no_useless_inheritdoc' => true,
'phpdoc_order' => true,
'phpdoc_order_by_value' => true,
'phpdoc_separation' => true,
'phpdoc_single_line_var_spacing' => true,
'phpdoc_summary' => true,
'phpdoc_tag_casing' => true,
'phpdoc_tag_type' => true,
'phpdoc_to_comment' => [
'ignored_tags' => [
'phpstan-ignore-line',
'phpstan-ignore-next-line',
'todo',
],
],
'phpdoc_trim_consecutive_blank_line_separation' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'alpha',
],
'phpdoc_var_annotation_correct_order' => true,
'phpdoc_var_without_name' => true,
'self_accessor' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude(['.Build', 'Documentation', 'Resources'])
->notName('ext_emconf.php')
);
5 changes: 5 additions & 0 deletions .Build/phpstan/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
parameters:
level: 9
paths:
- ../../Classes/
- ../../Configuration/
32 changes: 32 additions & 0 deletions .Build/v12/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "derhansen/add_pwd_policy_composer_v12",
"description": "composer.json for TYPO3 v12 build",
"keywords": ["TYPO3 CMS", "security", "password policy", "password validators"],
"repositories": [
{
"type": "path",
"url": "../../"
}
],
"require": {
"typo3/cms-core": "^12.4",
"typo3/cms-setup": "^12.4",
"typo3/cms-backend": "^12.4",
"typo3/cms-felogin": "^12.4",
"derhansen/add_pwd_policy": "@dev"
},
"require-dev": {
"typo3/cms-composer-installers": "^5.0",
"typo3/testing-framework": "^8.0.0",
"friendsofphp/php-cs-fixer": "^3.49",
"saschaegerer/phpstan-typo3": "^1.1.2",
"phpstan/extension-installer": "^1.1"
},
"config": {
"allow-plugins": {
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true,
"phpstan/extension-installer": true
}
}
}
32 changes: 32 additions & 0 deletions .Build/v13/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "derhansen/add_pwd_policy_composer_v12",
"description": "composer.json for TYPO3 v12 build",
"keywords": ["TYPO3 CMS", "security", "password policy", "password validators"],
"repositories": [
{
"type": "path",
"url": "../../"
}
],
"require": {
"typo3/cms-core": "^13.1",
"typo3/cms-setup": "^13.1",
"typo3/cms-backend": "^13.1",
"typo3/cms-felogin": "^13.1",
"derhansen/add_pwd_policy": "@dev"
},
"require-dev": {
"typo3/cms-composer-installers": "^5.0",
"typo3/testing-framework": "^8.0.0",
"friendsofphp/php-cs-fixer": "^3.49",
"saschaegerer/phpstan-typo3": "^1.1.2",
"phpstan/extension-installer": "^1.1"
},
"config": {
"allow-plugins": {
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true,
"phpstan/extension-installer": true
}
}
}
14 changes: 6 additions & 8 deletions .github/workflows/CodeQuality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,16 @@ jobs:

strategy:
matrix:
env:
- { php: 8.1, coverage: 0}
- { php: 8.2, coverage: 0}

env: ${{ matrix.env }}
typo3: [v12, v13]
php: [8.1, 8.2, 8.3]

steps:
- uses: actions/checkout@v3

- name: Set up PHP Version
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.env.php }}
php-version: ${{ matrix.php }}
tools: composer:v2

- name: Validate composer.json and composer.lock
Expand All @@ -35,12 +32,13 @@ jobs:

- name: Install composer dependencies
run: |
cd .Build/${{ matrix.typo3 }}/
composer install --no-progress
- name: Validate PHP coding guidelines
run: |
.Build/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --dry-run --stop-on-violation --using-cache=no
.Build/${{ matrix.typo3 }}/vendor/bin/php-cs-fixer fix --config=.Build/php-cs-fixer/.php-cs-fixer.php -v --dry-run --stop-on-violation --using-cache=no
- name: Run phpstan checks
run: |
.Build/bin/phpstan
.Build/${{ matrix.typo3 }}/vendor/bin/phpstan --configuration=.Build/phpstan/phpstan.neon
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.Build
.idea
.php-cs-fixer.cache
composer.lock
var
.Build/*/public
.Build/*/vendor
.Build/*/composer.lock
73 changes: 0 additions & 73 deletions .php-cs-fixer.dist.php

This file was deleted.

3 changes: 0 additions & 3 deletions Classes/Service/PwnedPasswordsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class PwnedPasswordsService
/**
* Checks the given password against data breaches using the haveibeenpwned.com API
* Returns the amount of times the password is found in the haveibeenpwned.com database
*
* @param string $password
* @return int
*/
public function checkPassword(string $password): int
{
Expand Down
34 changes: 5 additions & 29 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,10 @@
"GPL-2.0-or-later"
],
"require": {
"typo3/cms-core": "^12.4",
"typo3/cms-setup": "^12.4",
"typo3/cms-backend": "^12.4",
"typo3/cms-felogin": "^12.4"
},
"require-dev": {
"typo3/cms-composer-installers": "^5.0",
"typo3/testing-framework": "^8.0.0 || dev-main",
"friendsofphp/php-cs-fixer": "^3.12.0",
"saschaegerer/phpstan-typo3": "^1.1.2",
"phpstan/extension-installer": "^1.1"
"typo3/cms-core": "^12.4 || ^13.1",
"typo3/cms-setup": "^12.4 || ^13.1",
"typo3/cms-backend": "^12.4 || ^13.1",
"typo3/cms-felogin": "^12.4 || ^13.1"
},
"replace": {
"typo3-ter/add-pwd-policy": "self.version"
Expand All @@ -39,26 +32,9 @@
"Derhansen\\AddPwdPolicy\\": "Classes"
}
},
"autoload-dev": {
"psr-4": {
"Derhansen\\AddPwdPolicy\\Tests\\": "Tests"
}
},
"config": {
"vendor-dir": ".Build/vendor",
"bin-dir": ".Build/bin",
"allow-plugins": {
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true,
"phpstan/extension-installer": true,
"sbuerk/typo3-cmscomposerinstallers-testingframework-bridge": true
}
},
"extra": {
"typo3/cms": {
"extension-key": "add_pwd_policy",
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": ".Build/public"
"extension-key": "add_pwd_policy"
}
}
}
6 changes: 3 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
'uploadfolder' => '0',
'createDirs' => '',
'clearCacheOnLoad' => 1,
'version' => '1.0.0',
'version' => '1.1.0',
'constraints' => [
'depends' => [
'typo3' => '12.4.0-12.4.99',
'php' => '8.1.0-8.2.99',
'typo3' => '12.4.0-13.4.99',
'php' => '8.1.0-8.3.99',
],
'conflicts' => [],
'suggests' => [],
Expand Down
9 changes: 0 additions & 9 deletions phpstan.neon

This file was deleted.

0 comments on commit 51302f4

Please sign in to comment.