Skip to content

Commit

Permalink
added basic files
Browse files Browse the repository at this point in the history
  • Loading branch information
wachterjohannes committed Feb 27, 2020
1 parent 2f514bb commit 3f55425
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120

# markdown uses two trailing spaces for explicit line breaks
[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.php_cs.dist export-ignore
.phpstan.neon export-ignore
.phpunit.xml.dist export-ignore
/Tests export-ignore
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PHPUnit
/phpunit.xml
.phpunit.result.cache

# composer
/composer.phar
/composer.lock
/auth.json
/vendor

# IDEs
.idea/*
*.iml
*~
.php-version
php.ini

# System files
.DS_Store

# php-cs-fixer
.php_cs.cache
36 changes: 36 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

$finder = PhpCsFixer\Finder::create()
->exclude(['var/cache'])
->in(__DIR__);

return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'@Symfony:risky' => true,
'ordered_imports' => true,
'concat_space' => ['spacing' => 'one'],
'array_syntax' => ['syntax' => 'short'],
'phpdoc_align' => false,
'class_definition' => [
'multiLineExtendsEachSingleLine' => true,
],
'linebreak_after_opening_tag' => true,
'declare_strict_types' => true,
'mb_str_functions' => true,
'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'],
'no_php4_constructor' => true,
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true],
'no_unreachable_default_argument_value' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'php_unit_strict' => true,
'phpdoc_order' => true,
'semicolon_after_instruction' => true,
'strict_comparison' => true,
'strict_param' => true,
'array_indentation' => true,
'multiline_whitespace_before_semicolons' => true,
])
->setFinder($finder);
11 changes: 11 additions & 0 deletions HandcraftedInTheAlpsSuluResourceBundle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace HandcraftedInTheAlps\Bundle\SuluResourceBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class HandcraftedInTheAlpsSuluResourceBundle extends Bundle
{
}
64 changes: 64 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"name": "handcraftedinthealps/sulu-resource-bundle",
"license": "MIT",
"type": "sulu-bundle",
"description": "Provide resource functionality for Sulu CMS.",
"require": {
"php": "^7.2",
"symfony/http-kernel": "^4.3 || ^5.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.12",
"handcraftedinthealps/code-coverage-checker": "^0.2.0",
"jangregor/phpstan-prophecy": "^0.5.1",
"phpstan/phpstan": "^0.12.1",
"phpstan/phpstan-phpunit": "^0.12",
"phpstan/phpstan-webmozart-assert": "^0.12.2",
"sensiolabs-de/deptrac-shim": "^0.5.0",
"symfony/monolog-bundle": "^3.1",
"symfony/phpunit-bridge": "^4.3",
"thecodingmachine/phpstan-strict-rules": "^0.12",
"zendframework/zendsearch": "@dev"
},
"autoload": {
"psr-4": {
"HandcraftedInTheAlps\\Bundle\\SuluResourceBundle\\": ""
}
},
"scripts": {
"lint": [
"@lint-composer",
"@php-cs",
"@phpstan"
],
"test": "@phpunit",
"lint-composer": "@composer validate",
"phpstan": "vendor/bin/phpstan analyse",
"php-cs": "vendor/bin/php-cs-fixer fix --verbose --diff --dry-run",
"php-cs-fix": "vendor/bin/php-cs-fixer fix",
"check-code-coverage": "vendor/bin/code-coverage-checker",
"phpunit": "vendor/bin/simple-phpunit"
},
"config": {
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"repositories": [
{
"type": "git",
"url": "https://github.com/luca-rath/messenger-utils"
},
{
"type": "git",
"url": "https://github.com/luca-rath/model-utils"
},
{
"type": "git",
"url": "https://github.com/luca-rath/testing-utils"
}
]
}
16 changes: 16 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
includes:
- vendor/jangregor/phpstan-prophecy/src/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon

parameters:
paths:
- .
level: max
excludes_analyse:
- %currentWorkingDirectory%/DependencyInjection/Configuration.php
- %currentWorkingDirectory%/vendor/*
- %currentWorkingDirectory%/Tests/Application/var*
- %currentWorkingDirectory%/Tests/coverage-checker.php
25 changes: 25 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true" bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="Bundle">
<directory>./Tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory>.</directory>
<exclude>
<directory>Resources/</directory>
<directory>Tests/</directory>
<directory>vendor/</directory>
</exclude>
</whitelist>
</filter>

<php>
<server name="SYMFONY_PHPUNIT_VERSION" value="8"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
<server name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml"/>
</php>
</phpunit>

0 comments on commit 3f55425

Please sign in to comment.