Skip to content

Commit

Permalink
Update from internal 0.14 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alenpokos committed Nov 27, 2018
1 parent a20092c commit b3edc3d
Show file tree
Hide file tree
Showing 128 changed files with 1,366 additions and 488 deletions.
98 changes: 95 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ variables:
COMPOSE_PROJECT_NAME: "jsonapibundle${CI_BUILD_ID}"

stages:
- test
- test-latest
- lint
- test-versions

after_script:
- cd tests/Resources/docker/
Expand All @@ -12,8 +13,9 @@ after_script:
- docker-compose down
- echo "All Done!"

ci:
stage: test
# any latest built
ci-latest:
stage: test-latest
tags:
- docker-compose
script:
Expand All @@ -23,6 +25,96 @@ ci:
- 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

# symfony 4.1 build
ci-symfony4.1:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- bin/composer require "symfony/framework-bundle:^4.1" "symfony/form:^4.1" "symfony/validator:^4.1" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never

# supported 4.0 build
ci-symfony4.0:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- bin/composer require "symfony/framework-bundle:^4.0" "symfony/form:^4.0" "symfony/validator:^4.0" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never

# supported 3.4 build
ci-symfony3.4:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- mv -f ../app/config/symfony34/config.yml ../app/config/
- bin/composer require "symfony/framework-bundle:^3.4" "symfony/form:^3.4" "symfony/validator:^3.4" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never

# un-supported 3.3 build
ci-symfony3.3:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- mv -f ../app/config/symfony34/config.yml ../app/config/
- bin/composer require "symfony/framework-bundle:^3.3" "symfony/form:^3.3" "symfony/validator:^3.3" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never


# un-supported 3.2 build
ci-symfony3.2:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- mv -f ../app/config/symfony34/config.yml ../app/config/
- bin/composer require "symfony/framework-bundle:^3.2" "symfony/form:^3.2" "symfony/validator:^3.2" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never


# supported 3.1 build
ci-symfony3.1:
stage: test-versions
tags:
- docker-compose
script:
- cd tests/Resources/docker/
- docker-compose build
- docker-compose up -d
- mv -f ../app/config/symfony34/config.yml ../app/config/
- bin/composer require "symfony/framework-bundle:^3.1" "symfony/form:^3.1" "symfony/validator:^3.1" --no-interaction --no-ansi --prefer-dist
- docker-compose run --no-deps --rm php composer install --no-interaction --no-ansi --prefer-dist
- bin/setup_fixtures.sh
- docker-compose run --no-deps --rm php php vendor/bin/phpunit --debug --colors=never

lint:
stage: lint
tags:
Expand Down
2 changes: 2 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $finder = PhpCsFixer\Finder::create()
__DIR__ . '/src',
__DIR__ . '/tests',
])
->exclude('cache')
;

return PhpCsFixer\Config::create()
Expand Down Expand Up @@ -37,6 +38,7 @@ return PhpCsFixer\Config::create()
'yoda_style' => true,
'compact_nullable_typehint' => true,
'visibility_required' => true,
'no_superfluous_phpdoc_tags' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
Expand Down
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,30 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
## Unreleased

## [0.14.0] 2018-10-23

### Added
- Added support for automatically mapped schema files, see [schema automapping docs](src/Resources/doc/getting_started/schema_automapping.md)
- Implemented support for required roles config directive, see [config reference](src/Resources/doc/configuration/configuration.md)

### Changed
- `\Trikoder\JsonApiBundle\Controller\AbstractController` is now auto-tagged with the `controller.service_arguments` tag.


## [0.11.0] 2018-08-03

### Changed
- Changed route annotation use to symfony/routing, previously was sensio/framework-extra-bundle
- Added symfony/routing as dependancy on 3.4
- Added "doctrine/common": "<2.9" as dependancy to cover deprication notices

### Removed
- Removed second argument (ServiceContainer) of schema as closure definition. see [Manual](src/Resources/doc/getting_started/schema_class_map.md)

### Deprecated
- Deprecated RepositoryFactoryInterface (`\Trikoder\JsonApiBundle\Repository\RepositoryFactoryInterface`) in favour of using DIC factory options

## [0.1.0] 2017-07-27

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Copyright (C) 2017 Trikoder

Author: Alen Pokos.

Contributors (in alphabetic order): Antonio Pauletich, Alen Pokos, Antonio Šunjić, Damir Trputec, Juraj Juričić, Krešo Kunjas, Petar Obradović, Vedran Krizek, Vedran Mihočinec

## License

