Skip to content

Commit

Permalink
Merge branch 'cycle:2.x' into broken_insert_order
Browse files Browse the repository at this point in the history
  • Loading branch information
gam6itko authored Jan 29, 2024
2 parents 523c71e + 1cf556d commit 589efc2
Show file tree
Hide file tree
Showing 221 changed files with 6,601 additions and 307 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: roadrunner-server
8 changes: 3 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Bug Report
description: 🐛 File a bug report
title: "🐛 "
title: "🐛 Something went wrong"
labels: ["type:bug", "status:to be verified"]
assignees:
- roxblnfk
body:
- type: markdown
attributes:
Expand Down Expand Up @@ -34,8 +32,8 @@ body:
description: What version of our software are you running?
render: shell
value: |
ORM 2.0.0
PHP 8.1
ORM 2.3.4
PHP 8.2
validations:
required: true
- type: markdown
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Feauture request
description: 💡 Suggest an idea for this project
title: "💡 "
labels: ["type:feature"]
assignees:
- roxblnfk
labels: ["type:feature", "type:under discussion"]
body:
- type: markdown
attributes:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/ci-mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ jobs:
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
- php: '8.1'
extensions: pdo, pdo_sqlsrv-5.10.0beta2
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
- php: '8.2'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'
- php: '8.3'
extensions: pdo, pdo_sqlsrv
mssql: 'server:2019-latest'

services:
Expand Down Expand Up @@ -67,11 +73,11 @@ jobs:
run: composer self-update

- name: Install dependencies with composer
if: matrix.php != '8.2'
if: matrix.php != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php == '8.2'
- name: Install dependencies with composer php 8.4
if: matrix.php == '8.4'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run tests with phpunit without coverage
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"

mysql-version:
- "5.7"
Expand Down Expand Up @@ -80,11 +82,11 @@ jobs:
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
if: matrix.php-version != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
- name: Install dependencies with composer php 8.4
if: matrix.php-version == '8.4'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run mysql tests with phpunit
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"

pgsql-version:
- "10"
Expand Down Expand Up @@ -81,11 +83,11 @@ jobs:
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
if: matrix.php-version != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
- name: Install dependencies with composer php 8.4
if: matrix.php-version == '8.4'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run pgsql tests with phpunit
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -34,7 +36,7 @@ jobs:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: pecl
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv-5.10.0beta2, pdo_mysql
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv-5.11.1, pdo_mysql
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand All @@ -45,10 +47,10 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies with composer
if: matrix.php-version != '8.2'
if: matrix.php-version != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
- name: Install dependencies with composer php 8.4
if: matrix.php-version == '8.4'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Execute Tests
run: |
Expand Down Expand Up @@ -77,6 +79,8 @@ jobs:
php-version:
- "8.0"
- "8.1"
- "8.2"
- "8.3"
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -98,11 +102,11 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Install dependencies with composer
if: matrix.php-version != '8.2'
if: matrix.php-version != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.2
if: matrix.php-version == '8.2'
- name: Install dependencies with composer php 8.4
if: matrix.php-version == '8.4'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Execute Tests
Expand Down
64 changes: 62 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,68 @@
# CHANGELOG

