Skip to content

File tree

381 files changed

+4800
-4218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

381 files changed

+4800
-4218
lines changed

.editorconfig

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ indent_size = 4
3838
indent_style = space
3939
indent_size = 2
4040

41+
[grumphp.yml]
42+
indent_size = 4
43+
4144
[*.t3s]
4245
indent_style = space
4346
indent_size = 2
@@ -52,8 +55,8 @@ indent_size = 4
5255
ij_continuation_indent_size = 8
5356

5457
[*.sql]
55-
indent_style = tab
56-
indent_size = 2
58+
indent_style = space
59+
indent_size = 4
5760

5861
[.eslintrc]
5962
indent_style = space
@@ -63,3 +66,7 @@ indent_size = 4
6366
[{ext_typoscript_setup.txt, *.typoscript, setup.txt, constants.txt, setup.ts, constants.ts}]
6467
indent_style = space
6568
indent_size = 2
69+
70+
[*.neon]
71+
indent_style = tab
72+
indent_size = 4

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-20.04
1313
strategy:
1414
matrix:
15-
php: [ '7.2', '7.3', '7.4' ]
15+
php: [ '7.4', '8.0' ]
1616
minMax: [ 'composerInstallMin', 'composerInstallMax' ]
1717
steps:
1818
- name: Checkout

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Resources/Private/Clickdummy/zextensions.css
1717

1818
# Generated
1919
.Build
20+
.project/phars
2021
Build/testing-docker/.env
2122
Build/.phpunit.result.cache
23+
.php-cs-fixer.cache
2224
composer.lock

.project/githooks/pre-commit

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
#
4+
# This is a modified version which runs in a docker container instead of the local machine.
5+
#
6+
7+
# Ensure the phive directory already exists
8+
mkdir -p $HOME/.phive
9+
10+
# Fetch the GIT diff and format it as command input:
11+
DIFF=$(git -c diff.mnemonicprefix=false -c diff.noprefix=false --no-pager diff -r -p -m -M --full-index --no-color --staged | cat)
12+
13+
# Run GrumPHP
14+
( \
15+
cd "./" && printf "%s\n" "${DIFF}" \
16+
| \
17+
exec \
18+
docker run \
19+
--rm \
20+
-v $HOME/.phive:/tmp/phive \
21+
-v $PWD:$PWD \
22+
-w $PWD \
23+
-e GRUMPHP_GIT_WORKING_DIR="$(git rev-parse --show-toplevel)" \
24+
in2code/php:7.4-fpm \
25+
'.project/phars/grumphp' \
26+
'git:pre-commit' \
27+
'--skip-success-output' \
28+
)

.project/qa/grumphp.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
grumphp:
2+
tasks:
3+
phpcs:
4+
standard: [ '.project/qa/phpcs.xml' ]
5+
ignore_patterns:
6+
- /^Build/
7+
- /^Resources/
8+
phpcsfixer:
9+
config: '.project/qa/php-cs-fixer.php'
10+
diff: true
11+
phpmd:
12+
ruleset: [ '.project/qa/phpmd.xml' ]
13+
phpstan:
14+
configuration: '.project/qa/phpstan.neon'
15+
memory_limit: 1G
16+
psalm:
17+
config: '.project/qa/psalm.xml'

.project/qa/php-cs-fixer.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
$config = new PhpCsFixer\Config();
4+
$config->setRiskyAllowed(true);
5+
$config->setRules([
6+
'@DoctrineAnnotation' => true,
7+
'@PSR2' => true,
8+
'array_syntax' => ['syntax' => 'short'],
9+
'blank_line_after_opening_tag' => true,
10+
'braces' => ['allow_single_line_closure' => true],
11+
'cast_spaces' => ['space' => 'none'],
12+
'compact_nullable_typehint' => true,
13+
'concat_space' => ['spacing' => 'one'],
14+
'declare_equal_normalize' => ['space' => 'none'],
15+
'dir_constant' => true,
16+
'function_typehint_space' => true,
17+
'lowercase_cast' => true,
18+
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
19+
'modernize_types_casting' => true,
20+
'native_function_casing' => true,
21+
'new_with_braces' => true,
22+
'no_alias_functions' => true,
23+
'no_blank_lines_after_phpdoc' => true,
24+
'no_empty_phpdoc' => true,
25+
'no_empty_statement' => true,
26+
'no_extra_blank_lines' => true,
27+
'no_leading_import_slash' => true,
28+
'no_leading_namespace_whitespace' => true,
29+
'no_null_property_initialization' => true,
30+
'no_short_bool_cast' => true,
31+
'no_singleline_whitespace_before_semicolons' => true,
32+
'no_superfluous_elseif' => true,
33+
'no_trailing_comma_in_singleline_array' => true,
34+
'no_unneeded_control_parentheses' => true,
35+
'no_unused_imports' => true,
36+
'no_useless_else' => true,
37+
'no_whitespace_in_blank_line' => true,
38+
'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']],
39+
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
40+
'php_unit_mock_short_will_return' => true,
41+
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
42+
'phpdoc_no_access' => true,
43+
'phpdoc_no_empty_return' => true,
44+
'phpdoc_no_package' => true,
45+
'phpdoc_scalar' => true,
46+
'phpdoc_trim' => true,
47+
'phpdoc_types' => true,
48+
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
49+
'return_type_declaration' => ['space_before' => 'none'],
50+
'single_quote' => true,
51+
'single_line_comment_style' => ['comment_types' => ['hash']],
52+
'single_trait_insert_per_statement' => true,
53+
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
54+
'whitespace_after_comma_in_array' => true,
55+
]);
56+
$finder = $config->getFinder();
57+
$finder->in(__DIR__ . '/../../Classes');
58+
return $config;

