-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* drop TYPO3 < 11 Support * add TYPO3 13 Support * add ci workflow * add BeforeMiddlewareIsAppliedEvent Fixes: #5 Fixes: #11
- Loading branch information
1 parent
d899d70
commit b2a8bbd
Showing
11 changed files
with
164 additions
and
38 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 |
---|---|---|
|
@@ -18,7 +18,7 @@ indent_size = 2 | |
|
||
# JSON-Files | ||
[*.json] | ||
indent_style = tab | ||
indent_size = 2 | ||
|
||
# ReST-Files | ||
[*.rst] | ||
|
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,48 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
testsuite: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
TYPO3: ['11' , '12', '13'] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up PHP Version | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.3 | ||
tools: composer:v2 | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.composer/cache | ||
key: dependencies-composer-${{ hashFiles('composer.json') }} | ||
|
||
- name: Install composer dependencies TYPO3 13 | ||
if: matrix.TYPO3 == '13' | ||
run: | | ||
composer install --no-progress --no-interaction | ||
- name: Install composer dependencies TYPO3 12 | ||
if: matrix.TYPO3 == '12' | ||
run: | | ||
composer require typo3/cms-core:^12.4 --no-progress --no-interaction --dev -W | ||
- name: Install composer dependencies TYPO3 11 | ||
if: matrix.TYPO3 == '11' | ||
run: | | ||
composer require typo3/cms-core:^11.5 --no-progress --no-interaction --dev -W | ||
- name: Phpstan | ||
run: ./vendor/bin/phpstan analyze -c phpstan.neon | ||
- name: Phpcsfix | ||
run: ./vendor/bin/php-cs-fixer fix --config=php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no |
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,4 +1,4 @@ | ||
/composer.lock | ||
/public/ | ||
/vendor/ | ||
/.php_cs.cache | ||
/.php-cs-fixer.cache |
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,8 @@ | ||
services: | ||
_defaults: | ||
autowire: true | ||
autoconfigure: true | ||
public: false | ||
|
||
B13\JustInCase\: | ||
resource: '../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
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 |
---|---|---|
@@ -1,33 +1,38 @@ | ||
{ | ||
"name": "b13/justincase", | ||
"type": "typo3-cms-extension", | ||
"description": "With incoming URLs, it does not matter if they are upper/lowercase, they just work.", | ||
"license": "GPL-2.0-or-later", | ||
"require": { | ||
"php": "^7.2 || ^8.0", | ||
"typo3/cms-core": "^9.5 || ^10.0 || ^11.0 || ^12.0" | ||
}, | ||
"replace": { | ||
"typo3-ter/justincase": "self.version" | ||
}, | ||
"extra": { | ||
"typo3/cms": { | ||
"extension-key": "justincase" | ||
} | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"B13\\JustInCase\\": "src/" | ||
} | ||
}, | ||
"require-dev": { | ||
"typo3/coding-standards": "^0.2.0", | ||
"typo3/tailor": "^1.1" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"scripts": { | ||
"php:cs": "@composer exec php-cs-fixer fix" | ||
} | ||
"name": "b13/justincase", | ||
"type": "typo3-cms-extension", | ||
"description": "With incoming URLs, it does not matter if they are upper/lowercase, they just work.", | ||
"license": "GPL-2.0-or-later", | ||
"require": { | ||
"typo3/cms-core": "^11.5 || ^12.4 || ^13.1" | ||
}, | ||
"replace": { | ||
"typo3-ter/justincase": "self.version" | ||
}, | ||
"extra": { | ||
"typo3/cms": { | ||
"extension-key": "justincase" | ||
} | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"B13\\JustInCase\\": "src/" | ||
} | ||
}, | ||
"require-dev": { | ||
"typo3/coding-standards": "^0.5.5", | ||
"saschaegerer/phpstan-typo3": "^1.8", | ||
"typo3/tailor": "^1.1" | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"typo3/cms-composer-installers": true, | ||
"typo3/class-alias-loader": true | ||
} | ||
}, | ||
"scripts": { | ||
"php:cs": "@composer exec 'php-cs-fixer fix --config=php-cs-fixer.php'", | ||
"php:phpstan": "@composer exec 'phpstan analyse -c phpstan.neon'" | ||
} | ||
} |
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,5 +1,5 @@ | ||
<?php | ||
|
||
$config = \TYPO3\CodingStandards\CsFixerConfig::create(); | ||
$config->getFinder()->in(__DIR__); | ||
$config->getFinder()->exclude(['public', 'vendor'])->in(__DIR__); | ||
return $config; |
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,6 @@ | ||
parameters: | ||
level: 5 | ||
|
||
paths: | ||
- %currentWorkingDirectory%/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,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\JustInCase\Middleware; | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "JustInCase" by b13. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
*/ | ||
|
||
use Psr\Http\Message\ServerRequestInterface; | ||
|
||
final class BeforeMiddlewareIsAppliedEvent | ||
{ | ||
protected bool $shouldBeApplied = true; | ||
protected ServerRequestInterface $serverRequest; | ||
|
||
public function __construct(ServerRequestInterface $serverRequest) | ||
{ | ||
$this->serverRequest = $serverRequest; | ||
} | ||
|
||
public function doNotApply(): void | ||
{ | ||
$this->shouldBeApplied = false; | ||
} | ||
|
||
public function getServerRequest(): ServerRequestInterface | ||
{ | ||
return $this->serverRequest; | ||
} | ||
|
||
public function shouldBeApplied(): bool | ||
{ | ||
return $this->shouldBeApplied; | ||
} | ||
} |
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