-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f37c137
Showing
34 changed files
with
1,385 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coverage_clover: build/phpunit/clover.xml | ||
json_path: build/phpunit/coveralls-upload.json | ||
service_name: travis-ci |
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,52 @@ | ||
<!-- | ||
Before you open an issue, make sure this one does not already exist. | ||
Please also read the "guidelines for contributing" link above before posting. | ||
--> | ||
|
||
<!-- | ||
If you are reporting a bug, please try to fill in the following. | ||
Otherwise remove it. | ||
--> | ||
|
||
### Environment | ||
|
||
#### Sonata packages | ||
|
||
``` | ||
$ composer show --latest 'sonata-project/*' | ||
# Put the result here. | ||
``` | ||
|
||
#### Symfony packages | ||
|
||
``` | ||
$ composer show --latest 'symfony/*' | ||
# Put the result here. | ||
``` | ||
|
||
#### PHP version | ||
|
||
``` | ||
$ php -v | ||
# Put the result here. | ||
``` | ||
|
||
## Subject | ||
|
||
<!-- | ||
Give here as many details as possible. | ||
Next sections are for ERRORS only. | ||
--> | ||
|
||
## Steps to reproduce | ||
|
||
## Expected results | ||
|
||
## Actual results | ||
|
||
<!-- | ||
If it's an error message or piece of code, use code block tags, | ||
and make sure you provide the whole stack trace(s), | ||
not just the first error message you can see. | ||
More details here: https://github.com/ekino/tiny-png-sonata-media-bundle/blob/master/CONTRIBUTING.md#issues | ||
--> |
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,56 @@ | ||
<!-- THE PR TEMPLATE IS NOT AN OPTION. DO NOT DELETE IT, MAKE SURE YOU READ AND EDIT IT! --> | ||
|
||
<!-- | ||
Show us you choose the right branch. | ||
Different branches are used for different things : | ||
- master is for everything backwards compatible, like patches, features and deprecation notices | ||
- 1.x-dev is for deprecation removals and other changes that cannot be done without a BC-break | ||
More details here: https://github.com/ekino/tiny-png-sonata-media-bundle/blob/master/CONTRIBUTING.md#the-base-branch | ||
--> | ||
I am targeting this branch, because {reason}. | ||
|
||
<!-- | ||
Specify which issues will be fixed/closed. | ||
Remove it if this is not related. | ||
--> | ||
|
||
Closes #{put_issue_number_here} | ||
|
||
## Changelog | ||
|
||
<!-- MANDATORY | ||
Fill the changelog part inside the code block. | ||
Follow this schema: http://keepachangelog.com/ | ||
--> | ||
|
||
<!-- REMOVE EMPTY SECTIONS --> | ||
```markdown | ||
### Added | ||
- Added some `Class::newMethod` to do great stuff | ||
|
||
### Changed | ||
|
||
### Deprecated | ||
|
||
### Removed | ||
|
||
### Fixed | ||
|
||
### Security | ||
``` | ||
|
||
## To do | ||
|
||
<!-- | ||
If this is a work in progress, COMPLETE and ADD needed tasks. | ||
You can add as many tasks as you want. | ||
If some are not relevant, just REMOVE them. | ||
--> | ||
|
||
- [ ] Update the tests | ||
- [ ] Update the documentation | ||
- [ ] Add an upgrade note | ||
|
||
## Subject | ||
|
||
<!-- Describe your Pull Request content here --> |
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,5 @@ | ||
/build/ | ||
/vendor/ | ||
/.php_cs.cache | ||
/composer.lock | ||
.phpunit.result.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,67 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the ekino/tiny-png-sonata-media-bundle project. | ||
* | ||
* (c) Ekino | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
$header = <<<EOF | ||
This file is part of the ekino/tiny-png-sonata-media-bundle project. | ||
(c) Ekino | ||
For the full copyright and license information, please view the LICENSE | ||
file that was distributed with this source code. | ||
EOF; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRiskyAllowed(true) | ||
->setRules([ | ||
'array_indentation' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => true], | ||
'blank_line_after_namespace' => true, | ||
'blank_line_after_opening_tag' => true, | ||
'declare_strict_types' => true, | ||
'header_comment' => ['header' => $header], | ||
'indentation_type' => true, | ||
'linebreak_after_opening_tag' => true, | ||
'lowercase_constants' => true, | ||
'lowercase_keywords' => true, | ||
'method_separation' => true, | ||
'native_function_invocation' => ['include' => ['@compiler_optimized']], | ||
'no_alias_functions' => true, | ||
'no_closing_tag' => true, | ||
'no_extra_consecutive_blank_lines' => [ | ||
'tokens' => [ | ||
'break', | ||
'continue', | ||
'curly_brace_block', | ||
'extra', | ||
'parenthesis_brace_block', | ||
'return', | ||
'square_brace_block', | ||
'throw', | ||
'use', | ||
], | ||
], | ||
'no_short_echo_tag' => true, | ||
'no_useless_else' => true, | ||
'no_unused_imports' => true, | ||
'no_useless_return' => true, | ||
'ordered_imports' => true, | ||
'phpdoc_add_missing_param_annotation' => true, | ||
'phpdoc_order' => true, | ||
'semicolon_after_instruction' => true, | ||
'visibility_required' => true, | ||
]) | ||
->setUsingCache(true) | ||
->setFinder( | ||
PhpCsFixer\Finder::create() | ||
->in(__DIR__) | ||
) | ||
; |
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,60 @@ | ||
branches: | ||
only: | ||
- master | ||
|
||
language: php | ||
|
||
php: | ||
- '7.1' | ||
- '7.2' | ||
- '7.3' | ||
|
||
dist: trusty | ||
sudo: false | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache/files | ||
|
||
env: | ||
global: | ||
- TARGET=ci | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: '7.3' | ||
env: SYMFONY=3.4.* | ||
- php: '7.3' | ||
env: SYMFONY=^4.2 | ||
- php: '7.3' | ||
env: SYMFONY_DEPRECATIONS_HELPER=0 | ||
- php: '7.2' | ||
env: SYMFONY=3.4.* | ||
- php: '7.2' | ||
env: SYMFONY=^4.2 | ||
- php: '7.2' | ||
env: SYMFONY_DEPRECATIONS_HELPER=0 | ||
- php: '7.1' | ||
env: SYMFONY=3.4.* | ||
- php: '7.1' | ||
env: SYMFONY=^4.2 | ||
- php: '7.1' | ||
env: SYMFONY_DEPRECATIONS_HELPER=0 | ||
allow_failures: | ||
- php: nightly | ||
- php: '7.3' | ||
- env: SYMFONY_DEPRECATIONS_HELPER=0 | ||
|
||
before_install: | ||
- composer self-update | ||
- if [ -x .travis/before_install_${TARGET}.sh ]; then .travis/before_install_${TARGET}.sh; fi; | ||
|
||
install: | ||
- if [ -x .travis/install_${TARGET}.sh ]; then .travis/install_${TARGET}.sh; fi; | ||
|
||
script: | ||
- make $TARGET | ||
|
||
after_success: | ||
- if [ -x .travis/after_success_${TARGET}.sh ]; then .travis/after_success_${TARGET}.sh; fi; |
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,4 @@ | ||
#!/usr/bin/env sh | ||
set -ev | ||
|
||
coveralls -v |
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,10 @@ | ||
#!/usr/bin/env sh | ||
set -ev | ||
|
||
PHP_INI_DIR="$HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/" | ||
TRAVIS_INI_FILE="$PHP_INI_DIR/travis.ini" | ||
echo "memory_limit=3072M" >> "$TRAVIS_INI_FILE" | ||
|
||
sed --in-place "s/\"dev-master\":/\"dev-${TRAVIS_COMMIT}\":/" composer.json | ||
|
||
if [ "$SYMFONY" != "" ]; then composer require "symfony/symfony:$SYMFONY" --no-update; fi; |
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 @@ | ||
#!/usr/bin/env bash | ||
set -ev | ||
|
||
RELEVANT_FILES=$(git diff --name-only HEAD upstream/${TRAVIS_BRANCH} -- '*.php' '*.yml' '*.xml' '*.twig' '*.js' '*.css' '*.json') | ||
|
||
if [[ -z ${RELEVANT_FILES} ]]; then echo -n 'KO'; exit 0; fi; |
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,16 @@ | ||
#!/usr/bin/env sh | ||
set -ev | ||
|
||
mkdir --parents "${HOME}/bin" | ||
|
||
# Coveralls client install | ||
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar --output-document="${HOME}/bin/coveralls" | ||
chmod u+x "${HOME}/bin/coveralls" | ||
|
||
# To be removed when these issues are resolved: | ||
# https://github.com/composer/composer/issues/5355 | ||
if [ "${COMPOSER_FLAGS}" = '--prefer-lowest' ]; then | ||
composer update --prefer-dist --no-interaction --prefer-stable --quiet | ||
fi | ||
|
||
composer update --prefer-dist --no-interaction --prefer-stable ${COMPOSER_FLAGS} |
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,7 @@ | ||
extends: default | ||
|
||
rules: | ||
document-start: disable | ||
line-length: | ||
max: 120 | ||
level: warning |
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 @@ | ||
CHANGELOG | ||
========= | ||
|
||
master | ||
------ | ||
|
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,19 @@ | ||
Copyright (c) ekino | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is furnished | ||
to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
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,34 @@ | ||
.PHONY: app-composer-validate app-cs-check app-cs-fix app-install app-security-check app-static-analysis app-test \ | ||
app-test-with-code-coverage ci | ||
|
||
default: help | ||
|
||
help: | ||
@grep -E '^[a-zA-Z_-]+:.*?##.*$$' $(MAKEFILE_LIST) | sort | awk '{split($$0, a, ":"); printf "\033[36m%-30s\033[0m %-30s %s\n", a[1], a[2], a[3]}' | ||
|
||
app-composer-validate: ## to validate composer config | ||
composer validate | ||
|
||
app-cs-check: ## to show files that need to be fixed | ||
vendor/bin/php-cs-fixer fix --dry-run --diff --verbose | ||
|
||
app-cs-fix: ## to fix files that need to be fixed | ||
vendor/bin/php-cs-fixer fix --verbose | ||
|
||
app-install: ## to install app | ||
composer install --prefer-dist | ||
|
||
app-security-check: ## to check if any security issues in the PHP dependencies | ||
vendor/bin/security-checker security:check | ||
|
||
app-static-analysis: ## to run static analysis | ||
php -dmemory_limit=-1 vendor/bin/phpstan analyze . -l 5 | ||
|
||
app-test: ## to run unit tests | ||
vendor/bin/phpunit | ||
|
||
app-test-with-code-coverage: ## to run unit tests with code-coverage | ||
vendor/bin/phpunit --coverage-text --colors=never | ||
|
||
ci: ## to run checks during ci | ||
make app-composer-validate app-test-with-code-coverage app-static-analysis app-cs-check app-security-check |
Oops, something went wrong.