.project/qa/phpcs.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0"?>
2+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHP_CodeSniffer" xsi:noNamespaceSchemaLocation="phpcs.xsd">
3+
<file>../../Classes</file>
4+
<file>../../Tests</file>
5+
6+
<arg name="basepath" value="."/>
7+
<arg name="colors"/>
8+
<arg name="parallel" value="75"/>
9+
<arg value="np"/>
10+
11+
<rule ref="PSR12" />
12+
</ruleset>

.project/qa/phpmd.xml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPMD rule set"
3+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 https://pmd.sourceforge.io/ruleset_xml_schema.xsd"
6+
xsi:noNamespaceSchemaLocation="https://pmd.sourceforge.io/ruleset_xml_schema.xsd"
7+
>
8+
<description>PHPMD rules</description>
9+
10+
<rule ref="rulesets/codesize.xml" />
11+
<rule ref="rulesets/cleancode.xml">
12+
<exclude name="ElseExpression"/>
13+
<exclude name="StaticAccess"/>
14+
</rule>
15+
<rule ref="rulesets/controversial.xml">
16+
<exclude name="Superglobals"/>
17+
</rule>
18+
<rule ref="rulesets/design.xml" />
19+
<rule ref="rulesets/naming.xml">
20+
<exclude name="LongVariable"/>
21+
<exclude name="ShortVariable"/>
22+
</rule>
23+
<rule ref="rulesets/unusedcode.xml" />
24+
25+
<rule ref="rulesets/cleancode.xml/StaticAccess">
26+
<properties>
27+
<property name="exceptions">
28+
<value>
29+
\DateTime,
30+
\DateInterval,
31+
\DateTimeZone,
32+
\TYPO3\CMS\Backend\Utility\BackendUtility,
33+
\TYPO3\CMS\Core\Context\LanguageAspectFactory,
34+
\TYPO3\CMS\Core\Core\Bootstrap,
35+
\TYPO3\CMS\Core\Core\Environment,
36+
\TYPO3\CMS\Core\Database\Query\QueryHelper,
37+
\TYPO3\CMS\Core\Log\LogLevel,
38+
\TYPO3\CMS\Core\Utility\ArrayUtility,
39+
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility,
40+
\TYPO3\CMS\Core\Utility\GeneralUtility,
41+
\TYPO3\CMS\Core\Utility\MathUtility,
42+
\TYPO3\CMS\Core\Utility\PathUtility,
43+
\TYPO3\CMS\Core\Utility\VersionNumberUtility,
44+
\TYPO3\CMS\Extbase\Utility\ExtensionUtility,
45+
\TYPO3\CMS\Extbase\Utility\LocalizationUtility,
46+
\TYPO3\CMS\Extbase\Reflection\ObjectAccess,
47+
\In2code\In2publishCore\Config\Node\Specific\AbsSpecNode,
48+
\In2code\In2publishCore\Domain\Model\Record,
49+
\In2code\In2publishCore\Communication\RemoteProcedureCall\Envelope,
50+
\In2code\In2publishCore\Testing\Utility\TestLabelLocalizer,
51+
\In2code\In2publishCore\Utility\ArrayUtility,
52+
\In2code\In2publishCore\Utility\BackendUtility,
53+
\In2code\In2publishCore\Utility\ConfigurationUtility,
54+
\In2code\In2publishCore\Utility\DatabaseUtility,
55+
\In2code\In2publishCore\Utility\ExtensionUtility,
56+
\In2code\In2publishCore\Utility\FileUtility,
57+
\In2code\In2publishCore\Utility\FolderUtility,
58+
\In2code\In2publishCore\Utility\LogUtility,
59+
\In2code\In2publishCore\Utility\StorageDriverExtractor,
60+
\In2code\In2publishCore\Utility\UriUtility,
61+
\Spyc
62+
</value>
63+
</property>
64+
</properties>
65+
</rule>
66+
67+
<rule ref="rulesets/naming.xml/LongVariable">
68+
<properties>
69+
<property name="maximum">
70+
<value>30</value>
71+
</property>
72+
</properties>
73+
</rule>
74+
<rule ref="rulesets/naming.xml/ShortVariable">
75+
<properties>
76+
<property name="minimum">
77+
<value>2</value>
78+
</property>
79+
</properties>
80+
</rule>
81+
82+
<exclude-pattern>.Build</exclude-pattern>
83+
<exclude-pattern>.github</exclude-pattern>
84+
<exclude-pattern>.idea</exclude-pattern>
85+
<exclude-pattern>.phive</exclude-pattern>
86+
<exclude-pattern>Build</exclude-pattern>
87+
<exclude-pattern>Configuration</exclude-pattern>
88+
<exclude-pattern>Documentation</exclude-pattern>
89+
<exclude-pattern>Resources</exclude-pattern>
90+
</ruleset>

