Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
idmarinas committed Sep 2, 2021
1 parent c816e7d commit c177442
Show file tree
Hide file tree
Showing 19 changed files with 849 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

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

[*.md]
trim_trailing_whitespace = false
110 changes: 110 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Created by https://www.toptal.com/developers/gitignore/api/macos,linux,symfony,windows,composer,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,linux,symfony,windows,composer,visualstudiocode

### Composer ###
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Symfony ###
/var/

# PHPUnit
/phpunit.xml
.phpunit.result.cache

# Build data
/build/

# Composer PHAR
/composer.phar

### VisualStudioCode ###
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
*.code-workspace

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# dist files/folder
*.dist
# Not ignore
!phpunit.xml.dist

# End of https://www.toptal.com/developers/gitignore/api/macos,linux,symfony,windows,composer,visualstudiocode
110 changes: 110 additions & 0 deletions .php_cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/#version:3.0.0|configurator
* you can change this configuration by importing this file.
*/
$config = new PhpCsFixer\Config();

return $config
->setRiskyAllowed(true)
->setRules([
'@DoctrineAnnotation' => true,
'@PHP70Migration' => true,
'@PHP71Migration' => true,
'@PSR2' => true,
'@Symfony' => true,
'@PHP73Migration' => true,
// Each line of multi-line DocComments must have an asterisk [PSR-5] and must be aligned with the first one.
'align_multiline_comment' => true,
// Each element of an array must be indented exactly once.
'array_indentation' => true,
// PHP arrays should be declared using the configured syntax.
'array_syntax' => ['syntax' => 'short'],
// Binary operators should be surrounded by space as configured.
'binary_operator_spaces' => ['default' => 'align_single_space_minimal'],
// An empty line feed must precede any configured statement.
'blank_line_before_statement' => true,
// The body of each structure MUST be enclosed by braces. Braces should be properly placed. Body of braces should be properly indented.
'braces' => ['position_after_anonymous_constructs' => 'next', 'position_after_control_structures' => 'next', 'position_after_functions_and_oop_constructs' => 'next'],
// Using `isset($var) &&` multiple times should be done in one call.
'combine_consecutive_issets' => true,
// Calling `unset` on multiple items should be done in one call.
'combine_consecutive_unsets' => true,
// Replace multiple nested calls of `dirname` by only one call with second `$level` parameter. Requires PHP >= 7.0.
'combine_nested_dirname' => true,
// Remove extra spaces in a nullable typehint.
'compact_nullable_typehint' => true,
// Equal sign in declare statement should be surrounded by spaces or not following configuration.
'declare_equal_normalize' => ['space' => 'single'],
// Replaces `dirname(__FILE__)` expression with equivalent `__DIR__` constant.
'dir_constant' => true,
// Replace deprecated `ereg` regular expression functions with `preg`.
'ereg_to_preg' => true,
// Add curly braces to indirect variables to make them clear to understand. Requires PHP >= 7.0.
'explicit_indirect_variable' => true,
// Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.
'explicit_string_variable' => true,
// Replace core functions calls returning constants with the constants.
'function_to_constant' => true,
// Convert `heredoc` to `nowdoc` where possible.
'heredoc_to_nowdoc' => true,
// Ensure there is no code on the same line as the PHP open tag.
'linebreak_after_opening_tag' => true,
// Method chaining MUST be properly indented. Method chaining with different levels of indentation is not supported.
'method_chaining_indentation' => true,
// Replaces `intval`, `floatval`, `doubleval`, `strval` and `boolval` function calls with according type casting operator.
'modernize_types_casting' => true,
// DocBlocks must start with two asterisks, multiline comments must start with a single asterisk, after the opening slash. Both must end with a single asterisk before the closing slash.
'multiline_comment_opening_closing' => true,
// Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.
'multiline_whitespace_before_semicolons' => ['strategy' => 'new_line_for_chained_calls'],
// Add leading `\` before function invocation to speed up resolving.
'native_function_invocation' => true,
// Master functions shall be used instead of aliases.
'no_alias_functions' => true,
// Replace control structure alternative syntax to use braces.
'no_alternative_syntax' => true,
// Properties MUST not be explicitly initialized with `null` except when they have a type declaration (PHP 7.4).
'no_null_property_initialization' => true,
// Variables must be set `null` instead of using `(unset)` casting.
'no_unset_cast' => true,
// There should not be an empty `return` statement at the end of a function.
'no_useless_return' => true,
// Logical NOT operators (`!`) should have leading and trailing whitespaces.
'not_operator_with_space' => true,
// Adds or removes `?` before type declarations for parameters with a default `null` value.
'nullable_type_declaration_for_default_null_value' => true,
// Orders the elements of classes/interfaces/traits.
'ordered_class_elements' => true,
// Ordering `use` statements.
'ordered_imports' => true,
// All PHPUnit test classes should be marked as internal.
'php_unit_internal_class' => true,
// Enforce camel (or snake) case for PHPUnit test methods, following configuration.
'php_unit_method_casing' => true,
// Adds a default `@coversNothing` annotation to PHPUnit test classes that have no `@covers*` annotation.
'php_unit_test_class_requires_covers' => true,
// PHPDoc should contain `@param` for all params.
'phpdoc_add_missing_param_annotation' => true,
// `@return void` and `@return null` annotations should be omitted from PHPDoc.
'phpdoc_no_empty_return' => true,
// Annotations in PHPDoc should be ordered so that `@param` annotations come first, then `@throws` annotations, then `@return` annotations.
'phpdoc_order' => true,
// `@var` and `@type` annotations must have type and name in the correct order.
'phpdoc_var_annotation_correct_order' => true,
// Local, dynamic and directly referenced variables should not be assigned and directly returned by a function or method.
'return_assignment' => true,
// Converts explicit variables in double-quoted strings and heredoc syntax from simple to complex format (`${` to `{$`).
'simple_to_complex_string_variable' => true,
// Simplify `if` control structures that return the boolean result of their condition.
'simplified_if_return' => true,
// A return statement wishing to return `void` should not return `null`.
'simplified_null_return' => true,
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
)
;
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
![GitHub release](https://img.shields.io/github/release/lotgd-core/offering-bundle.svg)
![GitHub Release Date](https://img.shields.io/github/release-date/lotgd-core/offering-bundle.svg)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/lotgd-core/offering-bundle)
[![Build in PHP](https://img.shields.io/badge/PHP-^7.3-8892BF.svg?logo=php)](http://php.net/)

![GitHub issues](https://img.shields.io/github/issues/lotgd-core/offering-bundle.svg)
![GitHub pull requests](https://img.shields.io/github/issues-pr/lotgd-core/offering-bundle.svg)
![Github commits (since latest release)](https://img.shields.io/github/commits-since/lotgd-core/offering-bundle/latest.svg)
![GitHub commit activity](https://img.shields.io/github/commit-activity/w/lotgd-core/offering-bundle.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/lotgd-core/offering-bundle.svg)

![GitHub top language](https://img.shields.io/github/languages/top/lotgd-core/offering-bundle.svg)
![GitHub language count](https://img.shields.io/github/languages/count/lotgd-core/offering-bundle.svg)

[![PayPal.Me - The safer, easier way to pay online!](https://img.shields.io/badge/donate-help_my_project-ffaa29.svg?logo=paypal&cacheSeconds=86400)](https://www.paypal.me/idmarinas)
[![Liberapay - Donate](https://img.shields.io/liberapay/receives/IDMarinas.svg?logo=liberapay&cacheSeconds=86400)](https://liberapay.com/IDMarinas/donate)
[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&cacheSeconds=86400)](https://twitter.com/idmarinas)


## Installation ##

```bash
composer require lotgd-core/offering-bundle
```

# Default configuration
```yaml
# No configuration
```
72 changes: 72 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "lotgd-core/offering-bundle",
"version": "0.1.0",
"type": "lotgd-bundle",
"description": "Offerring Special for LoTGD IDMarinas Edition.",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Iván Diaz Marinas (IDMarinas)",
"email": "35842929+idmarinas@users.noreply.github.com",
"homepage": "https://github.com/lotgd-core/offering-bundle",
"role": "Developer, Maintainer"
},
{
"name": "Shannon Brown",
"role": "Original Idea"
}
],
"support": {
"issues": "https://github.com/lotgd-core/offering-bundle/issues"
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.3",
"lotgd-core/occurrence-bundle": "^0.1.0",
"idmarinas/lotgd-contracts": "^0.2.0",
"symfony/config": "^4.4",
"symfony/dependency-injection": "^4.4",
"symfony/event-dispatcher": "^4.4",
"symfony/http-kernel": "^4.4"
},
"require-dev": {
"idmarinas/lotgd": "^5.0",
"matthiasnoback/symfony-config-test": "^4.2",
"matthiasnoback/symfony-dependency-injection-test": "^4.2",
"nyholm/symfony-bundle-test": "^1.7",
"phpunit/phpunit": "^9.5",
"symfony/phpunit-bridge": "^5.3",
"symfony/test-pack": "^1.0"
},
"conflict": {
"idmarinas/lotgd": "<5.0"
},
"autoload": {
"psr-4": {
"Lotgd\\Bundle\\OfferingBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Lotgd\\Bundle\\OfferingBundle\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit --process-isolation"
},
"config": {
"optimize-autoloader": true,
"preferred-install": {
"*": "dist"
},
"process-timeout": 5000,
"sort-packages": true
},
"funding": [
{
"type": "paypal",
"url": "https://www.paypal.me/idmarinas"
}
]
}
55 changes: 55 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="tests/bootstrap.php"
convertDeprecationsToExceptions="false"
>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>

<report>
<clover outputFile="./build/reports/phpunit.coverage.xml"/>
<!-- <html outputDirectory="./build/coverage" lowUpperBound="35" highLowerBound="70" /> -->
<!-- <text outputFile="php://stdout" showUncoveredFiles="false"/> -->
</report>
</coverage>

<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
<env name="BOOTSTRAP_CLEAR_CACHE_ENV" value="test" />
<env name="XDEBUG_MODE" value="coverage"/>
<ini name="error_reporting" value="-1" />
<ini name="xdebug.mode" value="coverage"/>
<server name="APP_ENV" value="test" force="true" />
<server name="SHELL_VERBOSITY" value="-1" />
<server name="SYMFONY_PHPUNIT_REMOVE" value="" />
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5" />
</php>

<testsuites>
<testsuite name="Lotgd Core Occurrence Bundle Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>

<logging>
<junit outputFile="./build/reports/phpunit.xml"/>
</logging>

<listeners>
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
</listeners>

<!-- Run `composer require symfony/panther` before enabling this extension -->
<!--
<extensions>
<extension class="Symfony\Component\Panther\ServerExtension" />
</extensions>
-->
</phpunit>
Loading

0 comments on commit c177442

Please sign in to comment.