steevanb / doctrine-read-only-hydrator

Add SimpleObject and ReadOnly hydrators do Doctrine.
GNU General Public License v3.0
57 stars 14 forks source link

Class 'ComposerOverloadClass\steevanb\DoctrineReadOnlyHydrator\Hydrator\ReadOnlyHydrator' not found #11

Closed JanMikes closed 3 years ago

JanMikes commented 5 years ago

Hi, i just installed your package via composer, added hydrator to custom hydrators of doctrine, but this exceptions arise:

screenshot 2018-11-24 16 20 16

I noticed that there are two classes steevanb\DoctrineReadOnlyHydrator\Hydrator\ReadOnlyHydrator with same namespace.

steevanb commented 5 years ago

Hi,

Could you please show me your composer.json ?

JanMikes commented 5 years ago

Sure thing!

Here it is:

{
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "optimize-autoloader": true
    },
    "require": {
        "php": "~7.1.0",
        "ext-openssl": "*",
        "ext-bcmath": "*",
        "ext-gd": "*",
        "ext-pdo_sqlite": "*",
        "ext-apcu": "*",
        "ext-mongodb": "*",
        "ext-pcntl": "*",
        "ext-json": "*",
        "nette/di": "^2.4",
        "nette/neon": "^2.4",
        "nette/bootstrap": "^2.4",
        "nette/utils": "^2.4",
        "nette/application": "^2.4",
        "nette/component-model": "^2.3",
        "nette/finder": "^2.4",
        "nette/http": "^2.4",
        "tracy/tracy": "^2.4",
        "firebase/php-jwt": "5.*",
        "ramsey/uuid": "^3.5",
        "beberlei/assert": "^2.6",
        "moneyphp/money": "^3.0",
        "marc-mabe/php-enum": "^2.2",
        "kdyby/doctrine": "^3.2.0",
        "kdyby/console": "@dev",
        "entrydo/rest-route": "^2.2.0",
        "doctrine/data-fixtures": "^1.2",
        "mailgun/mailgun-php": "^2.3",
        "php-http/guzzle6-adapter": "^1.1",
        "guzzlehttp/guzzle": "6.3.*",
        "kdyby/monolog": "1.3.*",
        "sentry/sentry": "^1.6",
        "jms/serializer": "^1.6",
        "kreait/firebase-tokens": "^1.5",
        "h4kuna/ares": "^1.1",
        "moontoast/math": "^1.1",
        "justinrainbow/json-schema": "^5.2",
        "picqer/php-barcode-generator": "dev-master",
        "latte/latte": "^2.4",
        "mpdf/mpdf": "6.1.*",
        "kdyby/rabbitmq": "dev-master",
        "phing/phing": "2.16.*",
        "phpoffice/phpexcel": "^1.8",
        "facebook/graph-sdk": "^5.5",
        "google/apiclient": "^2.2",
        "sebastian/diff": "2.0.1 as 1.4",
        "kdyby/translation": "^2.4",
        "mongodb/mongodb": "1.1.*",
        "arara/process": "^1.10",
        "zenify/doctrine-behaviors": "^4.2",
        "tharos/schematic": "^1.3",
        "gopay/payments-sdk-php": "1.3.4",
        "fakturoid/fakturoid-php": "1.0.0",
        "league/fractal": "^0.17.0",
        "ramsey/uuid-doctrine": "^1.4",
        "endroid/qr-code": "^3.2",
        "florianv/swap": "^3.2",
        "blackfire/php-sdk": "^1.13",
        "braintree/braintree_php": "^3.31",
        "paypal/rest-api-sdk-php": "^1.13",
        "doctrine/orm": "2.6.*",
        "doctrine/dbal": "2.7.*",
        "nettrine/migrations": "0.3.*",
        "contributte/event-dispatcher": "0.4.*",
        "contributte/event-dispatcher-extra": "0.4.*",
        "entrydo/coding-standard": "dev-master",
        "vlucas/phpdotenv": "^2.5",
        "sendgrid/sendgrid": "^7.2",
        "damejidlo/datetime-factory": "^2.0",
        "messagebird/php-rest-api": "^1.10",
        "wodcz/nette-dotenv": "^2.0",
        "steevanb/doctrine-read-only-hydrator": "^2.2"
    },
    "require-dev": {
        "roave/security-advisories": "dev-master",
        "phpunit/phpunit": "6.5.*",
        "mockery/mockery": "1.1.*",
        "phpstan/phpstan": "0.9.*",
        "phpstan/phpstan-nette": "0.9.*",
        "vaclav-sir/n-browser-kit": "^1.0.7",
        "heroku/heroku-buildpack-php": "*",
        "jakub-onderka/php-parallel-lint": "^0.9.2",
        "bamarni/composer-bin-plugin": "^1.2"
    },
    "autoload": {
        "psr-4": {
            "Entrydo\\": "src",
            "Entrydo\\App\\": "app",
            "Entrydo\\Fixtures\\": "fixtures"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Entrydo\\Tests\\": "tests"
        }
    },
    "scripts": {
        "complete-check": ["vendor/bin/phpunit", "@phpstan"],
        "phpstan": "php -d memory_limit=512M vendor/bin/phpstan analyse src --level=6 -c phpstan.neon",
        "compile": [
            "phing createLocalConfig",
            "bin/console migrations:migrate --no-interaction --allow-no-migration"
        ],
        "warmup": "rm -rf var/* && mkdir -p var/proxies && mkdir -p var/cache && mkdir -p var/log && chmod -R 777 var",
        "cs": "vendor/bin/ecs check src app --config vendor/entrydo/coding-standard/config/entrydo.yml",
        "cs-fix": "vendor/bin/ecs check src app --config vendor/entrydo/coding-standard/config/entrydo.yml --fix",
        "auto-scripts": {

        }
    }
}
steevanb commented 5 years ago

Ok, i see, problem is when you optimize autoloader. For now, the only solution i have for you is to not let composer automaticaly found ReadOnlyHydrator, and tell to composer where to find it in composer.json:

    "autoload": {
        "files": [
            "vendor/steevanb/doctrine-read-only-hydrator/Hydrator/SimpleObjectHydrator.php",
            "vendor/steevanb/doctrine-read-only-hydrator/Hydrator/ReadOnlyHydrator.php"
        ]
    }

I will try to fix it as soon as possible.

maxhelias commented 3 years ago

@steevanb I think that https://github.com/steevanb/doctrine-read-only-hydrator/pull/18 has fixed this issue