Package is licensed under [MIT License](./LICENSE)
25 changes: 13 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,35 @@
"type": "symfony-bundle",
"require": {
"php": ">=7.0.0|>=7.1.0",
"symfony/framework-bundle": "^3.1|^4.0",
"symfony/dependency-injection": "^3.1|^4.0",
"symfony/framework-bundle": ">=3.1 <5.0",
"symfony/dependency-injection": ">=3.1 <5.0",
"sensio/framework-extra-bundle": ">3.0|^5.1|^5.2",
"symfony/form": ">=3.1 <5.0",
"symfony/routing": ">=3.1 <5.0",
"symfony/security-bundle": "^3.1|^4.0",
"symfony/translation": ">=3.1 <5.0",
"symfony/validator": ">=3.1 <5.0",
"symfony/monolog-bundle": ">=3.1 <5.0",
"neomerx/json-api": "^1.0",
"doctrine/orm": "~2.4,<2.5|2.5|^2.6",
"doctrine/doctrine-bundle": "~1.6|^1.8",
"sensio/framework-extra-bundle": "^3.0|^5.1",
"symfony/form": "^3.1|^4.0",
"symfony/translation": "^3.3|^4.0",
"symfony/validator": "^3.3|^4.0",
"symfony/monolog-bundle": "^3.1"
"doctrine/orm": "^2.4",
"doctrine/common": "^2",
"doctrine/doctrine-bundle": "~1.6|^1.8|^1.9"
},
"require-dev": {
"sensio/generator-bundle": "3.0.*|3.1.*|3.2.*|3.3.*",
"phpunit/phpunit": "^5.7",
"phpunit/php-code-coverage": "^4.0",
"symfony/phpunit-bridge": "^3.0|^4.0",
"justinrainbow/json-schema": "^1.6",
"doctrine/doctrine-fixtures-bundle": "^2.3",
"fzaninotto/faker": "^1.5",
"sensiolabs/security-checker": "^4.1",
"symfony/security-bundle": "^3.1|^4.0",
"symfony/twig-bundle": "^3.3|^4.0",
"doctrine/cache": "^1.6",
"symfony/debug-bundle": "^3.3|^4.0",
"symfony/web-profiler-bundle": "^3.3|^4.0",
"symfony/web-server-bundle": "^3.3|^4.0",
"symfony/browser-kit": "^3.3|^4.0",
"friendsofphp/php-cs-fixer": "^2.8"
"friendsofphp/php-cs-fixer": "2.13.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<php>
<server name="KERNEL_DIR" value="tests/Resources/app" />
<server name="KERNEL_CLASS" value="\AppKernel" />
<!-- \Doctrine\Common\ClassLoader is deprecated in doctrine/common v2.9.0 -->
<env name="SYMFONY_DEPRECATIONS_HELPER" value="1" />
</php>
<testsuites>
<testsuite name="Unit">
Expand Down
3 changes: 0 additions & 3 deletions src/Bridge/Doctrine/DoctrineRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class DoctrineRepository implements RepositoryInterface

/**
* DoctrineRepository constructor.
*
* @param EntityRepository $entityRepository
* @param EntityManager $entityManager
*/
public function __construct(EntityRepository $entityRepository, EntityManager $entityManager)
{
Expand Down
7 changes: 2 additions & 5 deletions src/Bridge/Doctrine/ObjectListCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,17 @@ class ObjectListCollection implements ObjectListCollectionInterface

/**
* ObjectListCollection constructor.
*
* @param array $collection
* @param null $total
*/
public function __construct(array $collection, $total = null)
{
if (false === is_array($collection) || null === $collection) {
if (false === \is_array($collection) || null === $collection) {
$collection = [];
}
$this->collection = $collection;

// if null, we presume full list is returned
if (null === $total) {
$total = count($collection);
$total = \count($collection);
}

$this->total = $total;
Expand Down
7 changes: 3 additions & 4 deletions src/Bridge/Doctrine/RepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
use Trikoder\JsonApiBundle\Contracts\RepositoryInterface;
use Trikoder\JsonApiBundle\Repository\RepositoryFactoryInterface;

/**
* @deprecated @see \Trikoder\JsonApiBundle\Repository\RepositoryFactoryInterface
*/
class RepositoryFactory implements RepositoryFactoryInterface
{
/**
Expand All @@ -15,18 +18,14 @@ class RepositoryFactory implements RepositoryFactoryInterface

/**
* RepositoryFactory constructor.
*
* @param EntityManager $entityManager
*/
public function __construct(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}

/**
* @param string $modelClass
*
* @return RepositoryInterface
*/
public function create(string $modelClass): RepositoryInterface
{
Expand Down
Loading

0 comments on commit b3edc3d

Please sign in to comment.