-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
160 changed files
with
1,008 additions
and
528 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
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,33 @@ | ||
variables: | ||
COMPOSE_PROJECT_NAME: "jsonapibundle${CI_BUILD_ID}" | ||
|
||
stages: | ||
- test | ||
- lint | ||
|
||
after_script: | ||
- cd tests/Resources/docker/ | ||
- echo "Fixing permissions after docker..." | ||
- bin/php chmod -R 0777 ../../../* | ||
- docker-compose down | ||
- echo "All Done!" | ||
|
||
ci: | ||
stage: test | ||
tags: | ||
- docker-compose | ||
script: | ||
- cd tests/Resources/docker/ | ||
- bin/build.sh | ||
- bin/setup_fixtures.sh | ||
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never --coverage-text=php://stdout --coverage-html=logs/coverage | ||
- bin/php php ../../../vendor/bin/security-checker security:check ../../../composer.lock | ||
|
||
lint: | ||
stage: lint | ||
tags: | ||
- docker-compose | ||
script: | ||
- cd tests/Resources/docker/ | ||
- bin/build.sh | ||
- bin/php_cs --dry-run --using-cache=no |
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,43 @@ | ||
<?php | ||
|
||
use PhpCsFixer\Fixer\Import\OrderedImportsFixer; | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->name('console') | ||
->in([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]) | ||
; | ||
|
||
return PhpCsFixer\Config::create() | ||
->setUsingCache(true) | ||
->setRules([ | ||
'@PSR2' => true, | ||
'@Symfony' => true, | ||
'@Symfony:risky' => true, | ||
'@DoctrineAnnotation' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'array_syntax' => ['syntax' => 'short'], | ||
'list_syntax' => ['syntax' => 'short'], | ||
'no_empty_phpdoc' => false, | ||
'phpdoc_align' => '', | ||
'phpdoc_no_empty_return' => false, | ||
'phpdoc_summary' => false, | ||
'ordered_imports' => [ | ||
'sortAlgorithm' => OrderedImportsFixer::SORT_ALPHA, | ||
'importsOrder' => [ | ||
OrderedImportsFixer::IMPORT_TYPE_CONST, | ||
OrderedImportsFixer::IMPORT_TYPE_FUNCTION, | ||
OrderedImportsFixer::IMPORT_TYPE_CLASS, | ||
], | ||
], | ||
'class_definition' => ['multiLineExtendsEachSingleLine' => true], | ||
'ternary_to_null_coalescing' => true, | ||
'yoda_style' => true, | ||
'compact_nullable_typehint' => true, | ||
'visibility_required' => true, | ||
]) | ||
->setRiskyAllowed(true) | ||
->setFinder($finder) | ||
; |
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
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 |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# Upgrade Guide | ||
|
||
This file provides notes on how to upgrade between versions. | ||
|
||
|
||
# Upgrade from v0.9.* | ||
|
||
## Bundle changes | ||
- bundle moves to support symfony 4 with default private services and autowiring | ||
- changes in demo code to reflect `controllers as services` change | ||
|
||
## Schema autowiring | ||
!NOTE - change described below will be updated in future version with option to have bundle perform this action automatically by scaning your schemas.. | ||
To use any non public services in your schemas, you must redefine `Trikoder\JsonApiBundle\Services\Neomerx\ServiceContainer` and call `set` for each of used service, ie: | ||
```yaml | ||
Trikoder\JsonApiBundle\Services\Neomerx\ServiceContainer: | ||
calls: | ||
- method: set | ||
arguments: | ||
- 'Symfony\Component\Routing\RouterInterface' | ||
- '@router' | ||
``` | ||
## Service definitions | ||
All services should use Interface hinting names as described by Symfony documentation on autowiring. https://symfony.com/doc/current/service_container/autowiring.html | ||
Bundle defines aliases for old naming to keep compatibility with existing implementations. | ||
This will be removed in later version. | ||
## Abstract controller | ||
1. No longer inherits `Symfony\Bundle\FrameworkBundle\Controller\Controller` but instead moves to be `Controller as Service`. | ||
2. It defines required setter injection for several services listed below. NOTE - this is subject to change in future versions | ||
`setSchemaClassMapProvider` in abstract controller, and usage of trait `\Trikoder\JsonApiBundle\Controller\Traits\Polyfill\SymfonyAutowiredServicesTrait` |
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
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
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
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
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
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
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
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
Oops, something went wrong.