Compare commits

...

47 Commits

Author SHA1 Message Date
Mitch 4af1aa3177 ScalarColumnHydrator: prevent early-bail on falsy values (#9663)
* add failing test for issue #9230

* ScalarColumnHydrator: prevent early-bail on falsy values, fix #9230

Co-authored-by: Mickael GOETZ <contact@mickael-goetz.com>
2022-04-19 09:01:33 +00:00
Alexander M. Turek f4d5283f70 Fix static analysis for Persistence 2.5 (#9648) 2022-04-10 23:31:12 +02:00
Grégoire Paris 976fe5bc0d Merge pull request #9639 from ruudk/patch-1
Fix composer install in contributing readme
2022-04-09 16:41:21 +02:00
Ruud Kamphuis 582b222b00 Fix composer install in contributing readme
People that contribute know how to use composer.
2022-04-09 15:29:45 +02:00
Grégoire Paris 1ffb9152f7 Merge pull request #9623 from BenoitDuffez/dont-use-depecated-ormexception
explicitly use the non-deprecated ORMException
2022-04-02 11:52:48 +02:00
Benoit Duffez 51faa6ddb7 explicitly use the non-deprecated ORMException 2022-04-01 13:23:05 -07:00
Alexander M. Turek 692c3e1b45 Remove "Description of" PHPDoc (#9611) 2022-03-28 13:47:30 +02:00
Alexander M. Turek e410180c6e PHPStan 1.5.0 (#9607) 2022-03-28 10:37:03 +02:00
Grégoire Paris 4476b05d59 Merge pull request #9608 from greg0ire/remove-python-config
Remove Sphinx config
2022-03-26 17:15:36 +01:00
Grégoire Paris 343b0ae576 Remove Sphinx config
I do not think this file is still useful, since AFAIK we are not using
Sphinx anymore. Besides, this is the only Doctrine project I could find
that still has that file. It was last updated 6 years ago.
2022-03-26 12:07:22 +01:00
Grégoire Paris de69f60c6a Merge pull request #9598 from greg0ire/fix-event-table
Use correct syntax for external links
2022-03-20 19:32:10 +01:00
Grégoire Paris 2a653b05a0 Use correct syntax for external links
There is no leading underscore, and the trailing underscore should not
be forgotten.
2022-03-20 19:13:19 +01:00
Jan Záruba c6831c6b07 Update XmlExporter.php - Type problem in php8.x (#9589)
Please see PHP interface SimpleXMLElement::addAttribute(string $name, string $value = null, string $namespace = null): void .... 
The $value must be string or null.
2022-03-19 13:03:28 +01:00
Grégoire Paris 33da4d84eb Merge pull request #9590 from greg0ire/fix-build
Ignore deprecation from Persistence
2022-03-18 22:56:08 +01:00
Grégoire Paris c1b373b931 Ignore deprecation from Persistence
The deprecation is already addressed in the next minor branch.
2022-03-18 19:19:15 +01:00
Maxime Veber b6cff1aa1c Stands with Ukraine (#9567) 2022-03-18 10:32:03 +01:00
Grégoire Paris d2206152bb Merge pull request #9585 from greg0ire/hunt-down-latest 2022-03-13 17:11:29 +01:00
Grégoire Paris a34dc0a0e3 Use internal links when self-referencing
This should result in links with the current version of the docs.
2022-03-13 14:36:37 +01:00
Grégoire Paris 881a7b3b69 Link to docs for the stable version
When we do not know what version people intend to browse, it seems more
sensible to assume they want to see the docs for the stable version.
2022-03-13 14:35:15 +01:00
Alexander M. Turek 82bbb1dc4a Baseline Psalm errors caused by DBAL 3.3.3 (#9577) 2022-03-09 17:18:11 +01:00
flack 9c351e0444 Make sure MemcachedAdapter is supported before tring to use it (#9574) 2022-03-09 16:23:58 +01:00
Thomas Landauer 5ed5383338 Fixing :doc: link (#9569) 2022-03-08 22:31:56 +01:00
Thomas Landauer eb1d54871b Adding PHP attributes (#9555)
Co-authored-by: Alexander M. Turek <me@derrabus.de>
Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com>
2022-03-08 01:40:01 +01:00
Grégoire Paris e148c838b0 Merge pull request #9563 from greg0ire/address-sqllogger-deprecation
Remove reference to removed class
2022-03-03 22:27:51 +01:00
Grégoire Paris c73df2a7b4 Remove reference to removed class
EchoSQLLogger is deprecated in DBAL 2, and removed in DBAL 3.
2022-03-03 22:12:04 +01:00
Jan Barášek 38682e93db Parser: SimpleArithmeticExpression should return ArithmeticTerm (#9557) 2022-03-03 00:25:27 +01:00
Alexander M. Turek 84df37de97 Update baselines for Lexer 1.2.3 (#9546) 2022-02-28 14:06:31 +01:00
Grégoire Paris 856c3143f8 Merge pull request #9537 from kiler129/fix-bug-9536
Make error message suggestion accurate
2022-02-22 20:08:49 +01:00
kiler129 79f73a23f3 Fix bug-#9536
Wrong validation message is displayed when an incorrect bidirectional
bi-directional mapping is set up. When the owning side is configured
correctly and the target side is missing the back reference, the ORM
suggests adding inverseBy instead of mappedBy, with the field name
missing. This commit fixes this problem.
2022-02-22 12:05:35 -06:00
Grégoire Paris 4af912f712 Merge pull request #9539 from greg0ire/use-stable-dbal
Drop minor version number
2022-02-22 18:01:26 +01:00
Grégoire Paris 65f48e0ecd Drop minor version number
We should make it explicit that we mean to test with whatever is the
latest 3.x
2022-02-22 17:25:21 +01:00
Matthias Pigulla 193c3abf0e Bring FilterCollection to a "clean" state after hash computation (#9523)
Co-authored-by: Alexander M. Turek <me@derrabus.de>
2022-02-20 13:09:05 +00:00
Grégoire Paris 5b8263e8fb Merge pull request #9526 from greg0ire/better-model-setup
Make creating test models more straightforward and revert to swallowing exceptions
2022-02-20 09:35:21 +01:00
Grégoire Paris 26e85b8c88 Make creating test models more straightforward
In https://github.com/doctrine/orm/pull/8962, I established that
swallowing exceptions while creating model was bad because it could hide
other helpful exceptions.
As it turns out however, swallowing exceptions is really the way to go
here, because of the performance implication of calling dropSchema(). It
is possible to catch a more precise exception as well, which should
preserve the benefits of not swallowing them.

It looks like I based my grep on the comment inside the catch and today,
I found many other occurrences of this pattern, without the easy to grep
comment.

I decided to fix them as well, but in a lazier way: one no longer has to
remember to call dropSchema in tearDown() now, it is automated.
2022-02-20 09:26:57 +01:00
Grégoire Paris 152c04c03d Merge pull request #9519 from lcobucci/fix-pagination-test
Trigger the desired code path
2022-02-16 09:24:32 +01:00
Luís Cobucci 12ab6fa43f Trigger the desired code path
Since v2.7.0 the ORM avoids using extra queries via the paginator
component when maximum results isn't set on the original query. With
that change, this test was not executing the code path that it was
expected to run.

This makes sure we trigger the forcing of custom DBAL types when
hydrating the identifiers, making sure we don't introduce bugs.

More info:
- Forcing DBAL type conversion: https://github.com/doctrine/orm/pull/7905
- Issue on optimisation: https://github.com/doctrine/orm/issues/7829
- PR on optimisation: https://github.com/doctrine/orm/pull/7863
- Minor BC-break docs: https://github.com/doctrine/orm/blob/2.11.x/UPGRADE.md#minor-bc-break-paginator-output-walkers-arent-be-called-anymore-on-sub-queries-for-queries-without-max-results
2022-02-15 22:59:09 +01:00
Yann Rabiller e8e61cbbd5 Fix syntax typo in attributes reference (#9513)
Curly brackets are the annotation way of declaring array. Probably a
mistake while copy pasting some examples from annotations.
2022-02-15 14:32:33 +00:00
Tony Lemke 8f847cb5aa Constructor-Argument "options" has the same type as the associated property. (#9501) 2022-02-13 21:42:15 +01:00
David Maicher 599832cb81 Fix AbstractQuery::setParameter phpdoc (#9504)
* Fix AbstractQuery::setParameter phpdoc

* Fix AbstractQuery::setParameter phpdoc
2022-02-12 21:49:30 +01:00
Dmytro Hordinskyi 530f515556 Added "false" value to $columnPrefix type declaration. (#9493) 2022-02-09 09:40:16 +01:00
Alexander M. Turek 1c55025b12 PHPStan 1.4.6, Psalm 4.20.0 (#9491) 2022-02-09 00:42:34 +01:00
Steve 0900d4bc97 Fix #[DiscriminatorMap] params (#9487)
Fix `#[DiscriminatorMap]` params
2022-02-08 08:35:46 +00:00
Alexander M. Turek be2518d784 Run tests with stricter error handling (#9482) 2022-02-07 22:08:34 +00:00
Alexander M. Turek bdd8883d12 Run Postgres 14 and MariaDB 10.6 in CI (#9470) 2022-02-05 19:28:13 +01:00
Alexander M. Turek 536b65f02b PDO is not a required extension (#9457) 2022-02-01 14:13:50 +01:00
Alexander M. Turek 103c42cdb7 Check requirements for metadata drivers (#9452) 2022-02-01 13:48:03 +01:00
Grégoire Paris cdaf7b5308 Remove trailing underscore (#9446)
It looks like there was confusion between the syntax for external links
and the syntax for internal links, which does not mention underscores.
See https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-doc
versus https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#external-links
2022-01-30 23:01:35 +00:00
118 changed files with 799 additions and 1116 deletions
+5 -5
View File
@@ -30,7 +30,7 @@ jobs:
- php-version: "8.0"
dbal-version: "2.13"
- php-version: "8.1"
dbal-version: "3.2@dev"
dbal-version: "3@dev"
steps:
- name: "Checkout"
@@ -83,11 +83,11 @@ jobs:
- "default"
postgres-version:
- "9.6"
- "13"
- "14"
include:
- php-version: "8.0"
dbal-version: "2.13"
postgres-version: "13"
postgres-version: "14"
services:
postgres:
@@ -143,14 +143,14 @@ jobs:
dbal-version:
- "default"
mariadb-version:
- "10.5"
- "10.6"
extension:
- "mysqli"
- "pdo_mysql"
include:
- php-version: "8.0"
dbal-version: "2.13"
mariadb-version: "10.5"
mariadb-version: "10.6"
extension: "pdo_mysql"
services:
+1 -2
View File
@@ -37,8 +37,7 @@ will have to run a composer installation in the project:
```sh
git clone git@github.com:doctrine/orm.git
cd orm
curl -sS https://getcomposer.org/installer | php --
./composer.phar install
composer install
```
To run the testsuite against another database, copy the ``phpunit.xml.dist``
+3 -1
View File
@@ -3,6 +3,8 @@
| [![Build status][3.0 image]][3.0] | [![Build status][2.12 image]][2.12] | [![Build status][2.11 image]][2.11] |
| [![Coverage Status][3.0 coverage image]][3.0 coverage]| [![Coverage Status][2.12 coverage image]][2.12 coverage] | [![Coverage Status][2.11 coverage image]][2.11 coverage] |
[<h1 align="center">🇺🇦 UKRAINE NEEDS YOUR HELP NOW!</h1>](https://www.doctrine-project.org/stop-war.html)
Doctrine 2 is an object-relational mapper (ORM) for PHP 7.1+ that provides transparent persistence
for PHP objects. It sits on top of a powerful database abstraction layer (DBAL). One of its key features
is the option to write database queries in a proprietary object oriented SQL dialect called Doctrine Query Language (DQL),
@@ -13,7 +15,7 @@ without requiring unnecessary code duplication.
## More resources:
* [Website](http://www.doctrine-project.org)
* [Documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/index.html)
* [Documentation](https://www.doctrine-project.org/projects/doctrine-orm/en/stable/index.html)
[3.0 image]: https://github.com/doctrine/orm/actions/workflows/continuous-integration.yml/badge.svg?branch=3.0.x
+2 -2
View File
@@ -10,8 +10,8 @@ we cannot protect you from SQL injection.
Please read the documentation chapter on Security in Doctrine DBAL and ORM to
understand the assumptions we make.
- [DBAL Security Page](https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/security.html)
- [ORM Security Page](https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/security.html)
- [DBAL Security Page](https://www.doctrine-project.org/projects/doctrine-dbal/en/stable/reference/security.html)
- [ORM Security Page](https://www.doctrine-project.org/projects/doctrine-orm/en/stable/reference/security.html)
If you find a Security bug in Doctrine, please report it on Jira and change the
Security Level to "Security Issues". It will be visible to Doctrine Core
+2 -2
View File
@@ -289,8 +289,8 @@ If you would still like to perform batching operations over small `UnitOfWork`
instances, it is suggested to follow these paths instead:
* eagerly use `EntityManager#clear()` in conjunction with a specific second level
cache configuration (see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/second-level-cache.html)
* use an explicit change tracking policy (see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/change-tracking-policies.html)
cache configuration (see http://docs.doctrine-project.org/projects/doctrine-orm/en/stable/reference/second-level-cache.html)
* use an explicit change tracking policy (see http://docs.doctrine-project.org/projects/doctrine-orm/en/stable/reference/change-tracking-policies.html)
## Deprecated `YAML` mapping drivers.
+3 -1
View File
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
convertDeprecationsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1" />
<var name="db_driver" value="mysqli"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_port" value="3306"/>
+3 -1
View File
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
convertDeprecationsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1" />
<var name="db_driver" value="pdo_mysql"/>
<var name="db_host" value="127.0.0.1" />
<var name="db_port" value="3306"/>
+3 -1
View File
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
convertDeprecationsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1" />
<var name="db_driver" value="pdo_pgsql"/>
<var name="db_host" value="localhost" />
<var name="db_user" value="postgres" />
+3 -1
View File
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../vendor/phpunit/phpunit/phpunit.xsd"
xsi:noNamespaceSchemaLocation="../../../vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
convertDeprecationsToExceptions="true"
>
<php>
<ini name="error_reporting" value="-1" />
<!-- use an in-memory sqlite database -->
<var name="db_driver" value="pdo_sqlite"/>
<var name="db_memory" value="true"/>
+2 -3
View File
@@ -23,7 +23,6 @@
"php": "^7.1 || ^8.0",
"composer-runtime-api": "^2",
"ext-ctype": "*",
"ext-pdo": "*",
"doctrine/cache": "^1.12.1 || ^2.1.1",
"doctrine/collections": "^1.5",
"doctrine/common": "^3.0.3",
@@ -43,12 +42,12 @@
"doctrine/annotations": "^1.13",
"doctrine/coding-standard": "^9.0",
"phpbench/phpbench": "^0.16.10 || ^1.0",
"phpstan/phpstan": "1.4.3",
"phpstan/phpstan": "~1.4.10 || 1.5.0",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.4",
"squizlabs/php_codesniffer": "3.6.2",
"symfony/cache": "^4.4 || ^5.4 || ^6.0",
"symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0",
"vimeo/psalm": "4.19.0"
"vimeo/psalm": "4.22.0"
},
"conflict": {
"doctrine/annotations": "<1.13 || >= 2.0"
-201
View File
@@ -1,201 +0,0 @@
# -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os, datetime
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append(os.path.abspath('_exts'))
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['configurationblock']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
#source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = u'Doctrine 2 ORM'
copyright = u'2010-%y, Doctrine Project Team'.format(datetime.date.today)
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2'
# The full version, including alpha/beta/rc tags.
release = '2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
language = 'en'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
#unused_docs = []
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
show_authors = True
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'doctrine'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = ['_theme']
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = None
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#html_favicon = None
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If false, no index is generated.
#html_use_index = True
# If true, the index is split into individual pages for each letter.
#html_split_index = False
# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# Output file base name for HTML help builder.
htmlhelp_basename = 'Doctrine2ORMdoc'
# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Doctrine2ORM.tex', u'Doctrine 2 ORM Documentation',
u'Doctrine Project Team', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True
primary_domain = "dcorm"
def linkcode_resolve(domain, info):
if domain == 'dcorm':
return 'http://'
return None
@@ -131,8 +131,8 @@ generation of a DateDiff FunctionNode somewhere in the AST of the
dql statement.
The ``ArithmeticPrimary`` method call is the most common
denominator of valid EBNF tokens taken from the
`DQL EBNF grammar <https://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#ebnf>`_
denominator of valid EBNF tokens taken from the :ref:`DQL EBNF grammar
<dql_ebnf_grammar>`
that matches our requirements for valid input into the DateDiff Dql
function. Picking the right tokens for your methods is a tricky
business, but the EBNF grammar is pretty helpful finding it, as is
@@ -3,8 +3,8 @@ Implementing Wakeup or Clone
.. sectionauthor:: Roman Borschel (roman@code-factory.org)
As explained in the
`restrictions for entity classes in the manual <https://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/architecture.html#entities>`_,
As explained in the :ref:`restrictions for entity classes in the manual
<terminology_entities>`,
it is usually not allowed for an entity to implement ``__wakeup``
or ``__clone``, because Doctrine makes special use of them.
However, it is quite easy to make use of these methods in a safe
+1 -4
View File
@@ -195,10 +195,7 @@ SQL Logger (***Optional***)
Gets or sets the logger to use for logging all SQL statements
executed by Doctrine. The logger class must implement the
``Doctrine\DBAL\Logging\SQLLogger`` interface. A simple default
implementation that logs to the standard output using ``echo`` and
``var_dump`` can be found at
``Doctrine\DBAL\Logging\EchoSQLLogger``.
deprecated ``Doctrine\DBAL\Logging\SQLLogger`` interface.
Auto-generating Proxy Classes (***OPTIONAL***)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+2
View File
@@ -66,6 +66,8 @@ The root namespace of the ORM package is ``Doctrine\ORM``.
Terminology
-----------
.. _terminology_entities:
Entities
~~~~~~~~
+3 -3
View File
@@ -570,7 +570,7 @@ Example with partial indexes:
<?php
use Doctrine\ORM\Mapping\Index;
#[Index(name: "search_idx", columns: {"category"},
#[Index(name: "search_idx", columns: ["category"],
options: [
"where": "((category IS NOT NULL))"
]
@@ -628,7 +628,7 @@ Examples:
#[Entity]
#[InheritanceType("SINGLE_TABLE")]
#[DiscriminatorColumn(name: "discr", type: "string")]
#[DiscriminatorMap({"person" = "Person", "employee" = "Employee"})]
#[DiscriminatorMap(["person" => "Person", "employee" => "Employee"])]
class Person
{
// ...
@@ -637,7 +637,7 @@ Examples:
#[Entity]
#[InheritanceType("JOINED")]
#[DiscriminatorColumn(name: "discr", type: "string")]
#[DiscriminatorMap({"person" = "Person", "employee" = "Employee"})]
#[DiscriminatorMap(["person" => "Person", "employee" => "Employee"])]
class Person
{
// ...
+101 -56
View File
@@ -14,17 +14,11 @@ After working through this guide you should know:
Mapping of associations will be covered in the next chapter on
:doc:`Association Mapping <association-mapping>`.
Guide Assumptions
-----------------
You should have already :doc:`installed and configure <configuration>`
Doctrine.
Creating Classes for the Database
---------------------------------
Every PHP object that you want to save in the database using Doctrine
is called an "Entity". The term "Entity" describes objects
is called an *Entity*. The term "Entity" describes objects
that have an identity over many independent requests. This identity is
usually achieved by assigning a unique identifier to an entity.
In this tutorial the following ``Message`` PHP class will serve as the
@@ -50,11 +44,11 @@ that describes your entity.
Doctrine provides several different ways to specify object-relational
mapping metadata:
- :doc:`Docblock Annotations <annotations-reference>`
- :doc:`Attributes <attributes-reference>`
- :doc:`Docblock Annotations <annotations-reference>`
- :doc:`XML <xml-mapping>`
- :doc:`YAML <yaml-mapping>`
- :doc:`PHP code <php-mapping>`
- :doc:`YAML <yaml-mapping>` (deprecated and will be removed in ``doctrine/orm`` 3.0.)
This manual will usually show mapping metadata via docblock annotations, though
many examples also show the equivalent configuration in YAML and XML.
@@ -62,8 +56,8 @@ many examples also show the equivalent configuration in YAML and XML.
.. note::
All metadata drivers perform equally. Once the metadata of a class has been
read from the source (annotations, xml or yaml) it is stored in an instance
of the ``Doctrine\ORM\Mapping\ClassMetadata`` class and these instances are
read from the source (attributes, annotations, XML, etc.) it is stored in an instance
of the ``Doctrine\ORM\Mapping\ClassMetadata`` class which are
stored in the metadata cache. If you're not using a metadata cache (not
recommended!) then the XML driver is the fastest.
@@ -71,9 +65,22 @@ Marking our ``Message`` class as an entity for Doctrine is straightforward:
.. configuration-block::
.. code-block:: php
.. code-block:: attribute
<?php
use Doctrine\ORM\Mapping\Entity;
#[Entity]
class Message
{
// ...
}
.. code-block:: annotation
<?php
use Doctrine\ORM\Mapping\Entity;
/** @Entity */
class Message
{
@@ -100,9 +107,25 @@ You can change this by configuring information about the table:
.. configuration-block::
.. code-block:: php
.. code-block:: attribute
<?php
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Table;
#[Entity]
#[Table(name: 'message')]
class Message
{
// ...
}
.. code-block:: annotation
<?php
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Table;
/**
* @Entity
* @Table(name="message")
@@ -132,19 +155,38 @@ Now the class ``Message`` will be saved and fetched from the table ``message``.
Property Mapping
----------------
The next step after marking a PHP class as an entity is mapping its properties
to columns in a table.
The next step is mapping its properties to columns in the table.
To configure a property use the ``@Column`` docblock annotation. The ``type``
To configure a property use the ``Column`` docblock annotation. The ``type``
attribute specifies the :ref:`Doctrine Mapping Type <reference-mapping-types>`
to use for the field. If the type is not specified, ``string`` is used as the
default.
.. configuration-block::
.. code-block:: php
.. code-block:: attribute
<?php
use Doctrine\ORM\Mapping\Column;
use Doctrine\DBAL\Types\Types;
#[Entity]
class Message
{
#[Column(type: Types::INTEGER)]
private $id;
#[Column(length: 140)]
private $text;
#[Column(name: 'posted_at', type: Types::DATETIME)]
private $postedAt;
}
.. code-block:: annotation
<?php
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Column;
/** @Entity */
class Message
{
@@ -180,42 +222,34 @@ default.
column: posted_at
When we don't explicitly specify a column name via the ``name`` option, Doctrine
assumes the field name is also the column name. This means that:
assumes the field name is also the column name. So in this example:
* the ``id`` property will map to the column ``id`` using the type ``integer``;
* the ``text`` property will map to the column ``text`` with the default mapping type ``string``;
* the ``postedAt`` property will map to the ``posted_at`` column with the ``datetime`` type.
The Column annotation has some more attributes. Here is a complete
list:
Here is a complete list of ``Column``s attributes (all optional):
- ``type``: (optional, defaults to 'string') The mapping type to
use for the column.
- ``name``: (optional, defaults to field name) The name of the
column in the database.
- ``length``: (optional, default 255) The length of the column in
the database. (Applies only if a string-valued column is used).
- ``unique``: (optional, default FALSE) Whether the column is a
unique key.
- ``nullable``: (optional, default FALSE) Whether the database
column is nullable.
- ``insertable``: (optional, default TRUE) Whether the database
column should be inserted.
- ``updatable``: (optional, default TRUE) Whether the database
column should be updated.
- ``enumType``: (optional, requires PHP 8.1 and ORM 2.11) The PHP enum type
name to convert the database value into.
- ``precision``: (optional, default 0) The precision for a decimal
(exact numeric) column (applies only for decimal column),
- ``type`` (default: 'string'): The mapping type to use for the column.
- ``name`` (default: name of property): The name of the column in the database.
- ``length`` (default: 255): The length of the column in the database.
Applies only if a string-valued column is used.
- ``unique`` (default: ``false``): Whether the column is a unique key.
- ``nullable`` (default: ``false``): Whether the column is nullable.
- ``insertable`` (default: ``true``): Whether the column should be inserted.
- ``updatable`` (default: ``true``): Whether the column should be updated.
- ``enumType`` (requires PHP 8.1 and ``doctrine/orm`` 2.11): The PHP enum class name to convert the database value into.
- ``precision`` (default: 0): The precision for a decimal (exact numeric) column
(applies only for decimal column),
which is the maximum number of digits that are stored for the values.
- ``scale``: (optional, default 0) The scale for a decimal (exact
- ``scale`` (default: 0): The scale for a decimal (exact
numeric) column (applies only for decimal column), which represents
the number of digits to the right of the decimal point and must
not be greater than *precision*.
- ``columnDefinition``: (optional) Allows to define a custom
not be greater than ``precision``.
- ``columnDefinition``: Allows to define a custom
DDL snippet that is used to create the column. Warning: This normally
confuses the SchemaTool to always detect the column as changed.
- ``options``: (optional) Key-value pairs of options that get passed
confuses the :doc:`SchemaTool <tools>` to always detect the column as changed.
- ``options``: Key-value pairs of options that get passed
to the underlying database platform when generating DDL statements.
.. _reference-php-mapping-types:
@@ -223,21 +257,32 @@ list:
PHP Types Mapping
_________________
Since version 2.9 Doctrine can determine usable defaults from property types
on entity classes. When property type is nullable this has no effect on
``nullable`` Column attribute at the moment for backwards compatibility
reasons.
.. versionadded:: 2.9
Additionally, Doctrine will map PHP types to ``type`` attribute as follows:
The column types can be inferred automatically from PHP's property types.
However, when the property type is nullable this has no effect on the ``nullable`` Column attribute.
- ``DateInterval``: ``dateinterval``
- ``DateTime``: ``datetime``
- ``DateTimeImmutable``: ``datetime_immutable``
- ``array``: ``json``
- ``bool``: ``boolean``
- ``float``: ``float``
- ``int``: ``integer``
- ``string`` or any other type: ``string``
These are the "automatic" mapping rules:
+-----------------------+-------------------------------+
| PHP property type | Doctrine column type |
+=======================+===============================+
| ``DateInterval`` | ``Types::DATEINTERVAL`` |
+-----------------------+-------------------------------+
| ``DateTime`` | ``Types::DATETIME_MUTABLE`` |
+-----------------------+-------------------------------+
| ``DateTimeImmutable`` | ``Types::DATETIME_IMMUTABLE`` |
+-----------------------+-------------------------------+
| ``array`` | ``Types::JSON`` |
+-----------------------+-------------------------------+
| ``bool`` | ``Types::BOOLEAN`` |
+-----------------------+-------------------------------+
| ``float`` | ``Types::FLOAT`` |
+-----------------------+-------------------------------+
| ``int`` | ``Types::INTEGER`` |
+-----------------------+-------------------------------+
| Any other type | ``Types::STRING`` |
+-----------------------+-------------------------------+
As of version 2.11 Doctrine can also automatically map typed properties using a
PHP 8.1 enum to set the right ``type`` and ``enumType``.
+1 -1
View File
@@ -95,7 +95,7 @@ If you want to configure Doctrine in more detail, take a look at the :doc:`Advan
.. note::
You can learn more about the database connection configuration in the
`Doctrine DBAL connection configuration reference <https://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html>`_.
`Doctrine DBAL connection configuration reference <https://docs.doctrine-project.org/projects/doctrine-dbal/en/stable/reference/configuration.html>`_.
Setting up the Commandline Tool
-------------------------------
@@ -1531,6 +1531,8 @@ Given that there are 10 users and corresponding addresses in the database the ex
a one-by-one basis once they are accessed.
.. _dql_ebnf_grammar:
EBNF
----
+13 -13
View File
@@ -142,33 +142,33 @@ Events Overview
| Event | Dispatched by | Lifecycle | Passed |
| | | Callback | Argument |
+=================================================================+=======================+===========+=====================================+
| :ref:`preRemove<reference-events-pre-remove>` | ``$em->remove()`` | Yes | `_LifecycleEventArgs`_ |
| :ref:`preRemove<reference-events-pre-remove>` | ``$em->remove()`` | Yes | `LifecycleEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`postRemove<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `_LifecycleEventArgs`_ |
| :ref:`postRemove<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `LifecycleEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`prePersist<reference-events-pre-persist>` | ``$em->persist()`` | Yes | `_LifecycleEventArgs`_ |
| :ref:`prePersist<reference-events-pre-persist>` | ``$em->persist()`` | Yes | `LifecycleEventArgs`_ |
| | on *initial* persist | | |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`postPersist<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `_LifecycleEventArgs`_ |
| :ref:`postPersist<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `LifecycleEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`preUpdate<reference-events-pre-update>` | ``$em->flush()`` | Yes | `_PreUpdateEventArgs`_ |
| :ref:`preUpdate<reference-events-pre-update>` | ``$em->flush()`` | Yes | `PreUpdateEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`postUpdate<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `_LifecycleEventArgs`_ |
| :ref:`postUpdate<reference-events-post-update-remove-persist>` | ``$em->flush()`` | Yes | `LifecycleEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`postLoad<reference-events-post-load>` | Loading from database | Yes | `_LifecycleEventArgs`_ |
| :ref:`postLoad<reference-events-post-load>` | Loading from database | Yes | `LifecycleEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`loadClassMetadata<reference-events-load-class-metadata>` | Loading of mapping | No | `_LoadClassMetadataEventArgs` |
| :ref:`loadClassMetadata<reference-events-load-class-metadata>` | Loading of mapping | No | `LoadClassMetadataEventArgs`_ |
| | metadata | | |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| ``onClassMetadataNotFound`` | ``MappingException`` | No | `_OnClassMetadataNotFoundEventArgs` |
| ``onClassMetadataNotFound`` | ``MappingException`` | No | `OnClassMetadataNotFoundEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`preFlush<reference-events-pre-flush>` | ``$em->flush()`` | Yes | `_PreFlushEventArgs`_ |
| :ref:`preFlush<reference-events-pre-flush>` | ``$em->flush()`` | Yes | `PreFlushEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`onFlush<reference-events-on-flush>` | ``$em->flush()`` | No | `_OnFlushEventArgs` |
| :ref:`onFlush<reference-events-on-flush>` | ``$em->flush()`` | No | `OnFlushEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`postFlush<reference-events-post-flush>` | ``$em->flush()`` | No | `_PostFlushEventArgs` |
| :ref:`postFlush<reference-events-post-flush>` | ``$em->flush()`` | No | `PostFlushEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
| :ref:`onClear<reference-events-on-clear>` | ``$em->clear()`` | No | `_OnClearEventArgs` |
| :ref:`onClear<reference-events-on-clear>` | ``$em->clear()`` | No | `OnClearEventArgs`_ |
+-----------------------------------------------------------------+-----------------------+-----------+-------------------------------------+
Naming convention
+1 -1
View File
@@ -13,7 +13,7 @@ as you want, or just pick a preferred one.
The ``QueryBuilder`` is not an abstraction of DQL, but merely a tool to dynamically build it.
You should still use plain DQL when you can, as it is simpler and more readable.
More about this in the :doc:`FAQ <faq>`_.
More about this in the :doc:`FAQ <faq>`.
Constructing a new QueryBuilder object
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+5 -5
View File
@@ -371,11 +371,11 @@ abstract class AbstractQuery
/**
* Sets a query parameter.
*
* @param string|int $key The parameter position or name.
* @param mixed $value The parameter value.
* @param string|null $type The parameter type. If specified, the given value will be run through
* the type conversion of this type. This is usually not needed for
* strings and numeric types.
* @param string|int $key The parameter position or name.
* @param mixed $value The parameter value.
* @param string|int|null $type The parameter type. If specified, the given value will be run through
* the type conversion of this type. This is usually not needed for
* strings and numeric types.
*
* @return $this
*/
+10
View File
@@ -39,11 +39,13 @@ use Doctrine\ORM\Repository\DefaultRepositoryFactory;
use Doctrine\ORM\Repository\RepositoryFactory;
use Doctrine\Persistence\Mapping\Driver\MappingDriver;
use Doctrine\Persistence\ObjectRepository;
use LogicException;
use Psr\Cache\CacheItemPoolInterface;
use ReflectionClass;
use function class_exists;
use function method_exists;
use function sprintf;
use function strtolower;
use function trim;
@@ -162,6 +164,14 @@ class Configuration extends \Doctrine\DBAL\Configuration
*/
public function newDefaultAnnotationDriver($paths = [], $useSimpleAnnotationReader = true)
{
if (! class_exists(AnnotationReader::class)) {
throw new LogicException(sprintf(
'The annotation metadata driver cannot be enabled because the "doctrine/annotations" library'
. ' is not installed. Please run "composer require doctrine/annotations" or choose a different'
. ' metadata driver.'
));
}
AnnotationRegistry::registerFile(__DIR__ . '/Mapping/Driver/DoctrineAnnotations.php');
if ($useSimpleAnnotationReader) {
+3 -2
View File
@@ -17,6 +17,7 @@ use Doctrine\ORM\Exception\InvalidHydrationMode;
use Doctrine\ORM\Exception\MismatchedEventManager;
use Doctrine\ORM\Exception\MissingIdentifierField;
use Doctrine\ORM\Exception\MissingMappingDriverImplementation;
use Doctrine\ORM\Exception\ORMException;
use Doctrine\ORM\Exception\UnrecognizedIdentifierFields;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
@@ -59,7 +60,7 @@ use function sprintf;
* $entityManager = EntityManager::create($dbParams, $config);
*
* For more information see
* {@link http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html}
* {@link http://docs.doctrine-project.org/projects/doctrine-orm/en/stable/reference/configuration.html}
*
* You should never attempt to inherit from the EntityManager: Inheritance
* is not a valid extension point for the EntityManager. Instead you
@@ -778,7 +779,7 @@ use function sprintf;
* @return ObjectRepository|EntityRepository The repository class.
* @psalm-return EntityRepository<T>
*
* @template T
* @template T of object
*/
public function getRepository($entityName)
{
+2 -1
View File
@@ -9,6 +9,7 @@ use DateTimeInterface;
use Doctrine\Common\EventManager;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\Exception\ORMException;
use Doctrine\ORM\Internal\Hydration\AbstractHydrator;
use Doctrine\ORM\Proxy\ProxyFactory;
use Doctrine\ORM\Query\Expr;
@@ -31,7 +32,7 @@ interface EntityManagerInterface extends ObjectManager
*
* @psalm-return EntityRepository<T>
*
* @template T
* @template T of object
*/
public function getRepository($className);
+1 -1
View File
@@ -30,7 +30,7 @@ use function substr;
* This class is designed for inheritance and users can subclass this class to
* write their own repositories with business-specific methods to locate entities.
*
* @template T
* @template T of object
* @template-implements Selectable<int,T>
* @template-implements ObjectRepository<T>
*/
@@ -7,6 +7,7 @@ namespace Doctrine\ORM\Internal\Hydration;
use Doctrine\DBAL\Driver\Exception;
use Doctrine\ORM\Exception\MultipleSelectorsFoundException;
use function array_column;
use function count;
/**
@@ -26,12 +27,8 @@ final class ScalarColumnHydrator extends AbstractHydrator
throw MultipleSelectorsFoundException::create($this->resultSetMapping()->fieldMappings);
}
$result = [];
$result = $this->statement()->fetchAllNumeric();
while ($row = $this->statement()->fetchOne()) {
$result[] = $row;
}
return $result;
return array_column($result, 0);
}
}
@@ -59,9 +59,9 @@ class ClassMetadataBuilder
/**
* Adds and embedded class
*
* @param string $fieldName
* @param string $class
* @param string|null $columnPrefix
* @param string $fieldName
* @param string $class
* @param string|false|null $columnPrefix
*
* @return $this
*/
@@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\Persistence\Mapping\Driver\AnnotationDriver;
use LogicException;
use ReflectionClass;
use ReflectionMethod;
use ReflectionProperty;
@@ -20,6 +21,9 @@ use function class_exists;
use function constant;
use function defined;
use function get_class;
use function sprintf;
use const PHP_VERSION_ID;
class AttributeDriver extends AnnotationDriver
{
@@ -35,6 +39,13 @@ class AttributeDriver extends AnnotationDriver
*/
public function __construct(array $paths)
{
if (PHP_VERSION_ID < 80000) {
throw new LogicException(sprintf(
'The attribute metadata driver cannot be enabled on PHP 7. Please upgrade to PHP 8 or choose a different'
. ' metadata driver.'
));
}
parent::__construct(new AttributeReader(), $paths);
}
@@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping\MappingException;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\Persistence\Mapping\Driver\FileDriver;
use InvalidArgumentException;
use LogicException;
use SimpleXMLElement;
use function assert;
@@ -18,6 +19,7 @@ use function constant;
use function count;
use function defined;
use function explode;
use function extension_loaded;
use function file_get_contents;
use function in_array;
use function simplexml_load_string;
@@ -39,6 +41,13 @@ class XmlDriver extends FileDriver
*/
public function __construct($locator, $fileExtension = self::DEFAULT_FILE_EXTENSION)
{
if (! extension_loaded('simplexml')) {
throw new LogicException(sprintf(
'The XML metadata driver cannot be enabled because the SimpleXML PHP extension is missing.'
. ' Please configure PHP with SimpleXML or choose a different metadata driver.'
));
}
parent::__construct($locator, $fileExtension);
}
@@ -11,9 +11,11 @@ use Doctrine\ORM\Mapping\MappingException;
use Doctrine\Persistence\Mapping\ClassMetadata;
use Doctrine\Persistence\Mapping\Driver\FileDriver;
use InvalidArgumentException;
use LogicException;
use Symfony\Component\Yaml\Yaml;
use function array_map;
use function class_exists;
use function constant;
use function defined;
use function explode;
@@ -45,6 +47,14 @@ class YamlDriver extends FileDriver
'YAML mapping driver is deprecated and will be removed in Doctrine ORM 3.0, please migrate to attribute or XML driver.'
);
if (! class_exists(Yaml::class)) {
throw new LogicException(sprintf(
'The YAML metadata driver cannot be enabled because the "symfony/yaml" library'
. ' is not installed. Please run "composer require symfony/yaml" or choose a different'
. ' metadata driver.'
));
}
parent::__construct($locator, $fileExtension);
}
+4 -4
View File
@@ -31,10 +31,10 @@ final class Index implements Annotation
public $options;
/**
* @param array<string>|null $columns
* @param array<string>|null $fields
* @param array<string>|null $flags
* @param array<string>|null $options
* @param array<string>|null $columns
* @param array<string>|null $fields
* @param array<string>|null $flags
* @param array<string,mixed>|null $options
*/
public function __construct(
?array $columns = null,
@@ -4,11 +4,6 @@ declare(strict_types=1);
namespace Doctrine\ORM\Query\AST;
/**
* Description of AggregateExpression.
*
* @link www.doctrine-project.org
*/
class AggregateExpression extends Node
{
/** @var string */
@@ -10,11 +10,6 @@ use function is_numeric;
use function strlen;
use function substr;
/**
* Description of InputParameter.
*
* @link www.doctrine-project.org
*/
class InputParameter extends Node
{
/** @var bool */
+5 -4
View File
@@ -97,8 +97,7 @@ class FilterCollection
// Keep the enabled filters sorted for the hash
ksort($this->enabledFilters);
// Now the filter collection is dirty
$this->filtersState = self::FILTERS_STATE_DIRTY;
$this->setFiltersStateDirty();
}
return $this->enabledFilters[$name];
@@ -120,8 +119,7 @@ class FilterCollection
unset($this->enabledFilters[$name]);
// Now the filter collection is dirty
$this->filtersState = self::FILTERS_STATE_DIRTY;
$this->setFiltersStateDirty();
return $filter;
}
@@ -194,6 +192,9 @@ class FilterCollection
$filterHash .= $name . $filter;
}
$this->filterHash = $filterHash;
$this->filtersState = self::FILTERS_STATE_CLEAN;
return $filterHash;
}
+1 -1
View File
@@ -2809,7 +2809,7 @@ class Parser
/**
* SimpleArithmeticExpression ::= ArithmeticTerm {("+" | "-") ArithmeticTerm}*
*
* @return SimpleArithmeticExpression
* @return SimpleArithmeticExpression|ArithmeticTerm
*/
public function SimpleArithmeticExpression()
{
@@ -8,11 +8,6 @@ use Doctrine\ORM\Exception\ORMException;
use Doctrine\ORM\Query\AST\PathExpression;
use Exception;
/**
* Description of QueryException.
*
* @link www.doctrine-project.org
*/
class QueryException extends ORMException
{
/**
@@ -73,7 +73,7 @@ class XmlExporter extends AbstractExporter
$discriminatorColumnXml->addAttribute('type', $metadata->discriminatorColumn['type']);
if (isset($metadata->discriminatorColumn['length'])) {
$discriminatorColumnXml->addAttribute('length', $metadata->discriminatorColumn['length']);
$discriminatorColumnXml->addAttribute('length', (string) $metadata->discriminatorColumn['length']);
}
}
@@ -339,7 +339,7 @@ class XmlExporter extends AbstractExporter
}
if (isset($inverseJoinColumn['nullable'])) {
$inverseJoinColumnXml->addAttribute('nullable', $inverseJoinColumn['nullable']);
$inverseJoinColumnXml->addAttribute('nullable', $inverseJoinColumn['nullable'] ? 'true' : 'false');
}
if (isset($inverseJoinColumn['orderBy'])) {
@@ -365,7 +365,7 @@ class XmlExporter extends AbstractExporter
}
if (isset($joinColumn['nullable'])) {
$joinColumnXml->addAttribute('nullable', $joinColumn['nullable']);
$joinColumnXml->addAttribute('nullable', $joinColumn['nullable'] ? 'true' : 'false');
}
}
}
+3 -3
View File
@@ -134,9 +134,9 @@ class SchemaValidator
'field ' . $assoc['targetEntity'] . '#' . $assoc['inversedBy'] . ' which does not exist.';
} elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] === null) {
$ce[] = 'The field ' . $class->name . '#' . $fieldName . ' is on the owning side of a ' .
'bi-directional relationship, but the specified mappedBy association on the target-entity ' .
$assoc['targetEntity'] . '#' . $assoc['mappedBy'] . ' does not contain the required ' .
"'inversedBy' attribute.";
'bi-directional relationship, but the specified inversedBy association on the target-entity ' .
$assoc['targetEntity'] . '#' . $assoc['inversedBy'] . ' does not contain the required ' .
"'mappedBy=\"" . $fieldName . "\"' attribute.";
} elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] !== $fieldName) {
$ce[] = 'The mappings ' . $class->name . '#' . $fieldName . ' and ' .
$assoc['targetEntity'] . '#' . $assoc['inversedBy'] . ' are ' .
+1 -1
View File
@@ -197,7 +197,7 @@ class Setup
$cache = class_exists(ArrayCache::class) ? new ArrayCache() : new ArrayAdapter();
} elseif (extension_loaded('apcu')) {
$cache = class_exists(ApcuCache::class) ? new ApcuCache() : new ApcuAdapter();
} elseif (extension_loaded('memcached')) {
} elseif (extension_loaded('memcached') && (class_exists(MemcachedCache::class) || MemcachedAdapter::isSupported())) {
$memcached = new Memcached();
$memcached->addServer('127.0.0.1', 11211);
+2 -1
View File
@@ -19,6 +19,7 @@ use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Event\PostFlushEventArgs;
use Doctrine\ORM\Event\PreFlushEventArgs;
use Doctrine\ORM\Event\PreUpdateEventArgs;
use Doctrine\ORM\Exception\ORMException;
use Doctrine\ORM\Exception\UnexpectedAssociationValue;
use Doctrine\ORM\Id\AssignedGenerator;
use Doctrine\ORM\Internal\CommitOrderCalculator;
@@ -103,7 +104,7 @@ class UnitOfWork implements PropertyChangedListener
* Hint used to collect all primary keys of associated entities during hydration
* and execute it in a dedicated query afterwards
*
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql
* @see https://www.doctrine-project.org/projects/doctrine-orm/en/stable/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql
*/
public const HINT_DEFEREAGERLOAD = 'deferEagerLoad';
+26 -56
View File
@@ -1,5 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Method Doctrine\\\\ORM\\\\AbstractQuery\\:\\:processParameterValue\\(\\) should return array\\|bool\\|float\\|int\\|string but returns mixed\\.$#"
count: 1
path: lib/Doctrine/ORM/AbstractQuery.php
-
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\Persisters\\\\Entity\\\\EntityPersister\\:\\:getCacheRegion\\(\\)\\.$#"
count: 1
@@ -130,36 +135,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:find\\(\\) should return T\\|null but returns object\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:find\\(\\) should return T\\|null but returns object\\|null\\.$#"
count: 3
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return T\\|null but returns object\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getPartialReference\\(\\) should return T\\|null but returns object\\|null\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return T\\|null but returns Doctrine\\\\Common\\\\Proxy\\\\Proxy\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityManager\\:\\:getReference\\(\\) should return T\\|null but returns object\\|null\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityManager.php
-
message: "#^Result of && is always false\\.$#"
count: 1
@@ -175,16 +150,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/EntityManagerInterface.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityRepository\\:\\:find\\(\\) should return T\\|null but returns object\\|null\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityRepository.php
-
message: "#^Method Doctrine\\\\ORM\\\\EntityRepository\\:\\:findOneBy\\(\\) should return T\\|null but returns object\\|null\\.$#"
count: 1
path: lib/Doctrine/ORM/EntityRepository.php
-
message: "#^Method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:find\\(\\) invoked with 4 parameters, 2 required\\.$#"
count: 1
@@ -700,11 +665,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/PersistentCollection.php
-
message: "#^Method Doctrine\\\\ORM\\\\PersistentCollection\\:\\:slice\\(\\) should return array\\<TKey of \\(int\\|string\\), T\\> but returns array\\.$#"
count: 2
path: lib/Doctrine/ORM/PersistentCollection.php
-
message: "#^Right side of && is always true\\.$#"
count: 2
@@ -920,11 +880,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/Query/Expr/Select.php
-
message: "#^Property Doctrine\\\\ORM\\\\Query\\\\FilterCollection\\:\\:\\$filterHash is never written, only read\\.$#"
count: 1
path: lib/Doctrine/ORM/Query/FilterCollection.php
-
message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#"
count: 3
@@ -936,12 +891,7 @@ parameters:
path: lib/Doctrine/ORM/Query/Parser.php
-
message: "#^Method Doctrine\\\\ORM\\\\Query\\\\Parser\\:\\:ArithmeticTerm\\(\\) should return Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticTerm but returns Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticFactor\\|string\\.$#"
count: 1
path: lib/Doctrine/ORM/Query/Parser.php
-
message: "#^Method Doctrine\\\\ORM\\\\Query\\\\Parser\\:\\:SimpleArithmeticExpression\\(\\) should return Doctrine\\\\ORM\\\\Query\\\\AST\\\\SimpleArithmeticExpression but returns Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticTerm\\|string\\.$#"
message: "#^Method Doctrine\\\\ORM\\\\Query\\\\Parser\\:\\:ArithmeticTerm\\(\\) should return Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticTerm but returns Doctrine\\\\ORM\\\\Query\\\\AST\\\\ArithmeticFactor\\|int\\|string\\.$#"
count: 1
path: lib/Doctrine/ORM/Query/Parser.php
@@ -1730,6 +1680,26 @@ parameters:
count: 2
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
-
message: "#^Offset 'indexes' on array\\{name\\: string, schema\\: string, indexes\\: array, uniqueConstraints\\: array, options\\: array\\<string, mixed\\>, quoted\\?\\: bool\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
-
message: "#^Offset 'options' on array\\{name\\: string, schema\\: string, indexes\\: array, uniqueConstraints\\: array, options\\: array\\<string, mixed\\>, quoted\\?\\: bool\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
-
message: "#^Offset 'schema' on array\\{name\\: string, schema\\: string, indexes\\: array, uniqueConstraints\\: array, options\\: array\\<string, mixed\\>, quoted\\?\\: bool\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
-
message: "#^Offset 'uniqueConstraints' on array\\{name\\: string, schema\\: string, indexes\\: array, uniqueConstraints\\: array, options\\: array\\<string, mixed\\>, quoted\\?\\: bool\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
-
message: "#^Property Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo\\<object\\>\\:\\:\\$lifecycleCallbacks \\(array\\<string, array\\<int, string\\>\\>\\) in isset\\(\\) is not nullable\\.$#"
count: 1
+2
View File
@@ -16,6 +16,7 @@
colors="true"
verbose="false"
failOnRisky="true"
convertDeprecationsToExceptions="true"
bootstrap="./tests/Doctrine/Tests/TestInit.php"
>
<testsuites>
@@ -32,6 +33,7 @@
</groups>
<php>
<ini name="error_reporting" value="-1" />
<!-- "Real" test database -->
<var name="db_driver" value="pdo_sqlite"/>
<var name="db_memory" value="true"/>
+98 -97
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.19.0@a2ad69ae4f5ab1f7d225a8dc4e2ec2d9415ed599">
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<DeprecatedClass occurrences="1">
<code>IterableResult</code>
@@ -508,12 +508,6 @@
<code>$entity</code>
</PossiblyNullArgument>
</file>
<file src="lib/Doctrine/ORM/Id/SequenceGenerator.php">
<MethodSignatureMustProvideReturnType occurrences="2">
<code>serialize</code>
<code>unserialize</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Id/TableGenerator.php">
<PossiblyFalseOperand occurrences="3">
<code>$currentLevel</code>
@@ -743,9 +737,6 @@
<code>$className</code>
<code>$this-&gt;namespace . '\\' . $className</code>
</LessSpecificReturnStatement>
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<MissingClosureParamType occurrences="2">
<code>$joinColumn</code>
<code>$joinColumn</code>
@@ -1468,6 +1459,14 @@
<ImplementedReturnTypeMismatch occurrences="1">
<code>int|null</code>
</ImplementedReturnTypeMismatch>
<InvalidReturnStatement occurrences="2">
<code>$numDeleted</code>
<code>$this-&gt;conn-&gt;executeStatement($statement, $parameters)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="2">
<code>int</code>
<code>int</code>
</InvalidReturnType>
<PossiblyNullArgument occurrences="14">
<code>$collection-&gt;getOwner()</code>
<code>$collection-&gt;getOwner()</code>
@@ -1749,6 +1748,9 @@
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/AbsFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="1">
<code>$simpleArithmeticExpression</code>
</PropertyNotSetInConstructor>
@@ -1842,15 +1844,15 @@
</ParamNameMismatch>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;getLexer()-&gt;token['value']</code>
</PossiblyInvalidPropertyAssignmentValue>
<PossiblyNullArrayAccess occurrences="1">
<code>$parser-&gt;getLexer()-&gt;token['value']</code>
</PossiblyNullArrayAccess>
<PossiblyNullArrayOffset occurrences="1">
<code>$class-&gt;associationMappings</code>
</PossiblyNullArrayOffset>
<PossiblyNullPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;getLexer()-&gt;token['value']</code>
</PossiblyNullPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$fieldMapping</code>
<code>$pathExpression</code>
@@ -1871,6 +1873,9 @@
<PossiblyInvalidArgument occurrences="1">
<code>$this-&gt;simpleArithmeticExpression</code>
</PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstStringPrimary</code>
<code>$secondStringPrimary</code>
@@ -1895,6 +1900,10 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/ModFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstSimpleArithmeticExpression</code>
<code>$secondSimpleArithmeticExpression</code>
@@ -1909,11 +1918,18 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/SqrtFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="1">
<code>$simpleArithmeticExpression</code>
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/SubstringFunction.php">
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<code>$parser-&gt;SimpleArithmeticExpression()</code>
<code>$parser-&gt;SimpleArithmeticExpression()</code>
</PossiblyInvalidPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="2">
<code>$firstSimpleArithmeticExpression</code>
<code>$stringPrimary</code>
@@ -1925,16 +1941,18 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/AST/Functions/TrimFunction.php">
<PossiblyNullArgument occurrences="1">
<PossiblyInvalidArgument occurrences="3">
<code>$value</code>
</PossiblyNullArgument>
<code>$value</code>
<code>$value</code>
</PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="1">
<code>$lexer-&gt;token['value']</code>
</PossiblyInvalidPropertyAssignmentValue>
<PossiblyNullArrayAccess occurrences="2">
<code>$lexer-&gt;lookahead['value']</code>
<code>$lexer-&gt;token['value']</code>
</PossiblyNullArrayAccess>
<PossiblyNullPropertyAssignmentValue occurrences="1">
<code>$lexer-&gt;token['value']</code>
</PossiblyNullPropertyAssignmentValue>
<PropertyNotSetInConstructor occurrences="4">
<code>$both</code>
<code>$leading</code>
@@ -2047,9 +2065,6 @@
<DocblockTypeContradiction occurrences="1">
<code>is_array($obj)</code>
</DocblockTypeContradiction>
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<RedundantConditionGivenDocblockType occurrences="1">
<code>is_object($obj)</code>
</RedundantConditionGivenDocblockType>
@@ -2192,6 +2207,12 @@
</PossiblyNullPropertyAssignmentValue>
</file>
<file src="lib/Doctrine/ORM/Query/Exec/MultiTableDeleteExecutor.php">
<InvalidReturnStatement occurrences="1">
<code>$numDeleted</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>int</code>
</InvalidReturnType>
<PossiblyInvalidIterator occurrences="1">
<code>$this-&gt;_sqlStatements</code>
</PossiblyInvalidIterator>
@@ -2204,6 +2225,12 @@
</UninitializedProperty>
</file>
<file src="lib/Doctrine/ORM/Query/Exec/MultiTableUpdateExecutor.php">
<InvalidReturnStatement occurrences="1">
<code>$numUpdated</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>int</code>
</InvalidReturnType>
<PossiblyInvalidIterator occurrences="1">
<code>$this-&gt;_sqlStatements</code>
</PossiblyInvalidIterator>
@@ -2220,6 +2247,12 @@
</PropertyNotSetInConstructor>
</file>
<file src="lib/Doctrine/ORM/Query/Exec/SingleTableDeleteUpdateExecutor.php">
<InvalidReturnStatement occurrences="1">
<code>$conn-&gt;executeStatement($this-&gt;_sqlStatements, $params, $types)</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="1">
<code>int</code>
</InvalidReturnType>
<PossiblyInvalidArgument occurrences="1">
<code>$this-&gt;_sqlStatements</code>
</PossiblyInvalidArgument>
@@ -2243,46 +2276,22 @@
<ArgumentTypeCoercion occurrences="1">
<code>$this-&gt;parts</code>
</ArgumentTypeCoercion>
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PossiblyInvalidCast occurrences="1">
<code>$this-&gt;parts[0]</code>
</PossiblyInvalidCast>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Comparison.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Composite.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PossiblyInvalidCast occurrences="2">
<code>$part</code>
<code>$this-&gt;parts[0]</code>
</PossiblyInvalidCast>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/From.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Func.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/GroupBy.php">
<NonInvariantDocblockPropertyType occurrences="1">
<code>$parts</code>
</NonInvariantDocblockPropertyType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Join.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PossiblyNullArgument occurrences="1">
<code>$this-&gt;conditionType</code>
</PossiblyNullArgument>
@@ -2292,16 +2301,6 @@
<code>$parts</code>
</NonInvariantDocblockPropertyType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Math.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/OrderBy.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Orx.php">
<NonInvariantDocblockPropertyType occurrences="2">
<code>$allowedClasses</code>
@@ -2315,9 +2314,6 @@
</NonInvariantDocblockPropertyType>
</file>
<file src="lib/Doctrine/ORM/Query/Filter/SQLFilter.php">
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<MissingClosureParamType occurrences="1">
<code>$value</code>
</MissingClosureParamType>
@@ -2354,17 +2350,16 @@
<InvalidArgument occurrences="1">
<code>$lookaheadType</code>
</InvalidArgument>
<InvalidNullableReturnType occurrences="6">
<InvalidNullableReturnType occurrences="1">
<code>SelectStatement|UpdateStatement|DeleteStatement</code>
<code>string</code>
<code>string</code>
<code>string</code>
<code>string</code>
<code>string</code>
</InvalidNullableReturnType>
<InvalidReturnStatement occurrences="11">
<InvalidReturnStatement occurrences="17">
<code>$aliasIdentVariable</code>
<code>$factors[0]</code>
<code>$identVariable</code>
<code>$primary</code>
<code>$resultVariable</code>
<code>$resultVariable</code>
<code>$terms[0]</code>
<code>$this-&gt;CollectionMemberExpression()</code>
<code>$this-&gt;ComparisonExpression()</code>
@@ -2374,23 +2369,44 @@
<code>$this-&gt;InstanceOfExpression()</code>
<code>$this-&gt;LikeExpression()</code>
<code>$this-&gt;NullComparisonExpression()</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
</InvalidReturnStatement>
<InvalidReturnType occurrences="4">
<InvalidReturnType occurrences="9">
<code>AST\BetweenExpression|</code>
<code>ArithmeticFactor</code>
<code>ArithmeticTerm</code>
<code>SimpleArithmeticExpression</code>
<code>SimpleArithmeticExpression|ArithmeticTerm</code>
<code>string</code>
<code>string</code>
<code>string</code>
<code>string</code>
<code>string</code>
</InvalidReturnType>
<InvalidScalarArgument occurrences="3">
<InvalidScalarArgument occurrences="13">
<code>$field</code>
<code>$field</code>
<code>$functionName</code>
<code>$functionName</code>
<code>$functionName</code>
<code>$this-&gt;lexer-&gt;getLiteral($token)</code>
<code>$this-&gt;lexer-&gt;getLiteral($token)</code>
<code>$this-&gt;lexer-&gt;getLiteral($token)</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
</InvalidScalarArgument>
<LessSpecificReturnStatement occurrences="3">
<LessSpecificReturnStatement occurrences="4">
<code>$function</code>
<code>$function</code>
<code>$function</code>
<code>$token</code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType occurrences="1">
<code>array{value: string, type: int|null|string, position: int}|null</code>
</MoreSpecificReturnType>
<NullableReturnStatement occurrences="9">
<code>$aliasIdentVariable</code>
<code>$factors[0]</code>
@@ -2405,41 +2421,35 @@
<PossiblyFalseArgument occurrences="1">
<code>strrpos($fromClassName, '\\')</code>
</PossiblyFalseArgument>
<PossiblyInvalidArgument occurrences="6">
<PossiblyInvalidArgument occurrences="14">
<code>$AST</code>
<code>$conditionalExpression</code>
<code>$expr</code>
<code>$pathExp</code>
<code>$stringExpr</code>
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$token['value']</code>
<code>$token['value']</code>
</PossiblyInvalidArgument>
<PossiblyInvalidPropertyAssignmentValue occurrences="2">
<PossiblyInvalidPropertyAssignmentValue occurrences="4">
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;ConditionalExpression()</code>
<code>$this-&gt;SimpleArithmeticExpression()</code>
<code>$value</code>
</PossiblyInvalidPropertyAssignmentValue>
<PossiblyNullArgument occurrences="22">
<PossiblyNullArgument occurrences="6">
<code>$aliasIdentVariable</code>
<code>$dql</code>
<code>$field</code>
<code>$fromClassName</code>
<code>$functionName</code>
<code>$functionName</code>
<code>$functionName</code>
<code>$resultVariable</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;lookahead['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;lexer-&gt;token['value']</code>
<code>$this-&gt;query-&gt;getDQL()</code>
<code>$token['value']</code>
<code>$token['value']</code>
<code>$token['value']</code>
</PossiblyNullArgument>
<PossiblyNullArrayAccess occurrences="74">
<code>$glimpse['type']</code>
@@ -2517,9 +2527,6 @@
<code>$token['value']</code>
<code>$token['value']</code>
</PossiblyNullArrayAccess>
<PossiblyNullPropertyAssignmentValue occurrences="1">
<code>$value</code>
</PossiblyNullPropertyAssignmentValue>
<PossiblyNullReference occurrences="1">
<code>getNumberOfRequiredParameters</code>
</PossiblyNullReference>
@@ -2571,9 +2578,6 @@
<code>$renameMode</code>
<code>$renameMode</code>
</ArgumentTypeCoercion>
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PossiblyNullPropertyFetch occurrences="1">
<code>$classMetadata-&gt;reflClass-&gt;name</code>
</PossiblyNullPropertyFetch>
@@ -2951,9 +2955,6 @@
<InvalidScalarArgument occurrences="1">
<code>$key</code>
</InvalidScalarArgument>
<MethodSignatureMustProvideReturnType occurrences="1">
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PossiblyFalseArgument occurrences="2">
<code>$spacePos</code>
<code>$spacePos</code>
+2
View File
@@ -30,6 +30,8 @@
<referencedClass name="Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand"/>
<referencedClass name="Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand"/>
<referencedClass name="Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand"/>
<!-- Remove on 2.12.x -->
<referencedClass name="Doctrine\Persistence\Mapping\Driver\AnnotationDriver"/>
</errorLevel>
</DeprecatedClass>
<DeprecatedMethod>
@@ -64,7 +64,12 @@ class DriverResultMock implements Result, ResultStatement
public function fetchAllNumeric(): array
{
throw new BadMethodCallException('Not implemented');
$values = [];
while (($row = $this->fetchNumeric()) !== false) {
$values[] = $row;
}
return $values;
}
public function fetchAllAssociative(): array
@@ -32,25 +32,13 @@ class AdvancedAssociationTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(Phrase::class),
$this->_em->getClassMetadata(PhraseType::class),
$this->_em->getClassMetadata(Definition::class),
$this->_em->getClassMetadata(Lemma::class),
$this->_em->getClassMetadata(Type::class),
]);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(Phrase::class),
$this->_em->getClassMetadata(PhraseType::class),
$this->_em->getClassMetadata(Definition::class),
$this->_em->getClassMetadata(Lemma::class),
$this->_em->getClassMetadata(Type::class),
]);
$this->createSchemaForModels(
Phrase::class,
PhraseType::class,
Definition::class,
Lemma::class,
Type::class
);
}
public function testIssue(): void
@@ -113,7 +113,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
public function testBasicOneToOne(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$user = new CmsUser();
$user->name = 'Roman';
$user->username = 'romanb';
@@ -658,8 +657,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
$this->_em->persist($article);
$this->_em->persist($user);
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_em->flush();
$this->_em->clear();
@@ -686,8 +683,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
$user->username = 'gblanco';
$user->status = 'developer';
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_em->persist($user);
$this->_em->flush();
$this->_em->clear();
@@ -721,8 +716,6 @@ class BasicFunctionalTest extends OrmFunctionalTestCase
});
$this->_em->clear();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$userRef = $this->_em->getReference(CmsUser::class, $user->getId());
$address2 = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsAddress a where a.user = :user')
->setParameter('user', $userRef)
@@ -24,23 +24,9 @@ class CascadeRemoveOrderTest extends OrmFunctionalTestCase
{
parent::setUp();
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(CascadeRemoveOrderEntityO::class),
$this->_em->getClassMetadata(CascadeRemoveOrderEntityG::class),
]
);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema(
[
$this->_em->getClassMetadata(CascadeRemoveOrderEntityO::class),
$this->_em->getClassMetadata(CascadeRemoveOrderEntityG::class),
]
$this->createSchemaForModels(
CascadeRemoveOrderEntityO::class,
CascadeRemoveOrderEntityG::class
);
}
@@ -30,23 +30,12 @@ class ClassTableInheritanceSecondTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(CTIParent::class),
$this->_em->getClassMetadata(CTIChild::class),
$this->_em->getClassMetadata(CTIRelated::class),
$this->_em->getClassMetadata(CTIRelated2::class),
]);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(CTIParent::class),
$this->_em->getClassMetadata(CTIChild::class),
$this->_em->getClassMetadata(CTIRelated::class),
$this->_em->getClassMetadata(CTIRelated2::class),
]);
$this->createSchemaForModels(
CTIParent::class,
CTIChild::class,
CTIRelated::class,
CTIRelated2::class
);
}
public function testOneToOneAssocToBaseTypeBidirectional(): void
@@ -76,7 +65,6 @@ class ClassTableInheritanceSecondTest extends OrmFunctionalTestCase
public function testManyToManyToCTIHierarchy(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger());
$mmrel = new CTIRelated2();
$child = new CTIChild();
$child->setData('child');
@@ -23,19 +23,10 @@ class DefaultValuesTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(DefaultValueUser::class),
$this->_em->getClassMetadata(DefaultValueAddress::class),
]);
}
protected function tearDown(): void
{
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(DefaultValueUser::class),
$this->_em->getClassMetadata(DefaultValueAddress::class),
]);
parent::tearDown();
$this->createSchemaForModels(
DefaultValueUser::class,
DefaultValueAddress::class
);
}
/**
@@ -25,7 +25,6 @@ class FlushEventTest extends OrmFunctionalTestCase
public function testPersistNewEntitiesOnPreFlush(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_em->getEventManager()->addEventListener(Events::onFlush, new OnFlushListener());
$user = new CmsUser();
@@ -41,23 +41,12 @@ class LifecycleCallbackTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(LifecycleCallbackEventArgEntity::class),
$this->_em->getClassMetadata(LifecycleCallbackTestEntity::class),
$this->_em->getClassMetadata(LifecycleCallbackTestUser::class),
$this->_em->getClassMetadata(LifecycleCallbackCascader::class),
]);
}
protected function tearDown(): void
{
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(LifecycleCallbackEventArgEntity::class),
$this->_em->getClassMetadata(LifecycleCallbackTestEntity::class),
$this->_em->getClassMetadata(LifecycleCallbackTestUser::class),
$this->_em->getClassMetadata(LifecycleCallbackCascader::class),
]);
parent::tearDown();
$this->createSchemaForModels(
LifecycleCallbackEventArgEntity::class,
LifecycleCallbackTestEntity::class,
LifecycleCallbackTestUser::class,
LifecycleCallbackCascader::class
);
}
public function testPreSavePostSaveCallbacksAreInvoked(): void
@@ -171,8 +160,6 @@ class LifecycleCallbackTest extends OrmFunctionalTestCase
*/
public function testCascadedEntitiesCallsPrePersist(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$e1 = new LifecycleCallbackTestEntity();
$e2 = new LifecycleCallbackTestEntity();
@@ -35,22 +35,12 @@ class OptimisticTest extends OrmFunctionalTestCase
private function createSchema(): void
{
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(OptimisticJoinedParent::class),
$this->_em->getClassMetadata(OptimisticJoinedChild::class),
$this->_em->getClassMetadata(OptimisticStandard::class),
$this->_em->getClassMetadata(OptimisticTimestamp::class),
]);
}
private function dropSchema(): void
{
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(OptimisticJoinedParent::class),
$this->_em->getClassMetadata(OptimisticJoinedChild::class),
$this->_em->getClassMetadata(OptimisticStandard::class),
$this->_em->getClassMetadata(OptimisticTimestamp::class),
]);
$this->createSchemaForModels(
OptimisticJoinedParent::class,
OptimisticJoinedChild::class,
OptimisticStandard::class,
OptimisticTimestamp::class
);
}
public function testJoinedChildInsertSetsInitialVersionValue(): OptimisticJoinedChild
@@ -93,8 +83,6 @@ class OptimisticTest extends OrmFunctionalTestCase
} catch (OptimisticLockException $e) {
self::assertSame($test, $e->getEntity());
}
$this->dropSchema();
}
public function testJoinedParentInsertSetsInitialVersionValue(): OptimisticJoinedParent
@@ -136,8 +124,6 @@ class OptimisticTest extends OrmFunctionalTestCase
} catch (OptimisticLockException $e) {
self::assertSame($test, $e->getEntity());
}
$this->dropSchema();
}
public function testMultipleFlushesDoIncrementalUpdates(): void
@@ -155,8 +141,6 @@ class OptimisticTest extends OrmFunctionalTestCase
self::assertIsInt($test->getVersion());
self::assertEquals($i + 1, $test->getVersion());
}
$this->dropSchema();
}
public function testStandardInsertSetsInitialVersionValue(): OptimisticStandard
@@ -200,8 +184,6 @@ class OptimisticTest extends OrmFunctionalTestCase
} catch (OptimisticLockException $e) {
self::assertSame($test, $e->getEntity());
}
$this->dropSchema();
}
public function testLockWorksWithProxy(): void
@@ -219,7 +201,6 @@ class OptimisticTest extends OrmFunctionalTestCase
$this->_em->lock($proxy, LockMode::OPTIMISTIC, 1);
$this->addToAssertionCount(1);
$this->dropSchema();
}
public function testOptimisticTimestampSetsDefaultValue(): OptimisticTimestamp
@@ -300,8 +281,6 @@ class OptimisticTest extends OrmFunctionalTestCase
self::assertNotNull($caughtException, 'No OptimisticLockingException was thrown');
self::assertSame($test, $caughtException->getEntity());
$this->dropSchema();
}
}
@@ -79,7 +79,6 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
public function testEagerLoadFromInverseSideAndLazyLoadFromOwningSide(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->createLoadingFixture();
$categories = $this->findCategories();
$this->assertLazyLoadFromOwningSide($categories);
@@ -87,7 +86,6 @@ class ManyToManyBidirectionalAssociationTest extends AbstractManyToManyAssociati
public function testEagerLoadFromOwningSideAndLazyLoadFromInverseSide(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->createLoadingFixture();
$products = $this->findProducts();
$this->assertLazyLoadFromInverseSide($products);
@@ -133,7 +133,6 @@ class OneToManyBidirectionalAssociationTest extends OrmFunctionalTestCase
public function testLazyLoadsObjectsOnTheInverseSide2(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->createFixture();
$query = $this->_em->createQuery('select f,p from Doctrine\Tests\Models\ECommerce\ECommerceFeature f join f.product p');
@@ -15,9 +15,7 @@ use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\ORM\Proxy\Proxy;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function count;
use function get_class;
@@ -30,19 +28,13 @@ class OneToOneEagerLoadingTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$schemaTool = new SchemaTool($this->_em);
try {
$schemaTool->createSchema(
[
$this->_em->getClassMetadata(Train::class),
$this->_em->getClassMetadata(TrainDriver::class),
$this->_em->getClassMetadata(TrainOwner::class),
$this->_em->getClassMetadata(Waggon::class),
$this->_em->getClassMetadata(TrainOrder::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
Train::class,
TrainDriver::class,
TrainOwner::class,
Waggon::class,
TrainOrder::class
);
}
/**
@@ -670,6 +670,7 @@ class PaginationTest extends OrmFunctionalTestCase
$dql = 'SELECT p FROM Doctrine\Tests\Models\CustomType\CustomIdObjectTypeParent p';
$query = $this->_em->createQuery($dql);
$query->setMaxResults(1);
$paginator = new Paginator($query, true);
$paginator->setUseOutputWalkers(false);
@@ -14,22 +14,16 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
class PersistentCollectionTest extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(PersistentCollectionHolder::class),
$this->_em->getClassMetadata(PersistentCollectionContent::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
PersistentCollectionHolder::class,
PersistentCollectionContent::class
);
PersistentObject::setObjectManager($this->_em);
}
@@ -11,7 +11,6 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* Test that Doctrine ORM correctly works with the ObjectManagerAware and PersistentObject
@@ -25,14 +24,7 @@ class PersistentObjectTest extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(PersistentEntity::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(PersistentEntity::class);
PersistentObject::setObjectManager($this->_em);
}
@@ -13,7 +13,6 @@ use Doctrine\Tests\Models\CMS\CmsTag;
use Doctrine\Tests\Models\CMS\CmsUser;
use Doctrine\Tests\OrmFunctionalTestCase;
use Doctrine\Tests\Proxies\__CG__\Doctrine\Tests\Models\CMS\CmsUser as CmsUserProxy;
use Exception;
use function assert;
@@ -34,20 +33,15 @@ class ProxiesLikeEntitiesTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(CmsUser::class),
$this->_em->getClassMetadata(CmsTag::class),
$this->_em->getClassMetadata(CmsPhonenumber::class),
$this->_em->getClassMetadata(CmsArticle::class),
$this->_em->getClassMetadata(CmsAddress::class),
$this->_em->getClassMetadata(CmsEmail::class),
$this->_em->getClassMetadata(CmsGroup::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
CmsUser::class,
CmsTag::class,
CmsPhonenumber::class,
CmsArticle::class,
CmsAddress::class,
CmsEmail::class,
CmsGroup::class
);
$this->user = new CmsUser();
$this->user->username = 'ocramius';
@@ -15,23 +15,7 @@ class QueryBuilderParenthesisTest extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(QueryBuilderParenthesisEntity::class),
]
);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema(
[
$this->_em->getClassMetadata(QueryBuilderParenthesisEntity::class),
]
);
$this->createSchemaForModels(QueryBuilderParenthesisEntity::class);
}
public function testParenthesisOnSingleLine(): void
@@ -522,7 +522,6 @@ class QueryTest extends OrmFunctionalTestCase
$this->_em->persist($article);
$this->_em->flush();
$this->_em->clear();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$q = $this->_em->createQuery('select a from Doctrine\Tests\Models\CMS\CmsArticle a where a.topic = :topic and a.user = :user')
->setParameter('user', $this->_em->getReference(CmsUser::class, $author->id))
->setParameter('topic', 'dr. dolittle');
@@ -10,7 +10,6 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Query;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function get_class;
@@ -25,14 +24,7 @@ class ReadOnlyTest extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(ReadOnlyEntity::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(ReadOnlyEntity::class);
}
public function testReadOnlyEntityNeverChangeTracked(): void
@@ -519,7 +519,6 @@ class SQLFilterTest extends OrmFunctionalTestCase
public function testToOneFilter(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->loadFixtureData();
$query = $this->_em->createQuery('select ux, ua from Doctrine\Tests\Models\CMS\CmsUser ux JOIN ux.address ua');
@@ -10,7 +10,6 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\SequenceGenerator;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* Description of SequenceGeneratorTest
@@ -25,14 +24,7 @@ class SequenceGeneratorTest extends OrmFunctionalTestCase
self::markTestSkipped('Only working for Databases that support sequences.');
}
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(SequenceEntity::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(SequenceEntity::class);
}
public function testHighAllocationSizeSequence(): void
@@ -13,7 +13,6 @@ use Doctrine\ORM\Mapping\InheritanceType;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* @group DDC-1113
@@ -25,17 +24,12 @@ class DDC1113Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1113Engine::class),
$this->_em->getClassMetadata(DDC1113Vehicle::class),
$this->_em->getClassMetadata(DDC1113Car::class),
$this->_em->getClassMetadata(DDC1113Bus::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC1113Engine::class,
DDC1113Vehicle::class,
DDC1113Car::class,
DDC1113Bus::class
);
}
public function testIssue(): void
@@ -29,7 +29,6 @@ class DDC1163Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1163Product::class),
@@ -18,7 +18,6 @@ class DDC1193Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1193Company::class),
@@ -12,23 +12,17 @@ use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
class DDC1209Test extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1209One::class),
$this->_em->getClassMetadata(DDC1209Two::class),
$this->_em->getClassMetadata(DDC1209Three::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC1209One::class,
DDC1209Two::class,
DDC1209Three::class
);
}
/**
@@ -10,7 +10,6 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* @group DDC-1228
@@ -21,15 +20,7 @@ class DDC1228Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1228User::class),
$this->_em->getClassMetadata(DDC1228Profile::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC1228User::class, DDC1228Profile::class);
}
public function testOneToOnePersist(): void
@@ -9,7 +9,6 @@ use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* @group DDC-1238
@@ -19,14 +18,7 @@ class DDC1238Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1238User::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC1238User::class);
}
public function testIssue(): void
@@ -6,6 +6,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -14,7 +15,6 @@ use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* @group DDC-1335
@@ -24,15 +24,10 @@ class DDC1335Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->createSchemaForModels(DDC1335User::class, DDC1335Phone::class);
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1335User::class),
$this->_em->getClassMetadata(DDC1335Phone::class),
]
);
$this->loadFixture();
} catch (Exception $e) {
} catch (UniqueConstraintViolationException $e) {
}
}
@@ -12,7 +12,6 @@ use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\ORM\UnitOfWork;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function get_class;
@@ -25,15 +24,10 @@ class DDC1461Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1461TwitterAccount::class),
$this->_em->getClassMetadata(DDC1461User::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC1461TwitterAccount::class,
DDC1461User::class
);
}
public function testChangeDetectionDeferredExplicit(): void
@@ -16,7 +16,6 @@ use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\ORM\Mapping\PostLoad;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function get_class;
use function get_debug_type;
@@ -32,16 +31,11 @@ class DDC1655Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1655Foo::class),
$this->_em->getClassMetadata(DDC1655Bar::class),
$this->_em->getClassMetadata(DDC1655Baz::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC1655Foo::class,
DDC1655Bar::class,
DDC1655Baz::class
);
}
public function testPostLoadOneToManyInheritance(): void
@@ -38,8 +38,6 @@ class DDC168Test extends OrmFunctionalTestCase
*/
public function testJoinedSubclassPersisterRequiresSpecificOrderOfMetadataReflFieldsArray(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$spouse = new CompanyEmployee();
$spouse->setName('Blub');
$spouse->setDepartment('Accounting');
@@ -20,22 +20,7 @@ class DDC1719Test extends OrmFunctionalTestCase
{
parent::setUp();
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC1719SimpleEntity::class),
]
);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema(
[
$this->_em->getClassMetadata(DDC1719SimpleEntity::class),
]
);
$this->createSchemaForModels(DDC1719SimpleEntity::class);
}
public function testCreateRetrieveUpdateDelete(): void
@@ -31,8 +31,6 @@ class DDC211Test extends OrmFunctionalTestCase
public function testIssue(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$user = new DDC211User();
$user->setName('John Doe');
@@ -34,8 +34,6 @@ class DDC258Test extends OrmFunctionalTestCase
*/
public function testIssue(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$c1 = new DDC258Class1();
$c1->title = 'Foo';
$c1->description = 'Foo';
@@ -29,32 +29,16 @@ class DDC2602Test extends OrmFunctionalTestCase
{
parent::setUp();
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC2602User::class),
$this->_em->getClassMetadata(DDC2602Biography::class),
$this->_em->getClassMetadata(DDC2602BiographyField::class),
$this->_em->getClassMetadata(DDC2602BiographyFieldChoice::class),
]
$this->createSchemaForModels(
DDC2602User::class,
DDC2602Biography::class,
DDC2602BiographyField::class,
DDC2602BiographyFieldChoice::class
);
$this->loadFixture();
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema(
[
$this->_em->getClassMetadata(DDC2602User::class),
$this->_em->getClassMetadata(DDC2602Biography::class),
$this->_em->getClassMetadata(DDC2602BiographyField::class),
$this->_em->getClassMetadata(DDC2602BiographyFieldChoice::class),
]
);
}
public function testPostLoadListenerShouldBeAbleToRunQueries(): void
{
$eventManager = $this->_em->getEventManager();
@@ -14,7 +14,6 @@ use Doctrine\ORM\Mapping\MappedSuperclass;
use Doctrine\ORM\Mapping\PrePersist;
use Doctrine\ORM\Mapping\PreUpdate;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function assert;
use function get_class;
@@ -24,14 +23,7 @@ class DDC2895Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC2895::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC2895::class);
}
public function testPostLoadOneToManyInheritance(): void
@@ -17,24 +17,7 @@ class DDC309Test extends OrmFunctionalTestCase
{
parent::setUp();
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC309Country::class),
$this->_em->getClassMetadata(DDC309User::class),
]
);
}
protected function tearDown(): void
{
$this->_schemaTool->dropSchema(
[
$this->_em->getClassMetadata(DDC309Country::class),
$this->_em->getClassMetadata(DDC309User::class),
]
);
parent::tearDown();
$this->createSchemaForModels(DDC309Country::class, DDC309User::class);
}
public function testTwoIterateHydrations(): void
@@ -26,7 +26,6 @@ class DDC345Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC345User::class),
@@ -25,7 +25,6 @@ class DDC371Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC371Parent::class),
@@ -18,7 +18,6 @@ use Doctrine\ORM\Mapping\JoinTable;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\Table;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
class DDC3785Test extends OrmFunctionalTestCase
{
@@ -28,16 +27,11 @@ class DDC3785Test extends OrmFunctionalTestCase
Type::addType('ddc3785_asset_id', DDC3785AssetIdType::class);
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC3785Asset::class),
$this->_em->getClassMetadata(DDC3785AssetId::class),
$this->_em->getClassMetadata(DDC3785Attribute::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC3785Asset::class,
DDC3785AssetId::class,
DDC3785Attribute::class
);
}
/**
@@ -9,7 +9,6 @@ use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function serialize;
use function unserialize;
@@ -20,14 +19,7 @@ class DDC381Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC381Entity::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC381Entity::class);
}
public function testCallUnserializedProxyMethods(): void
@@ -26,7 +26,6 @@ class DDC422Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC422Guest::class),
@@ -29,8 +29,6 @@ class DDC425Test extends OrmFunctionalTestCase
*/
public function testIssue(): void
{
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$num = $this->_em->createQuery('DELETE ' . __NAMESPACE__ . '\DDC425Entity e WHERE e.someDatetimeField > ?1')
->setParameter(1, new DateTime(), Types::DATETIME_MUTABLE)
->getResult();
@@ -19,7 +19,6 @@ class DDC444Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC444User::class),
@@ -12,7 +12,6 @@ use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\ORM\Proxy\Proxy;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function get_class;
@@ -26,16 +25,11 @@ class DDC522Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC522Customer::class),
$this->_em->getClassMetadata(DDC522Cart::class),
$this->_em->getClassMetadata(DDC522ForeignKeyTest::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC522Customer::class,
DDC522Cart::class,
DDC522ForeignKeyTest::class
);
}
/**
@@ -32,14 +32,7 @@ class DDC5684Test extends OrmFunctionalTestCase
DBALTypes\Type::addType(DDC5684ObjectIdType::class, DDC5684ObjectIdType::class);
}
$this->_schemaTool->createSchema([$this->_em->getClassMetadata(DDC5684Object::class)]);
}
protected function tearDown(): void
{
$this->_schemaTool->dropSchema([$this->_em->getClassMetadata(DDC5684Object::class)]);
parent::tearDown();
$this->createSchemaForModels(DDC5684Object::class);
}
public function testAutoIncrementIdWithCustomType(): void
@@ -24,7 +24,6 @@ class DDC599Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
try {
$this->_schemaTool->createSchema(
[
@@ -6,6 +6,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
@@ -14,7 +15,6 @@ use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\ORM\Query;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
/**
* @group DDC-618
@@ -24,14 +24,9 @@ class DDC618Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC618Author::class),
$this->_em->getClassMetadata(DDC618Book::class),
]
);
$this->createSchemaForModels(DDC618Author::class, DDC618Book::class);
try {
// Create author 10/Joe with two books 22/JoeA and 20/JoeB
$author = new DDC618Author();
$author->id = 10;
@@ -50,7 +45,7 @@ class DDC618Test extends OrmFunctionalTestCase
$this->_em->flush();
$this->_em->clear();
} catch (Exception $e) {
} catch (UniqueConstraintViolationException $e) {
}
}
@@ -11,22 +11,16 @@ use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\ORM\Proxy\Proxy;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
class DDC633Test extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC633Patient::class),
$this->_em->getClassMetadata(DDC633Appointment::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(
DDC633Patient::class,
DDC633Appointment::class
);
}
/**
@@ -9,7 +9,6 @@ use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function array_keys;
use function get_class;
@@ -19,14 +18,7 @@ class DDC656Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC656Entity::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC656Entity::class);
}
public function testRecomputeSingleEntityChangeSetPreservesFieldOrder(): void
@@ -14,7 +14,6 @@ use Doctrine\ORM\Mapping\JoinTable;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\Table;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function strtolower;
@@ -23,15 +22,7 @@ class DDC698Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC698Role::class),
$this->_em->getClassMetadata(DDC698Privilege::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC698Role::class, DDC698Privilege::class);
}
public function testTicket(): void
@@ -27,21 +27,11 @@ class DDC69Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
$this->_schemaTool->createSchema([
$this->_em->getClassMetadata(Lemma::class),
$this->_em->getClassMetadata(Relation::class),
$this->_em->getClassMetadata(RelationType::class),
]);
}
protected function tearDown(): void
{
parent::tearDown();
$this->_schemaTool->dropSchema([
$this->_em->getClassMetadata(Lemma::class),
$this->_em->getClassMetadata(Relation::class),
$this->_em->getClassMetadata(RelationType::class),
]);
// some of these models are created in other tests, but not all
$this->createSchemaForModels(RelationType::class);
$this->createSchemaForModels(Relation::class);
$this->createSchemaForModels(Lemma::class);
}
public function testIssue(): void
@@ -23,7 +23,6 @@ class DDC719Test extends OrmFunctionalTestCase
protected function setUp(): void
{
parent::setUp();
//$this->_em->getConnection()->getConfiguration()->setSQLLogger(new \Doctrine\DBAL\Logging\EchoSQLLogger);
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC719Group::class),
@@ -12,9 +12,7 @@ use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Tools\SchemaTool;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
use function count;
@@ -24,16 +22,7 @@ class DDC729Test extends OrmFunctionalTestCase
{
parent::setUp();
try {
$schemaTool = new SchemaTool($this->_em);
$schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC729A::class),
$this->_em->getClassMetadata(DDC729B::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC729A::class, DDC729B::class);
}
public function testMergeManyToMany(): void
@@ -13,22 +13,13 @@ use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\Tests\OrmFunctionalTestCase;
use Exception;
class DDC735Test extends OrmFunctionalTestCase
{
protected function setUp(): void
{
parent::setUp();
try {
$this->_schemaTool->createSchema(
[
$this->_em->getClassMetadata(DDC735Product::class),
$this->_em->getClassMetadata(DDC735Review::class),
]
);
} catch (Exception $e) {
}
$this->createSchemaForModels(DDC735Product::class, DDC735Review::class);
}
public function testRemoveElementAppliesOrphanRemoval(): void

Some files were not shown because too many files have changed in this diff Show More