Skip to content

Commit

Permalink
[TASK] Use custom composer.json for build
Browse files Browse the repository at this point in the history
Refs #80
  • Loading branch information
derhansen committed Feb 4, 2024
1 parent 96409d4 commit 223eafc
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 6 deletions.
48 changes: 48 additions & 0 deletions .Build/composer.json
@@ -0,0 +1,48 @@
{
"name": "derhansen/plain-faq_build",
"description": "composer.json for builds",
"repositories": [
{
"type": "path",
"url": "../"
}
],
"require": {
"derhansen/plain-faq": "@dev",
"typo3/cms-core": "^12.4",
"php": ">=8.1"
},
"require-dev": {
"typo3/cms-composer-installers": "^5.0",
"typo3/cms-backend": "^12.4",
"typo3/cms-frontend": "^12.4",
"typo3/cms-extbase": "^12.4",
"typo3/cms-felogin": "^12.4",
"typo3/cms-fluid-styled-content": "^12.4",
"typo3/cms-fluid": "^12.4",
"typo3/cms-tstemplate": "^12.4",
"typo3/cms-install": "^12.4",
"typo3/cms-extensionmanager": "^12.4",
"typo3/testing-framework": "^8.0",
"friendsofphp/php-cs-fixer": "^3.12.0",
"saschaegerer/phpstan-typo3": "^1.8.3",
"phpstan/extension-installer": "^1.1"
},
"config": {
"allow-plugins": {
"typo3/class-alias-loader": true,
"typo3/cms-composer-installers": true,
"phpstan/extension-installer": true
}
},
"autoload": {
"psr-4": {
"Derhansen\\PlainFaq\\": "Classes"
}
},
"autoload-dev": {
"psr-4": {
"Derhansen\\PlainFaq\\Tests\\": "Tests"
}
}
}
70 changes: 70 additions & 0 deletions .Build/php-cs-fixer/.php-cs-fixer.php
@@ -0,0 +1,70 @@
<?php

$header = <<<'EOF'
This file is part of the TYPO3 extension sf_event_mgt.
(c) Torben Hansen <derhansen@gmail.com>
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([
'@DoctrineAnnotation' => true,
'@PER' => true,
'array_syntax' => ['syntax' => 'short'],
'cast_spaces' => ['space' => 'none'],
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'none'],
'declare_parentheses' => true,
'dir_constant' => true,
'function_to_constant' => ['functions' => ['get_called_class', 'get_class', 'get_class_this', 'php_sapi_name', 'phpversion', 'pi']],
'list_syntax' => ['syntax' => 'short'],
'type_declaration_spaces' => true,
'modernize_strpos' => true,
'modernize_types_casting' => true,
'native_function_casing' => true,
'no_alias_functions' => true,
'no_blank_lines_after_phpdoc' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_leading_namespace_whitespace' => true,
'no_null_property_initialization' => true,
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_superfluous_elseif' => true,
'no_trailing_comma_in_singleline' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_else' => true,
'no_useless_nullsafe_operator' => true,
'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
'php_unit_construct' => ['assertions' => ['assertEquals', 'assertSame', 'assertNotEquals', 'assertNotSame']],
'php_unit_mock_short_will_return' => true,
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
'phpdoc_no_access' => true,
'phpdoc_no_empty_return' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
'return_type_declaration' => ['space_before' => 'none'],
'single_quote' => true,
'single_space_around_construct' => true,
'single_line_comment_style' => ['comment_types' => ['hash']],
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'single_line_empty_body' => false,
'whitespace_after_comma_in_array' => ['ensure_single_space' => true],
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
])
->setFinder(
PhpCsFixer\Finder::create()
->in(dirname(__DIR__ . '/../../../'))
->exclude(['.Build', 'Documentation', 'Resources'])
->notName('ext_emconf.php')
);
Empty file.
12 changes: 12 additions & 0 deletions .Build/phpstan/phpstan.neon
@@ -0,0 +1,12 @@
includes:
- phpstan-baseline.neon

parameters:
level: 5
paths:
- ../../Classes/
- ../../Configuration/

checkMissingIterableValueType: false
reportUnmatchedIgnoredErrors: true
checkGenericClassInNonGenericObjectType: false
28 changes: 28 additions & 0 deletions .Build/phpunit/FunctionalTests.xml
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
backupGlobals="true"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
cacheResult="false"
colors="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
failOnRisky="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="false"
>
<coverage/>
<testsuites>
<testsuite name="Functional Tests">
<directory>../../Tests/Functional/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./Classes</directory>
</include>
</source>
</phpunit>
30 changes: 30 additions & 0 deletions .Build/phpunit/UnitTests.xml
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd"
backupGlobals="true"
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTestsBootstrap.php"
cacheResult="false"
colors="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
beStrictAboutTestsThatDoNotTestAnything="false"
failOnWarning="true"
failOnRisky="true"
cacheDirectory=".phpunit.cache"
requireCoverageMetadata="false"
>
<coverage/>
<testsuites>
<testsuite name="Unit Tests">
<directory>../../Tests/Unit/</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./Classes</directory>
</include>
</source>
</phpunit>
12 changes: 6 additions & 6 deletions .gitignore
@@ -1,8 +1,8 @@
.idea/
.DS_Store
.Build/
# PHP Storm, other java IDE's
.idea
.Build/public
.Build/vendor
.Build/var/
composer.lock
.php-cs-fixer.cache
/var/
/Tests/Build/.phpunit.result.cache
/Tests/Build/.phpunit.cache
.phpunit.cache

0 comments on commit 223eafc

Please sign in to comment.