.project/qa/phpstan.neon

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
parameters:
2+
level: 1
3+
paths:
4+
- ../../Classes/
5+
excludePaths:
6+
- ../../.Build/
7+
- ../../.github/
8+
- ../../.idea/
9+
- ../../.project/
10+
- ../../Build/
11+
- ../../Configuration/
12+
- ../../Documentation/
13+
- ../../Resources/
14+
- ../../Tests/
15+
- ../../Classes/Features/LogsIntegration/Controller/LogController.php
16+
bootstrapFiles:
17+
- ../../.Build/vendor/autoload.php
18+
- phpstan_bootstrap.php

.project/qa/phpstan_bootstrap.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
define('TYPO3_MODE', 'BE');
6+
define('TYPO3_REQUESTTYPE', 2);
7+
define('TYPO3_REQUESTTYPE_FE', 1);
8+
define('TYPO3_REQUESTTYPE_BE', 2);
9+
define('TYPO3_REQUESTTYPE_CLI', 4);
10+
define('TYPO3_REQUESTTYPE_AJAX', 8);
11+
define('TYPO3_REQUESTTYPE_INSTALL', 16);
12+
13+
define('SSH2_STREAM_STDIO', 0);
14+
define('SSH2_STREAM_STDERR', 1);
15+
16+
define('SSH2_FINGERPRINT_MD5', 0);
17+
define('SSH2_FINGERPRINT_SHA1', 1);
18+
19+
define('SSH2_FINGERPRINT_HEX', 0);
20+
define('SSH2_FINGERPRINT_RAW', 2);

.project/qa/psalm.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="4"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns="https://getpsalm.org/schema/config"
6+
xsi:schemaLocation="https://getpsalm.org/schema/config"
7+
autoloader="phpstan_bootstrap.php"
8+
>
9+
<projectFiles>
10+
<directory name="../../Classes" />
11+
<ignoreFiles>
12+
<directory name="../../.Build/" />
13+
</ignoreFiles>
14+
</projectFiles>
15+
16+
<issueHandlers>
17+
<InternalMethod>
18+
<errorLevel type="suppress">
19+
<directory name="../../Classes" />
20+
</errorLevel>
21+
</InternalMethod>
22+
<InternalClass>
23+
<errorLevel type="suppress">
24+
<directory name="../../Classes" />
25+
</errorLevel>
26+
</InternalClass>
27+
<UndefinedClass>
28+
<errorLevel type="suppress">
29+
<referencedClass name="Spyc" />
30+
<referencedClass name="CoStack\Logs\Controller\LogController" />
31+
</errorLevel>
32+
</UndefinedClass>
33+
</issueHandlers>
34+
</psalm>

Build/FunctionalTestsBootstrap.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
use TYPO3\TestingFramework\Core\Testbase;
4+
25
/*
36
* This file is part of the TYPO3 CMS project.
47
*
@@ -16,7 +19,7 @@
1619
if (!getenv('IN2PUBLISH_CONTEXT')) {
1720
putenv('IN2PUBLISH_CONTEXT=Local');
1821
}
19-
$testbase = new \TYPO3\TestingFramework\Core\Testbase();
22+
$testbase = new Testbase();
2023
$testbase->defineOriginalRootPath();
2124
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/tests');
2225
$testbase->createDirectory(ORIGINAL_ROOT . 'typo3temp/var/transient');

0 commit comments

Comments
 (0)