Skip to content

Commit

Permalink
Merge pull request #8912 from greg0ire/3.0.x
Browse files Browse the repository at this point in the history
Merge 2.10.x into 3.0.x
  • Loading branch information
greg0ire authored Aug 11, 2021
2 parents d7a5eab + cbda203 commit a0b739c
Show file tree
Hide file tree
Showing 55 changed files with 689 additions and 362 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,56 @@ env:
fail-fast: true

jobs:
phpunit-smoke-check-dbal-3:
name: "Experimental: PHPUnit with SQLite and DBAL 3"
runs-on: "ubuntu-20.04"
continue-on-error: true

strategy:
matrix:
php-version:
- "8.0"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
extensions: "pdo, pdo_sqlite"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Require DBAL 3"
run: "composer require doctrine/dbal ^3.0 --no-update"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"

- name: "Run PHPUnit"
continue-on-error: true
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --coverage-clover=coverage-no-cache.xml"
env:
ENABLE_SECOND_LEVEL_CACHE: 0

- name: "Run PHPUnit with Second Level Cache"
id: "phpunit-run-slc"
continue-on-error: true
run: "vendor/bin/phpunit -c ci/github/phpunit/sqlite.xml --exclude-group performance,non-cacheable,locking_functional --coverage-clover=coverage-cache.xml"
env:
ENABLE_SECOND_LEVEL_CACHE: 1

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
if: "steps.phpunit-run-slc.outcome == 'success' && steps.phpunit-run-slc.conclusion == 'success'"
with:
name: "phpunit-sqlite-${{ matrix.php-version }}-dbal3-coverage"
path: "coverage*.xml"

phpunit-smoke-check:
name: "PHPUnit with SQLite"
runs-on: "ubuntu-20.04"
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-20.04"
continue-on-error: "${{ matrix.status == 'experimental' }}"

strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
dbal-version:
- "default"
status:
- "stable"
include:
- dbal-version: "^3.0"
php-version: "8.0"
status: "experimental"

steps:
- name: "Checkout code"
Expand All @@ -29,22 +39,37 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Require DBAL 3"
run: "composer require doctrine/dbal ${{ matrix.dbal-version }} --no-update"
if: "${{ matrix.dbal-version != 'default' }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: "Run a static analysis with phpstan/phpstan"
continue-on-error: "${{ matrix.status == 'experimental' }}"
run: "vendor/bin/phpstan analyse"

static-analysis-psalm:
name: "Static Analysis with Psalm"
runs-on: "ubuntu-20.04"
continue-on-error: "${{ matrix.status == 'experimental' }}"

strategy:
fail-fast: false
matrix:
php-version:
- "8.0"
dbal-version:
- "default"
status:
- "stable"
include:
- dbal-version: "^3.0"
php-version: "8.0"
status: "experimental"

steps:
- name: "Checkout code"
Expand All @@ -56,10 +81,15 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Require DBAL 3"
run: "composer require doctrine/dbal ${{ matrix.dbal-version }} --no-update"
if: "${{ matrix.dbal-version != 'default' }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "highest"

- name: "Run a static analysis with vimeo/psalm"
continue-on-error: "${{ matrix.status == 'experimental' }}"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"
32 changes: 32 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@ Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation

# Upgrade to 2.10

## BC Break: Removed possibility to extend the doctrine mapping xml schema with anything

If you want to extend it now you have to provide your own validation schema.

## New method `Doctrine\ORM\EntityManagerInterface#wrapInTransaction($func)`

Works the same as `Doctrine\ORM\EntityManagerInterface#transactional()` but returns any value returned from `$func` closure rather than just _non-empty value returned from the closure or true_.

Because of BC policy, the method does not exist on the interface yet. This is the example of safe usage:

```php
function foo(EntityManagerInterface $entityManager, callable $func) {
if (method_exists($entityManager, 'wrapInTransaction')) {
return $entityManager->wrapInTransaction($func);
}

return $entityManager->transactional($func);
}
```

`Doctrine\ORM\EntityManagerInterface#transactional()` has been deprecated.

## Minor BC BREAK: some exception methods have been removed

The following methods were not in use and are very unlikely to be used by
Expand Down Expand Up @@ -52,6 +74,16 @@ Overriding this method is not recommended, which is why the method is documented
+ public function toIterable($stmt, ResultSetMapping $resultSetMapping, array $hints = []): iterable
```

## Deprecated: Entity Namespace Aliases

Entity namespace aliases are deprecated, use the magic ::class constant to abbreviate full class names
in EntityManager, EntityRepository and DQL.

```diff
- $entityManager->find('MyBundle:User', $id);
+ $entityManager->find(User::class, $id);
```

# Upgrade to 2.9

## Minor BC BREAK: Setup tool needs cache implementation
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"doctrine/annotations": "^1.13",
"doctrine/coding-standard": "^9.0",
"phpbench/phpbench": "^0.16.10 || ^1.0",
"phpstan/phpstan": "0.12.91",
"phpstan/phpstan": "0.12.94",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.4",
"squizlabs/php_codesniffer": "3.6.0",
"symfony/cache": "^4.4 || ^5.2",
Expand Down
1 change: 0 additions & 1 deletion docs/en/reference/dql-doctrine-query-language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1527,7 +1527,6 @@ Terminals

- identifier (name, email, ...) must match ``[a-z_][a-z0-9_]*``
- fully_qualified_name (Doctrine\Tests\Models\CMS\CmsUser) matches PHP's fully qualified class names
- aliased_name (CMS:CmsUser) uses two identifiers, one for the namespace alias and one for the class inside it
- string ('foo', 'bar''s house', '%ninja%', ...)
- char ('/', '\\', ' ', ...)
- integer (-1, 0, 1, 34, ...)
Expand Down
3 changes: 2 additions & 1 deletion docs/en/tutorials/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ that directory with the following contents:
{
"require": {
"doctrine/orm": "^2.6.2",
"symfony/yaml": "2.*"
"symfony/yaml": "2.*",
"symfony/cache": "^5.3"
},
"autoload": {
"psr-0": {"": "src/"}
Expand Down
Loading

0 comments on commit a0b739c

Please sign in to comment.