pax_global_header00006660000000000000000000000064136123634440014520gustar00rootroot0000000000000052 comment=a89eb2520287834725e802a4ae37049e053874bb php-doctrine-persistence-1.3.6/000077500000000000000000000000001361236344400164455ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/.doctrine-project.json000066400000000000000000000010041361236344400226640ustar00rootroot00000000000000{ "active": true, "name": "Persistence", "slug": "persistence", "docsSlug": "doctrine-persistence", "versions": [ { "name": "1.1", "branchName": "1.1.x", "slug": "latest", "current": true, "aliases": [ "current", "stable" ] }, { "name": "1.0", "branchName": "1.0.x", "slug": "1.0", "maintained": false } ] } php-doctrine-persistence-1.3.6/.gitignore000066400000000000000000000000571361236344400204370ustar00rootroot00000000000000/vendor/ /phpunit.xml /phpcs.xml /.phpcs-cache php-doctrine-persistence-1.3.6/.scrutinizer.yml000066400000000000000000000017661361236344400216410ustar00rootroot00000000000000build: nodes: analysis: environment: php: version: 7.1 cache: disabled: false directories: - ~/.composer/cache project_setup: override: true tests: override: - php-scrutinizer-run - phpcs-run dependencies: override: - composer install -noa tools: external_code_coverage: timeout: 600 build_failure_conditions: - 'elements.rating(<= C).new.exists' # No new classes/methods with a rating of C or worse allowed - 'issues.label("coding-style").new.exists' # No new coding style issues allowed - 'issues.severity(>= MAJOR).new.exists' # New issues of major or higher severity - 'project.metric_change("scrutinizer.test_coverage", < 0)' # Code Coverage decreased from previous inspection php-doctrine-persistence-1.3.6/.travis.yml000066400000000000000000000024741361236344400205650ustar00rootroot00000000000000dist: xenial sudo: false language: php php: - 7.1 - 7.2 - 7.3 - 7.4 cache: directories: - $HOME/.composer/cache before_install: - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" install: - rm composer.lock - travis_retry composer update --prefer-dist script: - ./vendor/bin/phpunit jobs: include: - stage: Test env: DEPENDENCIES=low install: - rm composer.lock - travis_retry composer update --prefer-dist --prefer-lowest - stage: Test env: COVERAGE before_script: - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi script: - ./vendor/bin/phpunit --coverage-clover clover.xml after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover clover.xml - stage: Code Quality env: CODING_STANDARDS install: travis_retry composer install --prefer-dist script: ./vendor/bin/phpcs - stage: Code Quality php: 7.4 env: STATIC_ANALYSIS install: travis_retry composer install --prefer-dist script: vendor/bin/phpstan analyze php-doctrine-persistence-1.3.6/LICENSE000066400000000000000000000020511361236344400174500ustar00rootroot00000000000000Copyright (c) 2006-2015 Doctrine Project Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. php-doctrine-persistence-1.3.6/README.md000066400000000000000000000014731361236344400177310ustar00rootroot00000000000000# Doctrine Persistence [![Build Status](https://travis-ci.org/doctrine/persistence.svg)](https://travis-ci.org/doctrine/persistence) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/doctrine/persistence/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/doctrine/persistence/?branch=master) [![Code Coverage](https://scrutinizer-ci.com/g/doctrine/persistence/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/doctrine/persistence/?branch=master) The Doctrine Persistence project is a library that provides common abstractions for object mapper persistence. ## More resources: * [Website](https://www.doctrine-project.org/) * [Documentation](https://www.doctrine-project.org/projects/doctrine-persistence/en/latest/index.html) * [Downloads](https://github.com/doctrine/persistence/releases) php-doctrine-persistence-1.3.6/UPGRADE-1.2.md000066400000000000000000000005771361236344400203650ustar00rootroot00000000000000UPGRADE FROM 1.x to 1.2 ======================= * Deprecated `ObjectManager::merge()`. Please handle merge operations in your application instead. * Deprecated `ObjectManager::detach()`. Please use `ObjectManager::clear()` instead. * Deprecated `PersistentObject` class. Please implement this functionality directly in your application if you want ActiveRecord style functionality. php-doctrine-persistence-1.3.6/composer.json000066400000000000000000000033511361236344400211710ustar00rootroot00000000000000{ "name": "doctrine/persistence", "type": "library", "description": "The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share.", "keywords": [ "persistence", "object", "mapper", "orm", "odm" ], "homepage": "https://doctrine-project.org/projects/persistence.html", "license": "MIT", "authors": [ {"name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com"}, {"name": "Roman Borschel", "email": "roman@code-factory.org"}, {"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"}, {"name": "Jonathan Wage", "email": "jonwage@gmail.com"}, {"name": "Johannes Schmitt", "email": "schmittjoh@gmail.com"}, {"name": "Marco Pivetta", "email": "ocramius@gmail.com"} ], "require": { "php": "^7.1", "doctrine/annotations": "^1.0", "doctrine/cache": "^1.0", "doctrine/collections": "^1.0", "doctrine/event-manager": "^1.0", "doctrine/reflection": "^1.1" }, "require-dev": { "phpstan/phpstan": "^0.11", "doctrine/coding-standard": "^6.0", "phpunit/phpunit": "^7.0" }, "conflict": { "doctrine/common": "<2.10@dev" }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common", "Doctrine\\Persistence\\": "lib/Doctrine/Persistence" } }, "autoload-dev": { "psr-4": { "Doctrine\\Tests\\": "tests/Doctrine/Tests", "Doctrine\\Tests_PHP74\\": "tests/Doctrine/Tests_PHP74" } }, "extra": { "branch-alias": { "dev-master": "1.3.x-dev" } } } php-doctrine-persistence-1.3.6/composer.lock000066400000000000000000003424031361236344400211540ustar00rootroot00000000000000{ "_readme": [ "This file locks the dependencies of your project to a known state", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "5cb2477373746c5e1f76986cf3ad36dd", "packages": [ { "name": "doctrine/annotations", "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/annotations/zipball/904dca4eb10715b92569fbcd79e201d5c349b6bc", "reference": "904dca4eb10715b92569fbcd79e201d5c349b6bc", "shasum": "" }, "require": { "doctrine/lexer": "1.*", "php": "^7.1" }, "require-dev": { "doctrine/cache": "1.*", "phpunit/phpunit": "^7.5" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.7.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], "description": "Docblock Annotations Parser", "homepage": "http://www.doctrine-project.org", "keywords": [ "annotations", "docblock", "parser" ], "time": "2019-10-01T18:55:10+00:00" }, { "name": "doctrine/cache", "version": "v1.7.1", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", "shasum": "" }, "require": { "php": "~7.1" }, "conflict": { "doctrine/common": ">2.2,<2.4" }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", "mongodb/mongodb": "^1.1", "phpunit/phpunit": "^5.7", "predis/predis": "~1.0" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.7.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], "description": "Caching library offering an object-oriented API for many cache backends", "homepage": "http://www.doctrine-project.org", "keywords": [ "cache", "caching" ], "time": "2017-08-25T07:02:50+00:00" }, { "name": "doctrine/collections", "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/collections/zipball/a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "reference": "a01ee38fcd999f34d9bfbcee59dbda5105449cbf", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { "doctrine/coding-standard": "~0.1@dev", "phpunit/phpunit": "^5.7" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.3.x-dev" } }, "autoload": { "psr-0": { "Doctrine\\Common\\Collections\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], "description": "Collections Abstraction library", "homepage": "http://www.doctrine-project.org", "keywords": [ "array", "collections", "iterator" ], "time": "2017-07-22T10:37:32+00:00" }, { "name": "doctrine/event-manager", "version": "v1.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/event-manager/zipball/a520bc093a0170feeb6b14e9d83f3a14452e64b3", "reference": "a520bc093a0170feeb6b14e9d83f3a14452e64b3", "shasum": "" }, "require": { "php": "^7.1" }, "conflict": { "doctrine/common": "<2.9@dev" }, "require-dev": { "doctrine/coding-standard": "^4.0", "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" }, { "name": "Marco Pivetta", "email": "ocramius@gmail.com" } ], "description": "Doctrine Event Manager component", "homepage": "https://www.doctrine-project.org/projects/event-manager.html", "keywords": [ "event", "eventdispatcher", "eventmanager" ], "time": "2018-06-11T11:59:03+00:00" }, { "name": "doctrine/lexer", "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", "shasum": "" }, "require": { "php": ">=5.3.2" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-0": { "Doctrine\\Common\\Lexer\\": "lib/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" } ], "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", "homepage": "http://www.doctrine-project.org", "keywords": [ "lexer", "parser" ], "time": "2014-09-09T13:34:57+00:00" }, { "name": "doctrine/reflection", "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/reflection.git", "reference": "bc420ead87fdfe08c03ecc3549db603a45b06d4c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/reflection/zipball/bc420ead87fdfe08c03ecc3549db603a45b06d4c", "reference": "bc420ead87fdfe08c03ecc3549db603a45b06d4c", "shasum": "" }, "require": { "doctrine/annotations": "^1.0", "ext-tokenizer": "*", "php": "^7.1" }, "conflict": { "doctrine/common": "<2.9" }, "require-dev": { "doctrine/coding-standard": "^5.0", "doctrine/common": "^2.10", "phpstan/phpstan": "^0.11.0", "phpstan/phpstan-phpunit": "^0.11.0", "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Common\\": "lib/Doctrine/Common" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Guilherme Blanco", "email": "guilhermeblanco@gmail.com" }, { "name": "Roman Borschel", "email": "roman@code-factory.org" }, { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Jonathan Wage", "email": "jonwage@gmail.com" }, { "name": "Johannes Schmitt", "email": "schmittjoh@gmail.com" }, { "name": "Marco Pivetta", "email": "ocramius@gmail.com" } ], "description": "The Doctrine Reflection project is a simple library used by the various Doctrine projects which adds some additional functionality on top of the reflection functionality that comes with PHP. It allows you to get the reflection information about classes, methods and properties statically.", "homepage": "https://www.doctrine-project.org/projects/reflection.html", "keywords": [ "reflection", "static" ], "time": "2020-01-08T19:53:19+00:00" } ], "packages-dev": [ { "name": "composer/xdebug-handler", "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", "reference": "cbe23383749496fe0f373345208b79568e4bc248" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", "reference": "cbe23383749496fe0f373345208b79568e4bc248", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0" }, "require-dev": { "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" }, "type": "library", "autoload": { "psr-4": { "Composer\\XdebugHandler\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "John Stevenson", "email": "john-stevenson@blueyonder.co.uk" } ], "description": "Restarts a process without Xdebug.", "keywords": [ "Xdebug", "performance" ], "time": "2019-11-06T16:40:04+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", "reference": "e749410375ff6fb7a040a68878c656c2e610b132" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", "reference": "e749410375ff6fb7a040a68878c656c2e610b132", "shasum": "" }, "require": { "composer-plugin-api": "^1.0", "php": "^5.3|^7", "squizlabs/php_codesniffer": "^2|^3" }, "require-dev": { "composer/composer": "*", "phpcompatibility/php-compatibility": "^9.0", "sensiolabs/security-checker": "^4.1.0" }, "type": "composer-plugin", "extra": { "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Franck Nijhof", "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", "homepage": "http://www.dealerdirect.com", "keywords": [ "PHPCodeSniffer", "PHP_CodeSniffer", "code quality", "codesniffer", "composer", "installer", "phpcs", "plugin", "qa", "quality", "standard", "standards", "style guide", "stylecheck", "tests" ], "time": "2018-10-26T13:21:45+00:00" }, { "name": "doctrine/coding-standard", "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/coding-standard.git", "reference": "d33f69eb98b25aa51ffe3a909f0ec77000af4701" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/d33f69eb98b25aa51ffe3a909f0ec77000af4701", "reference": "d33f69eb98b25aa51ffe3a909f0ec77000af4701", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", "php": "^7.1", "slevomat/coding-standard": "^5.0", "squizlabs/php_codesniffer": "^3.4.0" }, "type": "phpcodesniffer-standard", "extra": { "branch-alias": { "dev-master": "6.0.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Sniffs\\": "lib/Doctrine/Sniffs" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Benjamin Eberlei", "email": "kontakt@beberlei.de" }, { "name": "Steve MΓΌller", "email": "st.mueller@dzh-online.de" } ], "description": "The Doctrine Coding Standard is a set of PHPCS rules applied to all Doctrine projects.", "homepage": "https://www.doctrine-project.org/projects/coding-standard.html", "keywords": [ "checks", "code", "coding", "cs", "doctrine", "rules", "sniffer", "sniffs", "standard", "style" ], "time": "2019-03-15T12:45:47+00:00" }, { "name": "doctrine/instantiator", "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "^6.2.3", "squizlabs/php_codesniffer": "^3.0.2" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.2.x-dev" } }, "autoload": { "psr-4": { "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Marco Pivetta", "email": "ocramius@gmail.com", "homepage": "http://ocramius.github.com/" } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", "homepage": "https://github.com/doctrine/instantiator", "keywords": [ "constructor", "instantiate" ], "time": "2017-07-22T11:58:36+00:00" }, { "name": "jean85/pretty-package-versions", "version": "1.2", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/75c7effcf3f77501d0e0caa75111aff4daa0dd48", "reference": "75c7effcf3f77501d0e0caa75111aff4daa0dd48", "shasum": "" }, "require": { "ocramius/package-versions": "^1.2.0", "php": "^7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.x-dev" } }, "autoload": { "psr-4": { "Jean85\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Alessandro Lai", "email": "alessandro.lai85@gmail.com" } ], "description": "A wrapper for ocramius/package-versions to get pretty versions strings", "keywords": [ "composer", "package", "release", "versions" ], "time": "2018-06-13T13:22:40+00:00" }, { "name": "myclabs/deep-copy", "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { "php": "^7.1" }, "replace": { "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { "psr-4": { "DeepCopy\\": "src/DeepCopy/" }, "files": [ "src/DeepCopy/deep_copy.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Create deep copies (clones) of your objects", "keywords": [ "clone", "copy", "duplicate", "object", "object graph" ], "time": "2018-06-11T23:09:50+00:00" }, { "name": "nette/bootstrap", "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/nette/bootstrap.git", "reference": "b45a1e33b6a44beb307756522396551e5a9ff249" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/bootstrap/zipball/b45a1e33b6a44beb307756522396551e5a9ff249", "reference": "b45a1e33b6a44beb307756522396551e5a9ff249", "shasum": "" }, "require": { "nette/di": "^3.0", "nette/utils": "^3.0", "php": ">=7.1" }, "conflict": { "tracy/tracy": "<2.6" }, "require-dev": { "latte/latte": "^2.2", "nette/application": "^3.0", "nette/caching": "^3.0", "nette/database": "^3.0", "nette/forms": "^3.0", "nette/http": "^3.0", "nette/mail": "^3.0", "nette/robot-loader": "^3.0", "nette/safe-stream": "^2.2", "nette/security": "^3.0", "nette/tester": "^2.0", "tracy/tracy": "^2.6" }, "suggest": { "nette/robot-loader": "to use Configurator::createRobotLoader()", "tracy/tracy": "to use Configurator::enableTracy()" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "πŸ…± Nette Bootstrap: the simple way to configure and bootstrap your Nette application.", "homepage": "https://nette.org", "keywords": [ "bootstrapping", "configurator", "nette" ], "time": "2019-09-30T08:19:38+00:00" }, { "name": "nette/di", "version": "v3.0.1", "source": { "type": "git", "url": "https://github.com/nette/di.git", "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/di/zipball/4aff517a1c6bb5c36fa09733d4cea089f529de6d", "reference": "4aff517a1c6bb5c36fa09733d4cea089f529de6d", "shasum": "" }, "require": { "ext-tokenizer": "*", "nette/neon": "^3.0", "nette/php-generator": "^3.2.2", "nette/robot-loader": "^3.2", "nette/schema": "^1.0", "nette/utils": "^3.0", "php": ">=7.1" }, "conflict": { "nette/bootstrap": "<3.0" }, "require-dev": { "nette/tester": "^2.2", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ], "files": [ "src/compatibility.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "πŸ’Ž Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP 7.1 features.", "homepage": "https://nette.org", "keywords": [ "compiled", "di", "dic", "factory", "ioc", "nette", "static" ], "time": "2019-08-07T12:11:33+00:00" }, { "name": "nette/finder", "version": "v2.5.1", "source": { "type": "git", "url": "https://github.com/nette/finder.git", "reference": "14164e1ddd69e9c5f627ff82a10874b3f5bba5fe" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/finder/zipball/14164e1ddd69e9c5f627ff82a10874b3f5bba5fe", "reference": "14164e1ddd69e9c5f627ff82a10874b3f5bba5fe", "shasum": "" }, "require": { "nette/utils": "^2.4 || ~3.0.0", "php": ">=7.1" }, "conflict": { "nette/nette": "<2.2" }, "require-dev": { "nette/tester": "^2.0", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.5-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "πŸ” Nette Finder: find files and directories with an intuitive API.", "homepage": "https://nette.org", "keywords": [ "filesystem", "glob", "iterator", "nette" ], "time": "2019-07-11T18:02:17+00:00" }, { "name": "nette/neon", "version": "v3.0.0", "source": { "type": "git", "url": "https://github.com/nette/neon.git", "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/neon/zipball/cbff32059cbdd8720deccf9e9eace6ee516f02eb", "reference": "cbff32059cbdd8720deccf9e9eace6ee516f02eb", "shasum": "" }, "require": { "ext-iconv": "*", "ext-json": "*", "php": ">=7.0" }, "require-dev": { "nette/tester": "^2.0", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "? Nette NEON: encodes and decodes NEON file format.", "homepage": "http://ne-on.org", "keywords": [ "export", "import", "neon", "nette", "yaml" ], "time": "2019-02-05T21:30:40+00:00" }, { "name": "nette/php-generator", "version": "v3.3.1", "source": { "type": "git", "url": "https://github.com/nette/php-generator.git", "reference": "4240fd7adf499138c07b814ef9b9a6df9f6d7187" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/php-generator/zipball/4240fd7adf499138c07b814ef9b9a6df9f6d7187", "reference": "4240fd7adf499138c07b814ef9b9a6df9f6d7187", "shasum": "" }, "require": { "nette/utils": "^2.4.2 || ~3.0.0", "php": ">=7.1" }, "require-dev": { "nette/tester": "^2.0", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.3-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "🐘 Nette PHP Generator: generates neat PHP code for you. Supports new PHP 7.3 features.", "homepage": "https://nette.org", "keywords": [ "code", "nette", "php", "scaffolding" ], "time": "2019-11-22T11:12:11+00:00" }, { "name": "nette/robot-loader", "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/nette/robot-loader.git", "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/robot-loader/zipball/0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", "reference": "0712a0e39ae7956d6a94c0ab6ad41aa842544b5c", "shasum": "" }, "require": { "ext-tokenizer": "*", "nette/finder": "^2.5", "nette/utils": "^3.0", "php": ">=7.1" }, "require-dev": { "nette/tester": "^2.0", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.2-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "? Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.", "homepage": "https://nette.org", "keywords": [ "autoload", "class", "interface", "nette", "trait" ], "time": "2019-03-08T21:57:24+00:00" }, { "name": "nette/schema", "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/nette/schema.git", "reference": "337117df1dade22e2ba1fdc4a4b832c1e9b06b76" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/schema/zipball/337117df1dade22e2ba1fdc4a4b832c1e9b06b76", "reference": "337117df1dade22e2ba1fdc4a4b832c1e9b06b76", "shasum": "" }, "require": { "nette/utils": "^3.0.1", "php": ">=7.1" }, "require-dev": { "nette/tester": "^2.2", "tracy/tracy": "^2.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "πŸ“ Nette Schema: validating data structures against a given Schema.", "homepage": "https://nette.org", "keywords": [ "config", "nette" ], "time": "2019-10-31T20:52:19+00:00" }, { "name": "nette/utils", "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/nette/utils.git", "reference": "c133e18c922dcf3ad07673077d92d92cef25a148" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nette/utils/zipball/c133e18c922dcf3ad07673077d92d92cef25a148", "reference": "c133e18c922dcf3ad07673077d92d92cef25a148", "shasum": "" }, "require": { "php": ">=7.1" }, "require-dev": { "nette/tester": "~2.0", "tracy/tracy": "^2.3" }, "suggest": { "ext-gd": "to use Image", "ext-iconv": "to use Strings::webalize() and toAscii()", "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", "ext-json": "to use Nette\\Utils\\Json", "ext-mbstring": "to use Strings::lower() etc...", "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", "ext-xml": "to use Strings::length() etc. when mbstring is not available" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause", "GPL-2.0", "GPL-3.0" ], "authors": [ { "name": "David Grudl", "homepage": "https://davidgrudl.com" }, { "name": "Nette Community", "homepage": "https://nette.org/contributors" } ], "description": "πŸ›  Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", "homepage": "https://nette.org", "keywords": [ "array", "core", "datetime", "images", "json", "nette", "paginator", "password", "slugify", "string", "unicode", "utf-8", "utility", "validation" ], "time": "2019-10-21T20:40:16+00:00" }, { "name": "nikic/php-parser", "version": "v4.3.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/9a9981c347c5c49d6dfe5cf826bb882b824080dc", "reference": "9a9981c347c5c49d6dfe5cf826bb882b824080dc", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=7.0" }, "require-dev": { "ircmaxell/php-yacc": "0.0.5", "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0" }, "bin": [ "bin/php-parse" ], "type": "library", "extra": { "branch-alias": { "dev-master": "4.3-dev" } }, "autoload": { "psr-4": { "PhpParser\\": "lib/PhpParser" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Nikita Popov" } ], "description": "A PHP parser written in PHP", "keywords": [ "parser", "php" ], "time": "2019-11-08T13:50:10+00:00" }, { "name": "ocramius/package-versions", "version": "1.4.2", "source": { "type": "git", "url": "https://github.com/Ocramius/PackageVersions.git", "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/Ocramius/PackageVersions/zipball/44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", "reference": "44af6f3a2e2e04f2af46bcb302ad9600cba41c7d", "shasum": "" }, "require": { "composer-plugin-api": "^1.0.0", "php": "^7.1.0" }, "require-dev": { "composer/composer": "^1.6.3", "doctrine/coding-standard": "^5.0.1", "ext-zip": "*", "infection/infection": "^0.7.1", "phpunit/phpunit": "^7.5.17" }, "type": "composer-plugin", "extra": { "class": "PackageVersions\\Installer", "branch-alias": { "dev-master": "2.0.x-dev" } }, "autoload": { "psr-4": { "PackageVersions\\": "src/PackageVersions" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Marco Pivetta", "email": "ocramius@gmail.com" } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", "time": "2019-11-15T16:17:10+00:00" }, { "name": "phar-io/manifest", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", "phar-io/version": "^1.0.1", "php": "^5.6 || ^7.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" }, { "name": "Sebastian Heuer", "email": "sebastian@phpeople.de", "role": "Developer" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "Developer" } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "time": "2017-03-05T18:14:27+00:00" }, { "name": "phar-io/version", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "type": "library", "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" }, { "name": "Sebastian Heuer", "email": "sebastian@phpeople.de", "role": "Developer" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "Developer" } ], "description": "Library for handling version information and constraints", "time": "2017-03-05T17:38:23+00:00" }, { "name": "phpdocumentor/reflection-common", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { "php": ">=5.5" }, "require-dev": { "phpunit/phpunit": "^4.6" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ "src" ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Jaap van Otterdijk", "email": "opensource@ijaap.nl" } ], "description": "Common reflection classes used by phpdocumentor to reflect the code structure", "homepage": "http://www.phpdoc.org", "keywords": [ "FQSEN", "phpDocumentor", "phpdoc", "reflection", "static analysis" ], "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", "version": "4.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", "reference": "94fd0001232e47129dd3504189fa1c7225010d08" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", "reference": "94fd0001232e47129dd3504189fa1c7225010d08", "shasum": "" }, "require": { "php": "^7.0", "phpdocumentor/reflection-common": "^1.0.0", "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { "doctrine/instantiator": "~1.0.5", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.x-dev" } }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ "src/" ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Mike van Riel", "email": "me@mikevanriel.com" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "time": "2017-11-30T07:14:17+00:00" }, { "name": "phpdocumentor/type-resolver", "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { "mockery/mockery": "^0.9.4", "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ "src/" ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Mike van Riel", "email": "me@mikevanriel.com" } ], "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", "version": "1.7.6", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpspec/prophecy/zipball/33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "reference": "33a7e3c4fda54e912ff6338c48823bd5c0f0b712", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.7.x-dev" } }, "autoload": { "psr-0": { "Prophecy\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Konstantin Kudryashov", "email": "ever.zet@gmail.com", "homepage": "http://everzet.com" }, { "name": "Marcello Duarte", "email": "marcello.duarte@gmail.com" } ], "description": "Highly opinionated mocking framework for PHP 5.3+", "homepage": "https://github.com/phpspec/prophecy", "keywords": [ "Double", "Dummy", "fake", "mock", "spy", "stub" ], "time": "2018-04-18T13:57:24+00:00" }, { "name": "phpstan/phpdoc-parser", "version": "0.3.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", "reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", "shasum": "" }, "require": { "php": "~7.1" }, "require-dev": { "consistence/coding-standard": "^3.5", "jakub-onderka/php-parallel-lint": "^0.9.2", "phing/phing": "^2.16.0", "phpstan/phpstan": "^0.10", "phpunit/phpunit": "^6.3", "slevomat/coding-standard": "^4.7.2", "squizlabs/php_codesniffer": "^3.3.2", "symfony/process": "^3.4 || ^4.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "0.3-dev" } }, "autoload": { "psr-4": { "PHPStan\\PhpDocParser\\": [ "src/" ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPDoc parser with support for nullable, intersection and generic types", "time": "2019-06-07T19:13:52+00:00" }, { "name": "phpstan/phpstan", "version": "0.11.19", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", "reference": "63cc502f6957b7f74efbac444b4cf219dcadffd7" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/63cc502f6957b7f74efbac444b4cf219dcadffd7", "reference": "63cc502f6957b7f74efbac444b4cf219dcadffd7", "shasum": "" }, "require": { "composer/xdebug-handler": "^1.3.0", "jean85/pretty-package-versions": "^1.0.3", "nette/bootstrap": "^2.4 || ^3.0", "nette/di": "^2.4.7 || ^3.0", "nette/neon": "^2.4.3 || ^3.0", "nette/robot-loader": "^3.0.1", "nette/schema": "^1.0", "nette/utils": "^2.4.5 || ^3.0", "nikic/php-parser": "^4.2.3", "php": "~7.1", "phpstan/phpdoc-parser": "^0.3.5", "symfony/console": "~3.2 || ~4.0", "symfony/finder": "~3.2 || ~4.0" }, "conflict": { "symfony/console": "3.4.16 || 4.1.5" }, "require-dev": { "brianium/paratest": "^2.0 || ^3.0", "consistence/coding-standard": "^3.5", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", "ext-intl": "*", "ext-mysqli": "*", "ext-simplexml": "*", "ext-soap": "*", "ext-zip": "*", "jakub-onderka/php-parallel-lint": "^1.0", "localheinz/composer-normalize": "^1.1.0", "phing/phing": "^2.16.0", "phpstan/phpstan-deprecation-rules": "^0.11", "phpstan/phpstan-php-parser": "^0.11", "phpstan/phpstan-phpunit": "^0.11", "phpstan/phpstan-strict-rules": "^0.11", "phpunit/phpunit": "^7.5.14 || ^8.0", "slevomat/coding-standard": "^4.7.2", "squizlabs/php_codesniffer": "^3.3.2" }, "bin": [ "bin/phpstan" ], "type": "library", "extra": { "branch-alias": { "dev-master": "0.11-dev" } }, "autoload": { "psr-4": { "PHPStan\\": [ "src/" ] } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", "time": "2019-10-22T20:20:22+00:00" }, { "name": "phpunit/php-code-coverage", "version": "6.0.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/865662550c384bc1db7e51d29aeda1c2c161d69a", "reference": "865662550c384bc1db7e51d29aeda1c2c161d69a", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", "php": "^7.1", "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", "sebastian/environment": "^3.1", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { "phpunit/phpunit": "^7.0" }, "suggest": { "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "6.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", "homepage": "https://github.com/sebastianbergmann/php-code-coverage", "keywords": [ "coverage", "testing", "xunit" ], "time": "2018-06-01T07:51:50+00:00" }, { "name": "phpunit/php-file-iterator", "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", "shasum": "" }, "require": { "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "FilterIterator implementation that filters files based on a list of suffixes.", "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", "keywords": [ "filesystem", "iterator" ], "time": "2018-06-11T11:44:00+00:00" }, { "name": "phpunit/php-text-template", "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { "php": ">=5.3.3" }, "type": "library", "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Simple template engine.", "homepage": "https://github.com/sebastianbergmann/php-text-template/", "keywords": [ "template" ], "time": "2015-06-21T13:50:34+00:00" }, { "name": "phpunit/php-timer", "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b8454ea6958c3dee38453d3bd571e023108c91f", "reference": "8b8454ea6958c3dee38453d3bd571e023108c91f", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Utility class for timing", "homepage": "https://github.com/sebastianbergmann/php-timer/", "keywords": [ "timer" ], "time": "2018-02-01T13:07:23+00:00" }, { "name": "phpunit/php-token-stream", "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/21ad88bbba7c3d93530d93994e0a33cd45f02ace", "reference": "21ad88bbba7c3d93530d93994e0a33cd45f02ace", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": "^7.1" }, "require-dev": { "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Wrapper around PHP's tokenizer extension.", "homepage": "https://github.com/sebastianbergmann/php-token-stream/", "keywords": [ "tokenizer" ], "time": "2018-02-01T13:16:43+00:00" }, { "name": "phpunit/phpunit", "version": "7.2.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/00bc0b93f0ff4f557e9ea766557fde96da9a03dd", "reference": "00bc0b93f0ff4f557e9ea766557fde96da9a03dd", "shasum": "" }, "require": { "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "myclabs/deep-copy": "^1.7", "phar-io/manifest": "^1.0.1", "phar-io/version": "^1.0", "php": "^7.1", "phpspec/prophecy": "^1.7", "phpunit/php-code-coverage": "^6.0.7", "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^2.0", "sebastian/comparator": "^3.0", "sebastian/diff": "^3.0", "sebastian/environment": "^3.1", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", "sebastian/resource-operations": "^1.0", "sebastian/version": "^2.0.1" }, "conflict": { "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { "ext-soap": "*", "ext-xdebug": "*", "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" ], "type": "library", "extra": { "branch-alias": { "dev-master": "7.2-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "The PHP Unit Testing framework.", "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], "time": "2018-06-05T03:40:05+00:00" }, { "name": "psr/container", "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", "shasum": "" }, "require": { "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { "Psr\\Container\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common Container Interface (PHP FIG PSR-11)", "homepage": "https://github.com/php-fig/container", "keywords": [ "PSR-11", "container", "container-interface", "container-interop", "psr" ], "time": "2017-02-14T16:28:37+00:00" }, { "name": "psr/log", "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/php-fig/log/zipball/446d54b4cb6bf489fc9d75f55843658e6f25d801", "reference": "446d54b4cb6bf489fc9d75f55843658e6f25d801", "shasum": "" }, "require": { "php": ">=5.3.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.1.x-dev" } }, "autoload": { "psr-4": { "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "PHP-FIG", "homepage": "http://www.php-fig.org/" } ], "description": "Common interface for logging libraries", "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], "time": "2019-11-01T11:05:21+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", "shasum": "" }, "require": { "php": "^5.6 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^5.7 || ^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "time": "2017-03-04T06:30:41+00:00" }, { "name": "sebastian/comparator", "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ed5fd2281113729f1ebcc64d101ad66028aeb3d5", "reference": "ed5fd2281113729f1ebcc64d101ad66028aeb3d5", "shasum": "" }, "require": { "php": "^7.1", "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Volker Dusch", "email": "github@wallbash.com" }, { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], "time": "2018-04-18T13:33:00+00:00" }, { "name": "sebastian/diff", "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", "reference": "366541b989927187c4ca70490a35615d3fef2dce" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/366541b989927187c4ca70490a35615d3fef2dce", "reference": "366541b989927187c4ca70490a35615d3fef2dce", "shasum": "" }, "require": { "php": "^7.1" }, "require-dev": { "phpunit/phpunit": "^7.0", "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff", "udiff", "unidiff", "unified diff" ], "time": "2018-06-10T07:54:39+00:00" }, { "name": "sebastian/environment", "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", "shasum": "" }, "require": { "php": "^7.0" }, "require-dev": { "phpunit/phpunit": "^6.1" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.1.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Provides functionality to handle HHVM/PHP environments", "homepage": "http://www.github.com/sebastianbergmann/environment", "keywords": [ "Xdebug", "environment", "hhvm" ], "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", "shasum": "" }, "require": { "php": "^7.0", "sebastian/recursion-context": "^3.0" }, "require-dev": { "ext-mbstring": "*", "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.1.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Volker Dusch", "email": "github@wallbash.com" }, { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], "description": "Provides the functionality to export PHP variables for visualization", "homepage": "http://www.github.com/sebastianbergmann/exporter", "keywords": [ "export", "exporter" ], "time": "2017-04-03T13:19:02+00:00" }, { "name": "sebastian/global-state", "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", "shasum": "" }, "require": { "php": "^7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" }, "suggest": { "ext-uopz": "*" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Snapshotting of global state", "homepage": "http://www.github.com/sebastianbergmann/global-state", "keywords": [ "global state" ], "time": "2017-04-27T15:39:26+00:00" }, { "name": "sebastian/object-enumerator", "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", "shasum": "" }, "require": { "php": "^7.0", "sebastian/object-reflector": "^1.1.1", "sebastian/recursion-context": "^3.0" }, "require-dev": { "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "time": "2017-08-03T12:35:26+00:00" }, { "name": "sebastian/object-reflector", "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", "reference": "773f97c67f28de00d397be301821b06708fca0be" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", "reference": "773f97c67f28de00d397be301821b06708fca0be", "shasum": "" }, "require": { "php": "^7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.1-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", "time": "2017-03-29T09:07:27+00:00" }, { "name": "sebastian/recursion-context", "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", "shasum": "" }, "require": { "php": "^7.0" }, "require-dev": { "phpunit/phpunit": "^6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "3.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" }, { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" }, { "name": "Adam Harvey", "email": "aharvey@php.net" } ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "time": "2017-03-03T06:23:57+00:00" }, { "name": "sebastian/resource-operations", "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, "require": { "php": ">=5.6.0" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de" } ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "time": "2015-07-28T20:34:47+00:00" }, { "name": "sebastian/version", "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", "shasum": "" }, "require": { "php": ">=5.6" }, "type": "library", "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } }, "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", "email": "sebastian@phpunit.de", "role": "lead" } ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", "time": "2016-10-03T07:35:21+00:00" }, { "name": "slevomat/coding-standard", "version": "5.0.4", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", "reference": "287ac3347c47918c0bf5e10335e36197ea10894c" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/287ac3347c47918c0bf5e10335e36197ea10894c", "reference": "287ac3347c47918c0bf5e10335e36197ea10894c", "shasum": "" }, "require": { "php": "^7.1", "phpstan/phpdoc-parser": "^0.3.1", "squizlabs/php_codesniffer": "^3.4.1" }, "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", "phing/phing": "2.16.1", "phpstan/phpstan": "0.11.4", "phpstan/phpstan-phpunit": "0.11", "phpstan/phpstan-strict-rules": "0.11", "phpunit/phpunit": "8.0.5" }, "type": "phpcodesniffer-standard", "autoload": { "psr-4": { "SlevomatCodingStandard\\": "SlevomatCodingStandard" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "time": "2019-03-22T19:10:53+00:00" }, { "name": "squizlabs/php_codesniffer", "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "reference": "557a1fc7ac702c66b0bbfe16ab3d55839ef724cb", "shasum": "" }, "require": { "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.4.0" }, "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "bin": [ "bin/phpcs", "bin/phpcbf" ], "type": "library", "extra": { "branch-alias": { "dev-master": "3.x-dev" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Greg Sherwood", "role": "lead" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", "standards" ], "time": "2019-12-04T04:46:47+00:00" }, { "name": "symfony/console", "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", "reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/console/zipball/f0aea3df20d15635b3cb9730ca5eea1c65b7f201", "reference": "f0aea3df20d15635b3cb9730ca5eea1c65b7f201", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php73": "^1.8", "symfony/service-contracts": "^1.1|^2" }, "conflict": { "symfony/dependency-injection": "<3.4", "symfony/event-dispatcher": "<4.3|>=5", "symfony/lock": "<4.4", "symfony/process": "<3.3" }, "provide": { "psr/log-implementation": "1.0" }, "require-dev": { "psr/log": "~1.0", "symfony/config": "^3.4|^4.0|^5.0", "symfony/dependency-injection": "^3.4|^4.0|^5.0", "symfony/event-dispatcher": "^4.3", "symfony/lock": "^4.4|^5.0", "symfony/process": "^3.4|^4.0|^5.0", "symfony/var-dumper": "^4.3|^5.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.4-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Console\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Console Component", "homepage": "https://symfony.com", "time": "2019-12-01T10:06:17+00:00" }, { "name": "symfony/finder", "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", "shasum": "" }, "require": { "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "4.4-dev" } }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" }, "exclude-from-classmap": [ "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", "time": "2019-11-17T21:56:56+00:00" }, { "name": "symfony/polyfill-mbstring", "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f", "reference": "7b4aab9743c30be783b73de055d24a39cf4b954f", "shasum": "" }, "require": { "php": ">=5.3.3" }, "suggest": { "ext-mbstring": "For best performance" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, "files": [ "bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Nicolas Grekas", "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for the Mbstring extension", "homepage": "https://symfony.com", "keywords": [ "compatibility", "mbstring", "polyfill", "portable", "shim" ], "time": "2019-11-27T14:18:11+00:00" }, { "name": "symfony/polyfill-php73", "version": "v1.13.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/4b0e2222c55a25b4541305a053013d5647d3a25f", "reference": "4b0e2222c55a25b4541305a053013d5647d3a25f", "shasum": "" }, "require": { "php": ">=5.3.3" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.13-dev" } }, "autoload": { "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" ], "classmap": [ "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Nicolas Grekas", "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", "polyfill", "portable", "shim" ], "time": "2019-11-27T16:25:15+00:00" }, { "name": "symfony/service-contracts", "version": "v1.1.8", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "reference": "ffc7f5692092df31515df2a5ecf3b7302b3ddacf", "shasum": "" }, "require": { "php": "^7.1.3", "psr/container": "^1.0" }, "suggest": { "symfony/service-implementation": "" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.1-dev" } }, "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Nicolas Grekas", "email": "p@tchwork.com" }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" } ], "description": "Generic abstractions related to writing services", "homepage": "https://symfony.com", "keywords": [ "abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards" ], "time": "2019-10-14T12:27:06+00:00" }, { "name": "theseer/tokenizer", "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": "^7.0" }, "type": "library", "autoload": { "classmap": [ "src/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Arne Blankerts", "email": "arne@blankerts.de", "role": "Developer" } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "time": "2017-04-07T12:08:54+00:00" }, { "name": "webmozart/assert", "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", "reference": "0df1908962e7a3071564e857d86874dad1ef204a" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", "reference": "0df1908962e7a3071564e857d86874dad1ef204a", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^4.6", "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { "dev-master": "1.3-dev" } }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { "name": "Bernhard Schussek", "email": "bschussek@gmail.com" } ], "description": "Assertions to validate method input/output with nice error messages.", "keywords": [ "assert", "check", "validate" ], "time": "2018-01-29T19:49:41+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { "php": "^7.1" }, "platform-dev": [] } php-doctrine-persistence-1.3.6/docs/000077500000000000000000000000001361236344400173755ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/docs/en/000077500000000000000000000000001361236344400177775ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/docs/en/index.rst000066400000000000000000000016221361236344400216410ustar00rootroot00000000000000Persistence Documentation ========================= The Doctrine Persistence documentation is a reference guide to everything you need to know about the project. Getting Help ------------ If this documentation is not helping to answer questions you have about the Doctrine Persistence project, don't panic. You can get help from different sources: - Slack chat room `#persistence `_ - On `Stack Overflow `_ - The `Doctrine Mailing List `_ - Report a bug on `GitHub `_. Getting Started --------------- The best way to get started is with the :doc:`Introduction ` section in the documentation. Use the sidebar to browse other documentation for the Doctrine Persistence project. php-doctrine-persistence-1.3.6/docs/en/reference/000077500000000000000000000000001361236344400217355ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/docs/en/reference/index.rst000066400000000000000000000267131361236344400236070ustar00rootroot00000000000000Introduction ============ The Doctrine Persistence project is a set of shared interfaces and functionality that the different Doctrine object mappers share. You can use these interfaces and abstract classes to build your own mapper if you don't want to use the full data mappers provided by Doctrine. Installation ============ The library can easily be installed with composer. .. code-block:: sh $ composer require doctrine/persistence Overview ======== The interfaces and functionality in this project evolved from building several different implementations of Doctrine object mappers. The first implementation was the ORM_ then came the `MongoDB ODM`_. A set of common interfaces were extracted from both projects and released in the `Doctrine Common`_ project. Over the years, more common functionality was extracted and eventually moved to this standalone project. A Doctrine object mapper looks like this when implemented. .. code-block:: php final class User { /** @var string */ private $username; public function __construct(string $username) { $this->username = $username; } // ... } $objectManager = new ObjectManager(); $userRepository = $objectManager->getRepository(User::class); $newUser = new User('jwage'); $objectManager->persist($newUser); $objectManager->flush(); $user = $objectManager->find(User::class, 1); $objectManager->remove($user); $objectManager->flush(); $users = $userRepository->findAll(); To learn more about the full interfaces and functionality continue reading! Object Manager ============== The main public interface that an end user will use is the ``Doctrine\Common\Persistence\ObjectManager`` interface. .. code-block:: php namespace Doctrine\Common\Persistence; interface ObjectManager { public function find($className, $id); public function persist($object); public function remove($object); public function merge($object); public function clear($objectName = null); public function detach($object); public function refresh($object); public function flush(); public function getRepository($className); public function getClassMetadata($className); public function getMetadataFactory(); public function initializeObject($obj); public function contains($object); } ObjectRepository ================ The object repository is used to retrieve instances of your mapped objects from the mapper. .. code-block:: php namespace Doctrine\Common\Persistence; interface ObjectRepository { public function find($id); public function findAll(); public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null); public function findOneBy(array $criteria); public function getClassName(); } Mapping ======= In order for Doctrine to be able to persist your objects to a data store, you have to map the classes and class properties so they can be properly stored and retrieved while maintaining a consistent state. ClassMetadata ------------- .. code-block:: php namespace Doctrine\Common\Persistence\Mapping; interface ClassMetadata { public function getName(); public function getIdentifier(); public function getReflectionClass(); public function isIdentifier($fieldName); public function hasField($fieldName); public function hasAssociation($fieldName); public function isSingleValuedAssociation($fieldName); public function isCollectionValuedAssociation($fieldName); public function getFieldNames(); public function getIdentifierFieldNames(); public function getAssociationNames(); public function getTypeOfField($fieldName); public function getAssociationTargetClass($assocName); public function isAssociationInverseSide($assocName); public function getAssociationMappedByTargetField($assocName); public function getIdentifierValues($object); } ClassMetadataFactory -------------------- The ``Doctrine\Common\Persistence\Mapping\ClassMetadataFactory`` class can be used to manage the instances for each of your mapped PHP classes. .. code-block:: php namespace Doctrine\Common\Persistence\Mapping; interface ClassMetadataFactory { public function getAllMetadata(); public function getMetadataFor($className); public function hasMetadataFor($className); public function setMetadataFor($className, $class); public function isTransient($className); } Mapping Driver ============== In order to load ``ClassMetadata`` instances you can use the ``Doctrine\Common\Persistence\Mapping\Driver\MappingDriver`` interface. This is the interface that does the core loading of mapping information from wherever they are stored. That may be in files, annotations, yaml, xml, etc. .. code-block:: php namespace Doctrine\Common\Persistence\Mapping\Driver; use Doctrine\Common\Persistence\Mapping\ClassMetadata; interface MappingDriver { public function loadMetadataForClass($className, ClassMetadata $metadata); public function getAllClassNames(); public function isTransient($className); } The Doctrine Persistence project offers a few base implementations that make it easy to implement your own XML, Annotations or YAML drivers. FileDriver ---------- The file driver operates in a mode where it loads the mapping files of individual classes on demand. This requires the user to adhere to the convention of 1 mapping file per class and the file names of the mapping files must correspond to the full class name, including namespace, with the namespace delimiters '\', replaced by dots '.'. Extend the ``Doctrine\Common\Persistence\Mapping\Driver\FileDriver`` class to implement your own file driver. Here is an example JSON file driver implementation. .. code-block:: php use Doctrine\Common\Persistence\Mapping\Driver\FileDriver; final class JSONFileDriver extends FileDriver { public function loadMetadataForClass($className, ClassMetadata $metadata) { $mappingFileData = $this->getElement($className); // use the array of mapping information from the file to populate the $metadata instance } protected function loadMappingFile($file) { return json_decode($file, true); } } Now you can use it like the following. .. code-block:: php use Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator; $fileLocator = new DefaultFileLocator('/path/to/mapping/files', 'json'); $jsonFileDriver = new JSONFileDriver($fileLocator); Now if you have a class named ``App\Model\User`` and you can load the mapping information like this. .. code-block:: php use App\Model\User; use Doctrine\Common\Persistence\Mapping\ClassMetadata; $classMetadata = new ClassMetadata(); // looks for a file at /path/to/mapping/files/App.Model.User.json $jsonFileDriver->loadMetadataForClass(User::class, $classMetadata); AnnotationDriver ---------------- .. note:: This driver requires the ``doctrine/annotations`` project. You can install it with composer. .. code-block:: php composer require doctrine/annotations The AnnotationDriver reads the mapping metadata from docblock annotations. .. code-block:: php final class MyAnnotationDriver extends AnnotationDriver { public function loadMetadataForClass($className, ClassMetadata $metadata) { /** @var ClassMetadata $class */ $reflClass = $class->getReflectionClass(); $classAnnotations = $this->reader->getClassAnnotations($reflClass); // Use the reader to read annotations from your classes to then populate the $metadata instance. } } Now you can use it like the following: .. code-block:: php use App\Model\User; use Doctrine\Common\Annotations\AnnotationReader; use Doctrine\Common\Persistence\Mapping\ClassMetadata; $annotationReader = new AnnotationReader(); $annotationDriver = new AnnotationDriver($annotationReader, '/path/to/classes/with/annotations'); $classMetadata = new ClassMetadata(); // looks for a PHP file at /path/to/classes/with/annotations/App/Model/User.php $annotationDriver->loadMetadataForClass(User::class, $classMetadata); PHPDriver --------- The PHPDriver includes PHP files which just populate ``ClassMetadata`` instances with plain PHP code. .. code-block:: php use Doctrine\Common\Persistence\Mapping\Driver\PHPDriver; $phpDriver = new PHPDriver('/path/to/mapping/files'); Now you can use it like the following: .. code-block:: php use App\Model\User; use Doctrine\Common\Persistence\Mapping\ClassMetadata; $classMetadata = new ClassMetadata(); // looks for a PHP file at /path/to/mapping/files/App.Model.User.php $phpDriver->loadMetadataForClass(User::class, $classMetadata); Inside the ``/path/to/mapping/files/App.Model.User.php`` file you can write raw PHP code to populate a ``ClassMetadata`` instance. You will have access to a variable named ``$metadata`` inside the file that you can use to populate the mapping metadata. .. code-block:: php use App\Model\User; $metadata->name = User::class; // ... StaticPHPDriver -------------- The StaticPHPDriver calls a static ``loadMetadata()`` method on your model classes where you can manually populate the ``ClassMetadata`` instance. .. code-block:: php $staticPHPDriver = new StaticPHPDriver('/path/to/classes'); $classMetadata = new ClassMetadata(); // looks for a PHP file at /path/to/classes/App/Model/User.php $phpDriver->loadMetadataForClass(User::class, $classMetadata); Your class in ``App\Model\User`` would look like the following. .. code-block:: php namespace App\Model; final class User { // ... public static function loadMetadata(ClassMetadata $metadata) { // populate the $metadata instance } } Reflection ========== Doctrine uses reflection to set and get the data inside your objects. The ``Doctrine\Common\Persistence\Mapping\ReflectionService`` is the primary interface needed for a Doctrine mapper. .. code-block:: php namespace Doctrine\Common\Persistence\Mapping; interface ReflectionService { public function getParentClasses($class); public function getClassShortName($class); public function getClassNamespace($class); public function getClass($class); public function getAccessibleProperty($class, $property); public function hasPublicMethod($class, $method); } Doctrine provides an implementation of this interface in the class named ``Doctrine\Common\Persistence\Mapping\RuntimeReflectionService``. Implementations =============== There are several different implementations of the Doctrine Persistence APIs. - ORM_ - The Doctrine Object Relational Mapper is a data mapper for relational databases. - `MongoDB ODM`_ - The Doctrine MongoDB ODM is a data mapper for MongoDB. - `PHPCR ODM`_ - The Doctrine PHPCR ODM a data mapper built on top of the PHPCR API. .. _ORM: https://www.doctrine-project.org/projects/orm.html .. _MongoDB ODM: https://www.doctrine-project.org/projects/mongodb-odm.html .. _PHPCR ODM: https://www.doctrine-project.org/projects/phpcr-odm.html .. _Doctrine Common: https://www.doctrine-project.org/projects/common.html php-doctrine-persistence-1.3.6/docs/en/reference/object-change-tracking.rst000066400000000000000000000046361361236344400267710ustar00rootroot00000000000000.. object_change_tracking: Object Change Tracking ====================== Change tracking is the process of determining what has changed in observed objects since the last time they were synchronized with the persistence backend. This approach is based on `the observer pattern `_ and consists of the following two interfaces: * ``Doctrine\Common\NotifyPropertyChanged`` that is implemented by the object whose changes can be tracked, * ``Doctrine\Common\PropertyChangedListener`` that is implemented by subscribers which are interested in tracking the changes. Notifying subscribers ~~~~~~~~~~~~~~~~~~~~~ A class that wants to allow other objects to subscribe needs to implement the ``NotifyPropertyChanged`` interface. As a guideline, such an implementation can look as follows: .. code-block:: php listeners[] = $listener; } } Then, in each mutator of this class or any derived classes, you need to notify all the ``PropertyChangedListener`` instances. As an example we add a convenience method on ``MyTrackedObject`` that shows this behavior: .. code-block:: php listeners as $listener) { $listener->propertyChanged($this, $propertyName, $oldValue, $newValue); } } public function setAge(int $age) : void { if ($this->age === $age) { return; } $this->notifySubscribers('age', $this->age, $age); $this->age = $age; } } You have to invoke ``notifySubscribers()`` inside every method that changes the persistent state of ``MyTrackedObject``. The check whether the new value is different from the old one is not mandatory but recommended. That way you also have full control over when you consider a property changed. php-doctrine-persistence-1.3.6/docs/en/sidebar.rst000066400000000000000000000001251361236344400221400ustar00rootroot00000000000000.. toctree:: :depth: 3 reference/index reference/object-change-tracking php-doctrine-persistence-1.3.6/lib/000077500000000000000000000000001361236344400172135ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/lib/Doctrine/000077500000000000000000000000001361236344400207625ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/lib/Doctrine/Common/000077500000000000000000000000001361236344400222125ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/lib/Doctrine/Common/NotifyPropertyChanged.php000066400000000000000000000004471361236344400272170ustar00rootroot00000000000000getId(); // method exists through __call */ abstract class PersistentObject implements ObjectManagerAware { /** @var ObjectManager|null */ private static $objectManager = null; /** @var ClassMetadata|null */ private $cm = null; /** * Sets the object manager responsible for all persistent object base classes. * * @return void */ public static function setObjectManager(?ObjectManager $objectManager = null) { self::$objectManager = $objectManager; } /** * @return ObjectManager|null */ public static function getObjectManager() { return self::$objectManager; } /** * Injects the Doctrine Object Manager. * * @return void * * @throws RuntimeException */ public function injectObjectManager(ObjectManager $objectManager, ClassMetadata $classMetadata) { if ($objectManager !== self::$objectManager) { throw new RuntimeException('Trying to use PersistentObject with different ObjectManager instances. ' . 'Was PersistentObject::setObjectManager() called?'); } $this->cm = $classMetadata; } /** * Sets a persistent fields value. * * @param string $field * @param mixed[] $args * * @return void * * @throws BadMethodCallException When no persistent field exists by that name. * @throws InvalidArgumentException When the wrong target object type is passed to an association. */ private function set($field, $args) { if ($this->cm->hasField($field) && ! $this->cm->isIdentifier($field)) { $this->$field = $args[0]; } elseif ($this->cm->hasAssociation($field) && $this->cm->isSingleValuedAssociation($field)) { $targetClass = $this->cm->getAssociationTargetClass($field); if (! ($args[0] instanceof $targetClass) && $args[0] !== null) { throw new InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'"); } $this->$field = $args[0]; $this->completeOwningSide($field, $targetClass, $args[0]); } else { throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'"); } } /** * Gets a persistent field value. * * @param string $field * * @return mixed * * @throws BadMethodCallException When no persistent field exists by that name. */ private function get($field) { if ($this->cm->hasField($field) || $this->cm->hasAssociation($field)) { return $this->$field; } throw new BadMethodCallException("no field with name '" . $field . "' exists on '" . $this->cm->getName() . "'"); } /** * If this is an inverse side association, completes the owning side. * * @param string $field * @param ClassMetadata $targetClass * @param object $targetObject * * @return void */ private function completeOwningSide($field, $targetClass, $targetObject) { // add this object on the owning side as well, for obvious infinite recursion // reasons this is only done when called on the inverse side. if (! $this->cm->isAssociationInverseSide($field)) { return; } $mappedByField = $this->cm->getAssociationMappedByTargetField($field); $targetMetadata = self::$objectManager->getClassMetadata($targetClass); $setter = ($targetMetadata->isCollectionValuedAssociation($mappedByField) ? 'add' : 'set') . $mappedByField; $targetObject->$setter($this); } /** * Adds an object to a collection. * * @param string $field * @param mixed[] $args * * @return void * * @throws BadMethodCallException * @throws InvalidArgumentException */ private function add($field, $args) { if (! $this->cm->hasAssociation($field) || ! $this->cm->isCollectionValuedAssociation($field)) { throw new BadMethodCallException('There is no method add' . $field . '() on ' . $this->cm->getName()); } $targetClass = $this->cm->getAssociationTargetClass($field); if (! ($args[0] instanceof $targetClass)) { throw new InvalidArgumentException("Expected persistent object of type '" . $targetClass . "'"); } if (! ($this->$field instanceof Collection)) { $this->$field = new ArrayCollection($this->$field ?: []); } $this->$field->add($args[0]); $this->completeOwningSide($field, $targetClass, $args[0]); } /** * Initializes Doctrine Metadata for this class. * * @return void * * @throws RuntimeException */ private function initializeDoctrine() { if ($this->cm !== null) { return; } if (! self::$objectManager) { throw new RuntimeException('No runtime object manager set. Call PersistentObject#setObjectManager().'); } $this->cm = self::$objectManager->getClassMetadata(static::class); } /** * Magic methods. * * @param string $method * @param mixed[] $args * * @return mixed * * @throws BadMethodCallException */ public function __call($method, $args) { $this->initializeDoctrine(); $command = substr($method, 0, 3); $field = lcfirst(substr($method, 3)); if ($command === 'set') { $this->set($field, $args); } elseif ($command === 'get') { return $this->get($field); } elseif ($command === 'add') { $this->add($field, $args); } else { throw new BadMethodCallException('There is no method ' . $method . ' on ' . $this->cm->getName()); } } } class_exists(\Doctrine\Common\Persistence\PersistentObject::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Common/Persistence/Proxy.php000066400000000000000000000003631361236344400263320ustar00rootroot00000000000000name = $name; $this->connections = $connections; $this->managers = $managers; $this->defaultConnection = $defaultConnection; $this->defaultManager = $defaultManager; $this->proxyInterfaceName = $proxyInterfaceName; } /** * Fetches/creates the given services. * * A service in this context is connection or a manager instance. * * @param string $name The name of the service. * * @return ObjectManager The instance of the given service. */ abstract protected function getService($name); /** * Resets the given services. * * A service in this context is connection or a manager instance. * * @param string $name The name of the service. * * @return void */ abstract protected function resetService($name); /** * Gets the name of the registry. * * @return string */ public function getName() { return $this->name; } /** * {@inheritdoc} */ public function getConnection($name = null) { if ($name === null) { $name = $this->defaultConnection; } if (! isset($this->connections[$name])) { throw new InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->name, $name)); } return $this->getService($this->connections[$name]); } /** * {@inheritdoc} */ public function getConnectionNames() { return $this->connections; } /** * {@inheritdoc} */ public function getConnections() { $connections = []; foreach ($this->connections as $name => $id) { $connections[$name] = $this->getService($id); } return $connections; } /** * {@inheritdoc} */ public function getDefaultConnectionName() { return $this->defaultConnection; } /** * {@inheritdoc} */ public function getDefaultManagerName() { return $this->defaultManager; } /** * {@inheritdoc} * * @throws InvalidArgumentException */ public function getManager($name = null) { if ($name === null) { $name = $this->defaultManager; } if (! isset($this->managers[$name])) { throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); } return $this->getService($this->managers[$name]); } /** * {@inheritdoc} */ public function getManagerForClass($class) { // Check for namespace alias if (strpos($class, ':') !== false) { [$namespaceAlias, $simpleClassName] = explode(':', $class, 2); $class = $this->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName; } $proxyClass = new ReflectionClass($class); if ($proxyClass->implementsInterface($this->proxyInterfaceName)) { $parentClass = $proxyClass->getParentClass(); if (! $parentClass) { return null; } $class = $parentClass->getName(); } foreach ($this->managers as $id) { $manager = $this->getService($id); if (! $manager->getMetadataFactory()->isTransient($class)) { return $manager; } } } /** * {@inheritdoc} */ public function getManagerNames() { return $this->managers; } /** * {@inheritdoc} */ public function getManagers() { $dms = []; foreach ($this->managers as $name => $id) { $dms[$name] = $this->getService($id); } return $dms; } /** * {@inheritdoc} */ public function getRepository($persistentObjectName, $persistentManagerName = null) { return $this ->selectManager($persistentObjectName, $persistentManagerName) ->getRepository($persistentObjectName); } /** * {@inheritdoc} */ public function resetManager($name = null) { if ($name === null) { $name = $this->defaultManager; } if (! isset($this->managers[$name])) { throw new InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.', $this->name, $name)); } // force the creation of a new document manager // if the current one is closed $this->resetService($this->managers[$name]); return $this->getManager($name); } private function selectManager(string $persistentObjectName, ?string $persistentManagerName = null) : ObjectManager { if ($persistentManagerName !== null) { return $this->getManager($persistentManagerName); } return $this->getManagerForClass($persistentObjectName) ?? $this->getManager(); } } class_exists(\Doctrine\Common\Persistence\AbstractManagerRegistry::class); interface_exists(ObjectManager::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/ConnectionRegistry.php000066400000000000000000000017351361236344400276150ustar00rootroot00000000000000object = $object; $this->objectManager = $objectManager; } /** * Retrieves the associated entity. * * @deprecated * * @return object */ public function getEntity() { return $this->object; } /** * Retrieves the associated object. * * @return object */ public function getObject() { return $this->object; } /** * Retrieves the associated ObjectManager. * * @return ObjectManager */ public function getObjectManager() { return $this->objectManager; } } class_exists(\Doctrine\Common\Persistence\Event\LifecycleEventArgs::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Event/LoadClassMetadataEventArgs.php000066400000000000000000000021071361236344400321650ustar00rootroot00000000000000classMetadata = $classMetadata; $this->objectManager = $objectManager; } /** * Retrieves the associated ClassMetadata. * * @return ClassMetadata */ public function getClassMetadata() { return $this->classMetadata; } /** * Retrieves the associated ObjectManager. * * @return ObjectManager */ public function getObjectManager() { return $this->objectManager; } } class_exists(\Doctrine\Common\Persistence\Event\LoadClassMetadataEventArgs::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Event/ManagerEventArgs.php000066400000000000000000000012651361236344400302350ustar00rootroot00000000000000objectManager = $objectManager; } /** * Retrieves the associated ObjectManager. * * @return ObjectManager */ public function getObjectManager() { return $this->objectManager; } } class_exists(\Doctrine\Common\Persistence\Event\ManagerEventArgs::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Event/OnClearEventArgs.php000066400000000000000000000025271361236344400302100ustar00rootroot00000000000000objectManager = $objectManager; $this->entityClass = $entityClass; } /** * Retrieves the associated ObjectManager. * * @return ObjectManager */ public function getObjectManager() { return $this->objectManager; } /** * Returns the name of the entity class that is cleared, or null if all are cleared. * * @return string|null */ public function getEntityClass() { return $this->entityClass; } /** * Returns whether this event clears all entities. * * @return bool */ public function clearsAllEntities() { return $this->entityClass === null; } } class_exists(\Doctrine\Common\Persistence\Event\OnClearEventArgs::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Event/PreUpdateEventArgs.php000066400000000000000000000047701361236344400305600ustar00rootroot00000000000000entityChangeSet = &$changeSet; } /** * Retrieves the entity changeset. * * @return mixed[][] */ public function getEntityChangeSet() { return $this->entityChangeSet; } /** * Checks if field has a changeset. * * @param string $field * * @return bool */ public function hasChangedField($field) { return isset($this->entityChangeSet[$field]); } /** * Gets the old value of the changeset of the changed field. * * @param string $field * * @return mixed */ public function getOldValue($field) { $this->assertValidField($field); return $this->entityChangeSet[$field][0]; } /** * Gets the new value of the changeset of the changed field. * * @param string $field * * @return mixed */ public function getNewValue($field) { $this->assertValidField($field); return $this->entityChangeSet[$field][1]; } /** * Sets the new value of this field. * * @param string $field * @param mixed $value * * @return void */ public function setNewValue($field, $value) { $this->assertValidField($field); $this->entityChangeSet[$field][1] = $value; } /** * Asserts the field exists in changeset. * * @param string $field * * @return void * * @throws InvalidArgumentException */ private function assertValidField($field) { if (! isset($this->entityChangeSet[$field])) { throw new InvalidArgumentException(sprintf( 'Field "%s" is not a valid field of the entity "%s" in PreUpdateEventArgs.', $field, get_class($this->getObject()) )); } } } class_exists(\Doctrine\Common\Persistence\Event\PreUpdateEventArgs::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/ManagerRegistry.php000066400000000000000000000052321361236344400270640ustar00rootroot00000000000000cacheDriver = $cacheDriver; } /** * Gets the cache driver used by the factory to cache ClassMetadata instances. * * @return Cache|null */ public function getCacheDriver() { return $this->cacheDriver; } /** * Returns an array of all the loaded metadata currently in memory. * * @return ClassMetadata[] */ public function getLoadedMetadata() { return $this->loadedMetadata; } /** * Forces the factory to load the metadata of all classes known to the underlying * mapping driver. * * @return ClassMetadata[] The ClassMetadata instances of all mapped classes. */ public function getAllMetadata() { if (! $this->initialized) { $this->initialize(); } $driver = $this->getDriver(); $metadata = []; foreach ($driver->getAllClassNames() as $className) { $metadata[] = $this->getMetadataFor($className); } return $metadata; } /** * Lazy initialization of this stuff, especially the metadata driver, * since these are not needed at all when a metadata cache is active. * * @return void */ abstract protected function initialize(); /** * Gets the fully qualified class-name from the namespace alias. * * @param string $namespaceAlias * @param string $simpleClassName * * @return string */ abstract protected function getFqcnFromAlias($namespaceAlias, $simpleClassName); /** * Returns the mapping driver implementation. * * @return MappingDriver */ abstract protected function getDriver(); /** * Wakes up reflection after ClassMetadata gets unserialized from cache. * * @return void */ abstract protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService); /** * Initializes Reflection after ClassMetadata was constructed. * * @return void */ abstract protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService); /** * Checks whether the class metadata is an entity. * * This method should return false for mapped superclasses or embedded classes. * * @return bool */ abstract protected function isEntity(ClassMetadata $class); /** * Gets the class metadata descriptor for a class. * * @param string $className The name of the class. * * @return ClassMetadata * * @throws ReflectionException * @throws MappingException */ public function getMetadataFor($className) { if (isset($this->loadedMetadata[$className])) { return $this->loadedMetadata[$className]; } // Check for namespace alias if (strpos($className, ':') !== false) { [$namespaceAlias, $simpleClassName] = explode(':', $className, 2); $realClassName = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); } else { $realClassName = $this->getRealClass($className); } if (isset($this->loadedMetadata[$realClassName])) { // We do not have the alias name in the map, include it return $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; } $loadingException = null; try { if ($this->cacheDriver) { $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); if ($cached instanceof ClassMetadata) { $this->loadedMetadata[$realClassName] = $cached; $this->wakeupReflection($cached, $this->getReflectionService()); } else { foreach ($this->loadMetadata($realClassName) as $loadedClassName) { $this->cacheDriver->save( $loadedClassName . $this->cacheSalt, $this->loadedMetadata[$loadedClassName] ); } } } else { $this->loadMetadata($realClassName); } } catch (MappingException $loadingException) { $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName); if (! $fallbackMetadataResponse) { throw $loadingException; } $this->loadedMetadata[$realClassName] = $fallbackMetadataResponse; } if ($className !== $realClassName) { // We do not have the alias name in the map, include it $this->loadedMetadata[$className] = $this->loadedMetadata[$realClassName]; } return $this->loadedMetadata[$className]; } /** * Checks whether the factory has the metadata for a class loaded already. * * @param string $className * * @return bool TRUE if the metadata of the class in question is already loaded, FALSE otherwise. */ public function hasMetadataFor($className) { return isset($this->loadedMetadata[$className]); } /** * Sets the metadata descriptor for a specific class. * * NOTE: This is only useful in very special cases, like when generating proxy classes. * * @param string $className * @param ClassMetadata $class * * @return void */ public function setMetadataFor($className, $class) { $this->loadedMetadata[$className] = $class; } /** * Gets an array of parent classes for the given entity class. * * @param string $name * * @return string[] */ protected function getParentClasses($name) { // Collect parent classes, ignoring transient (not-mapped) classes. $parentClasses = []; foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { if ($this->getDriver()->isTransient($parentClass)) { continue; } $parentClasses[] = $parentClass; } return $parentClasses; } /** * Loads the metadata of the class in question and all it's ancestors whose metadata * is still not loaded. * * Important: The class $name does not necessarily exist at this point here. * Scenarios in a code-generation setup might have access to XML/YAML * Mapping files without the actual PHP code existing here. That is why the * {@see Doctrine\Common\Persistence\Mapping\ReflectionService} interface * should be used for reflection. * * @param string $name The name of the class for which the metadata should get loaded. * * @return string[] */ protected function loadMetadata($name) { if (! $this->initialized) { $this->initialize(); } $loaded = []; $parentClasses = $this->getParentClasses($name); $parentClasses[] = $name; // Move down the hierarchy of parent classes, starting from the topmost class $parent = null; $rootEntityFound = false; $visited = []; $reflService = $this->getReflectionService(); foreach ($parentClasses as $className) { if (isset($this->loadedMetadata[$className])) { $parent = $this->loadedMetadata[$className]; if ($this->isEntity($parent)) { $rootEntityFound = true; array_unshift($visited, $className); } continue; } $class = $this->newClassMetadataInstance($className); $this->initializeReflection($class, $reflService); $this->doLoadMetadata($class, $parent, $rootEntityFound, $visited); $this->loadedMetadata[$className] = $class; $parent = $class; if ($this->isEntity($class)) { $rootEntityFound = true; array_unshift($visited, $className); } $this->wakeupReflection($class, $reflService); $loaded[] = $className; } return $loaded; } /** * Provides a fallback hook for loading metadata when loading failed due to reflection/mapping exceptions * * Override this method to implement a fallback strategy for failed metadata loading * * @param string $className * * @return ClassMetadata|null */ protected function onNotFoundMetadata($className) { return null; } /** * Actually loads the metadata from the underlying metadata. * * @param ClassMetadata $class * @param ClassMetadata|null $parent * @param bool $rootEntityFound * @param string[] $nonSuperclassParents All parent class names * that are not marked as mapped superclasses. * * @return void */ abstract protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents); /** * Creates a new ClassMetadata instance for the given class name. * * @param string $className * * @return ClassMetadata */ abstract protected function newClassMetadataInstance($className); /** * {@inheritDoc} */ public function isTransient($class) { if (! $this->initialized) { $this->initialize(); } // Check for namespace alias if (strpos($class, ':') !== false) { [$namespaceAlias, $simpleClassName] = explode(':', $class, 2); $class = $this->getFqcnFromAlias($namespaceAlias, $simpleClassName); } return $this->getDriver()->isTransient($class); } /** * Sets the reflectionService. * * @return void */ public function setReflectionService(ReflectionService $reflectionService) { $this->reflectionService = $reflectionService; } /** * Gets the reflection service associated with this metadata factory. * * @return ReflectionService */ public function getReflectionService() { if ($this->reflectionService === null) { $this->reflectionService = new RuntimeReflectionService(); } return $this->reflectionService; } /** * Gets the real class name of a class name that could be a proxy. */ private function getRealClass(string $class) : string { $pos = strrpos($class, '\\' . Proxy::MARKER . '\\'); if ($pos === false) { return $class; } return substr($class, $pos + Proxy::MARKER_LENGTH + 2); } } class_exists(\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory::class); interface_exists(ClassMetadata::class); interface_exists(ReflectionService::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/ClassMetadata.php000066400000000000000000000073561361236344400300730ustar00rootroot00000000000000reader = $reader; if (! $paths) { return; } $this->addPaths((array) $paths); } /** * Appends lookup paths to metadata driver. * * @param string[] $paths * * @return void */ public function addPaths(array $paths) { $this->paths = array_unique(array_merge($this->paths, $paths)); } /** * Retrieves the defined metadata lookup paths. * * @return string[] */ public function getPaths() { return $this->paths; } /** * Append exclude lookup paths to metadata driver. * * @param string[] $paths */ public function addExcludePaths(array $paths) { $this->excludePaths = array_unique(array_merge($this->excludePaths, $paths)); } /** * Retrieve the defined metadata lookup exclude paths. * * @return string[] */ public function getExcludePaths() { return $this->excludePaths; } /** * Retrieve the current annotation reader * * @return Reader */ public function getReader() { return $this->reader; } /** * Gets the file extension used to look for mapping files under. * * @return string */ public function getFileExtension() { return $this->fileExtension; } /** * Sets the file extension used to look for mapping files under. * * @param string $fileExtension The file extension to set. * * @return void */ public function setFileExtension($fileExtension) { $this->fileExtension = $fileExtension; } /** * Returns whether the class with the specified name is transient. Only non-transient * classes, that is entities and mapped superclasses, should have their metadata loaded. * * A class is non-transient if it is annotated with an annotation * from the {@see AnnotationDriver::entityAnnotationClasses}. * * @param string $className * * @return bool */ public function isTransient($className) { $classAnnotations = $this->reader->getClassAnnotations(new ReflectionClass($className)); foreach ($classAnnotations as $annot) { if (isset($this->entityAnnotationClasses[get_class($annot)])) { return false; } } return true; } /** * {@inheritDoc} */ public function getAllClassNames() { if ($this->classNames !== null) { return $this->classNames; } if (! $this->paths) { throw MappingException::pathRequired(); } $classes = []; $includedFiles = []; foreach ($this->paths as $path) { if (! is_dir($path)) { throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new RegexIterator( new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY ), '/^.+' . preg_quote($this->fileExtension) . '$/i', RecursiveRegexIterator::GET_MATCH ); foreach ($iterator as $file) { $sourceFile = $file[0]; if (! preg_match('(^phar:)i', $sourceFile)) { $sourceFile = realpath($sourceFile); } foreach ($this->excludePaths as $excludePath) { $exclude = str_replace('\\', '/', realpath($excludePath)); $current = str_replace('\\', '/', $sourceFile); if (strpos($current, $exclude) !== false) { continue 2; } } require_once $sourceFile; $includedFiles[] = $sourceFile; } } $declared = get_declared_classes(); foreach ($declared as $className) { $rc = new ReflectionClass($className); $sourceFile = $rc->getFileName(); if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) { continue; } $classes[] = $className; } $this->classNames = $classes; return $classes; } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\AnnotationDriver::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/DefaultFileLocator.php000066400000000000000000000104621361236344400323200ustar00rootroot00000000000000addPaths((array) $paths); $this->fileExtension = $fileExtension; } /** * Appends lookup paths to metadata driver. * * @param string[] $paths * * @return void */ public function addPaths(array $paths) { $this->paths = array_unique(array_merge($this->paths, $paths)); } /** * Retrieves the defined metadata lookup paths. * * @return string[] */ public function getPaths() { return $this->paths; } /** * Gets the file extension used to look for mapping files under. * * @return string|null */ public function getFileExtension() { return $this->fileExtension; } /** * Sets the file extension used to look for mapping files under. * * @param string|null $fileExtension The file extension to set. * * @return void */ public function setFileExtension($fileExtension) { $this->fileExtension = $fileExtension; } /** * {@inheritDoc} */ public function findMappingFile($className) { $fileName = str_replace('\\', '.', $className) . $this->fileExtension; // Check whether file exists foreach ($this->paths as $path) { if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { return $path . DIRECTORY_SEPARATOR . $fileName; } } throw MappingException::mappingFileNotFound($className, $fileName); } /** * {@inheritDoc} */ public function getAllClassNames($globalBasename) { $classes = []; if ($this->paths) { foreach ($this->paths as $path) { if (! is_dir($path)) { throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($iterator as $file) { $fileName = $file->getBasename($this->fileExtension); if ($fileName === $file->getBasename() || $fileName === $globalBasename) { continue; } // NOTE: All files found here means classes are not transient! $classes[] = str_replace('.', '\\', $fileName); } } } return $classes; } /** * {@inheritDoc} */ public function fileExists($className) { $fileName = str_replace('\\', '.', $className) . $this->fileExtension; // Check whether file exists foreach ((array) $this->paths as $path) { if (is_file($path . DIRECTORY_SEPARATOR . $fileName)) { return true; } } return false; } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\DefaultFileLocator::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/FileDriver.php000066400000000000000000000127301361236344400306430ustar00rootroot00000000000000locator = $locator; } else { $this->locator = new DefaultFileLocator((array) $locator, $fileExtension); } } /** * Sets the global basename. * * @param string $file * * @return void */ public function setGlobalBasename($file) { $this->globalBasename = $file; } /** * Retrieves the global basename. * * @return string|null */ public function getGlobalBasename() { return $this->globalBasename; } /** * Gets the element of schema meta data for the class from the mapping file. * This will lazily load the mapping file if it is not loaded yet. * * @param string $className * * @return ClassMetadata The element of schema meta data. * * @throws MappingException */ public function getElement($className) { if ($this->classCache === null) { $this->initialize(); } if (isset($this->classCache[$className])) { return $this->classCache[$className]; } $result = $this->loadMappingFile($this->locator->findMappingFile($className)); if (! isset($result[$className])) { throw MappingException::invalidMappingFile($className, str_replace('\\', '.', $className) . $this->locator->getFileExtension()); } $this->classCache[$className] = $result[$className]; return $result[$className]; } /** * {@inheritDoc} */ public function isTransient($className) { if ($this->classCache === null) { $this->initialize(); } if (isset($this->classCache[$className])) { return false; } return ! $this->locator->fileExists($className); } /** * {@inheritDoc} */ public function getAllClassNames() { if ($this->classCache === null) { $this->initialize(); } if (! $this->classCache) { return (array) $this->locator->getAllClassNames($this->globalBasename); } return array_unique(array_merge( array_keys($this->classCache), (array) $this->locator->getAllClassNames($this->globalBasename) )); } /** * Loads a mapping file with the given name and returns a map * from class/entity names to their corresponding file driver elements. * * @param string $file The mapping file to load. * * @return ClassMetadata[] */ abstract protected function loadMappingFile($file); /** * Initializes the class cache from all the global files. * * Using this feature adds a substantial performance hit to file drivers as * more metadata has to be loaded into memory than might actually be * necessary. This may not be relevant to scenarios where caching of * metadata is in place, however hits very hard in scenarios where no * caching is used. * * @return void */ protected function initialize() { $this->classCache = []; if ($this->globalBasename === null) { return; } foreach ($this->locator->getPaths() as $path) { $file = $path . '/' . $this->globalBasename . $this->locator->getFileExtension(); if (! is_file($file)) { continue; } $this->classCache = array_merge( $this->classCache, $this->loadMappingFile($file) ); } } /** * Retrieves the locator used to discover mapping files by className. * * @return FileLocator */ public function getLocator() { return $this->locator; } /** * Sets the locator used to discover mapping files by className. */ public function setLocator(FileLocator $locator) { $this->locator = $locator; } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\FileDriver::class); interface_exists(FileLocator::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/FileLocator.php000066400000000000000000000025271361236344400310160ustar00rootroot00000000000000defaultDriver; } /** * Set the default driver. * * @return void */ public function setDefaultDriver(MappingDriver $driver) { $this->defaultDriver = $driver; } /** * Adds a nested driver. * * @param string $namespace * * @return void */ public function addDriver(MappingDriver $nestedDriver, $namespace) { $this->drivers[$namespace] = $nestedDriver; } /** * Gets the array of nested drivers. * * @return MappingDriver[] $drivers */ public function getDrivers() { return $this->drivers; } /** * {@inheritDoc} */ public function loadMetadataForClass($className, ClassMetadata $metadata) { /** @var MappingDriver $driver */ foreach ($this->drivers as $namespace => $driver) { if (strpos($className, $namespace) === 0) { $driver->loadMetadataForClass($className, $metadata); return; } } if ($this->defaultDriver !== null) { $this->defaultDriver->loadMetadataForClass($className, $metadata); return; } throw MappingException::classNotFoundInNamespaces($className, array_keys($this->drivers)); } /** * {@inheritDoc} */ public function getAllClassNames() { $classNames = []; $driverClasses = []; /** @var MappingDriver $driver */ foreach ($this->drivers as $namespace => $driver) { $oid = spl_object_hash($driver); if (! isset($driverClasses[$oid])) { $driverClasses[$oid] = $driver->getAllClassNames(); } foreach ($driverClasses[$oid] as $className) { if (strpos($className, $namespace) !== 0) { continue; } $classNames[$className] = true; } } if ($this->defaultDriver !== null) { foreach ($this->defaultDriver->getAllClassNames() as $className) { $classNames[$className] = true; } } return array_keys($classNames); } /** * {@inheritDoc} */ public function isTransient($className) { /** @var MappingDriver $driver */ foreach ($this->drivers as $namespace => $driver) { if (strpos($className, $namespace) === 0) { return $driver->isTransient($className); } } if ($this->defaultDriver !== null) { return $this->defaultDriver->isTransient($className); } return true; } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain::class); interface_exists(ClassMetadata::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/PHPDriver.php000066400000000000000000000020701361236344400304070ustar00rootroot00000000000000metadata = $metadata; $this->loadMappingFile($this->locator->findMappingFile($className)); } /** * {@inheritDoc} */ protected function loadMappingFile($file) { $metadata = $this->metadata; include $file; return [$metadata->getName() => $metadata]; } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\PHPDriver::class); interface_exists(ClassMetadata::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/StaticPHPDriver.php000066400000000000000000000063561361236344400315720ustar00rootroot00000000000000addPaths((array) $paths); } /** * Adds paths. * * @param string[] $paths * * @return void */ public function addPaths(array $paths) { $this->paths = array_unique(array_merge($this->paths, $paths)); } /** * {@inheritdoc} */ public function loadMetadataForClass($className, ClassMetadata $metadata) { $className::loadMetadata($metadata); } /** * {@inheritDoc} * * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? */ public function getAllClassNames() { if ($this->classNames !== null) { return $this->classNames; } if (! $this->paths) { throw MappingException::pathRequired(); } $classes = []; $includedFiles = []; foreach ($this->paths as $path) { if (! is_dir($path)) { throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($iterator as $file) { if ($file->getBasename('.php') === $file->getBasename()) { continue; } $sourceFile = realpath($file->getPathName()); require_once $sourceFile; $includedFiles[] = $sourceFile; } } $declared = get_declared_classes(); foreach ($declared as $className) { $rc = new ReflectionClass($className); $sourceFile = $rc->getFileName(); if (! in_array($sourceFile, $includedFiles) || $this->isTransient($className)) { continue; } $classes[] = $className; } $this->classNames = $classes; return $classes; } /** * {@inheritdoc} */ public function isTransient($className) { return ! method_exists($className, 'loadMetadata'); } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver::class); interface_exists(ClassMetadata::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/Driver/SymfonyFileLocator.php000066400000000000000000000150661361236344400324050ustar00rootroot00000000000000addNamespacePrefixes($prefixes); $this->fileExtension = $fileExtension; if (empty($nsSeparator)) { throw new InvalidArgumentException('Namespace separator should not be empty'); } $this->nsSeparator = (string) $nsSeparator; } /** * Adds Namespace Prefixes. * * @param string[] $prefixes * * @return void */ public function addNamespacePrefixes(array $prefixes) { $this->prefixes = array_merge($this->prefixes, $prefixes); $this->paths = array_merge($this->paths, array_keys($prefixes)); } /** * Gets Namespace Prefixes. * * @return string[] */ public function getNamespacePrefixes() { return $this->prefixes; } /** * {@inheritDoc} */ public function getPaths() { return $this->paths; } /** * {@inheritDoc} */ public function getFileExtension() { return $this->fileExtension; } /** * Sets the file extension used to look for mapping files under. * * @param string $fileExtension The file extension to set. * * @return void */ public function setFileExtension($fileExtension) { $this->fileExtension = $fileExtension; } /** * {@inheritDoc} */ public function fileExists($className) { $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; foreach ($this->paths as $path) { if (! isset($this->prefixes[$path])) { // global namespace class if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { return true; } continue; } $prefix = $this->prefixes[$path]; if (strpos($className, $prefix . '\\') !== 0) { continue; } $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; if (is_file($filename)) { return true; } } return false; } /** * {@inheritDoc} */ public function getAllClassNames($globalBasename = null) { $classes = []; if ($this->paths) { foreach ((array) $this->paths as $path) { if (! is_dir($path)) { throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($iterator as $file) { $fileName = $file->getBasename($this->fileExtension); if ($fileName === $file->getBasename() || $fileName === $globalBasename) { continue; } // NOTE: All files found here means classes are not transient! if (isset($this->prefixes[$path])) { // Calculate namespace suffix for given prefix as a relative path from basepath to file path $nsSuffix = strtr( substr(realpath($file->getPath()), strlen(realpath($path))), $this->nsSeparator, '\\' ); $classes[] = $this->prefixes[$path] . str_replace(DIRECTORY_SEPARATOR, '\\', $nsSuffix) . '\\' . str_replace($this->nsSeparator, '\\', $fileName); } else { $classes[] = str_replace($this->nsSeparator, '\\', $fileName); } } } } return $classes; } /** * {@inheritDoc} */ public function findMappingFile($className) { $defaultFileName = str_replace('\\', $this->nsSeparator, $className) . $this->fileExtension; foreach ($this->paths as $path) { if (! isset($this->prefixes[$path])) { if (is_file($path . DIRECTORY_SEPARATOR . $defaultFileName)) { return $path . DIRECTORY_SEPARATOR . $defaultFileName; } continue; } $prefix = $this->prefixes[$path]; if (strpos($className, $prefix . '\\') !== 0) { continue; } $filename = $path . '/' . strtr(substr($className, strlen($prefix) + 1), '\\', $this->nsSeparator) . $this->fileExtension; if (is_file($filename)) { return $filename; } } throw MappingException::mappingFileNotFound($className, substr($className, strrpos($className, '\\') + 1) . $this->fileExtension); } } class_exists(\Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/MappingException.php000066400000000000000000000044421361236344400306300ustar00rootroot00000000000000supportsTypedPropertiesWorkaround = version_compare((string) phpversion(), '7.4.0') >= 0; } /** * {@inheritDoc} */ public function getParentClasses($class) { if (! class_exists($class)) { throw MappingException::nonExistingClass($class); } return class_parents($class); } /** * {@inheritDoc} */ public function getClassShortName($class) { $reflectionClass = new ReflectionClass($class); return $reflectionClass->getShortName(); } /** * {@inheritDoc} */ public function getClassNamespace($class) { $reflectionClass = new ReflectionClass($class); return $reflectionClass->getNamespaceName(); } /** * {@inheritDoc} */ public function getClass($class) { return new ReflectionClass($class); } /** * {@inheritDoc} */ public function getAccessibleProperty($class, $property) { $reflectionProperty = new ReflectionProperty($class, $property); if ($reflectionProperty->isPublic()) { $reflectionProperty = new RuntimePublicReflectionProperty($class, $property); } elseif ($this->supportsTypedPropertiesWorkaround && ! array_key_exists($property, $this->getClass($class)->getDefaultProperties())) { $reflectionProperty = new TypedNoDefaultReflectionProperty($class, $property); } $reflectionProperty->setAccessible(true); return $reflectionProperty; } /** * {@inheritDoc} */ public function hasPublicMethod($class, $method) { try { $reflectionMethod = new ReflectionMethod($class, $method); } catch (ReflectionException $e) { return false; } return $reflectionMethod->isPublic(); } } class_exists(\Doctrine\Common\Persistence\Mapping\RuntimeReflectionService::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/Mapping/StaticReflectionService.php000066400000000000000000000025741361236344400321450ustar00rootroot00000000000000find($id). * * @param string $className The class name of the object to find. * @param mixed $id The identity of the object to find. * * @return object|null The found object. */ public function find($className, $id); /** * Tells the ObjectManager to make an instance managed and persistent. * * The object will be entered into the database as a result of the flush operation. * * NOTE: The persist operation always considers objects that are not yet known to * this ObjectManager as NEW. Do not pass detached objects to the persist operation. * * @param object $object The instance to make managed and persistent. * * @return void */ public function persist($object); /** * Removes an object instance. * * A removed object will be removed from the database as a result of the flush operation. * * @param object $object The object instance to remove. * * @return void */ public function remove($object); /** * Merges the state of a detached object into the persistence context * of this ObjectManager and returns the managed copy of the object. * The object passed to merge will not become associated/managed with this ObjectManager. * * @deprecated Merge operation is deprecated and will be removed in Persistence 2.0. * Merging should be part of the business domain of an application rather than * a generic operation of ObjectManager. * * @param object $object * * @return object */ public function merge($object); /** * Clears the ObjectManager. All objects that are currently managed * by this ObjectManager become detached. * * @param string|null $objectName if given, only objects of this type will get detached. * * @return void */ public function clear($objectName = null); /** * Detaches an object from the ObjectManager, causing a managed object to * become detached. Unflushed changes made to the object if any * (including removal of the object), will not be synchronized to the database. * Objects which previously referenced the detached object will continue to * reference it. * * @deprecated Detach operation is deprecated and will be removed in Persistence 2.0. Please use * {@see ObjectManager::clear()} instead. * * @param object $object The object to detach. * * @return void */ public function detach($object); /** * Refreshes the persistent state of an object from the database, * overriding any local changes that have not yet been persisted. * * @param object $object The object to refresh. * * @return void */ public function refresh($object); /** * Flushes all changes to objects that have been queued up to now to the database. * This effectively synchronizes the in-memory state of managed objects with the * database. * * @return void */ public function flush(); /** * Gets the repository for a class. * * @param string $className * * @return ObjectRepository */ public function getRepository($className); /** * Returns the ClassMetadata descriptor for a class. * * The class name must be the fully-qualified class name without a leading backslash * (as it is returned by get_class($obj)). * * @param string $className * * @return ClassMetadata */ public function getClassMetadata($className); /** * Gets the metadata factory used to gather the metadata of classes. * * @return ClassMetadataFactory */ public function getMetadataFactory(); /** * Helper method to initialize a lazy loading proxy or persistent collection. * * This method is a no-op for other objects. * * @param object $obj * * @return void */ public function initializeObject($obj); /** * Checks if the object is part of the current UnitOfWork and therefore managed. * * @param object $object * * @return bool */ public function contains($object); } interface_exists(\Doctrine\Common\Persistence\ObjectManager::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/ObjectManagerAware.php000066400000000000000000000022671361236344400274470ustar00rootroot00000000000000wrapped->find($className, $id); } /** * {@inheritdoc} */ public function persist($object) { $this->wrapped->persist($object); } /** * {@inheritdoc} */ public function remove($object) { $this->wrapped->remove($object); } /** * {@inheritdoc} */ public function merge($object) { return $this->wrapped->merge($object); } /** * {@inheritdoc} */ public function clear($objectName = null) { $this->wrapped->clear($objectName); } /** * {@inheritdoc} */ public function detach($object) { $this->wrapped->detach($object); } /** * {@inheritdoc} */ public function refresh($object) { $this->wrapped->refresh($object); } /** * {@inheritdoc} */ public function flush() { $this->wrapped->flush(); } /** * {@inheritdoc} */ public function getRepository($className) { return $this->wrapped->getRepository($className); } /** * {@inheritdoc} */ public function getClassMetadata($className) { return $this->wrapped->getClassMetadata($className); } /** * {@inheritdoc} */ public function getMetadataFactory() { return $this->wrapped->getMetadataFactory(); } /** * {@inheritdoc} */ public function initializeObject($obj) { $this->wrapped->initializeObject($obj); } /** * {@inheritdoc} */ public function contains($object) { return $this->wrapped->contains($object); } } class_exists(\Doctrine\Common\Persistence\ObjectManagerDecorator::class); php-doctrine-persistence-1.3.6/lib/Doctrine/Persistence/ObjectRepository.php000066400000000000000000000031131361236344400272630ustar00rootroot00000000000000 lib tests */tests/* tests/Doctrine/Tests/Common/Util/ClassUtilsTest.php */tests/* */tests/* lib/Doctrine/Common/Persistence/AbstractManagerRegistry.php lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php lib/Doctrine/Persistence/AbstractManagerRegistry.php lib/Doctrine/Persistence/Mapping/AbstractClassMetadataFactory.php lib/Doctrine/Common/Persistence/Mapping/MappingException.php lib/Doctrine/Persistence/Mapping/MappingException.php php-doctrine-persistence-1.3.6/phpstan.neon000066400000000000000000000017171361236344400210110ustar00rootroot00000000000000parameters: level: 3 paths: - lib - tests autoload_files: - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Persistence/ObjectManagerDecoratorTest.php - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Persistence/PersistentObjectTest.php - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/TestClass.php excludes_analyse: - %currentWorkingDirectory%/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php ignoreErrors: - '#Call to an undefined method Doctrine\\Tests\\Common\\Persistence\\TestObject#' - '#Method Doctrine\\Tests\\Common\\Persistence\\Mapping\\TestFileDriver\:\:loadMappingFile\(\) should return array\ but returns array\\.#' php-doctrine-persistence-1.3.6/phpunit.xml.dist000066400000000000000000000013031361236344400216150ustar00rootroot00000000000000 ./tests/Doctrine/Tests ./tests/Doctrine/Tests_PHP74 ./lib/Doctrine/ php-doctrine-persistence-1.3.6/tests/000077500000000000000000000000001361236344400176075ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/000077500000000000000000000000001361236344400213565ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/000077500000000000000000000000001361236344400224605ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/000077500000000000000000000000001361236344400237105ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/000077500000000000000000000000001361236344400261745ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php000066400000000000000000000152111361236344400326500ustar00rootroot00000000000000mr = new TestManagerRegistry( 'ORM', ['default' => 'default_connection'], ['default' => 'default_manager'], 'default', 'default', ObjectManagerAware::class, $this->getManagerFactory() ); } public function testGetManagerForClass() { self::assertNull($this->mr->getManagerForClass(TestObject::class)); } public function testGetManagerForProxyInterface() { self::assertNull($this->mr->getManagerForClass(ObjectManagerAware::class)); } public function testGetManagerForInvalidClass() { $this->expectException(ReflectionException::class); $this->expectExceptionMessage('Class Doctrine\Tests\Common\Persistence\TestObjectInexistent does not exist'); $this->mr->getManagerForClass('prefix:TestObjectInexistent'); } public function testGetManagerForAliasedClass() { self::assertNull($this->mr->getManagerForClass('prefix:TestObject')); } public function testGetManagerForInvalidAliasedClass() { $this->expectException(ReflectionException::class); $this->expectExceptionMessage('Class Doctrine\Tests\Common\Persistence\TestObject:Foo does not exist'); $this->mr->getManagerForClass('prefix:TestObject:Foo'); } public function testResetManager() { $manager = $this->mr->getManager(); $newManager = $this->mr->resetManager(); self::assertInstanceOf(ObjectManager::class, $newManager); self::assertNotSame($manager, $newManager); } public function testGetRepository() { $repository = $this->createMock(ObjectRepository::class); /** @var MockObject $defaultManager */ $defaultManager = $this->mr->getManager(); $defaultManager ->expects($this->once()) ->method('getRepository') ->with($this->equalTo(TestObject::class)) ->will($this->returnValue($repository)); self::assertSame($repository, $this->mr->getRepository(TestObject::class)); } public function testGetRepositoryWithSpecificManagerName() { $this->mr = new TestManagerRegistry( 'ORM', ['default' => 'default_connection'], ['default' => 'default_manager', 'other' => 'other_manager'], 'default', 'default', ObjectManagerAware::class, $this->getManagerFactory() ); $repository = $this->createMock(ObjectRepository::class); /** @var MockObject $defaultManager */ $defaultManager = $this->mr->getManager(); $defaultManager ->expects($this->never()) ->method('getRepository'); /** @var MockObject $otherManager */ $otherManager = $this->mr->getManager('other'); $otherManager ->expects($this->once()) ->method('getRepository') ->with($this->equalTo(TestObject::class)) ->will($this->returnValue($repository)); self::assertSame($repository, $this->mr->getRepository(TestObject::class, 'other')); } public function testGetRepositoryWithManagerDetection() { $this->mr = new TestManagerRegistry( 'ORM', ['default' => 'default_connection'], ['default' => 'default_manager', 'other' => 'other_manager'], 'default', 'default', Proxy::class, $this->getManagerFactory() ); $repository = $this->createMock(ObjectRepository::class); /** @var MockObject $defaultManager */ $defaultManager = $this->mr->getManager(); $defaultManager ->expects($this->never()) ->method('getRepository'); /** @var MockObject $otherManager */ $otherManager = $this->mr->getManager('other'); $otherManager ->expects($this->once()) ->method('getRepository') ->with($this->equalTo(OtherTestObject::class)) ->will($this->returnValue($repository)); self::assertSame($repository, $this->mr->getRepository(OtherTestObject::class)); } private function getManagerFactory() { return function (string $name) { $mock = $this->createMock(ObjectManager::class); $driver = $this->createMock(MappingDriver::class); $metadata = $this->createMock(ClassMetadata::class); $metadata ->expects($this->any()) ->method('getName') ->willReturn($name === 'other_manager' ? OtherTestObject::class : TestObject::class); $mock->method('getMetadataFactory')->willReturn(new TestClassMetadataFactory($driver, $metadata)); return $mock; }; } } class TestManagerRegistry extends AbstractManagerRegistry { /** @var object[] */ private $services; /** @var callable */ private $managerFactory; /** * @param string[] $connections * @param string[] $managers */ public function __construct( $name, array $connections, array $managers, $defaultConnection, $defaultManager, $proxyInterfaceName, callable $managerFactory ) { $this->managerFactory = $managerFactory; parent::__construct($name, $connections, $managers, $defaultConnection, $defaultManager, $proxyInterfaceName); } protected function getService($name) { if (! isset($this->services[$name])) { $this->services[$name] = call_user_func($this->managerFactory, $name); } return $this->services[$name]; } protected function resetService($name) { unset($this->services[$name]); } public function getAliasNamespace($alias) { return __NAMESPACE__; } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/000077500000000000000000000000001361236344400275675ustar00rootroot00000000000000AnnotationDriverTest.php000066400000000000000000000015521361236344400343520ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappinggetAllClassNames(); self::assertSame([TestClass::class], $classes); } } class SimpleAnnotationDriver extends AnnotationDriver { /** @var bool[] */ protected $entityAnnotationClasses = [Entity::class => true]; public function loadMetadataForClass($className, ClassMetadata $metadata) { } } ClassMetadataFactoryTest.php000066400000000000000000000117151361236344400351240ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappingcreateMock(MappingDriver::class); $metadata = $this->createMock(ClassMetadata::class); $this->cmf = new TestClassMetadataFactory($driver, $metadata); } public function testGetCacheDriver() { self::assertNull($this->cmf->getCacheDriver()); $cache = new ArrayCache(); $this->cmf->setCacheDriver($cache); self::assertSame($cache, $this->cmf->getCacheDriver()); } public function testGetMetadataFor() { $metadata = $this->cmf->getMetadataFor('stdClass'); self::assertInstanceOf(ClassMetadata::class, $metadata); self::assertTrue($this->cmf->hasMetadataFor('stdClass')); } public function testGetMetadataForAbsentClass() { $this->expectException(MappingException::class); $this->cmf->getMetadataFor(__NAMESPACE__ . '\AbsentClass'); } public function testGetParentMetadata() { $metadata = $this->cmf->getMetadataFor(ChildEntity::class); self::assertInstanceOf(ClassMetadata::class, $metadata); self::assertTrue($this->cmf->hasMetadataFor(ChildEntity::class)); self::assertTrue($this->cmf->hasMetadataFor(RootEntity::class)); } public function testGetCachedMetadata() { $metadata = $this->createMock(ClassMetadata::class); $cache = new ArrayCache(); $cache->save(ChildEntity::class . '$CLASSMETADATA', $metadata); $this->cmf->setCacheDriver($cache); self::assertSame($metadata, $this->cmf->getMetadataFor(ChildEntity::class)); } public function testCacheGetMetadataFor() { $cache = new ArrayCache(); $this->cmf->setCacheDriver($cache); $loadedMetadata = $this->cmf->getMetadataFor(ChildEntity::class); self::assertSame($loadedMetadata, $cache->fetch(ChildEntity::class . '$CLASSMETADATA')); } public function testGetAliasedMetadata() { $this->cmf->getMetadataFor('prefix:ChildEntity'); self::assertTrue($this->cmf->hasMetadataFor(__NAMESPACE__ . '\ChildEntity')); self::assertTrue($this->cmf->hasMetadataFor('prefix:ChildEntity')); } /** * @group DCOM-270 */ public function testGetInvalidAliasedMetadata() { $this->expectException(MappingException::class); $this->expectExceptionMessage( 'Class \'Doctrine\Tests\Common\Persistence\Mapping\ChildEntity:Foo\' does not exist' ); $this->cmf->getMetadataFor('prefix:ChildEntity:Foo'); } /** * @group DCOM-270 */ public function testClassIsTransient() { self::assertTrue($this->cmf->isTransient('prefix:ChildEntity:Foo')); } public function testWillFallbackOnNotLoadedMetadata() { $classMetadata = $this->createMock(ClassMetadata::class); $this->cmf->fallbackCallback = static function () use ($classMetadata) { return $classMetadata; }; $this->cmf->metadata = null; self::assertSame($classMetadata, $this->cmf->getMetadataFor('Foo')); } public function testWillFailOnFallbackFailureWithNotLoadedMetadata() { $this->cmf->fallbackCallback = static function () { return null; }; $this->cmf->metadata = null; $this->expectException(MappingException::class); $this->cmf->getMetadataFor('Foo'); } /** * @group 717 */ public function testWillIgnoreCacheEntriesThatAreNotMetadataInstances() { /** @var Cache|PHPUnit_Framework_MockObject_MockObject $cacheDriver */ $cacheDriver = $this->createMock(Cache::class); $this->cmf->setCacheDriver($cacheDriver); $cacheDriver->expects(self::once())->method('fetch')->with('Foo$CLASSMETADATA')->willReturn(new stdClass()); /** @var ClassMetadata $metadata */ $metadata = $this->createMock(ClassMetadata::class); /** @var PHPUnit_Framework_MockObject_MockObject|stdClass|callable $fallbackCallback */ $fallbackCallback = $this->getMockBuilder(stdClass::class)->setMethods(['__invoke'])->getMock(); $fallbackCallback->expects(self::any())->method('__invoke')->willReturn($metadata); $this->cmf->fallbackCallback = $fallbackCallback; self::assertSame($metadata, $this->cmf->getMetadataFor('Foo')); } } class RootEntity { } class ChildEntity extends RootEntity { } DefaultFileLocatorTest.php000066400000000000000000000060001361236344400345650ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappinggetPaths()); $locator = new DefaultFileLocator($path); self::assertSame([$path], $locator->getPaths()); } public function testGetFileExtension() { $locator = new DefaultFileLocator([], '.yml'); self::assertSame('.yml', $locator->getFileExtension()); $locator->setFileExtension('.xml'); self::assertSame('.xml', $locator->getFileExtension()); } public function testUniquePaths() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path, $path]); self::assertSame([$path], $locator->getPaths()); } public function testFindMappingFile() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path], '.yml'); self::assertSame(__DIR__ . '/_files' . DIRECTORY_SEPARATOR . 'stdClass.yml', $locator->findMappingFile('stdClass')); } public function testFindMappingFileNotFound() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path], '.yml'); $this->expectException(MappingException::class); $this->expectExceptionMessage("No mapping file found named 'stdClass2.yml' for class 'stdClass2'"); $locator->findMappingFile('stdClass2'); } public function testGetAllClassNames() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path], '.yml'); $allClasses = $locator->getAllClassNames(null); $globalClasses = $locator->getAllClassNames('global'); $expectedAllClasses = ['global', 'stdClass', 'subDirClass']; $expectedGlobalClasses = ['subDirClass', 'stdClass']; sort($allClasses); sort($globalClasses); sort($expectedAllClasses); sort($expectedGlobalClasses); self::assertSame($expectedAllClasses, $allClasses); self::assertSame($expectedGlobalClasses, $globalClasses); } public function testGetAllClassNamesNonMatchingFileExtension() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path], '.xml'); self::assertSame([], $locator->getAllClassNames('global')); } public function testFileExists() { $path = __DIR__ . '/_files'; $locator = new DefaultFileLocator([$path], '.yml'); self::assertTrue($locator->fileExists('stdClass')); self::assertFalse($locator->fileExists('stdClass2')); self::assertTrue($locator->fileExists('global')); self::assertFalse($locator->fileExists('global2')); } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/DriverChainTest.php000066400000000000000000000141711361236344400333420ustar00rootroot00000000000000createMock(ClassMetadata::class); $chain = new MappingDriverChain(); /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $driver1 */ $driver1 = $this->createMock(MappingDriver::class); $driver1->expects($this->never()) ->method('loadMetadataForClass'); $driver1->expectS($this->never()) ->method('isTransient'); /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $driver2 */ $driver2 = $this->createMock(MappingDriver::class); $driver2->expects($this->at(0)) ->method('loadMetadataForClass') ->with($this->equalTo($className), $this->equalTo($classMetadata)); $driver2->expects($this->at(1)) ->method('isTransient') ->with($this->equalTo($className)) ->will($this->returnValue(true)); $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); $chain->addDriver($driver2, 'Doctrine\Tests\Common\Persistence\Mapping'); $chain->loadMetadataForClass($className, $classMetadata); self::assertTrue($chain->isTransient($className)); } public function testLoadMetadataShouldThrowMappingExceptionWhenNoDelegatorWasFound() { $className = DriverChainEntity::class; /** @var ClassMetadata|PHPUnit_Framework_MockObject_MockObject $classMetadata */ $classMetadata = $this->createMock(ClassMetadata::class); $chain = new MappingDriverChain(); $this->expectException(MappingException::class); $chain->loadMetadataForClass($className, $classMetadata); } public function testGatherAllClassNames() { $chain = new MappingDriverChain(); /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $driver1 */ $driver1 = $this->createMock(MappingDriver::class); $driver1->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(['Doctrine\Tests\Models\Company\Foo'])); /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $driver2 */ $driver2 = $this->createMock(MappingDriver::class); $driver2->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(['Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', 'FooBarBaz'])); $chain->addDriver($driver1, 'Doctrine\Tests\Models\Company'); $chain->addDriver($driver2, 'Doctrine\Tests\ORM\Mapping'); self::assertSame([ 'Doctrine\Tests\Models\Company\Foo', 'Doctrine\Tests\ORM\Mapping\Bar', 'Doctrine\Tests\ORM\Mapping\Baz', ], $chain->getAllClassNames()); } /** * @group DDC-706 */ public function testIsTransient() { /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $driver1 */ $driver1 = $this->createMock(MappingDriver::class); $chain = new MappingDriverChain(); $chain->addDriver($driver1, 'Doctrine\Tests\Models\CMS'); self::assertTrue($chain->isTransient('stdClass'), 'stdClass isTransient'); } /** * @group DDC-1412 */ public function testDefaultDriver() { $companyDriver = $this->createMock(MappingDriver::class); $defaultDriver = $this->createMock(MappingDriver::class); $entityClassName = 'Doctrine\Tests\ORM\Mapping\DriverChainEntity'; $managerClassName = 'Doctrine\Tests\Models\Company\CompanyManager'; $chain = new MappingDriverChain(); $companyDriver->expects($this->never()) ->method('loadMetadataForClass'); $companyDriver->expects($this->once()) ->method('isTransient') ->with($this->equalTo($managerClassName)) ->will($this->returnValue(false)); $defaultDriver->expects($this->never()) ->method('loadMetadataForClass'); $defaultDriver->expects($this->once()) ->method('isTransient') ->with($this->equalTo($entityClassName)) ->will($this->returnValue(true)); self::assertNull($chain->getDefaultDriver()); $chain->setDefaultDriver($defaultDriver); $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); self::assertSame($defaultDriver, $chain->getDefaultDriver()); self::assertTrue($chain->isTransient($entityClassName)); self::assertFalse($chain->isTransient($managerClassName)); } public function testDefaultDriverGetAllClassNames() { /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $companyDriver */ $companyDriver = $this->createMock(MappingDriver::class); /** @var MappingDriver|PHPUnit_Framework_MockObject_MockObject $defaultDriver */ $defaultDriver = $this->createMock(MappingDriver::class); $chain = new MappingDriverChain(); $companyDriver->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(['Doctrine\Tests\Models\Company\Foo'])); $defaultDriver->expects($this->once()) ->method('getAllClassNames') ->will($this->returnValue(['Other\Class'])); $chain->setDefaultDriver($defaultDriver); $chain->addDriver($companyDriver, 'Doctrine\Tests\Models\Company'); $classNames = $chain->getAllClassNames(); self::assertSame(['Doctrine\Tests\Models\Company\Foo', 'Other\Class'], $classNames); } } class DriverChainEntity { } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/FileDriverTest.php000066400000000000000000000130241361236344400331730ustar00rootroot00000000000000getGlobalBasename()); $driver->setGlobalBasename('global'); self::assertSame('global', $driver->getGlobalBasename()); } public function testGetElementFromGlobalFile() { $driver = new TestFileDriver($this->newLocator()); $driver->setGlobalBasename('global'); $element = $driver->getElement('stdGlobal'); self::assertSame('stdGlobal', $element); } public function testGetElementFromFile() { $locator = $this->newLocator(); $locator->expects($this->once()) ->method('findMappingFile') ->with($this->equalTo('stdClass')) ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); $driver = new TestFileDriver($locator); self::assertSame('stdClass', $driver->getElement('stdClass')); } public function testGetElementUpdatesClassCache() { $locator = $this->newLocator(); // findMappingFile should only be called once $locator->expects($this->once()) ->method('findMappingFile') ->with($this->equalTo('stdClass')) ->will($this->returnValue(__DIR__ . '/_files/stdClass.yml')); $driver = new TestFileDriver($locator); // not cached self::assertSame('stdClass', $driver->getElement('stdClass')); // cached call self::assertSame('stdClass', $driver->getElement('stdClass')); } public function testGetAllClassNamesGlobalBasename() { $driver = new TestFileDriver($this->newLocator()); $driver->setGlobalBasename('global'); $classNames = $driver->getAllClassNames(); self::assertSame(['stdGlobal', 'stdGlobal2'], $classNames); } public function testGetAllClassNamesFromMappingFile() { $locator = $this->newLocator(); $locator->expects($this->any()) ->method('getAllClassNames') ->with($this->equalTo(null)) ->will($this->returnValue(['stdClass'])); $driver = new TestFileDriver($locator); $classNames = $driver->getAllClassNames(); self::assertSame(['stdClass'], $classNames); } public function testGetAllClassNamesBothSources() { $locator = $this->newLocator(); $locator->expects($this->any()) ->method('getAllClassNames') ->with($this->equalTo('global')) ->will($this->returnValue(['stdClass'])); $driver = new TestFileDriver($locator); $driver->setGlobalBasename('global'); $classNames = $driver->getAllClassNames(); self::assertSame(['stdGlobal', 'stdGlobal2', 'stdClass'], $classNames); } public function testGetAllClassNamesBothSourcesNoDupes() : void { $locator = $this->newLocator(); $locator->expects($this->once()) ->method('getAllClassNames') ->with($this->equalTo('global')) ->willReturn(['stdClass']); $driver = new TestFileDriver($locator); $driver->setGlobalBasename('global'); $driver->getElement('stdClass'); $classNames = $driver->getAllClassNames(); self::assertSame(['stdGlobal', 'stdGlobal2', 'stdClass'], $classNames); } public function testIsNotTransient() { $locator = $this->newLocator(); $locator->expects($this->once()) ->method('fileExists') ->with($this->equalTo('stdClass')) ->will($this->returnValue(true)); $driver = new TestFileDriver($locator); $driver->setGlobalBasename('global'); self::assertFalse($driver->isTransient('stdClass')); self::assertFalse($driver->isTransient('stdGlobal')); self::assertFalse($driver->isTransient('stdGlobal2')); } public function testIsTransient() { $locator = $this->newLocator(); $locator->expects($this->once()) ->method('fileExists') ->with($this->equalTo('stdClass2')) ->will($this->returnValue(false)); $driver = new TestFileDriver($locator); self::assertTrue($driver->isTransient('stdClass2')); } public function testNonLocatorFallback() { $driver = new TestFileDriver(__DIR__ . '/_files', '.yml'); self::assertTrue($driver->isTransient('stdClass2')); self::assertFalse($driver->isTransient('stdClass')); } private function newLocator() { $locator = $this->createMock(FileLocator::class); $locator->expects($this->any())->method('getFileExtension')->will($this->returnValue('.yml')); $locator->expects($this->any())->method('getPaths')->will($this->returnValue([__DIR__ . '/_files'])); return $locator; } } class TestFileDriver extends FileDriver { protected function loadMappingFile($file) { if (strpos($file, 'global.yml') !== false) { return ['stdGlobal' => 'stdGlobal', 'stdGlobal2' => 'stdGlobal2']; } return ['stdClass' => 'stdClass']; } public function loadMetadataForClass($className, ClassMetadata $metadata) { } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/PHPDriverTest.php000066400000000000000000000012451361236344400327450ustar00rootroot00000000000000createMock(ClassMetadata::class); $metadata->expects($this->once())->method('getFieldNames'); $driver = new PHPDriver([__DIR__ . '/_files']); $driver->loadMetadataForClass('TestEntity', $metadata); } } RuntimeReflectionServiceTest.php000066400000000000000000000045361361236344400360500ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappingreflectionService = new RuntimeReflectionService(); } public function testShortname() { self::assertSame('RuntimeReflectionServiceTest', $this->reflectionService->getClassShortName(self::class)); } public function testClassNamespaceName() { self::assertSame('Doctrine\Tests\Common\Persistence\Mapping', $this->reflectionService->getClassNamespace(self::class)); } public function testGetParentClasses() { $classes = $this->reflectionService->getParentClasses(self::class); self::assertTrue(count($classes) >= 1, 'The test class ' . self::class . ' should have at least one parent.'); } public function testGetParentClassesForAbsentClass() { $this->expectException(MappingException::class); $this->reflectionService->getParentClasses(__NAMESPACE__ . '\AbsentClass'); } public function testGetReflectionClass() { $class = $this->reflectionService->getClass(self::class); self::assertInstanceOf('ReflectionClass', $class); } public function testGetMethods() { self::assertTrue($this->reflectionService->hasPublicMethod(self::class, 'testGetMethods')); self::assertFalse($this->reflectionService->hasPublicMethod(self::class, 'testGetMethods2')); } public function testGetAccessibleProperty() { $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'reflectionService'); self::assertInstanceOf(ReflectionProperty::class, $reflProp); self::assertInstanceOf(RuntimeReflectionService::class, $reflProp->getValue($this)); $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'unusedPublicProperty'); self::assertInstanceOf(RuntimePublicReflectionProperty::class, $reflProp); } } StaticPHPDriverTest.php000066400000000000000000000020111361236344400340260ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappingcreateMock(ClassMetadata::class); $metadata->expects($this->once())->method('getFieldNames'); $driver = new StaticPHPDriver([__DIR__]); $driver->loadMetadataForClass(TestEntity::class, $metadata); } public function testGetAllClassNames() { $driver = new StaticPHPDriver([__DIR__]); $classNames = $driver->getAllClassNames(); self::assertContains(TestEntity::class, $classNames); } } class TestEntity { public static function loadMetadata($metadata) { $metadata->getFieldNames(); } } StaticReflectionServiceTest.php000066400000000000000000000033171361236344400356500ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/MappingreflectionService = new StaticReflectionService(); } public function testShortname() { self::assertSame('StaticReflectionServiceTest', $this->reflectionService->getClassShortName(self::class)); } public function testClassNamespaceName() { self::assertSame('', $this->reflectionService->getClassNamespace(stdClass::class)); self::assertSame(__NAMESPACE__, $this->reflectionService->getClassNamespace(self::class)); } public function testGetParentClasses() { $classes = $this->reflectionService->getParentClasses(self::class); self::assertTrue(count($classes) === 0, 'The test class ' . self::class . ' should have no parents according to static reflection.'); } public function testGetReflectionClass() { $class = $this->reflectionService->getClass(self::class); self::assertNull($class); } public function testGetMethods() { self::assertTrue($this->reflectionService->hasPublicMethod(self::class, 'testGetMethods')); self::assertTrue($this->reflectionService->hasPublicMethod(self::class, 'testGetMethods2')); } public function testGetAccessibleProperty() { $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'reflectionService'); self::assertNull($reflProp); } } SymfonyFileLocatorTest.php000066400000000000000000000154501361236344400346560ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping $prefix]); self::assertSame([$path], $locator->getPaths()); $locator = new SymfonyFileLocator([$path => $prefix]); self::assertSame([$path], $locator->getPaths()); } public function testGetPrefixes() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix]); self::assertSame([$path => $prefix], $locator->getNamespacePrefixes()); } public function testGetFileExtension() { $locator = new SymfonyFileLocator([], '.yml'); self::assertSame('.yml', $locator->getFileExtension()); $locator->setFileExtension('.xml'); self::assertSame('.xml', $locator->getFileExtension()); } public function testFileExists() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); self::assertTrue($locator->fileExists('Foo\stdClass')); self::assertTrue($locator->fileExists('Foo\global')); self::assertFalse($locator->fileExists('Foo\stdClass2')); self::assertFalse($locator->fileExists('Foo\global2')); } public function testGetAllClassNames() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); $allClasses = $locator->getAllClassNames(null); $globalClasses = $locator->getAllClassNames('global'); $expectedAllClasses = ['Foo\\Bar\\subDirClass', 'Foo\\global', 'Foo\\stdClass']; $expectedGlobalClasses = ['Foo\\Bar\\subDirClass', 'Foo\\stdClass']; sort($allClasses); sort($globalClasses); sort($expectedAllClasses); sort($expectedGlobalClasses); self::assertSame($expectedAllClasses, $allClasses); self::assertSame($expectedGlobalClasses, $globalClasses); } /** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Namespace separator should not be empty */ public function testInvalidCustomNamespaceSeparator() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; new SymfonyFileLocator([$path => $prefix], '.yml', null); } public function customNamespaceSeparatorProvider() { return [ 'directory separator' => [DIRECTORY_SEPARATOR, '/_custom_ns/dir'], 'default dot separator' => ['.', '/_custom_ns/dot'], ]; } /** * @param string $separator Directory separator to test against * @param string $dir Path to load mapping data from * * @throws MappingException * * @dataProvider customNamespaceSeparatorProvider */ public function testGetClassNamesWithCustomNsSeparator($separator, $dir) { $path = __DIR__ . $dir; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); $classes = $locator->getAllClassNames(null); sort($classes); self::assertSame(['Foo\\stdClass', 'Foo\\sub\\subClass', 'Foo\\sub\\subsub\\subSubClass'], $classes); } public function customNamespaceLookupQueryProvider() { return [ 'directory separator' => [ DIRECTORY_SEPARATOR, '/_custom_ns/dir', [ 'stdClass.yml' => 'Foo\\stdClass', 'sub/subClass.yml' => 'Foo\\sub\\subClass', 'sub/subsub/subSubClass.yml' => 'Foo\\sub\\subsub\\subSubClass', ], ], 'default dot separator' => [ '.', '/_custom_ns/dot', [ 'stdClass.yml' => 'Foo\\stdClass', 'sub.subClass.yml' => 'Foo\\sub\\subClass', 'sub.subsub.subSubClass.yml' => 'Foo\\sub\\subsub\\subSubClass', ], ], ]; } /** * @param string $separator Directory separator to test against * @param string $dir Path to load mapping data from * @param string[] $files Files to lookup classnames * * @throws MappingException * * @dataProvider customNamespaceLookupQueryProvider */ public function testFindMappingFileWithCustomNsSeparator($separator, $dir, $files) { $path = __DIR__ . $dir; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml', $separator); foreach ($files as $filePath => $className) { self::assertSame(realpath($path . '/' . $filePath), realpath($locator->findMappingFile($className))); } } public function testFindMappingFile() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); self::assertSame(__DIR__ . '/_files/stdClass.yml', $locator->findMappingFile('Foo\\stdClass')); } public function testFindMappingFileNotFound() { $path = __DIR__ . '/_files'; $prefix = 'Foo'; $locator = new SymfonyFileLocator([$path => $prefix], '.yml'); $this->expectException(MappingException::class); $this->expectExceptionMessage("No mapping file found named 'stdClass2.yml' for class 'Foo\stdClass2'."); $locator->findMappingFile('Foo\\stdClass2'); } public function testFindMappingFileLeastSpecificNamespaceFirst() { // Low -> High $prefixes = []; $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; $locator = new SymfonyFileLocator($prefixes, '.yml'); self::assertSame( __DIR__ . '/_match_ns/Bar/barEntity.yml', $locator->findMappingFile("Foo\\Bar\\barEntity") ); } public function testFindMappingFileMostSpecificNamespaceFirst() { $prefixes = []; $prefixes[__DIR__ . '/_match_ns/Bar'] = 'Foo\\Bar'; $prefixes[__DIR__ . '/_match_ns'] = 'Foo'; $locator = new SymfonyFileLocator($prefixes, '.yml'); self::assertSame( __DIR__ . '/_match_ns/Bar/barEntity.yml', $locator->findMappingFile("Foo\\Bar\\barEntity") ); } } TestClassMetadataFactory.php000066400000000000000000000035421361236344400351230ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mappingdriver = $driver; $this->metadata = $metadata; } /** * @param string[] $nonSuperclassParents */ protected function doLoadMetadata($class, $parent, $rootEntityFound, array $nonSuperclassParents) { } protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) { return __NAMESPACE__ . '\\' . $simpleClassName; } protected function initialize() { } protected function newClassMetadataInstance($className) { return $this->metadata; } protected function getDriver() { return $this->driver; } protected function wakeupReflection(ClassMetadata $class, ReflectionService $reflService) { } protected function initializeReflection(ClassMetadata $class, ReflectionService $reflService) { } protected function isEntity(ClassMetadata $class) { return true; } protected function onNotFoundMetadata($className) { if (! $this->fallbackCallback) { return null; } return ($this->fallbackCallback)(); } public function isTransient($class) { $name = $this->metadata->getName(); return $class !== $name; } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/000077500000000000000000000000001361236344400317405ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/000077500000000000000000000000001361236344400325165ustar00rootroot00000000000000stdClass.yml000066400000000000000000000000051361236344400347350ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dirtest php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/000077500000000000000000000000001361236344400333075ustar00rootroot00000000000000subClass.yml000066400000000000000000000000051361236344400355250ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/subtest subsub/000077500000000000000000000000001361236344400345335ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/subsubSubClass.yml000066400000000000000000000000051361236344400375020ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dir/sub/subsubtest php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dot/000077500000000000000000000000001361236344400325265ustar00rootroot00000000000000stdClass.yml000066400000000000000000000000051361236344400347450ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dottest sub.subClass.yml000066400000000000000000000000051361236344400355340ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dottest sub.subsub.subSubClass.yml000066400000000000000000000000051361236344400375100ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_custom_ns/dottest php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/000077500000000000000000000000001361236344400310305ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/Bar/000077500000000000000000000000001361236344400315345ustar00rootroot00000000000000subDirClass.yml000066400000000000000000000000041361236344400344100ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/Bartestphp-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/TestEntity.php000066400000000000000000000000431361236344400336520ustar00rootroot00000000000000getFieldNames(); php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotation/000077500000000000000000000000001361236344400332025ustar00rootroot00000000000000TestClass.php000066400000000000000000000001651361236344400355430ustar00rootroot00000000000000php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/Mapping/_files/annotationwrapped = $wrapped; } } class ObjectManagerDecoratorTest extends TestCase { /** @var PHPUnit_Framework_MockObject_MockObject|ObjectManager */ private $wrapped; /** @var NullObjectManagerDecorator */ private $decorated; public function setUp() { $this->wrapped = $this->createMock(ObjectManager::class); $this->decorated = new NullObjectManagerDecorator($this->wrapped); } public function getMethodParameters() { $class = new ReflectionClass(ObjectManager::class); $voidMethods = [ 'persist', 'remove', 'clear', 'detach', 'refresh', 'flush', 'initializeObject', ]; $methods = []; foreach ($class->getMethods() as $method) { $isVoidMethod = in_array($method->getName(), $voidMethods, true); if ($method->getNumberOfRequiredParameters() === 0) { $methods[] = [$method->getName(), [], $isVoidMethod]; } elseif ($method->getNumberOfRequiredParameters() > 0) { $methods[] = [$method->getName(), array_fill(0, $method->getNumberOfRequiredParameters(), 'req') ?: [], $isVoidMethod]; } if ($method->getNumberOfParameters() === $method->getNumberOfRequiredParameters()) { continue; } $methods[] = [$method->getName(), array_fill(0, $method->getNumberOfParameters(), 'all') ?: [], $isVoidMethod]; } return $methods; } /** * @param string $method * @param mixed[] $parameters * @param bool $isVoidMethod * * @dataProvider getMethodParameters */ public function testAllMethodCallsAreDelegatedToTheWrappedInstance($method, array $parameters, $isVoidMethod) { $returnedValue = $isVoidMethod ? null : 'INNER VALUE FROM ' . $method; $stub = $this->wrapped ->expects($this->once()) ->method($method) ->will($this->returnValue($returnedValue)); call_user_func_array([$stub, 'with'], $parameters); self::assertSame($returnedValue, call_user_func_array([$this->decorated, $method], $parameters)); } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/OtherTestObject.php000066400000000000000000000003401361236344400317520ustar00rootroot00000000000000cm = new TestObjectMetadata(); $this->om = $this->createMock(ObjectManager::class); $this->om->expects($this->any())->method('getClassMetadata') ->will($this->returnValue($this->cm)); $this->object = new TestObject(); PersistentObject::setObjectManager($this->om); $this->object->injectObjectManager($this->om, $this->cm); } public function testGetObjectManager() { self::assertSame($this->om, PersistentObject::getObjectManager()); } public function testNonMatchingObjectManager() { $this->expectException(RuntimeException::class); $om = $this->createMock(ObjectManager::class); $this->object->injectObjectManager($om, $this->cm); } public function testGetField() { self::assertSame('beberlei', $this->object->getName()); } public function testSetField() { $this->object->setName('test'); self::assertSame('test', $this->object->getName()); } public function testGetIdentifier() { self::assertSame(1, $this->object->getId()); } public function testSetIdentifier() { $this->expectException(BadMethodCallException::class); $this->object->setId(2); } public function testSetUnknownField() { $this->expectException(BadMethodCallException::class); $this->object->setUnknown('test'); } public function testGetUnknownField() { $this->expectException(BadMethodCallException::class); $this->object->getUnknown(); } public function testUndefinedMethod() { $this->expectException(BadMethodCallException::class); $this->expectExceptionMessage('There is no method'); (new TestObject())->undefinedMethod(); } public function testGetToOneAssociation() { self::assertNull($this->object->getParent()); } public function testSetToOneAssociation() { $parent = new TestObject(); $this->object->setParent($parent); self::assertSame($parent, $this->object->getParent($parent)); } public function testSetInvalidToOneAssociation() { $parent = new stdClass(); $this->expectException(InvalidArgumentException::class); $this->object->setParent($parent); } public function testSetToOneAssociationNull() { $parent = new TestObject(); $this->object->setParent($parent); $this->object->setParent(null); self::assertNull($this->object->getParent()); } public function testAddToManyAssociation() { $child = new TestObject(); $this->object->addChildren($child); self::assertSame($this->object, $child->getParent()); self::assertSame(1, count($this->object->getChildren())); $child = new TestObject(); $this->object->addChildren($child); self::assertSame(2, count($this->object->getChildren())); } public function testAddInvalidToManyAssociation() { $this->expectException(InvalidArgumentException::class); $this->object->addChildren(new stdClass()); } public function testNoObjectManagerSet() { PersistentObject::setObjectManager(null); $child = new TestObject(); $this->expectException(RuntimeException::class); $child->setName('test'); } public function testInvalidMethod() { $this->expectException(BadMethodCallException::class); $this->object->asdf(); } public function testAddInvalidCollection() { $this->expectException(BadMethodCallException::class); $this->object->addAsdf(new stdClass()); } } class TestObjectMetadata implements ClassMetadata { public function getAssociationMappedByTargetField($assocName) { $assoc = ['children' => 'parent']; return $assoc[$assocName]; } public function getAssociationNames() { return ['parent', 'children']; } public function getAssociationTargetClass($assocName) { return __NAMESPACE__ . '\TestObject'; } public function getFieldNames() { return ['id', 'name']; } public function getIdentifier() { return ['id']; } public function getName() { return __NAMESPACE__ . '\TestObject'; } public function getReflectionClass() { return new ReflectionClass($this->getName()); } public function getTypeOfField($fieldName) { $types = ['id' => 'integer', 'name' => 'string']; return $types[$fieldName]; } public function hasAssociation($fieldName) { return in_array($fieldName, ['parent', 'children']); } public function hasField($fieldName) { return in_array($fieldName, ['id', 'name']); } public function isAssociationInverseSide($assocName) { return $assocName === 'children'; } public function isCollectionValuedAssociation($fieldName) { return $fieldName === 'children'; } public function isIdentifier($fieldName) { return $fieldName === 'id'; } public function isSingleValuedAssociation($fieldName) { return $fieldName === 'parent'; } public function getIdentifierValues($entity) { } public function getIdentifierFieldNames() { } public function initializeReflection(ReflectionService $reflService) { } public function wakeupReflection(ReflectionService $reflService) { } } php-doctrine-persistence-1.3.6/tests/Doctrine/Tests/Common/Persistence/TestObject.php000066400000000000000000000005751361236344400307620ustar00rootroot00000000000000reflectionService = new RuntimeReflectionService(); } public function testGetTypedNoDefaultReflectionProperty() : void { $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'typedNoDefaultProperty'); self::assertInstanceOf(TypedNoDefaultReflectionProperty::class, $reflProp); } public function testGetTypedDefaultReflectionProperty() : void { $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'typedDefaultProperty'); self::assertInstanceOf(ReflectionProperty::class, $reflProp); self::assertNotInstanceOf(TypedNoDefaultReflectionProperty::class, $reflProp); } public function testGetTypedPublicNoDefaultPropertyWorksWithGetValue() : void { $reflProp = $this->reflectionService->getAccessibleProperty(self::class, 'typedNoDefaultPublicProperty'); self::assertInstanceOf(RuntimePublicReflectionProperty::class, $reflProp); self::assertNull($reflProp->getValue($this)); } }