v2.2.1 (in progress)
v2.6.0 (22.12.2023)
--------------------
- Fix `cascade` mode in BelongsTo relation by @roxblnfk (#347)
- Add support for `loophp/collection` v7 by @msmakouz (#448)
- Fix wrong adding table prefix on joins by @msmakouz (#447)

v2.5.0 (27.11.2023)
--------------------
- Expose JSON methods in the Select query builder by @msmakouz (#445)
- Add NullHeap by @roxblnfk (#441)

v2.4.0 (05.10.2023)
--------------------
- Add support uninitialized collections in entities by @roxblnfk (#431)
- Allow `doctrine/instantiator` 2.x by @msmakouz (#438)
- Improve relations hydration for non-proxy entities. Now it more lazy. By @msmakouz (#429)

v2.3.4 (31.07.2023)
--------------------
- Fix fields uncasting in the ManyToMany relation by @roxblnfk, thanks @gam6itko (#427, #428)
- Fix resolving of a not loaded parent in the relation RefersTo by @roxblnfk, thanks @msmakouz and snafets (#414)
- Fix belongs to relation when parent is changed using parent id by @roxblnfk, thanks @roquie (#346, #432)

v2.3.3 (21.07.2023)
--------------------
- Fix loading for Embedded entities when parent is null by @gam6itko and @roxblnfk (#422, #423)
- Fix: remove extra joins from JTI and eager relations when ManyToMany is resolved. By @msmakouz and @roxblnfk (#418)
- Fix the Unit of Work persistState() method in a sequenced call. By @msmakouz and @roxblnfk (#424, #426)
- Fix ManyToMany lazy loading when value object are used as keys. By @msmakouz and @roxblnfk (#318, #420)

v2.3.2 (20.06.2023)
--------------------
- Fix proxy-mapper hydration mechanism: public relations in a non-proxy-entity are hydrated like private ones.
There is a special logic related to `ReferenceInterface` hydrating. By @roxblnfk (#417)
- Add the method `forUpdate` in the `Select` phpdoc. By @msmakouz (#413)

v2.3.1 (01.05.2023)
--------------------
- Fix typecasting in relations when JTI entities are loaded by @roxblnfk (#408, #409)

v2.3.0 (03.04.2023)
--------------------
- Update `where()` and `orderBy()` behavior in the JTI case. It possible to pass parent field name. By @roxblnfk (#405)
- `Select::wherePK()` is now more strict. Use entity field name instead of table columns.
- Fix method naming: `AbstractLoader::loadIerarchy()` deprecated and renamed to `::loadHierarchy()`.
- Class `\Cycle\ORM\Parser\Typecast` is now not internal by @thenotsoft (#395)
- Update test case generator script. Now it possible to set case name like "Issue777" and a template folder that
different from the default `CaseTemplate` by @gam6itko (#389)

v2.2.2 (08.02.2023)
--------------------
- Fix compatibility with PHP 8.2 (AllowDynamicProperties) by @roxblnfk (#394)
- Add tests with using for microseconds in a datetime fields by @BelaRyc and @msmakouz (#383)

v2.2.1 (01.12.2022)
--------------------
- Fix `EM::persistState()` that inserted the same entity twice by @roxblnfk (#368)
- Fix bug on saving of replaced pivoted collection by @BelaRyc (#382)
- Fix `cascade` mode in BelongsTo relation by @roxblnfk and @msmakouz (#347, #374)
- Fix storing od embedded entities in a JTI by @butschster (#379)
- Add tests case template by @roxblnfk and @kastahov (#372, #377)
- [How to make an issue with test case](https://cycle-orm.dev/docs/issue-test-case)
- Add a previous exception in TransactionException on throwing by @Eugentis (#367)
- Add annotation `@readonly` for `Repository::$select` by @roxblnfk (#369)

v2.2.0 (05.07.2022)
--------------------
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2022 Spiral Scout
Copyright (c) 2023 Spiral Scout

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

<img src="https://cycle-orm.dev/cycle.png" height="135px" alt="Cycle ORM" align="left"/>

Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and daemonized PHP applications (like [RoadRunner](https://github.com/spiral/roadrunner)). The ORM provides flexible configuration options to model datasets, powerful query builder and supports dynamic mapping schema. The engine can work with plain PHP objects, support annotation declarations, and proxies via extensions.
Cycle is PHP DataMapper, ORM and Data Modelling engine designed to safely work in classic and demonized PHP
applications (like [RoadRunner](https://github.com/spiral/roadrunner)). The ORM provides flexible configuration options
to model datasets, powerful query builder and supports dynamic mapping schema. The engine can work with plain PHP
objects, support annotation declarations, and proxies via extensions.

<p align="center">
<a href="https://cycle-orm.dev/docs"><b>Website and Documentation</b></a> | <a href="https://github.com/cycle/docs/issues/3">Comparison with Eloquent and Doctrine</a>
Expand Down
63 changes: 32 additions & 31 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"name": "cycle/orm",
"type": "library",
"license": "MIT",
"description": "PHP DataMapper ORM and Data Modelling Engine",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"ext-pdo": "*",
"cycle/database": "^2.2.1",
"doctrine/instantiator": "^1.3.1"
},
"require-dev": {
"doctrine/collections": "^1.6",
"illuminate/collections": "^8.0",
"loophp/collection": "^6.0",
"mockery/mockery": "^1.1",
"phpunit/phpunit": "^9.5",
"ramsey/uuid": "^4.0",
"spiral/tokenizer": "^2.8",
"vimeo/psalm": "^4.9"
},
"autoload": {
"psr-4": {
"Cycle\\ORM\\": "src/"
"name": "cycle/orm",
"type": "library",
"license": "MIT",
"description": "PHP DataMapper ORM and Data Modelling Engine",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.0",
"ext-pdo": "*",
"cycle/database": "^2.6",
"doctrine/instantiator": "^1.3.1 || ^2.0",
"spiral/core": "^2.8 || ^3.0"
},
"require-dev": {
"doctrine/collections": "^1.6 || ^2.0",
"illuminate/collections": "^8.0",
"loophp/collection": "^6.0 || ^7.0",
"mockery/mockery": "^1.1",
"phpunit/phpunit": "^9.5",
"ramsey/uuid": "^4.0",
"spiral/tokenizer": "^2.8 || ^3.0",
"vimeo/psalm": "^4.9"
},
"autoload": {
"psr-4": {
"Cycle\\ORM\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Cycle\\ORM\\Tests\\": "tests/ORM/"
}
}
},
"autoload-dev": {
"psr-4": {
"Cycle\\ORM\\Tests\\": "tests/ORM/"
}
}
}
4 changes: 3 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="tests/bootstrap.php"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="tests/bootstrap.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
convertDeprecationsToExceptions="true"
processIsolation="false"
stopOnFailure="true"
stopOnError="true"
Expand Down
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<UndefinedAttributeClass>
<errorLevel type="suppress">
<referencedClass name="JetBrains\PhpStorm\ExpectedValues" />
<referencedClass name="JetBrains\PhpStorm\Deprecated" />
<referencedClass name="JetBrains\PhpStorm\Pure" />
</errorLevel>
</UndefinedAttributeClass>
Expand Down
1 change: 1 addition & 0 deletions src/Collection/ArrayCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* </code>
*
* @template TCollection of array
*
* @template-implements CollectionFactoryInterface<TCollection>
*/
final class ArrayCollectionFactory implements CollectionFactoryInterface
Expand Down
1 change: 1 addition & 0 deletions src/Collection/DoctrineCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Items and Pivots for `Many to Many` relation stores in {@see PivotedCollection}.
*
* @template TCollection of Collection
*
* @template-implements CollectionFactoryInterface<TCollection>
*/
final class DoctrineCollectionFactory implements CollectionFactoryInterface
Expand Down
1 change: 1 addition & 0 deletions src/Collection/IlluminateCollectionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @template TCollection of Collection
*
* @template-implements CollectionFactoryInterface<TCollection>
*/
final class IlluminateCollectionFactory implements CollectionFactoryInterface
Expand Down
Loading

0 comments on commit 589efc2

Please sign in to comment.