-
Notifications
You must be signed in to change notification settings - Fork 178
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
122 changed files
with
2,425 additions
and
4,648 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 |
---|---|---|
@@ -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 |
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,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" |
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,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) | ||
; |
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,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. |
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.