Skip to content

Commit

Permalink
Merge branch '2.0' into new_factory
Browse files Browse the repository at this point in the history
  • Loading branch information
eigan authored Dec 22, 2023
2 parents 3b4b43a + 30e83ee commit 6c4103a
Show file tree
Hide file tree
Showing 122 changed files with 2,425 additions and 4,648 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
name: CI
on: [push, pull_request]
on:
schedule:
- cron: '0 0 * * *'
push:
pull_request:
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
php: ['8.0', '8.1']
doctrine: ['2.11']
php: ['8.0', '8.1', '8.2', '8.3']
doctrine: ['2.14']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: error_reporting=E_ALL
tools: phpunit, git
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies for doctrine/orm ${{ matrix.doctrine }}
run: composer require --no-progress --no-scripts --no-plugins -v -W doctrine/orm "~${{ matrix.doctrine }}.0"
- name: PHPUnit
run: vendor/bin/phpunit --coverage-clover=coverage.xml --coverage-text
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
36 changes: 36 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Static Analysis"

on:
pull_request:
push:

jobs:
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-22.04"

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

steps:
- name: "Checkout code"
uses: "actions/checkout@v3"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: "pdo_sqlite"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse -c phpstan.neon.dist"
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ composer.phar
composer.lock
.DS_Store
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache

/tests/Stubs/storage/framework/views/*
!/tests/Stubs/storage/framework/views/.gitkeep
/tests/Stubs/storage/doctrine.generated.php
.idea
laravel-doctrine-orm.iml
laravel-doctrine-orm.iml
30 changes: 30 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('vendor')
;

$config = new PhpCsFixer\Config();

return $config->setRules([
'@PSR2' => true,
'blank_line_after_opening_tag' => true,
'no_leading_namespace_whitespace' => true,
'no_blank_lines_after_class_opening' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_blank_lines_after_phpdoc' => true,
'concat_space' => ['spacing' => 'one'],
'ordered_imports' => true,
'blank_line_before_statement' => true,
'no_extra_blank_lines' => true,
'no_unused_imports' => true,
'no_whitespace_in_blank_line' => true,
'phpdoc_order' => true,
'phpdoc_align' => ['tags' => ['param', 'return', 'throws', 'type', 'var']],
'phpdoc_scalar' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => ['operators' => ['==' => 'align', '=' => 'align', '=>' => 'align']],
])
->setFinder($finder)
;
45 changes: 0 additions & 45 deletions .php_cs

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[![GitHub release](https://img.shields.io/github/release/laravel-doctrine/orm.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/orm)
[![Github actions](https://github.com/laravel-doctrine/orm/workflows/CI/badge.svg?branch=1.8)](https://github.com/laravel-doctrine/orm/actions?query=workflow%3ACI+branch%3A1.7)
[![StyleCI](https://styleci.io/repos/39036008/shield)](https://styleci.io/repos/39036008)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/laravel-doctrine/orm.svg?style=flat-square)](https://github.com/laravel-doctrine/orm)
[![Packagist](https://img.shields.io/packagist/dm/laravel-doctrine/orm.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/orm)
[![Packagist](https://img.shields.io/packagist/dt/laravel-doctrine/orm.svg?style=flat-square)](https://packagist.org/packages/laravel-doctrine/orm)
Expand Down Expand Up @@ -50,6 +49,7 @@ Version | Supported Laravel Versions
~1.6 | 7.x
~1.7 | 8.x
~1.8 | 9.x
~2.0 | 10.x

Because of the auto package discovery feature Laravel has, the ServiceProvider and Facades are automatically registered.

Expand Down
72 changes: 72 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Upgrade to 2.0

## DBAL 3

The most significant change in version 2.0 is using doctrine/dbal 3. You should [review their upgrade guide](https://github.com/doctrine/dbal/blob/bd54f5043eaff656b314037bf285d8b7f1c311b8/UPGRADE.md) in addition to this one.

## Lumen supported dropped
We recommend using eloquent instead.

## Minimum Doctrine/ORM version to 2.14

This release supports a minimum doctrine/orm version of 2.14 due to a number of deprecations and new features that we are taking advantage of.


## Proxy namespace required
You must now set a namespace for your proxies. Use the configuration option `proxies.namespace`. the previous default value was `DoctrineProxies`.

## Command signature changed

All doctrine commands are now extended from `doctrine` itself. Some of the command options have been changed or removed, and some have been added.

### Removed: FluentExporter, GenerateEntitiesCommand, GenerateRepositoriesCommand, ConvertMappingCommand, MappingImportCommand, ConvertConfigCommand

Doctrine is moving away from code generation and we are following suit, as well as reducing our maintenance burden.

## Removed MasterSlaveConnection

The old MasterSlaveConnection has been supported for backwards compatibility, but has now been removed. You can migrate to the new PrimaryReadReplicaConnection instead.

## Removed JSON type
If you were still including this line in your custom_types config, it should be removed:

```
'json' => LaravelDoctrine\ORM\Types\Json::class
```

## Removed 'simple' Annotations
The `simple` configuration option for simple annotation reader has been removed as support for this
is removed in Doctrine.


## Short namespaces

Short namespaces such as `Entities:User` are no longer supported by Doctrine and have been removed.

## Driver Options Rename

If you have been setting "driverOptions" on your MySQL database config, you should rename it to "options" to align with Laravel's naming scheme.

## Metadata driver `config` removed
Used deprecated YamlDriver and was not supported by doctrine.

## UrlRoutable::getRouteKeyName renamed to getRouteKeyNameStatic
This method was renamed to not conflict with the UrlRoutable trait of Laravel.

## Logging configuration changed
DBAL deprecated the SQLLogger functionality in favor of the new middleware functionality.
Logging moved to the new middlewares section.
```php
'middlewares' => [
\Doctrine\DBAL\Logging\Middleware::class
],
```

### Classes and interface in `LaravelDoctrine\ORM\Loggers` removed
Use new "middleware" logic, see above.

### Clockwork logger removed
Out of scope for this package.

### Laravel debugbar logger removed
Laravel debugbar does not support the new Middleware to Doctrine. Open for PR to re-add this functionality.
41 changes: 22 additions & 19 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,34 @@
],
"require": {
"php": "^8.0",
"doctrine/annotations": "^1.13",
"doctrine/cache": "^1",
"doctrine/dbal": "^2.13.3",
"doctrine/orm": "^2.11",
"doctrine/persistence": "^1.3.5|^2.0",
"illuminate/auth": "^9.0",
"illuminate/console": "^9.0",
"illuminate/container": "^9.0",
"illuminate/contracts": "^9.0",
"illuminate/pagination": "^9.0",
"illuminate/routing": "^9.0",
"illuminate/support": "^9.0",
"illuminate/validation": "^9.0",
"illuminate/view": "^9.0",
"doctrine/annotations": "^2",
"doctrine/dbal": "^3.2",
"doctrine/orm": "^2.14",
"doctrine/persistence": "^3",
"illuminate/auth": "^9.0|^10.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/container": "^9.0|^10.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/pagination": "^9.0|^10.0",
"illuminate/routing": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"illuminate/validation": "^9.0|^10.0",
"illuminate/view": "^9.0|^10.0",
"symfony/cache": "^6.0",
"symfony/serializer": "^5.0|^6.0",
"symfony/yaml": "^5.0|^6.0"
},
"conflict": {
"laravel/lumen": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
"mockery/mockery": "^1.3.1",
"barryvdh/laravel-debugbar": "~3.0",
"itsgoingd/clockwork": "^5.0",
"illuminate/log": "^9.0",
"illuminate/notifications": "^9.0",
"illuminate/queue": "^9.0",
"illuminate/log": "^9.0|^10.0",
"illuminate/notifications": "^9.0|^10.0",
"illuminate/queue": "^9.0|^10.0",
"phpstan/phpstan": "^1.9",
"phpstan/phpstan-deprecation-rules": "^1.1",
"fakerphp/faker": "^1.20"
},
"autoload": {
Expand Down
Loading

0 comments on commit 6c4103a

Please sign in to comment.