Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build, Add support for doctrine/common:v3 #172

Merged
merged 4 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
- pull_request
- push

env:
COMPOSER_ROOT_VERSION: 1.99

jobs:
composer-json-lint:
name: "Lint composer.json"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph.

[![Total Downloads](https://poser.pugx.org/myclabs/deep-copy/downloads.svg)](https://packagist.org/packages/myclabs/deep-copy)
[![Integrate](https://github.com/myclabs/DeepCopy/workflows/ci/badge.svg?branch=1.x)](https://github.com/myclabs/DeepCopy/actions)

## Table of Contents

Expand Down
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
"php": "^7.1 || ^8.0"
},
"require-dev": {
"doctrine/collections": "^1.6",
"doctrine/common": "^2.13",
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5"
"doctrine/collections": "^1.6.8",
"doctrine/common": "^2.13.3 || ^3.2.2",
"phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
},
"conflict": {
"doctrine/collections": "<1.6.8",
"doctrine/common": "<2.13.3 || >=3,<3.2.2"
},
"autoload": {
"psr-4": {
Expand Down
7 changes: 3 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
colors="true"
bootstrap="vendor/autoload.php">
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true">

<testsuites>
<testsuite name="Test suite">
<directory>./tests</directory>
<directory>./tests/DeepCopyTest</directory>
</testsuite>
</testsuites>

Expand Down
2 changes: 1 addition & 1 deletion src/DeepCopy/Matcher/Doctrine/DoctrineProxyMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace DeepCopy\Matcher\Doctrine;

use DeepCopy\Matcher\Matcher;
use Doctrine\Common\Persistence\Proxy;
use Doctrine\Persistence\Proxy;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doctrine already published a forward compatibility alias, so we don't need to care about it:
https://github.com/doctrine/persistence/blob/1.3.8/lib/Doctrine/Common/Persistence/Proxy.php


/**
* @final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use BadMethodCallException;
use DeepCopy\Matcher\Doctrine\DoctrineProxyMatcher;
use Doctrine\Common\Persistence\Proxy;
use Doctrine\Persistence\Proxy;
use PHPUnit\Framework\TestCase;
use stdClass;

Expand Down