From 9fe18212bed0c75c3e6cecb9a037f97367a9f635 Mon Sep 17 00:00:00 2001 From: "Jonathan H. Wage" Date: Wed, 19 Sep 2018 06:57:18 +0100 Subject: [PATCH] Use Doctrine Skeleton Mapper for the object mapper layer. --- cache/.gitignore | 2 + composer.json | 4 + composer.lock | 1949 ++++++++++++++++- config/config.yml | 2 +- config/projects.yml | 8 +- config/services.xml | 212 +- config/team_members.yml | 285 +-- lib/Application.php | 3 + lib/Blog/BlogPostRepository.php | 68 - lib/Commands/ClearBuildCacheCommand.php | 10 +- lib/Controllers/AtomController.php | 2 +- lib/Controllers/BlogController.php | 4 +- lib/Controllers/DocumentationController.php | 4 +- lib/Controllers/HomepageController.php | 23 +- lib/Controllers/ProjectController.php | 25 +- lib/Controllers/SitemapController.php | 2 +- lib/Controllers/TeamController.php | 23 +- lib/DataSource/CriteriaMatcher.php | 73 + lib/DataSource/DataSource.php | 13 + .../DataSourceObjectDataRepository.php | 139 ++ lib/DataSource/Sorter.php | 106 + lib/DataSources/BlogPosts.php | 45 + lib/DataSources/Contributors.php | 53 + lib/DataSources/DoctrineUsers.php | 29 + lib/DataSources/ProjectContributors.php | 79 + lib/DataSources/Projects.php | 51 + .../SitemapPages.php} | 48 +- lib/DataSources/TeamMembers.php | 29 + lib/Docs/APIBuilder.php | 4 +- lib/Docs/BuildDocs.php | 52 +- lib/Docs/RST/RSTBuilder.php | 4 +- lib/Docs/RST/RSTCopier.php | 4 +- lib/Docs/RST/RSTLanguagesDetector.php | 4 +- lib/Docs/RST/RSTPostBuildProcessor.php | 4 +- lib/Docs/SearchIndexer.php | 4 +- lib/Github/GithubProjectContributors.php | 49 + lib/{Blog => Model}/BlogPost.php | 26 +- lib/Model/Contributor.php | 91 + lib/Model/DoctrineUser.php | 43 + lib/{Projects => Model}/Project.php | 49 +- lib/Model/ProjectContributor.php | 102 + .../ProjectIntegrationType.php | 10 +- lib/{Projects => Model}/ProjectVersion.php | 2 +- lib/Model/SitemapPage.php | 50 + lib/Model/TeamMember.php | 89 + lib/Projects/ProjectDataReader.php | 6 +- lib/Projects/ProjectDataRepository.php | 33 + lib/Projects/ProjectFactory.php | 27 - lib/Projects/ProjectGitSyncer.php | 7 + lib/Projects/ProjectIntegration.php | 36 - lib/Projects/ProjectRepository.php | 134 -- lib/Repositories/BlogPostRepository.php | 34 + lib/Repositories/ContributorRepository.php | 27 + lib/Repositories/DoctrineUserRepository.php | 22 + .../ProjectContributorRepository.php | 45 + lib/Repositories/ProjectRepository.php | 90 + lib/Repositories/SitemapPageRepository.php | 22 + lib/Repositories/TeamMemberRepository.php | 16 + lib/Sitemap/SitemapPage.php | 32 - lib/Team/TeamRepository.php | 119 - lib/Twig/MainExtension.php | 2 +- lib/Twig/ProjectExtension.php | 10 +- lib/WebsiteBuilder.php | 9 +- source/index.html | 10 +- source/team.html | 23 - source/team/contributors.html | 18 + source/team/maintainers.html | 17 + templates/contributors-list.html.twig | 27 + templates/layouts/layout.html.twig | 9 +- templates/layouts/project.html.twig | 25 +- templates/maintainers-list.html.twig | 33 + templates/projects-short-list.html.twig | 2 +- templates/team-members-list.html.twig | 26 - templates/team-members-short-list.html.twig | 22 - tests/Blog/BlogPostRepositoryTest.php | 165 -- tests/DataSource/CriteriaMatcherTest.php | 51 + .../DataSourceObjectDataRepositoryTest.php | 136 ++ tests/DataSource/SorterTest.php | 189 ++ tests/DataSources/BlogPostsTest.php | 95 + tests/DataSources/ContributorsTest.php | 105 + tests/DataSources/DoctrineUsersTest.php | 29 + tests/DataSources/ProjectContributorsTest.php | 252 +++ tests/DataSources/ProjectsTest.php | 72 + tests/DataSources/SitemapPagesTest.php | 39 + tests/DataSources/TeamMembersTest.php | 34 + tests/Docs/APIBuilderTest.php | 4 +- tests/Docs/BuildDocsTest.php | 24 +- tests/Docs/RST/RSTBuilderTest.php | 4 +- tests/Docs/SearchIndexerTest.php | 4 +- tests/FunctionalTest.php | 11 +- .../Github/GithubProjectContributorsTest.php | 105 + tests/{Blog => Model}/BlogPostTest.php | 4 +- tests/{Sitemap => Model}/SitemapPageTest.php | 4 +- tests/Projects/ProjectDataReaderTest.php | 4 +- tests/Projects/ProjectFactoryTest.php | 43 - tests/Projects/ProjectGitSyncerTest.php | 4 +- tests/Projects/ProjectRepositoryTest.php | 78 - tests/Projects/ProjectTest.php | 4 +- tests/Projects/ProjectVersionTest.php | 2 +- tests/Sitemap/SitemapPageRepositoryTest.php | 35 - tests/Team/TeamRepositoryTest.php | 102 - tests/Twig/MainExtensionTest.php | 2 +- tests/Twig/ProjectExtensionTest.php | 8 +- tests/WebsiteBuilderTest.php | 2 +- 104 files changed, 4929 insertions(+), 1443 deletions(-) create mode 100644 cache/.gitignore delete mode 100644 lib/Blog/BlogPostRepository.php create mode 100644 lib/DataSource/CriteriaMatcher.php create mode 100644 lib/DataSource/DataSource.php create mode 100644 lib/DataSource/DataSourceObjectDataRepository.php create mode 100644 lib/DataSource/Sorter.php create mode 100644 lib/DataSources/BlogPosts.php create mode 100644 lib/DataSources/Contributors.php create mode 100644 lib/DataSources/DoctrineUsers.php create mode 100644 lib/DataSources/ProjectContributors.php create mode 100644 lib/DataSources/Projects.php rename lib/{Sitemap/SitemapPageRepository.php => DataSources/SitemapPages.php} (54%) create mode 100644 lib/DataSources/TeamMembers.php create mode 100644 lib/Github/GithubProjectContributors.php rename lib/{Blog => Model}/BlogPost.php (56%) create mode 100644 lib/Model/Contributor.php create mode 100644 lib/Model/DoctrineUser.php rename lib/{Projects => Model}/Project.php (81%) create mode 100644 lib/Model/ProjectContributor.php rename lib/{Projects => Model}/ProjectIntegrationType.php (63%) rename lib/{Projects => Model}/ProjectVersion.php (97%) create mode 100644 lib/Model/SitemapPage.php create mode 100644 lib/Model/TeamMember.php create mode 100644 lib/Projects/ProjectDataRepository.php delete mode 100644 lib/Projects/ProjectFactory.php delete mode 100644 lib/Projects/ProjectIntegration.php delete mode 100644 lib/Projects/ProjectRepository.php create mode 100644 lib/Repositories/BlogPostRepository.php create mode 100644 lib/Repositories/ContributorRepository.php create mode 100644 lib/Repositories/DoctrineUserRepository.php create mode 100644 lib/Repositories/ProjectContributorRepository.php create mode 100644 lib/Repositories/ProjectRepository.php create mode 100644 lib/Repositories/SitemapPageRepository.php create mode 100644 lib/Repositories/TeamMemberRepository.php delete mode 100644 lib/Sitemap/SitemapPage.php delete mode 100644 lib/Team/TeamRepository.php delete mode 100644 source/team.html create mode 100644 source/team/contributors.html create mode 100644 source/team/maintainers.html create mode 100644 templates/contributors-list.html.twig create mode 100644 templates/maintainers-list.html.twig delete mode 100644 templates/team-members-list.html.twig delete mode 100644 templates/team-members-short-list.html.twig delete mode 100644 tests/Blog/BlogPostRepositoryTest.php create mode 100644 tests/DataSource/CriteriaMatcherTest.php create mode 100644 tests/DataSource/DataSourceObjectDataRepositoryTest.php create mode 100644 tests/DataSource/SorterTest.php create mode 100644 tests/DataSources/BlogPostsTest.php create mode 100644 tests/DataSources/ContributorsTest.php create mode 100644 tests/DataSources/DoctrineUsersTest.php create mode 100644 tests/DataSources/ProjectContributorsTest.php create mode 100644 tests/DataSources/ProjectsTest.php create mode 100644 tests/DataSources/SitemapPagesTest.php create mode 100644 tests/DataSources/TeamMembersTest.php create mode 100644 tests/Github/GithubProjectContributorsTest.php rename tests/{Blog => Model}/BlogPostTest.php (95%) rename tests/{Sitemap => Model}/SitemapPageTest.php (90%) delete mode 100644 tests/Projects/ProjectFactoryTest.php delete mode 100644 tests/Projects/ProjectRepositoryTest.php delete mode 100644 tests/Sitemap/SitemapPageRepositoryTest.php delete mode 100644 tests/Team/TeamRepositoryTest.php diff --git a/cache/.gitignore b/cache/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/cache/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/composer.json b/composer.json index 1366e1b..29cfc4a 100644 --- a/composer.json +++ b/composer.json @@ -13,9 +13,13 @@ "require": { "php": "^7.1", "algolia/algoliasearch-client-php": "^1.27", + "cache/doctrine-adapter": "^1.0", "doctrine/inflector": "^1.3", "doctrine/rst-parser": "dev-master", + "doctrine/skeleton-mapper": "dev-master", "erusev/parsedown": "^1.7", + "knplabs/github-api": "^2.10", + "php-http/guzzle6-adapter": "^1.1", "scrivo/highlight.php": "v9.12.0.4", "symfony/config": "^4.1", "symfony/console": "^4.1", diff --git a/composer.lock b/composer.lock index 1a386e5..c919ae1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bd0377b59218acf391d8104254fb3041", + "content-hash": "9d12d5c13d9d7db2761bafb2d5b805ac", "packages": [ { "name": "algolia/algoliasearch-client-php", @@ -57,6 +57,616 @@ "homepage": "https://github.com/algolia/algoliasearch-client-php", "time": "2018-06-19T05:59:53+00:00" }, + { + "name": "cache/adapter-common", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-cache/adapter-common.git", + "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-cache/adapter-common/zipball/6320bb5f5574cb88438059b59f8708da6b6f1d32", + "reference": "6320bb5f5574cb88438059b59f8708da6b6f1d32", + "shasum": "" + }, + "require": { + "cache/tag-interop": "^1.0", + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/log": "^1.0", + "psr/simple-cache": "^1.0" + }, + "require-dev": { + "cache/integration-tests": "^0.16", + "phpunit/phpunit": "^5.7.21" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Cache\\Adapter\\Common\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Scherer", + "email": "aequasi@gmail.com", + "homepage": "https://github.com/aequasi" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/nyholm" + } + ], + "description": "Common classes for PSR-6 adapters", + "homepage": "http://www.php-cache.com/en/latest/", + "keywords": [ + "cache", + "psr-6", + "tag" + ], + "time": "2018-07-08T13:04:33+00:00" + }, + { + "name": "cache/doctrine-adapter", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-cache/doctrine-adapter.git", + "reference": "8eed76c8fa4400b84d89fc62687c25eaedf8e341" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-cache/doctrine-adapter/zipball/8eed76c8fa4400b84d89fc62687c25eaedf8e341", + "reference": "8eed76c8fa4400b84d89fc62687c25eaedf8e341", + "shasum": "" + }, + "require": { + "cache/adapter-common": "^1.0", + "doctrine/cache": "^1.6", + "php": "^5.6 || ^7.0", + "psr/cache": "^1.0", + "psr/simple-cache": "^1.0" + }, + "provide": { + "psr/cache-implementation": "^1.0" + }, + "require-dev": { + "cache/integration-tests": "^0.16", + "mockery/mockery": "^0.9.9", + "phpunit/phpunit": "^5.7.21" + }, + "suggest": { + "ext-apc": "Allows for caching with Apc", + "ext-memcache": "Allows for caching with Memcache", + "ext-memcached": "Allows for caching with Memcached", + "ext-redis": "Allows for caching with Redis" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Cache\\Adapter\\Doctrine\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Scherer", + "email": "aequasi@gmail.com", + "homepage": "https://github.com/aequasi" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/nyholm" + } + ], + "description": "A PSR-6 cache implementation using Doctrine. This implementation supports tags", + "homepage": "http://www.php-cache.com/en/latest/", + "keywords": [ + "cache", + "doctrine", + "psr-6", + "tag" + ], + "time": "2017-07-16T21:09:25+00:00" + }, + { + "name": "cache/tag-interop", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-cache/tag-interop.git", + "reference": "c7496dd81530f538af27b4f2713cde97bc292832" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-cache/tag-interop/zipball/c7496dd81530f538af27b4f2713cde97bc292832", + "reference": "c7496dd81530f538af27b4f2713cde97bc292832", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "psr/cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Cache\\TagInterop\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/nyholm" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com", + "homepage": "https://github.com/nicolas-grekas" + } + ], + "description": "Framework interoperable interfaces for tags", + "homepage": "http://www.php-cache.com/en/latest/", + "keywords": [ + "cache", + "psr", + "psr6", + "tag" + ], + "time": "2017-03-13T09:14:27+00:00" + }, + { + "name": "clue/stream-filter", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/clue/php-stream-filter.git", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/php-stream-filter/zipball/d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "reference": "d80fdee9b3a7e0d16fc330a22f41f3ad0eeb09d0", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^5.0 || ^4.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@lueck.tv" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/php-stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "time": "2017-08-18T09:54:01+00:00" + }, + { + "name": "doctrine/annotations", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/annotations.git", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "reference": "c7f2050c68a9ab0bdb0f98567ec08d80ea7d24d5", + "shasum": "" + }, + "require": { + "doctrine/lexer": "1.*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/cache": "1.*", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + } + }, + "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": "Docblock Annotations Parser", + "homepage": "http://www.doctrine-project.org", + "keywords": [ + "annotations", + "docblock", + "parser" + ], + "time": "2017-12-06T07:11:42+00:00" + }, + { + "name": "doctrine/cache", + "version": "v1.8.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/cache.git", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", + "shasum": "" + }, + "require": { + "php": "~7.1" + }, + "conflict": { + "doctrine/common": ">2.2,<2.4" + }, + "require-dev": { + "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^4.0", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^7.0", + "predis/predis": "~1.0" + }, + "suggest": { + "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8.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": "https://www.doctrine-project.org", + "keywords": [ + "cache", + "caching" + ], + "time": "2018-08-21T18:01:43+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/common", + "version": "v2.9.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/common.git", + "reference": "a210246d286c77d2b89040f8691ba7b3a713d2c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/common/zipball/a210246d286c77d2b89040f8691ba7b3a713d2c1", + "reference": "a210246d286c77d2b89040f8691ba7b3a713d2c1", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/inflector": "^1.0", + "doctrine/lexer": "^1.0", + "doctrine/persistence": "^1.0", + "doctrine/reflection": "^1.0", + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^1.0", + "phpunit/phpunit": "^6.3", + "squizlabs/php_codesniffer": "^3.0", + "symfony/phpunit-bridge": "^4.0.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.9.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": "Common Library for Doctrine projects", + "homepage": "https://www.doctrine-project.org", + "keywords": [ + "annotations", + "collections", + "eventmanager", + "persistence", + "spl" + ], + "time": "2018-07-12T21:16:12+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/inflector", "version": "v1.3.0", @@ -124,18 +734,225 @@ ], "time": "2018-01-09T20:05:19+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/persistence", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/doctrine/persistence.git", + "reference": "af1ec238659a83e320f03e0e454e200f689b4b97" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/persistence/zipball/af1ec238659a83e320f03e0e454e200f689b4b97", + "reference": "af1ec238659a83e320f03e0e454e200f689b4b97", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "doctrine/cache": "^1.0", + "doctrine/collections": "^1.0", + "doctrine/event-manager": "^1.0", + "doctrine/reflection": "^1.0", + "php": "^7.1" + }, + "conflict": { + "doctrine/common": "<2.9@dev" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "phpstan/phpstan": "^0.8", + "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 Persistence abstractions.", + "homepage": "https://doctrine-project.org/projects/persistence.html", + "keywords": [ + "persistence" + ], + "time": "2018-07-12T12:37:50+00:00" + }, + { + "name": "doctrine/reflection", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/reflection.git", + "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/reflection/zipball/02538d3f95e88eb397a5f86274deb2c6175c2ab6", + "reference": "02538d3f95e88eb397a5f86274deb2c6175c2ab6", + "shasum": "" + }, + "require": { + "doctrine/annotations": "^1.0", + "ext-tokenizer": "*", + "php": "^7.1" + }, + "require-dev": { + "doctrine/coding-standard": "^4.0", + "doctrine/common": "^2.8", + "phpstan/phpstan": "^0.9.2", + "phpstan/phpstan-phpunit": "^0.9.4", + "phpunit/phpunit": "^7.0", + "squizlabs/php_codesniffer": "^3.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 Reflection component", + "homepage": "https://www.doctrine-project.org/projects/reflection.html", + "keywords": [ + "reflection" + ], + "time": "2018-06-14T14:45:07+00:00" + }, { "name": "doctrine/rst-parser", "version": "dev-master", "source": { "type": "git", "url": "https://github.com/doctrine/rst-parser.git", - "reference": "bae8bc79d7caebb21d744f7dcf755f0649051e0e" + "reference": "f7bb93bc336345a66c1a27c4d7baa07a0642707b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/rst-parser/zipball/bae8bc79d7caebb21d744f7dcf755f0649051e0e", - "reference": "bae8bc79d7caebb21d744f7dcf755f0649051e0e", + "url": "https://api.github.com/repos/doctrine/rst-parser/zipball/f7bb93bc336345a66c1a27c4d7baa07a0642707b", + "reference": "f7bb93bc336345a66c1a27c4d7baa07a0642707b", "shasum": "" }, "require": { @@ -172,14 +989,71 @@ "homepage": "https://jwage.com" } ], - "description": "PHP library to parse reStructuredText documents", + "description": "PHP library to parse reStructuredText documents and generate HTML or LaTeX documents.", "homepage": "https://github.com/doctrine/rst-parser", "keywords": [ + "html", + "latex", "markup", "parser", + "reStructuredText", "rst" ], - "time": "2018-09-10T00:24:52+00:00" + "time": "2018-09-10T00:56:04+00:00" + }, + { + "name": "doctrine/skeleton-mapper", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/doctrine/skeleton-mapper.git", + "reference": "dc25fa5cafc773f5e083f2be5a4dc2149e04eafe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/skeleton-mapper/zipball/dc25fa5cafc773f5e083f2be5a4dc2149e04eafe", + "reference": "dc25fa5cafc773f5e083f2be5a4dc2149e04eafe", + "shasum": "" + }, + "require": { + "doctrine/collections": "~1.5", + "doctrine/common": "~2.9", + "php": "^7.1" + }, + "require-dev": { + "guzzlehttp/guzzle": "~5.0", + "phpunit/phpunit": "~7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\SkeletonMapper": "lib/", + "Doctrine\\SkeletonMapper\\Tests": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan H. Wage", + "email": "jonwage@gmail.com" + } + ], + "description": "The Doctrine SkeletonMapper is a skeleton object mapper where you are 100% responsible for implementing the guts of the persistence operations. This means you write plain old PHP code for the data repositories, object repositories, object hydrators and object persisters.", + "homepage": "https://www.doctrine-project.org/projects/skeleton-mapper.html", + "keywords": [ + "database", + "object", + "persistence" + ], + "time": "2018-09-20T02:23:45+00:00" }, { "name": "erusev/parsedown", @@ -227,6 +1101,767 @@ ], "time": "2018-03-08T01:11:30+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "6.3.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", + "shasum": "" + }, + "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.3-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2018-04-22T15:46:56+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "knplabs/github-api", + "version": "2.10.1", + "source": { + "type": "git", + "url": "https://github.com/KnpLabs/php-github-api.git", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/KnpLabs/php-github-api/zipball/493423ae7ad1fa9075924cdfb98537828b9e80b5", + "reference": "493423ae7ad1fa9075924cdfb98537828b9e80b5", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0", + "php-http/cache-plugin": "^1.4", + "php-http/client-common": "^1.6", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.0", + "php-http/httplug": "^1.1", + "psr/cache": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "cache/array-adapter": "^0.4", + "guzzlehttp/psr7": "^1.2", + "php-http/guzzle6-adapter": "^1.0", + "php-http/mock-client": "^1.0", + "phpunit/phpunit": "^5.5 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Github\\": "lib/Github/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Thibault Duplessis", + "email": "thibault.duplessis@gmail.com", + "homepage": "http://ornicar.github.com" + }, + { + "name": "KnpLabs Team", + "homepage": "http://knplabs.com" + } + ], + "description": "GitHub API v3 client", + "homepage": "https://github.com/KnpLabs/php-github-api", + "keywords": [ + "api", + "gh", + "gist", + "github" + ], + "time": "2018-09-05T19:12:14+00:00" + }, + { + "name": "php-http/cache-plugin", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/cache-plugin.git", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/cache-plugin/zipball/c573ac6ea9b4e33fad567f875b844229d18000b9", + "reference": "c573ac6ea9b4e33fad567f875b844229d18000b9", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/client-common": "^1.1", + "php-http/message-factory": "^1.0", + "psr/cache": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "PSR-6 Cache plugin for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "cache", + "http", + "httplug", + "plugin" + ], + "time": "2017-11-29T20:45:41+00:00" + }, + { + "name": "php-http/client-common", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/949ee8a8cba5fa2abe839c87bf7b885ac3330589", + "reference": "949ee8a8cba5fa2abe839c87bf7b885ac3330589", + "shasum": "" + }, + "require": { + "php": "^5.4 || ^7.0", + "php-http/httplug": "^1.1", + "php-http/message": "^1.6", + "php-http/message-factory": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.0 || ^4.0" + }, + "require-dev": { + "guzzlehttp/psr7": "^1.4", + "phpspec/phpspec": "^2.5 || ^3.4 || ^4.2" + }, + "suggest": { + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "time": "2018-06-22T12:36:17+00:00" + }, + { + "name": "php-http/discovery", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "reference": "9a6cb24de552bfe1aa9d7d1569e2d49c5b169a33", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^2.0.2", + "php-http/httplug": "^1.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^2.4", + "puli/composer-plugin": "1.0.0-beta10" + }, + "suggest": { + "php-http/message": "Allow to use Guzzle, Diactoros or Slim Framework factories", + "puli/composer-plugin": "Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds installed HTTPlug implementations and PSR-7 message factories", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr7" + ], + "time": "2018-02-06T10:55:24+00:00" + }, + { + "name": "php-http/guzzle6-adapter", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/guzzle6-adapter.git", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/guzzle6-adapter/zipball/a56941f9dc6110409cfcddc91546ee97039277ab", + "reference": "a56941f9dc6110409cfcddc91546ee97039277ab", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "php-http/httplug": "^1.0" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0" + }, + "require-dev": { + "ext-curl": "*", + "php-http/adapter-integration-tests": "^0.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Adapter\\Guzzle6\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Guzzle 6 HTTP Adapter", + "homepage": "http://httplug.io", + "keywords": [ + "Guzzle", + "http" + ], + "time": "2016-05-10T06:13:32+00:00" + }, + { + "name": "php-http/httplug", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "reference": "1c6381726c18579c4ca2ef1ec1498fdae8bdf018", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "php-http/promise": "^1.0", + "psr/http-message": "^1.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "time": "2016-08-31T08:30:17+00:00" + }, + { + "name": "php-http/message", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/741f2266a202d59c4ed75436671e1b8e6f475ea3", + "reference": "741f2266a202d59c4ed75436671e1b8e6f475ea3", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.4", + "php": "^5.4 || ^7.0", + "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "akeneo/phpspec-skip-example-extension": "^1.0", + "coduo/phpspec-data-provider-extension": "^1.0", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0", + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4", + "slim/slim": "^3.0", + "zendframework/zend-diactoros": "^1.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation", + "zendframework/zend-diactoros": "Used with Diactoros Factories" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + }, + "files": [ + "src/filters.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "time": "2018-08-15T06:37:30+00:00" + }, + { + "name": "php-http/message-factory", + "version": "v1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message-factory.git", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message-factory/zipball/a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "reference": "a478cb11f66a6ac48d8954216cfed9aa06a501a1", + "shasum": "" + }, + "require": { + "php": ">=5.4", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Factory interfaces for PSR-7 HTTP Message", + "homepage": "http://php-http.org", + "keywords": [ + "factory", + "http", + "message", + "stream", + "uri" + ], + "time": "2015-12-19T14:08:53+00:00" + }, + { + "name": "php-http/promise", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/dc494cdc9d7160b9a09bd5573272195242ce7980", + "reference": "dc494cdc9d7160b9a09bd5573272195242ce7980", + "shasum": "" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "^1.0", + "phpspec/phpspec": "^2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + }, + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "time": "2016-01-26T13:27:02+00:00" + }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "time": "2016-08-06T20:24:11+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -276,6 +1911,151 @@ ], "time": "2017-02-14T16:28:37+00:00" }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.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": "2016-10-10T12:19:37+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "time": "2017-10-23T01:57:42+00:00" + }, { "name": "scrivo/highlight.php", "version": "v9.12.0.4", @@ -632,6 +2412,60 @@ "homepage": "https://symfony.com", "time": "2018-07-26T11:24:31+00:00" }, + { + "name": "symfony/options-resolver", + "version": "v4.1.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1913f1962477cdbb13df951f8147d5da1fe2412c", + "reference": "1913f1962477cdbb13df951f8147d5da1fe2412c", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "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 OptionsResolver Component", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "time": "2018-07-26T08:55:25+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.9.0", @@ -1330,16 +3164,16 @@ }, { "name": "nette/di", - "version": "v2.4.13", + "version": "v2.4.14", "source": { "type": "git", "url": "https://github.com/nette/di.git", - "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca" + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/di/zipball/3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", - "reference": "3f8f212b02d5c17feb97a7e0a39ab306f40c06ca", + "url": "https://api.github.com/repos/nette/di/zipball/923da3e2c0aa53162ef455472c0ac7787b096c5a", + "reference": "923da3e2c0aa53162ef455472c0ac7787b096c5a", "shasum": "" }, "require": { @@ -1395,7 +3229,7 @@ "nette", "static" ], - "time": "2018-06-11T08:46:01+00:00" + "time": "2018-09-17T15:47:40+00:00" }, { "name": "nette/finder", @@ -1649,16 +3483,16 @@ }, { "name": "nette/utils", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5" + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/183069866dc477fcfbac393ed486aaa6d93d19a5", - "reference": "183069866dc477fcfbac393ed486aaa6d93d19a5", + "url": "https://api.github.com/repos/nette/utils/zipball/17b9f76f2abd0c943adfb556e56f2165460b15ce", + "reference": "17b9f76f2abd0c943adfb556e56f2165460b15ce", "shasum": "" }, "require": { @@ -1727,20 +3561,20 @@ "utility", "validation" ], - "time": "2018-05-02T17:16:08+00:00" + "time": "2018-09-18T10:22:16+00:00" }, { "name": "nikic/php-parser", - "version": "v4.0.3", + "version": "v4.0.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "bd088dc940a418f09cda079a9b5c7c478890fb8d" + "reference": "fa6ee28600d21d49b2b4e1006b48426cec8e579c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/bd088dc940a418f09cda079a9b5c7c478890fb8d", - "reference": "bd088dc940a418f09cda079a9b5c7c478890fb8d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/fa6ee28600d21d49b2b4e1006b48426cec8e579c", + "reference": "fa6ee28600d21d49b2b4e1006b48426cec8e579c", "shasum": "" }, "require": { @@ -1778,7 +3612,7 @@ "parser", "php" ], - "time": "2018-07-15T17:25:16+00:00" + "time": "2018-09-18T07:03:24+00:00" }, { "name": "ocramius/package-versions", @@ -2468,21 +4302,24 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cecbc684605bb0cc288828eb5d65d93d5c676d3c", - "reference": "cecbc684605bb0cc288828eb5d65d93d5c676d3c", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { "php": "^7.1" }, + "require-dev": { + "phpunit/phpunit": "^7.1" + }, "type": "library", "extra": { "branch-alias": { @@ -2511,7 +4348,7 @@ "filesystem", "iterator" ], - "time": "2018-06-11T11:44:00+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -2736,53 +4573,6 @@ ], "time": "2018-09-08T15:14:29+00:00" }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.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": "2016-10-10T12:19:37+00:00" - }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", @@ -3348,16 +5138,16 @@ }, { "name": "slevomat/coding-standard", - "version": "4.8.2", + "version": "4.8.3", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "5e878708a16a75ed11a7d9aa02f50c257065d4fe" + "reference": "32e1ca205fc34920f323582ed29c0602e3897ae3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/5e878708a16a75ed11a7d9aa02f50c257065d4fe", - "reference": "5e878708a16a75ed11a7d9aa02f50c257065d4fe", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/32e1ca205fc34920f323582ed29c0602e3897ae3", + "reference": "32e1ca205fc34920f323582ed29c0602e3897ae3", "shasum": "" }, "require": { @@ -3383,7 +5173,7 @@ "MIT" ], "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "time": "2018-09-25T06:49:15+00:00" + "time": "2018-09-25T21:21:11+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3640,7 +5430,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "doctrine/rst-parser": 20 + "doctrine/rst-parser": 20, + "doctrine/skeleton-mapper": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/config/config.yml b/config/config.yml index f1d810f..8f072d4 100644 --- a/config/config.yml +++ b/config/config.yml @@ -18,7 +18,7 @@ parameters: Layer (DBAL) it is built upon. doctrine.website.google_analytics_tracking_id: '' - doctrine.website.who_uses_doctrine: + doctrine.website.doctrine_users: - name: Symfony url: https://symfony.com/ diff --git a/config/projects.yml b/config/projects.yml index 99e3dcb..affa787 100644 --- a/config/projects.yml +++ b/config/projects.yml @@ -77,25 +77,25 @@ parameters: - repositoryName: DoctrineBundle - isIntegration: true + integration: true integrationFor: orm integrationType: symfony - repositoryName: DoctrineCacheBundle - isIntegration: true + integration: true integrationFor: cache integrationType: symfony - repositoryName: DoctrineMigrationsBundle - isIntegration: true + integration: true integrationFor: migrations integrationType: symfony - repositoryName: DoctrineMongoDBBundle slug: doctrine-mongodb-bundle - isIntegration: true + integration: true integrationFor: mongodb-odm integrationType: symfony diff --git a/config/services.xml b/config/services.xml index 357b514..2f5b3da 100644 --- a/config/services.xml +++ b/config/services.xml @@ -13,7 +13,7 @@ %doctrine.website.projects_data% %doctrine.website.team_members% %doctrine.website.templates_path% - %doctrine.website.who_uses_doctrine% + %doctrine.website.doctrine_users% %doctrine.website.project_integration.types% @@ -21,7 +21,7 @@ - + @@ -33,10 +33,27 @@ + + + %doctrine.website.github.http_token% + + http_token + + + + + + + + + + + %doctrine.website.cache_dir% + @@ -86,5 +103,196 @@ + + + + + + + + + + + + + + + + + + + + + Doctrine\Website\Model\BlogPost + + + + + + + + + + Doctrine\Website\Model\BlogPost + + + + + + + + + Doctrine\Website\Model\Contributor + + + + + + + + + + Doctrine\Website\Model\Contributor + + + + + + + + + Doctrine\Website\Model\DoctrineUser + + + + + + + + + + Doctrine\Website\Model\DoctrineUser + + + + + + + + + Doctrine\Website\Model\Project + + + + + + + + + + Doctrine\Website\Model\Project + + + + + + + + + Doctrine\Website\Model\ProjectContributor + + + + + + + + + + Doctrine\Website\Model\ProjectContributor + + + + + + + + + Doctrine\Website\Model\SitemapPage + + + + + + + + + + Doctrine\Website\Model\SitemapPage + + + + + + + + + Doctrine\Website\Model\TeamMember + + + + + + + + + + Doctrine\Website\Model\TeamMember + + + + + Doctrine\Website\Model\BlogPost + + + + + Doctrine\Website\Model\Contributor + + + + + Doctrine\Website\Model\DoctrineUser + + + + + Doctrine\Website\Model\Project + + + + + Doctrine\Website\Model\ProjectContributor + + + + + Doctrine\Website\Model\TeamMember + + + + + Doctrine\Website\Model\SitemapPage + + + + + + + + + + + diff --git a/config/team_members.yml b/config/team_members.yml index 045ea0e..974ebcb 100644 --- a/config/team_members.yml +++ b/config/team_members.yml @@ -1,32 +1,19 @@ parameters: doctrine.website.team_members: - # active alcaeus: name: Andreas github: alcaeus avatarUrl: 'https://avatars2.githubusercontent.com/u/383198?v=4' website: ~ location: Munich - active: true - core: true - projects: ["mongodb-odm", "mongodb"] + maintains: ["mongodb-odm", "mongodb", "doctrine-mongodb-bundle"] beberlei: name: 'Benjamin Eberlei' github: beberlei avatarUrl: 'https://avatars2.githubusercontent.com/u/26936?v=4' website: 'https://beberlei.de' location: Germany - active: true - core: true - projects: ["orm", "dbal", "couchdb-odm"] - billschaller: - name: 'Bill Schaller' - github: billschaller - avatarUrl: 'https://avatars1.githubusercontent.com/u/4266849?v=4' - website: ~ - location: 'New York, NY' - active: true - core: true + maintains: ["orm", "dbal", "common", "cache", "annotations", "collections", "event-manager"] carusogabriel: name: 'Gabriel Caruso' twitter: carusogabriel @@ -34,18 +21,14 @@ parameters: avatarUrl: 'https://avatars3.githubusercontent.com/u/16328050?v=4' website: ~ location: Brazil - active: true - core: true - projects: ["coding-standard"] + maintains: ["coding-standard"] deeky666: name: 'Steve Müller' github: deeky666 avatarUrl: 'https://avatars2.githubusercontent.com/u/1411514?v=4' website: 'http://dzh-online.de/' location: 'Hamburg, Germany' - active: true - core: true - projects: ["dbal", "coding-standard"] + maintains: ["dbal", "coding-standard"] greg0ire: name: 'Grégoire Paris' twitter: greg0ire @@ -53,9 +36,7 @@ parameters: avatarUrl: 'https://avatars1.githubusercontent.com/u/657779?v=4' website: 'https://greg0ire.fr' location: Paris - active: true - core: true - projects: ["dbal", "orm", "coding-standard"] + maintains: ["dbal", "orm", "coding-standard"] guilhermeblanco: name: 'Guilherme Blanco' twitter: guilhermeblanco @@ -63,9 +44,7 @@ parameters: avatarUrl: 'https://avatars1.githubusercontent.com/u/208883?v=4' website: 'http://www.doctrine-project.org' location: 'Toronto, ON, Canada' - active: true - core: true - projects: ["orm", "dbal", "annotations", "doctrine1"] + maintains: ["orm", "dbal", "annotations", "doctrine1", "common", "cache", "event-manager", "lexer", "doctrine-cache-bundle"] jmikola: name: 'Jeremy Mikola' twitter: jmikola @@ -73,9 +52,7 @@ parameters: avatarUrl: 'https://avatars3.githubusercontent.com/u/244663?v=4' website: 'http://jmikola.net' location: 'Hoboken, NJ' - active: true - core: true - projects: ["mongodb", "mongodb-odm"] + maintains: ["mongodb", "mongodb-odm", "doctrine-mongodb-bundle"] jwage: name: 'Jonathan H. Wage' twitter: jwage @@ -83,10 +60,7 @@ parameters: github: jwage avatarUrl: 'https://avatars0.githubusercontent.com/u/97422?v=4' location: 'Nashville, TN' - active: true - core: true - documentation: true - projects: ["mongodb", "mongodb-odm", "migrations", "doctrine1", "event-manager", "persistence", "reflection", "rst-parser", "skeleton-mapper"] + maintains: ["mongodb", "mongodb-odm", "migrations", "doctrine1", "event-manager", "persistence", "reflection", "rst-parser", "skeleton-mapper", "common", "doctrine-migrations-bundle", "inflector", "lexer"] kimhemsoe: name: 'Kim Hemsø Rasmussen' twitter: kimhemsoe @@ -94,8 +68,7 @@ parameters: avatarUrl: 'https://avatars3.githubusercontent.com/u/568787?v=4' website: ~ location: Copenhagen - active: true - core: true + maintains: ["doctrine-bundle"] lcobucci: name: 'Luís Cobucci' twitter: lcobucci @@ -103,9 +76,7 @@ parameters: avatarUrl: 'https://avatars2.githubusercontent.com/u/201963?v=4' website: ~ location: 'Amsterdam, NL' - active: true - core: true - projects: ["orm", "dbal", "migrations", "cache", "coding-standard"] + maintains: ["orm", "dbal", "migrations", "cache", "coding-standard", "collections"] Majkl578: name: 'Michael Moravec' twitter: Majkl578 @@ -113,9 +84,7 @@ parameters: avatarUrl: 'https://avatars2.githubusercontent.com/u/144181?v=4' website: 'https://majkl.me' location: 'Prague, Czech Republic' - active: true - core: true - projects: ["orm", "dbal", "event-manager", "annotations", "persistence", "reflection", "coding-standard"] + maintains: ["orm", "dbal", "event-manager", "annotations", "persistence", "reflection", "coding-standard", "common"] mikeSimonson: name: "Mike Simonson" twitter: _mikeSimonson @@ -123,9 +92,7 @@ parameters: avatarUrl: 'https://avatars3.githubusercontent.com/u/907613?v=4' website: ~ location: ~ - active: true - core: true - projects: ["migrations"] + maintains: ["migrations"] malarzm: name: 'Maciej Malarz' twitter: malarzm @@ -133,9 +100,7 @@ parameters: avatarUrl: 'https://avatars1.githubusercontent.com/u/4947711?v=4' website: ~ location: Cracow - active: true - core: true - projects: ["mongodb", "mongodb-odm"] + maintains: ["mongodb", "mongodb-odm", "doctrine-mongodb-bundle"] morozov: name: 'Sergei Morozov' twitter: srgmrzv @@ -143,9 +108,7 @@ parameters: avatarUrl: 'https://avatars1.githubusercontent.com/u/59683?v=4' website: 'http://morozov.livejournal.com/' location: 'San Jose, CA' - active: true - core: true - projects: ["dbal"] + maintains: ["dbal"] Ocramius: name: 'Marco Pivetta' twitter: ocramius @@ -153,243 +116,31 @@ parameters: github: Ocramius avatarUrl: 'https://avatars2.githubusercontent.com/u/154256?v=4' location: 'Frankfurt am Main' - active: true - core: true - projects: ["orm", "dbal", "reflection", "instantiator", "coding-standard"] + maintains: ["orm", "dbal", "reflection", "instantiator", "coding-standard", "common", "cache", "annotations", "collections", "event-manager", "lexer"] TomHAnderson: name: 'Tom H Anderson' github: TomHAnderson avatarUrl: 'https://avatars1.githubusercontent.com/u/493920?v=4' website: 'http://tomhanderson.com' location: 'Salt Lake City, Utah' - active: true - core: true + maintains: ["doctrine-module"] dbu: name: 'David Buchmann' github: dbu avatarUrl: 'https://avatars3.githubusercontent.com/u/76576?v=4' website: 'http://davidbu.ch' location: Switzerland - active: true - core: true - projects: ["phpcr-odm"] + maintains: ["phpcr-odm"] weaverryan: name: 'Ryan Weaver' github: weaverryan avatarUrl: 'https://avatars1.githubusercontent.com/u/121003?v=4' website: 'http://knpuniversity.com' location: 'Grand Rapids MI' - active: true - documentation: true - projects: ["rst-parser"] + maintains: ["rst-parser", "doctrine-bundle"] SenseException: name: 'Claudio Zizza' github: 'SenseException' avatarUrl: 'https://avatars3.githubusercontent.com/u/859964?v=4' website: 'http://php.budgegeria.de/' location: 'Karlsruhe' - active: true - documentation: true - - # inactive - zYne-: - name: Konsta Vesterinen - github: kvesteri - avatarUrl: https://avatars3.githubusercontent.com/u/398714?v=4 - website: 'http://www.fastmonkeys.com/' - location: Espoo, Finland - active: false - founder: true - projects: ["doctrine1"] - romanb: - name: Roman Borschel - github: romanb - avatarUrl: https://avatars1.githubusercontent.com/u/177309?v=4 - website: ~ - location: Berlin, Germany - active: false - projects: ["doctrine1", "orm", "dbal", "common", "annotations", "lexer", "collections", "cache", "inflector"] - asm89: - name: Alexander - github: asm89 - avatarUrl: 'https://avatars0.githubusercontent.com/u/657357?v=4' - website: ~ - location: ~ - avalanche123: - name: 'Bulat Shakirzyanov' - github: avalanche123 - avatarUrl: 'https://avatars0.githubusercontent.com/u/83289?v=4' - website: 'http://avalanche123.com/' - location: 'Conshohocken, PA' - Baachi: - name: 'Markus Bachmann' - github: Baachi - avatarUrl: 'https://avatars1.githubusercontent.com/u/833645?v=4' - website: 'http://www.bachi.biz' - location: Germany - bakura10: - name: 'Michaël Gallego' - github: bakura10 - avatarUrl: 'https://avatars1.githubusercontent.com/u/1198915?v=4' - website: 'http://www.michaelgallego.fr' - location: 'Paris, France' - dantleech: - name: dantleech - github: dantleech - avatarUrl: 'https://avatars1.githubusercontent.com/u/530801?v=4' - website: 'http://www.dantleech.com' - location: Europe - projects: ["phpcr-odm"] - davidino: - name: 'David Funaro' - github: davidino - avatarUrl: 'https://avatars2.githubusercontent.com/u/265253?v=4' - website: 'http://www.davidfunaro.com' - location: Dubai - ElectricMaxxx: - name: 'Maximilian Berghoff' - github: ElectricMaxxx - avatarUrl: 'https://avatars1.githubusercontent.com/u/2905834?v=4' - website: ~ - location: 'Ansbach, Germany' - EmanueleMinotto: - name: 'Emanuele Minotto' - github: EmanueleMinotto - avatarUrl: 'https://avatars2.githubusercontent.com/u/417201?v=4' - website: 'http://emanueleminotto.github.io' - location: ~ - FabioBatSilva: - name: 'Fabio B. Silva' - twitter: FabioBatSilva - github: FabioBatSilva - avatarUrl: 'https://avatars2.githubusercontent.com/u/588172?v=4' - website: ~ - location: 'Toronto, Canada' - fabpot: - name: 'Fabien Potencier' - github: fabpot - avatarUrl: 'https://avatars3.githubusercontent.com/u/47313?v=4' - website: 'http://fabien.potencier.org/' - location: 'San Francisco' - gianarb: - name: 'Gianluca Arbezzano' - github: gianarb - avatarUrl: 'https://avatars1.githubusercontent.com/u/1630267?v=4' - website: 'https://gianarb.it' - location: ~ - igorgolovanov: - name: 'Igor Golovanov' - github: igorgolovanov - avatarUrl: 'https://avatars3.githubusercontent.com/u/363810?v=4' - website: 'https://www.linkedin.com/in/igorgolovanov' - location: ~ - igorw: - name: Igor - github: igorw - avatarUrl: 'https://avatars2.githubusercontent.com/u/88061?v=4' - website: ~ - location: ~ - kore: - name: 'Kore Nordmann' - github: kore - avatarUrl: 'https://avatars0.githubusercontent.com/u/154398?v=4' - website: 'http://kore-nordmann.de' - location: ~ - kriswallsmith: - name: 'Kris Wallsmith' - github: kriswallsmith - avatarUrl: 'https://avatars2.githubusercontent.com/u/33886?v=4' - website: 'http://kriswallsmith.net' - location: 'Portland, Oregon USA' - lavoiesl: - name: 'Sébastien Lavoie' - github: lavoiesl - avatarUrl: 'https://avatars0.githubusercontent.com/u/1216046?v=4' - website: 'http://blog.lavoie.sl' - location: 'California, US' - lsmith77: - name: 'Lukas Kahwe Smith' - github: lsmith77 - avatarUrl: 'https://avatars0.githubusercontent.com/u/300279?v=4' - website: 'http://pooteeweet.org' - location: 'Zurich, Switzerland' - projects: ["couchdb-odm", "phpcr-odm"] - mikelohmann: - name: 'Mike Lohmann' - github: mikelohmann - avatarUrl: 'https://avatars0.githubusercontent.com/u/600423?v=4' - website: 'http://elbstack.com' - location: Hamburg - MrHash: - name: 'Hasham Ahmad' - github: MrHash - avatarUrl: 'https://avatars3.githubusercontent.com/u/390925?v=4' - website: ~ - location: 'Berlin, London, Tokyo, and more' - naderman: - name: 'Nils Adermann' - github: naderman - avatarUrl: 'https://avatars1.githubusercontent.com/u/154844?v=4' - website: 'http://www.naderman.de' - location: 'Berlin, Germany' - nicam: - name: 'Pascal Helfenstein' - github: nicam - avatarUrl: 'https://avatars0.githubusercontent.com/u/182071?v=4' - website: 'https://nicam.ch/' - location: 'Zürich Switzerland' - nrk: - name: 'Daniele Alessandri' - github: nrk - avatarUrl: 'https://avatars0.githubusercontent.com/u/17923?v=4' - website: 'http://clorophilla.net/' - location: 'Milan, Italy' - odino: - name: 'Alessandro Nadalin' - github: odino - avatarUrl: 'https://avatars3.githubusercontent.com/u/328420?v=4' - website: 'https://odino.org/' - location: 'Dubai, UAE' - projects: [orientdb-odm] - richardfullmer: - name: 'Richard Fullmer' - github: richardfullmer - avatarUrl: 'https://avatars0.githubusercontent.com/u/384602?v=4' - website: ~ - location: 'Las Vegas' - rndstr: - name: 'Roland Schilter' - github: rndstr - avatarUrl: 'https://avatars0.githubusercontent.com/u/32963?v=4' - website: ~ - location: 'San Francisco' - schmittjoh: - name: Johannes - github: schmittjoh - avatarUrl: 'https://avatars2.githubusercontent.com/u/197017?v=4' - website: 'https://scrutinizer-ci.com' - location: ~ - Seldaek: - name: 'Jordi Boggiano' - github: Seldaek - avatarUrl: 'https://avatars1.githubusercontent.com/u/183678?v=4' - website: 'https://seld.be/' - location: 'Zürich, Zurich, Switzerland' - sixty-nine: - name: Dan - github: sixty-nine - avatarUrl: 'https://avatars1.githubusercontent.com/u/398679?v=4' - website: ~ - location: ~ - stof: - name: 'Christophe Coevoet' - github: stof - avatarUrl: 'https://avatars0.githubusercontent.com/u/439401?v=4' - website: ~ - location: Paris - superdweebie: - name: 'Tim Roediger' - github: superdweebie - avatarUrl: 'https://avatars1.githubusercontent.com/u/1670364?v=4' - website: ~ - location: 'Sydney, Australia' diff --git a/lib/Application.php b/lib/Application.php index a204d06..bb6567c 100644 --- a/lib/Application.php +++ b/lib/Application.php @@ -15,6 +15,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use function file_exists; +use function getenv; use function realpath; use function sprintf; @@ -65,6 +66,8 @@ class Application $container->setParameter('doctrine.website.env', $env); $container->setParameter('doctrine.website.root_dir', realpath(__DIR__ . '/..')); $container->setParameter('doctrine.website.config_dir', realpath(__DIR__ . '/../config')); + $container->setParameter('doctrine.website.cache_dir', realpath(__DIR__ . '/../cache')); + $container->setParameter('doctrine.website.github.http_token', getenv('doctrine_website_github_http_token')); $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../config')); $loader->load('services.xml'); diff --git a/lib/Blog/BlogPostRepository.php b/lib/Blog/BlogPostRepository.php deleted file mode 100644 index 8027621..0000000 --- a/lib/Blog/BlogPostRepository.php +++ /dev/null @@ -1,68 +0,0 @@ -sourceFileRepository = $sourceFileRepository; - } - - public function find(SourceFile $sourceFile) : BlogPost - { - return new BlogPost( - $sourceFile->getParameter('url'), - $sourceFile->getParameter('title'), - (string) $sourceFile->getParameter('authorName'), - (string) $sourceFile->getParameter('authorEmail'), - $sourceFile->getContents(), - $sourceFile->getDate() - ); - } - - /** - * @return BlogPost[] - */ - public function findPaginated(int $page = 1, int $perPage = 10) : array - { - if ($page < 1 || $perPage < 1) { - throw new InvalidArgumentException('Pagination parameters must be positive.'); - } - - $offset = ($page - 1) * $perPage; - - return array_slice($this->findAll(), $offset, $perPage); - } - - /** - * @return BlogPost[] - */ - public function findAll() : array - { - $sourceFiles = $this->sourceFileRepository->getFiles('', 'source/blog'); - - usort($sourceFiles, static function (SourceFile $a, SourceFile $b) : int { - return $a->getDate()->getTimestamp() - $b->getDate()->getTimestamp(); - }); - - $reversedSourceFiles = array_reverse($sourceFiles); - - return array_map(function (SourceFile $sourceFile) : BlogPost { - return $this->find($sourceFile); - }, $reversedSourceFiles); - } -} diff --git a/lib/Commands/ClearBuildCacheCommand.php b/lib/Commands/ClearBuildCacheCommand.php index dbb7218..53bcd9c 100644 --- a/lib/Commands/ClearBuildCacheCommand.php +++ b/lib/Commands/ClearBuildCacheCommand.php @@ -4,12 +4,14 @@ declare(strict_types=1); namespace Doctrine\Website\Commands; -use Doctrine\Website\Projects\ProjectRepository; +use Doctrine\Website\Repositories\ProjectRepository; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; +use function array_filter; +use function glob; use function sprintf; class ClearBuildCacheCommand extends Command @@ -88,6 +90,12 @@ class ClearBuildCacheCommand extends Command ); } + $cacheDirectories = array_filter(glob($this->rootDir . '/cache/*'), 'is_dir'); + + foreach ($cacheDirectories as $cacheDirectory) { + $remove[] = $cacheDirectory; + } + foreach ($remove as $path) { $output->writeln(sprintf('Removing %s', $path)); diff --git a/lib/Controllers/AtomController.php b/lib/Controllers/AtomController.php index b9d6190..1c31126 100644 --- a/lib/Controllers/AtomController.php +++ b/lib/Controllers/AtomController.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Doctrine\Website\Controllers; -use Doctrine\Website\Blog\BlogPostRepository; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; +use Doctrine\Website\Repositories\BlogPostRepository; class AtomController { diff --git a/lib/Controllers/BlogController.php b/lib/Controllers/BlogController.php index b762041..52101e4 100644 --- a/lib/Controllers/BlogController.php +++ b/lib/Controllers/BlogController.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Doctrine\Website\Controllers; -use Doctrine\Website\Blog\BlogPostRepository; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; +use Doctrine\Website\Repositories\BlogPostRepository; class BlogController { @@ -35,7 +35,7 @@ class BlogController public function view(SourceFile $sourceFile) : ControllerResult { return new ControllerResult([ - 'blogPost' => $this->blogPostRepository->find($sourceFile), + 'blogPost' => $this->blogPostRepository->find($sourceFile->getParameter('url')), ]); } } diff --git a/lib/Controllers/DocumentationController.php b/lib/Controllers/DocumentationController.php index 29a0ed4..8c27fef 100644 --- a/lib/Controllers/DocumentationController.php +++ b/lib/Controllers/DocumentationController.php @@ -6,7 +6,7 @@ namespace Doctrine\Website\Controllers; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; -use Doctrine\Website\Projects\ProjectRepository; +use Doctrine\Website\Repositories\ProjectRepository; class DocumentationController { @@ -20,7 +20,7 @@ class DocumentationController public function view(SourceFile $sourceFile) : ControllerResult { - $project = $this->projectRepository->findOneBySlug($sourceFile->getParameter('docsSlug')); + $project = $this->projectRepository->findOneByDocsSlug($sourceFile->getParameter('docsSlug')); return new ControllerResult([ 'project' => $project, diff --git a/lib/Controllers/HomepageController.php b/lib/Controllers/HomepageController.php index 588df50..8b727fd 100644 --- a/lib/Controllers/HomepageController.php +++ b/lib/Controllers/HomepageController.php @@ -4,10 +4,11 @@ declare(strict_types=1); namespace Doctrine\Website\Controllers; -use Doctrine\Website\Blog\BlogPostRepository; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; -use Doctrine\Website\Projects\ProjectRepository; +use Doctrine\Website\Repositories\BlogPostRepository; +use Doctrine\Website\Repositories\DoctrineUserRepository; +use Doctrine\Website\Repositories\ProjectRepository; class HomepageController { @@ -17,31 +18,29 @@ class HomepageController /** @var ProjectRepository */ private $projectRepository; - /** @var string[][] */ - private $whoUsesDoctrine; + /** @var DoctrineUserRepository */ + private $doctrineUserRepository; - /** - * @param string[][] $whoUsesDoctrine - */ public function __construct( BlogPostRepository $blogPostRepository, ProjectRepository $projectRepository, - array $whoUsesDoctrine + DoctrineUserRepository $doctrineUserRepository ) { - $this->blogPostRepository = $blogPostRepository; - $this->projectRepository = $projectRepository; - $this->whoUsesDoctrine = $whoUsesDoctrine; + $this->blogPostRepository = $blogPostRepository; + $this->projectRepository = $projectRepository; + $this->doctrineUserRepository = $doctrineUserRepository; } public function index(SourceFile $sourceFile) : ControllerResult { $blogPosts = $this->blogPostRepository->findPaginated(1, 10); $primaryProjects = $this->projectRepository->findPrimaryProjects(); + $doctrineUsers = $this->doctrineUserRepository->findAll(); return new ControllerResult([ 'blogPosts' => $blogPosts, 'primaryProjects' => $primaryProjects, - 'whoUsesDoctrine' => $this->whoUsesDoctrine, + 'doctrineUsers' => $doctrineUsers, ]); } } diff --git a/lib/Controllers/ProjectController.php b/lib/Controllers/ProjectController.php index 43643e6..7218089 100644 --- a/lib/Controllers/ProjectController.php +++ b/lib/Controllers/ProjectController.php @@ -6,21 +6,23 @@ namespace Doctrine\Website\Controllers; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Team\TeamRepository; +use Doctrine\Website\Repositories\ProjectContributorRepository; +use Doctrine\Website\Repositories\ProjectRepository; class ProjectController { /** @var ProjectRepository */ private $projectRepository; - /** @var TeamRepository */ - private $teamRepository; + /** @var ProjectContributorRepository */ + private $projectContributorRepository; - public function __construct(ProjectRepository $projectRepository, TeamRepository $teamRepository) - { - $this->projectRepository = $projectRepository; - $this->teamRepository = $teamRepository; + public function __construct( + ProjectRepository $projectRepository, + ProjectContributorRepository $projectContributorRepository + ) { + $this->projectRepository = $projectRepository; + $this->projectContributorRepository = $projectContributorRepository; } public function index(SourceFile $sourceFile) : ControllerResult @@ -35,14 +37,13 @@ class ProjectController public function view(SourceFile $sourceFile) : ControllerResult { - $project = $this->projectRepository->findOneBySlug($sourceFile->getParameter('docsSlug')); + $project = $this->projectRepository->findOneByDocsSlug($sourceFile->getParameter('docsSlug')); return new ControllerResult([ 'project' => $project, - 'allTeamMembers' => $this->teamRepository->getAllProjectTeamMembers($project), - 'activeTeamMembers' => $this->teamRepository->getActiveProjectTeamMembers($project), - 'inactiveTeamMembers' => $this->teamRepository->getInactiveProjectTeamMembers($project), 'integrationProjects' => $this->projectRepository->findProjectIntegrations($project), + 'maintainers' => $this->projectContributorRepository->findMaintainersByProject($project), + 'contributors' => $this->projectContributorRepository->findContributorsByProject($project), ]); } } diff --git a/lib/Controllers/SitemapController.php b/lib/Controllers/SitemapController.php index d265b21..78cdbc8 100644 --- a/lib/Controllers/SitemapController.php +++ b/lib/Controllers/SitemapController.php @@ -6,7 +6,7 @@ namespace Doctrine\Website\Controllers; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; -use Doctrine\Website\Sitemap\SitemapPageRepository; +use Doctrine\Website\Repositories\SitemapPageRepository; class SitemapController { diff --git a/lib/Controllers/TeamController.php b/lib/Controllers/TeamController.php index e3daf13..4aaff6a 100644 --- a/lib/Controllers/TeamController.php +++ b/lib/Controllers/TeamController.php @@ -6,24 +6,29 @@ namespace Doctrine\Website\Controllers; use Doctrine\Website\Builder\SourceFile; use Doctrine\Website\Controller\ControllerResult; -use Doctrine\Website\Team\TeamRepository; +use Doctrine\Website\Repositories\ContributorRepository; class TeamController { - /** @var TeamRepository */ - private $teamRepository; + /** @var ContributorRepository */ + private $contributorRepository; - public function __construct(TeamRepository $teamRepository) + public function __construct(ContributorRepository $contributorRepository) { - $this->teamRepository = $teamRepository; + $this->contributorRepository = $contributorRepository; } - public function index(SourceFile $sourceFile) : ControllerResult + public function maintainers(SourceFile $sourceFile) : ControllerResult { return new ControllerResult([ - 'activeCoreTeamMembers' => $this->teamRepository->getActiveCoreTeamMembers(), - 'activeDocumentationTeamMembers' => $this->teamRepository->getActiveDocumentationTeamMembers(), - 'inactiveTeamMembers' => $this->teamRepository->getInactiveTeamMembers(), + 'contributors' => $this->contributorRepository->findMaintainers(), + ]); + } + + public function contributors(SourceFile $sourceFile) : ControllerResult + { + return new ControllerResult([ + 'contributors' => $this->contributorRepository->findContributors(), ]); } } diff --git a/lib/DataSource/CriteriaMatcher.php b/lib/DataSource/CriteriaMatcher.php new file mode 100644 index 0000000..7051cb7 --- /dev/null +++ b/lib/DataSource/CriteriaMatcher.php @@ -0,0 +1,73 @@ +criteria = $criteria; + $this->row = $row; + } + + public function matches() : bool + { + $matches = true; + + foreach ($this->criteria as $key => $value) { + if ($this->criteriaElementMatches($key, $value)) { + continue; + } + + $matches = false; + } + + return $matches; + } + + /** + * @param mixed $value + */ + private function criteriaElementMatches(string $key, $value) : bool + { + if (isset($value['$contains'])) { + if ($this->contains($key, $value)) { + return true; + } + } elseif ($this->equals($key, $value)) { + return true; + } + + return false; + } + + /** + * @param mixed[] $value + */ + private function contains(string $key, array $value) : bool + { + return isset($this->row[$key]) && in_array($value['$contains'], $this->row[$key], true); + } + + /** + * @param mixed $value + */ + private function equals(string $key, $value) : bool + { + return isset($this->row[$key]) && $this->row[$key] === $value; + } +} diff --git a/lib/DataSource/DataSource.php b/lib/DataSource/DataSource.php new file mode 100644 index 0000000..678fefd --- /dev/null +++ b/lib/DataSource/DataSource.php @@ -0,0 +1,13 @@ +dataSource = $dataSource; + } + + /** + * @return mixed[][] + */ + public function findAll() : array + { + return $this->getSourceRows(); + } + + /** + * @param mixed[] $criteria + * @param mixed[] $orderBy + * + * @return mixed[][] + */ + public function findBy( + array $criteria, + ?array $orderBy = null, + ?int $limit = null, + ?int $offset = null + ) : array { + $rows = []; + + foreach ($this->getSourceRows() as $row) { + if (! $this->matches($criteria, $row)) { + continue; + } + + $rows[] = $row; + } + + if ($orderBy !== null && $orderBy !== []) { + $rows = $this->sort($rows, $orderBy); + } + + if ($limit !== null || $offset !== null) { + return $this->slice($rows, $limit, $offset); + } + + return $rows; + } + + /** + * @param mixed[] $criteria + * + * @return mixed[]|null + */ + public function findOneBy(array $criteria) : ?array + { + foreach ($this->getSourceRows() as $row) { + if ($this->matches($criteria, $row)) { + return $row; + } + } + + return null; + } + + + /** + * @param mixed[] $criteria + * @param mixed[] $row + */ + private function matches(array $criteria, array $row) : bool + { + return (new CriteriaMatcher($criteria, $row))->matches(); + } + + /** + * @param mixed[][] $rows + * @param string[] $orderBy + * + * @return mixed[][] $rows + */ + private function sort(array $rows, array $orderBy) : array + { + usort($rows, new Sorter($orderBy)); + + return $rows; + } + + /** + * @param mixed[][] $rows + * + * @return mixed[][] $rows + */ + private function slice(array $rows, ?int $limit, ?int $offset) : array + { + if ($limit === null) { + $limit = count($rows); + } + + if ($offset === null) { + $offset = 0; + } + + return array_slice($rows, $offset, $limit); + } + + /** + * @return mixed[][] + */ + private function getSourceRows() : array + { + if ($this->sourceRows === null) { + $this->sourceRows = $this->dataSource->getSourceRows(); + } + + return $this->sourceRows; + } +} diff --git a/lib/DataSource/Sorter.php b/lib/DataSource/Sorter.php new file mode 100644 index 0000000..7758bce --- /dev/null +++ b/lib/DataSource/Sorter.php @@ -0,0 +1,106 @@ + $order) { + $this->fields[] = $field; + $this->orders[] = $this->getOrder($order); + } + } + + /** + * @param mixed[] $a + * @param mixed[] $b + */ + public function __invoke(array $a, array $b) : int + { + $returnVal = 0; + $comparisonField = $this->fields[$this->level]; + $order = $this->orders[$this->level]; + $aComparisonField = $this->getComparisonField($a, $comparisonField); + $bComparisonField = $this->getComparisonField($b, $comparisonField); + + $comparisonResult = $aComparisonField <=> $bComparisonField; + + if ($comparisonResult !== 0) { + $returnVal = $comparisonResult; + } else { + if ($this->level < count($this->fields) - 1) { + $this->level++; + + return $this->__invoke($a, $b); + } + } + + $returnVal *= $order; + + $this->level = 0; + + return $returnVal; + } + + private function getOrder(string $order) : int + { + $lowercaseOrder = strtolower($order); + + if ($lowercaseOrder === self::ORDER_ASC) { + return 1; + } + + if ($lowercaseOrder === self::ORDER_DESC) { + return -1; + } + + throw new InvalidArgumentException(sprintf( + '$order value of %s is not accepted. Only a value of asc or desc is allowed.', + $order + )); + } + + /** + * @param mixed[] $item + * + * @return mixed + */ + private function getComparisonField(array $item, string $field) + { + if (! isset($item[$field])) { + throw new InvalidArgumentException(sprintf('Unable to find comparison field %s', $field)); + } + + $value = $item[$field]; + + return is_string($value) ? strtolower($value) : $value; + } +} diff --git a/lib/DataSources/BlogPosts.php b/lib/DataSources/BlogPosts.php new file mode 100644 index 0000000..0b22fa4 --- /dev/null +++ b/lib/DataSources/BlogPosts.php @@ -0,0 +1,45 @@ +sourceFileRepository = $sourceFileRepository; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + $sourceFiles = $this->sourceFileRepository->getFiles('', 'source/blog'); + + $reversedSourceFiles = array_reverse($sourceFiles); + + $blogPostRows = []; + + foreach ($reversedSourceFiles as $sourceFile) { + $blogPostRows[] = [ + 'url' => $sourceFile->getParameter('url'), + 'title' => $sourceFile->getParameter('title'), + 'authorName' => (string) $sourceFile->getParameter('authorName'), + 'authorEmail' => (string) $sourceFile->getParameter('authorEmail'), + 'contents' => $sourceFile->getContents(), + 'date' => $sourceFile->getDate(), + ]; + } + + return $blogPostRows; + } +} diff --git a/lib/DataSources/Contributors.php b/lib/DataSources/Contributors.php new file mode 100644 index 0000000..fe866da --- /dev/null +++ b/lib/DataSources/Contributors.php @@ -0,0 +1,53 @@ +projectContributorRepository = $projectContributorRepository; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + $projectContributors = $this->projectContributorRepository->findAll(); + + $contributorRows = []; + + foreach ($projectContributors as $projectContributor) { + $github = $projectContributor->getGithub(); + + if (! isset($contributorRows[$github])) { + $contributorRows[$github] = [ + 'teamMember' => $projectContributor->getTeamMember(), + 'isTeamMember' => $projectContributor->isTeamMember(), + 'github' => $github, + 'avatarUrl' => $projectContributor->getAvatarUrl(), + 'numCommits' => 0, + 'numAdditions' => 0, + 'numDeletions' => 0, + 'projects' => [], + ]; + } + + $contributorRows[$github]['numCommits'] += $projectContributor->getNumCommits(); + $contributorRows[$github]['numAdditions'] += $projectContributor->getNumAdditions(); + $contributorRows[$github]['numDeletions'] += $projectContributor->getNumDeletions(); + $contributorRows[$github]['projects'][] = $projectContributor->getProject(); + } + + return $contributorRows; + } +} diff --git a/lib/DataSources/DoctrineUsers.php b/lib/DataSources/DoctrineUsers.php new file mode 100644 index 0000000..aea8d5d --- /dev/null +++ b/lib/DataSources/DoctrineUsers.php @@ -0,0 +1,29 @@ +doctrineUsers = $doctrineUsers; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + return $this->doctrineUsers; + } +} diff --git a/lib/DataSources/ProjectContributors.php b/lib/DataSources/ProjectContributors.php new file mode 100644 index 0000000..3870e3c --- /dev/null +++ b/lib/DataSources/ProjectContributors.php @@ -0,0 +1,79 @@ +projectRepository = $projectRepository; + $this->teamMemberRepository = $teamMemberRepository; + $this->githubProjectContributors = $githubProjectContributors; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + $projects = $this->projectRepository->findAll(); + + $projectContributorRows = []; + + foreach ($projects as $project) { + $contributors = $this->githubProjectContributors->getProjectContributors($project); + + foreach ($contributors as $contributor) { + $numAdditions = 0; + $numDeletions = 0; + + foreach ($contributor['weeks'] as $week) { + $numAdditions += $week['a']; + $numDeletions += $week['d']; + } + + $teamMember = $this->teamMemberRepository->findOneByGithub($contributor['author']['login']); + + $isMaintainer = $teamMember !== null + ? $teamMember->isProjectMaintainer($project) + : false; + + $isTeamMember = $teamMember !== null; + + $projectContributorRows[] = [ + 'teamMember' => $teamMember, + 'isTeamMember' => $isTeamMember, + 'isMaintainer' => $isMaintainer, + 'projectSlug' => $project->getSlug(), + 'project' => $project, + 'github' => $contributor['author']['login'], + 'avatarUrl' => $contributor['author']['avatar_url'], + 'numCommits' => $contributor['total'], + 'numAdditions' => $numAdditions, + 'numDeletions' => $numDeletions, + ]; + } + } + + return $projectContributorRows; + } +} diff --git a/lib/DataSources/Projects.php b/lib/DataSources/Projects.php new file mode 100644 index 0000000..171f85a --- /dev/null +++ b/lib/DataSources/Projects.php @@ -0,0 +1,51 @@ + true, + 'archived' => false, + 'hasDocs' => true, + 'integration' => false, + ]; + + /** @var ProjectDataReader */ + private $projectDataReader; + + /** @var mixed[][] */ + private $projectsData = []; + + /** + * @param mixed[][] $projectsData + */ + public function __construct(ProjectDataReader $projectDataReader, array $projectsData) + { + $this->projectDataReader = $projectDataReader; + $this->projectsData = $projectsData; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + $projectRows = []; + + foreach ($this->projectsData as $projectData) { + $projectRows[] = array_replace( + self::DEFAULTS, + $this->projectDataReader->read($projectData['repositoryName']) + ); + } + + return $projectRows; + } +} diff --git a/lib/Sitemap/SitemapPageRepository.php b/lib/DataSources/SitemapPages.php similarity index 54% rename from lib/Sitemap/SitemapPageRepository.php rename to lib/DataSources/SitemapPages.php index bf52e5c..15dbee4 100644 --- a/lib/Sitemap/SitemapPageRepository.php +++ b/lib/DataSources/SitemapPages.php @@ -2,13 +2,12 @@ declare(strict_types=1); -namespace Doctrine\Website\Sitemap; +namespace Doctrine\Website\DataSources; use DateTimeImmutable; -use Iterator; +use Doctrine\Website\DataSource\DataSource; use RecursiveDirectoryIterator; use RecursiveIteratorIterator; -use SplHeap; use function array_merge; use function assert; use function file_exists; @@ -16,7 +15,7 @@ use function filemtime; use function is_int; use function str_replace; -class SitemapPageRepository +class SitemapPages implements DataSource { /** @var string */ private $sourcePath; @@ -27,21 +26,26 @@ class SitemapPageRepository } /** - * @return SitemapPage[] + * @return mixed[][] */ - public function findAll() : array + public function getSourceRows() : array { return array_merge( - [new SitemapPage('/', new DateTimeImmutable())], - $this->getUrlsFromFiles('projects'), - $this->getUrlsFromFiles('api') + [ + [ + 'url' => '/', + 'date' => new DateTimeImmutable(), + ], + ], + $this->getSitemapPagesDataFromFiles('projects'), + $this->getSitemapPagesDataFromFiles('api') ); } /** - * @return SitemapPage[] + * @return mixed[][] */ - private function getUrlsFromFiles(string $path) : array + private function getSitemapPagesDataFromFiles(string $path) : array { $path = $this->sourcePath . '/' . $path; @@ -56,23 +60,8 @@ class SitemapPageRepository $it = new RecursiveIteratorIterator($it); - // Sorting the results so we get a consistent order in the sitemap - $sortedIterator = new class($it) extends SplHeap { - public function __construct(Iterator $iterator) - { - foreach ($iterator as $item) { - $this->insert($item); - } - } - - public function compare(string $b, string $a) : int - { - return $a <=> $b; - } - }; - $urls = []; - foreach ($sortedIterator as $file) { + foreach ($it as $file) { $url = str_replace($this->sourcePath, '', $file); $timestamp = filemtime($file); @@ -80,7 +69,10 @@ class SitemapPageRepository $date = (new DateTimeImmutable())->setTimestamp($timestamp); - $urls[] = new SitemapPage($url, $date); + $urls[] = [ + 'url' => $url, + 'date' => $date, + ]; } return $urls; diff --git a/lib/DataSources/TeamMembers.php b/lib/DataSources/TeamMembers.php new file mode 100644 index 0000000..a94870f --- /dev/null +++ b/lib/DataSources/TeamMembers.php @@ -0,0 +1,29 @@ +teamMembers = $teamMembers; + } + + /** + * @return mixed[][] + */ + public function getSourceRows() : array + { + return $this->teamMembers; + } +} diff --git a/lib/Docs/APIBuilder.php b/lib/Docs/APIBuilder.php index 61041cf..de758d3 100644 --- a/lib/Docs/APIBuilder.php +++ b/lib/Docs/APIBuilder.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Doctrine\Website\Docs; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\ProcessFactory; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; use function file_put_contents; use function sprintf; use function unlink; diff --git a/lib/Docs/BuildDocs.php b/lib/Docs/BuildDocs.php index b49fbcf..18739cf 100644 --- a/lib/Docs/BuildDocs.php +++ b/lib/Docs/BuildDocs.php @@ -6,10 +6,11 @@ namespace Doctrine\Website\Docs; use Doctrine\Website\Docs\RST\RSTBuilder; use Doctrine\Website\Docs\RST\RSTLanguagesDetector; -use Doctrine\Website\Projects\Project; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; +use Doctrine\Website\Projects\ProjectDataRepository; use Doctrine\Website\Projects\ProjectGitSyncer; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Repositories\ProjectRepository; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\Exception\ProcessFailedException; use function array_filter; @@ -17,6 +18,9 @@ use function sprintf; class BuildDocs { + /** @var ProjectDataRepository */ + private $projectDataRepository; + /** @var ProjectRepository */ private $projectRepository; @@ -36,6 +40,7 @@ class BuildDocs private $searchIndexer; public function __construct( + ProjectDataRepository $projectDataRepository, ProjectRepository $projectRepository, ProjectGitSyncer $projectGitSyncer, APIBuilder $apiBuilder, @@ -43,12 +48,13 @@ class BuildDocs RSTBuilder $rstBuilder, SearchIndexer $searchIndexer ) { - $this->projectRepository = $projectRepository; - $this->projectGitSyncer = $projectGitSyncer; - $this->apiBuilder = $apiBuilder; - $this->rstLanguagesDetector = $rstLanguagesDetector; - $this->rstBuilder = $rstBuilder; - $this->searchIndexer = $searchIndexer; + $this->projectDataRepository = $projectDataRepository; + $this->projectRepository = $projectRepository; + $this->projectGitSyncer = $projectGitSyncer; + $this->apiBuilder = $apiBuilder; + $this->rstLanguagesDetector = $rstLanguagesDetector; + $this->rstBuilder = $rstBuilder; + $this->searchIndexer = $searchIndexer; } public function build( @@ -63,9 +69,19 @@ class BuildDocs $this->searchIndexer->initSearchIndex(); } + foreach ($this->projectDataRepository->getProjectRepositoryNames() as $repositoryName) { + if ($this->projectGitSyncer->isRepositoryInitialized($repositoryName)) { + continue; + } + + $output->writeln(sprintf('Initializing %s repository', $repositoryName)); + + $this->projectGitSyncer->initRepository($repositoryName); + } + $projects = $this->projectRepository->findAll(); - $this->initRepositories($projects); + $this->initDocsRepositories($output, $projects); $projectsToBuild = $this->getProjectsToBuild($projects, $projectToBuild); @@ -130,18 +146,22 @@ class BuildDocs /** * @param Project[] $projects */ - private function initRepositories(array $projects) : void + private function initDocsRepositories(OutputInterface $output, array $projects) : void { - foreach ($this->projectRepository->getProjectRepositoryNames() as $repositoryName) { - $this->projectGitSyncer->initRepository($repositoryName); - } - foreach ($projects as $project) { if ($project->getRepositoryName() === $project->getDocsRepositoryName()) { continue; } - $this->projectGitSyncer->initRepository($project->getDocsRepositoryName()); + $repositoryName = $project->getDocsRepositoryName(); + + if ($this->projectGitSyncer->isRepositoryInitialized($repositoryName)) { + continue; + } + + $output->writeln(sprintf('Initializing %s repository', $repositoryName)); + + $this->projectGitSyncer->initRepository($repositoryName); } } diff --git a/lib/Docs/RST/RSTBuilder.php b/lib/Docs/RST/RSTBuilder.php index 47c318c..1861d4a 100644 --- a/lib/Docs/RST/RSTBuilder.php +++ b/lib/Docs/RST/RSTBuilder.php @@ -6,8 +6,8 @@ namespace Doctrine\Website\Docs\RST; use Doctrine\RST\Builder; use Doctrine\RST\Document; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Symfony\Component\Filesystem\Filesystem; class RSTBuilder diff --git a/lib/Docs/RST/RSTCopier.php b/lib/Docs/RST/RSTCopier.php index 7ba3f63..bcee541 100644 --- a/lib/Docs/RST/RSTCopier.php +++ b/lib/Docs/RST/RSTCopier.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Docs\RST; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Symfony\Component\Filesystem\Filesystem; use function file_exists; use function preg_replace; diff --git a/lib/Docs/RST/RSTLanguagesDetector.php b/lib/Docs/RST/RSTLanguagesDetector.php index 26aef3f..8cfb5d9 100644 --- a/lib/Docs/RST/RSTLanguagesDetector.php +++ b/lib/Docs/RST/RSTLanguagesDetector.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Docs\RST; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\SplFileInfo; use function array_map; diff --git a/lib/Docs/RST/RSTPostBuildProcessor.php b/lib/Docs/RST/RSTPostBuildProcessor.php index df68855..043aae8 100644 --- a/lib/Docs/RST/RSTPostBuildProcessor.php +++ b/lib/Docs/RST/RSTPostBuildProcessor.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Docs\RST; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Symfony\Component\Filesystem\Filesystem; use function preg_match; use function preg_replace; diff --git a/lib/Docs/SearchIndexer.php b/lib/Docs/SearchIndexer.php index af52d64..536f26e 100644 --- a/lib/Docs/SearchIndexer.php +++ b/lib/Docs/SearchIndexer.php @@ -10,8 +10,8 @@ use Doctrine\RST\Document; use Doctrine\RST\HTML\Nodes\ParagraphNode; use Doctrine\RST\HTML\Nodes\TitleNode; use Doctrine\RST\Nodes\Node; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use function get_class; use function in_array; use function md5; diff --git a/lib/Github/GithubProjectContributors.php b/lib/Github/GithubProjectContributors.php new file mode 100644 index 0000000..6f26d01 --- /dev/null +++ b/lib/Github/GithubProjectContributors.php @@ -0,0 +1,49 @@ +filesystemCache = $filesystemCache; + $this->githubClient = $githubClient; + } + + /** + * @return mixed[] + */ + public function getProjectContributors(Project $project) : array + { + $id = sprintf('doctrine-%s-contributors-data', $project->getSlug()); + + if ($this->filesystemCache->contains($id)) { + return $this->filesystemCache->fetch($id); + } + + /** @var Repo $repo */ + $repo = $this->githubClient->api('repo'); + + $contributors = $repo->statistics('doctrine', $project->getRepositoryName()); + + $this->filesystemCache->save($id, $contributors, 86400); + + return $contributors; + } +} diff --git a/lib/Blog/BlogPost.php b/lib/Model/BlogPost.php similarity index 56% rename from lib/Blog/BlogPost.php rename to lib/Model/BlogPost.php index 7283413..c76cf93 100644 --- a/lib/Blog/BlogPost.php +++ b/lib/Model/BlogPost.php @@ -2,11 +2,15 @@ declare(strict_types=1); -namespace Doctrine\Website\Blog; +namespace Doctrine\Website\Model; use DateTimeImmutable; +use Doctrine\SkeletonMapper\Hydrator\HydratableInterface; +use Doctrine\SkeletonMapper\Mapping\ClassMetadataInterface; +use Doctrine\SkeletonMapper\Mapping\LoadMetadataInterface; +use Doctrine\SkeletonMapper\ObjectManagerInterface; -class BlogPost +class BlogPost implements HydratableInterface, LoadMetadataInterface { /** @var string */ private $url; @@ -42,6 +46,24 @@ class BlogPost $this->date = $date; } + public static function loadMetadata(ClassMetadataInterface $metadata) : void + { + $metadata->setIdentifier(['url']); + } + + /** + * @param mixed[] $project + */ + public function hydrate(array $project, ObjectManagerInterface $objectManager) : void + { + $this->url = (string) $project['url'] ?? ''; + $this->title = (string) $project['title'] ?? ''; + $this->authorName = (string) $project['authorName'] ?? ''; + $this->authorEmail = (string) $project['authorEmail'] ?? ''; + $this->contents = (string) $project['contents'] ?? ''; + $this->date = $project['date'] ?? new DateTimeImmutable(); + } + public function getUrl() : string { return $this->url; diff --git a/lib/Model/Contributor.php b/lib/Model/Contributor.php new file mode 100644 index 0000000..457070a --- /dev/null +++ b/lib/Model/Contributor.php @@ -0,0 +1,91 @@ +setIdentifier(['github']); + } + + /** + * @param mixed[] $contributor + */ + public function hydrate(array $contributor, ObjectManagerInterface $objectManager) : void + { + $this->teamMember = $contributor['teamMember'] ?? null; + $this->github = (string) ($contributor['github'] ?? ''); + $this->avatarUrl = (string) ($contributor['avatarUrl'] ?? ''); + $this->numCommits = (int) ($contributor['numCommits'] ?? 0); + $this->numAdditions = (int) ($contributor['numAdditions'] ?? 0); + $this->numDeletions = (int) ($contributor['numDeletions'] ?? 0); + $this->projects = $contributor['projects'] ?? []; + } + + public function getTeamMember() : ?TeamMember + { + return $this->teamMember; + } + + public function getGithub() : string + { + return $this->github; + } + + public function getAvatarUrl() : string + { + return $this->avatarUrl; + } + + public function getNumCommits() : int + { + return $this->numCommits; + } + + public function getNumAdditions() : int + { + return $this->numAdditions; + } + + public function getNumDeletions() : int + { + return $this->numDeletions; + } + + /** + * @return Project[] + */ + public function getProjects() : array + { + return $this->projects; + } +} diff --git a/lib/Model/DoctrineUser.php b/lib/Model/DoctrineUser.php new file mode 100644 index 0000000..4cf1da8 --- /dev/null +++ b/lib/Model/DoctrineUser.php @@ -0,0 +1,43 @@ +setIdentifier(['name']); + } + + /** + * @param mixed[] $doctrineUser + */ + public function hydrate(array $doctrineUser, ObjectManagerInterface $objectManager) : void + { + $this->name = (string) $doctrineUser['name']; + $this->url = (string) $doctrineUser['url']; + } + + public function getName() : string + { + return $this->name; + } + + public function getUrl() : string + { + return $this->url; + } +} diff --git a/lib/Projects/Project.php b/lib/Model/Project.php similarity index 81% rename from lib/Projects/Project.php rename to lib/Model/Project.php index 6b49ca6..cfe3df2 100644 --- a/lib/Projects/Project.php +++ b/lib/Model/Project.php @@ -2,16 +2,23 @@ declare(strict_types=1); -namespace Doctrine\Website\Projects; +namespace Doctrine\Website\Model; use Closure; +use Doctrine\SkeletonMapper\Hydrator\HydratableInterface; +use Doctrine\SkeletonMapper\Mapping\ClassMetadataInterface; +use Doctrine\SkeletonMapper\Mapping\LoadMetadataInterface; +use Doctrine\SkeletonMapper\ObjectManagerInterface; use InvalidArgumentException; use function array_filter; use function array_values; use function sprintf; -class Project +class Project implements HydratableInterface, LoadMetadataInterface { + /** @var ProjectIntegrationType|null */ + private $projectIntegrationType; + /** @var bool */ private $active; @@ -67,6 +74,27 @@ class Project * @param mixed[] $project */ public function __construct(array $project) + { + $this->doHydrate($project); + } + + public static function loadMetadata(ClassMetadataInterface $metadata) : void + { + $metadata->setIdentifier(['slug']); + } + + /** + * @param mixed[] $project + */ + public function hydrate(array $project, ObjectManagerInterface $objectManager) : void + { + $this->doHydrate($project); + } + + /** + * @param mixed[] $project + */ + public function doHydrate(array $project) : void { $this->active = (bool) ($project['active'] ?? true); $this->archived = (bool) ($project['archived'] ?? false); @@ -76,9 +104,9 @@ class Project $this->docsSlug = (string) ($project['docsSlug'] ?? $this->slug); $this->composerPackageName = (string) ($project['composerPackageName'] ?? ''); $this->repositoryName = (string) ($project['repositoryName'] ?? ''); - $this->hasDocs = $project['hasDocs'] ?? true; - $this->isIntegration = $project['isIntegration'] ?? false; - $this->integrationFor = $project['integrationFor'] ?? ''; + $this->hasDocs = (bool) ($project['hasDocs'] ?? true); + $this->isIntegration = (bool) ($project['integration'] ?? false); + $this->integrationFor = (string) ($project['integrationFor'] ?? ''); $this->docsRepositoryName = (string) ($project['docsRepositoryName'] ?? $this->repositoryName); $this->docsPath = (string) ($project['docsPath'] ?? '/docs'); $this->codePath = (string) ($project['codePath'] ?? '/lib'); @@ -94,6 +122,17 @@ class Project ? $version : new ProjectVersion($version); } + + if (! $this->isIntegration) { + return; + } + + $this->projectIntegrationType = new ProjectIntegrationType($project['integrationType']); + } + + public function getProjectIntegrationType() : ?ProjectIntegrationType + { + return $this->projectIntegrationType; } public function isActive() : bool diff --git a/lib/Model/ProjectContributor.php b/lib/Model/ProjectContributor.php new file mode 100644 index 0000000..6fd101d --- /dev/null +++ b/lib/Model/ProjectContributor.php @@ -0,0 +1,102 @@ +setIdentifier(['projectSlug', 'github']); + } + + /** + * @param mixed[] $projectContributor + */ + public function hydrate(array $projectContributor, ObjectManagerInterface $objectManager) : void + { + $this->teamMember = $projectContributor['teamMember'] ?? null; + $this->projectSlug = (string) ($projectContributor['projectSlug'] ?? ''); + $this->project = $projectContributor['project'] ?? new Project([]); + $this->github = (string) ($projectContributor['github'] ?? ''); + $this->avatarUrl = (string) ($projectContributor['avatarUrl'] ?? ''); + $this->numCommits = (int) ($projectContributor['numCommits'] ?? 0); + $this->numAdditions = (int) ($projectContributor['numAdditions'] ?? 0); + $this->numDeletions = (int) ($projectContributor['numDeletions'] ?? 0); + } + + public function getTeamMember() : ?TeamMember + { + return $this->teamMember; + } + + public function isTeamMember() : bool + { + return $this->teamMember !== null; + } + + public function getProjectSlug() : string + { + return $this->projectSlug; + } + + public function getProject() : Project + { + return $this->project; + } + + public function getGithub() : string + { + return $this->github; + } + + public function getAvatarUrl() : string + { + return $this->avatarUrl; + } + + public function getNumCommits() : int + { + return $this->numCommits; + } + + public function getNumAdditions() : int + { + return $this->numAdditions; + } + + public function getNumDeletions() : int + { + return $this->numDeletions; + } +} diff --git a/lib/Projects/ProjectIntegrationType.php b/lib/Model/ProjectIntegrationType.php similarity index 63% rename from lib/Projects/ProjectIntegrationType.php rename to lib/Model/ProjectIntegrationType.php index 88d2a3e..ba9d883 100644 --- a/lib/Projects/ProjectIntegrationType.php +++ b/lib/Model/ProjectIntegrationType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Doctrine\Website\Projects; +namespace Doctrine\Website\Model; class ProjectIntegrationType { @@ -16,13 +16,13 @@ class ProjectIntegrationType private $icon; /** - * @param string[] $projectIntegrationType + * @param mixed[] $projectIntegrationType */ public function __construct(array $projectIntegrationType) { - $this->name = $projectIntegrationType['name'] ?? ''; - $this->url = $projectIntegrationType['url'] ?? ''; - $this->icon = $projectIntegrationType['icon'] ?? ''; + $this->name = (string) ($projectIntegrationType['name'] ?? ''); + $this->url = (string) ($projectIntegrationType['url'] ?? ''); + $this->icon = (string) ($projectIntegrationType['icon'] ?? ''); } public function getName() : string diff --git a/lib/Projects/ProjectVersion.php b/lib/Model/ProjectVersion.php similarity index 97% rename from lib/Projects/ProjectVersion.php rename to lib/Model/ProjectVersion.php index b820c7b..1ea4a48 100644 --- a/lib/Projects/ProjectVersion.php +++ b/lib/Model/ProjectVersion.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Doctrine\Website\Projects; +namespace Doctrine\Website\Model; use function array_merge; diff --git a/lib/Model/SitemapPage.php b/lib/Model/SitemapPage.php new file mode 100644 index 0000000..ce13f00 --- /dev/null +++ b/lib/Model/SitemapPage.php @@ -0,0 +1,50 @@ +url = $url; + $this->date = $date; + } + + public static function loadMetadata(ClassMetadataInterface $metadata) : void + { + $metadata->setIdentifier(['url']); + } + + /** + * @param mixed[] $sitemapPage + */ + public function hydrate(array $sitemapPage, ObjectManagerInterface $objectManager) : void + { + $this->url = (string) ($sitemapPage['url'] ?? ''); + $this->date = $sitemapPage['date'] ?? new DateTimeImmutable(); + } + + public function getUrl() : string + { + return $this->url; + } + + public function getDate() : DateTimeImmutable + { + return $this->date; + } +} diff --git a/lib/Model/TeamMember.php b/lib/Model/TeamMember.php new file mode 100644 index 0000000..7161530 --- /dev/null +++ b/lib/Model/TeamMember.php @@ -0,0 +1,89 @@ +setIdentifier(['github']); + } + + /** + * @param mixed[] $teamMember + */ + public function hydrate(array $teamMember, ObjectManagerInterface $objectManager) : void + { + $this->name = (string) ($teamMember['name'] ?? ''); + $this->github = (string) ($teamMember['github'] ?? ''); + $this->twitter = (string) ($teamMember['twitter'] ?? ''); + $this->avatarUrl = (string) ($teamMember['avatarUrl'] ?? ''); + $this->website = (string) ($teamMember['website'] ?? ''); + $this->location = (string) ($teamMember['location'] ?? ''); + $this->maintains = $teamMember['maintains'] ?? []; + } + + public function getName() : string + { + return $this->name; + } + + public function getGithub() : string + { + return $this->github; + } + + public function getTwitter() : string + { + return $this->twitter; + } + + public function getAvatarUrl() : string + { + return $this->avatarUrl; + } + + public function getWebsite() : string + { + return $this->website; + } + + public function getLocation() : string + { + return $this->location; + } + + public function isProjectMaintainer(Project $project) : bool + { + return in_array($project->getSlug(), $this->maintains, true); + } +} diff --git a/lib/Projects/ProjectDataReader.php b/lib/Projects/ProjectDataReader.php index 54b8eae..22d22c1 100644 --- a/lib/Projects/ProjectDataReader.php +++ b/lib/Projects/ProjectDataReader.php @@ -59,7 +59,7 @@ class ProjectDataReader $this->readJsonFile($repositoryName, self::DOCTRINE_PROJECT_JSON_FILE_NAME) ); - if (isset($projectData['isIntegration']) && $projectData['isIntegration'] === true) { + if (isset($projectData['integration']) && $projectData['integration'] === true) { if (! isset($projectData['integrationType'])) { throw new InvalidArgumentException(sprintf( 'Project integration %s requires a type.', @@ -78,6 +78,10 @@ class ProjectDataReader $projectData['integrationType'] = $this->projectIntegrationTypes[$projectData['integrationType']]; } + if (! isset($projectData['docsSlug'])) { + $projectData['docsSlug'] = $projectData['slug']; + } + return $projectData; } diff --git a/lib/Projects/ProjectDataRepository.php b/lib/Projects/ProjectDataRepository.php new file mode 100644 index 0000000..b821764 --- /dev/null +++ b/lib/Projects/ProjectDataRepository.php @@ -0,0 +1,33 @@ +projectsData = $projectsData; + } + + /** + * @return string[] + */ + public function getProjectRepositoryNames() : array + { + $projectRepositoryNames = []; + + foreach ($this->projectsData as $projectData) { + $projectRepositoryNames[] = $projectData['repositoryName']; + } + + return $projectRepositoryNames; + } +} diff --git a/lib/Projects/ProjectFactory.php b/lib/Projects/ProjectFactory.php deleted file mode 100644 index 9309338..0000000 --- a/lib/Projects/ProjectFactory.php +++ /dev/null @@ -1,27 +0,0 @@ -projectDataReader = $projectDataReader; - } - - public function create(string $repositoryName) : Project - { - $projectData = $this->projectDataReader->read($repositoryName); - - if (isset($projectData['isIntegration']) && $projectData['isIntegration'] === true) { - return new ProjectIntegration($projectData); - } - - return new Project($projectData); - } -} diff --git a/lib/Projects/ProjectGitSyncer.php b/lib/Projects/ProjectGitSyncer.php index 4710d55..a9e8401 100644 --- a/lib/Projects/ProjectGitSyncer.php +++ b/lib/Projects/ProjectGitSyncer.php @@ -4,6 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Projects; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\ProcessFactory; use function is_dir; use function sprintf; @@ -22,6 +24,11 @@ class ProjectGitSyncer $this->projectsPath = $projectsPath; } + public function isRepositoryInitialized(string $repositoryName) : bool + { + return is_dir($this->projectsPath . '/' . $repositoryName); + } + public function initRepository(string $repositoryName) : void { $repositoryPath = $this->projectsPath . '/' . $repositoryName; diff --git a/lib/Projects/ProjectIntegration.php b/lib/Projects/ProjectIntegration.php deleted file mode 100644 index 4fe0613..0000000 --- a/lib/Projects/ProjectIntegration.php +++ /dev/null @@ -1,36 +0,0 @@ -getName() - )); - } - - $this->type = new ProjectIntegrationType($project['integrationType']); - } - - public function getType() : ProjectIntegrationType - { - return $this->type; - } -} diff --git a/lib/Projects/ProjectRepository.php b/lib/Projects/ProjectRepository.php deleted file mode 100644 index 626085c..0000000 --- a/lib/Projects/ProjectRepository.php +++ /dev/null @@ -1,134 +0,0 @@ -projectsData = $projectsData; - $this->projectFactory = $projectFactory; - } - - /** - * @return string[] - */ - public function getProjectRepositoryNames() : array - { - $projectRepositoryNames = []; - - foreach ($this->projectsData as $projectData) { - $projectRepositoryNames[] = $projectData['repositoryName']; - } - - return $projectRepositoryNames; - } - - public function findOneBySlug(string $slug) : Project - { - $this->init(); - - foreach ($this->projects as $project) { - if ($project->getSlug() === $slug || $project->getDocsSlug() === $slug) { - return $project; - } - } - - throw new InvalidArgumentException(sprintf('Could not find Project with slug "%s"', $slug)); - } - - /** - * @return Project[] - */ - public function findAll() : array - { - $this->init(); - - return $this->projects; - } - - /** - * @return Project[] - */ - public function findPrimaryProjects() : array - { - return array_filter($this->findAll(), static function (Project $project) : bool { - return $project->isActive() && ! $project->isIntegration(); - }); - } - - /** - * @return Project[] - */ - public function findInactiveProjects() : array - { - return array_filter($this->findAll(), static function (Project $project) : bool { - return ! $project->isActive() && ! $project->isArchived(); - }); - } - - /** - * @return Project[] - */ - public function findArchivedProjects() : array - { - return array_filter($this->findAll(), static function (Project $project) : bool { - return ! $project->isActive() && $project->isArchived(); - }); - } - - /** - * @return Project[] - */ - public function findIntegrationProjects() : array - { - return array_filter($this->findAll(), static function (Project $project) : bool { - return $project->isActive() && $project->isIntegration(); - }); - } - - /** - * @return Project[] - */ - public function findProjectIntegrations(Project $project) : array - { - return array_filter($this->findAll(), static function (Project $p) use ($project) : bool { - return $p->isIntegration() && $p->getIntegrationFor() === $project->getSlug(); - }); - } - - private function init() : void - { - if ($this->projects !== []) { - return; - } - - $this->projects = array_map(function (array $projectData) : Project { - return $this->projectFactory->create($projectData['repositoryName']); - }, $this->projectsData); - - usort($this->projects, static function (Project $a, Project $b) { - return $a->getName() <=> $b->getName(); - }); - } -} diff --git a/lib/Repositories/BlogPostRepository.php b/lib/Repositories/BlogPostRepository.php new file mode 100644 index 0000000..6d6ee55 --- /dev/null +++ b/lib/Repositories/BlogPostRepository.php @@ -0,0 +1,34 @@ +findBy([], ['date' => 'desc']); + } + + /** + * @return BlogPost[] + */ + public function findPaginated(int $page = 1, int $perPage = 10) : array + { + if ($page < 1 || $perPage < 1) { + throw new InvalidArgumentException('Pagination parameters must be positive.'); + } + + $offset = ($page - 1) * $perPage; + + return $this->findBy([], ['date' => 'desc'], $perPage, $offset); + } +} diff --git a/lib/Repositories/ContributorRepository.php b/lib/Repositories/ContributorRepository.php new file mode 100644 index 0000000..34ce719 --- /dev/null +++ b/lib/Repositories/ContributorRepository.php @@ -0,0 +1,27 @@ +findBy(['isTeamMember' => true], ['github' => 'asc']); + } + + /** + * @return Contributor[] + */ + public function findContributors() : array + { + return $this->findBy(['isTeamMember' => false], ['github' => 'asc']); + } +} diff --git a/lib/Repositories/DoctrineUserRepository.php b/lib/Repositories/DoctrineUserRepository.php new file mode 100644 index 0000000..c5001b2 --- /dev/null +++ b/lib/Repositories/DoctrineUserRepository.php @@ -0,0 +1,22 @@ +findBy([], ['github' => 'asc']); + + return $projectContributors; + } + + /** + * @return ProjectContributor[] + */ + public function findMaintainersByProject(Project $project) : array + { + return $this->findBy([ + 'isMaintainer' => true, + 'projectSlug' => $project->getSlug(), + ], ['github' => 'asc']); + } + + /** + * @return ProjectContributor[] + */ + public function findContributorsByProject(Project $project) : array + { + return $this->findBy([ + 'isMaintainer' => false, + 'projectSlug' => $project->getSlug(), + ], ['github' => 'asc']); + } +} diff --git a/lib/Repositories/ProjectRepository.php b/lib/Repositories/ProjectRepository.php new file mode 100644 index 0000000..dab1542 --- /dev/null +++ b/lib/Repositories/ProjectRepository.php @@ -0,0 +1,90 @@ +findOneBy(['docsSlug' => $docsSlug]); + + if ($project === null) { + throw new InvalidArgumentException(sprintf('Could not find Project with docsSlug "%s"', $docsSlug)); + } + + return $project; + } + + /** + * @return Project[] + */ + public function findPrimaryProjects() : array + { + return $this->findBy([ + 'active' => true, + 'integration' => false, + ], ['name' => 'asc']); + } + + /** + * @return Project[] + */ + public function findInactiveProjects() : array + { + return $this->findBy([ + 'active' => false, + 'archived' => false, + ], ['name' => 'asc']); + } + + /** + * @return Project[] + */ + public function findArchivedProjects() : array + { + return $this->findBy([ + 'active' => false, + 'archived' => true, + ], ['name' => 'asc']); + } + + /** + * @return Project[] + */ + public function findIntegrationProjects() : array + { + return $this->findBy([ + 'active' => true, + 'integration' => true, + ], ['name' => 'asc']); + } + + /** + * @return Project[] + */ + public function findProjectIntegrations(Project $project) : array + { + return $this->findBy([ + 'integration' => true, + 'integrationFor' => $project->getSlug(), + ], ['name' => 'asc']); + } +} diff --git a/lib/Repositories/SitemapPageRepository.php b/lib/Repositories/SitemapPageRepository.php new file mode 100644 index 0000000..3e3dcf3 --- /dev/null +++ b/lib/Repositories/SitemapPageRepository.php @@ -0,0 +1,22 @@ +findBy([], ['url' => 'asc']); + + return $sitemapPages; + } +} diff --git a/lib/Repositories/TeamMemberRepository.php b/lib/Repositories/TeamMemberRepository.php new file mode 100644 index 0000000..b74e8d8 --- /dev/null +++ b/lib/Repositories/TeamMemberRepository.php @@ -0,0 +1,16 @@ +findOneBy(['github' => $github]); + } +} diff --git a/lib/Sitemap/SitemapPage.php b/lib/Sitemap/SitemapPage.php deleted file mode 100644 index e13fc10..0000000 --- a/lib/Sitemap/SitemapPage.php +++ /dev/null @@ -1,32 +0,0 @@ -url = $url; - $this->date = $date; - } - - public function getUrl() : string - { - return $this->url; - } - - public function getDate() : DateTimeImmutable - { - return $this->date; - } -} diff --git a/lib/Team/TeamRepository.php b/lib/Team/TeamRepository.php deleted file mode 100644 index 6dc131d..0000000 --- a/lib/Team/TeamRepository.php +++ /dev/null @@ -1,119 +0,0 @@ -teamMembers = $teamMembers; - } - - /** - * @return mixed[] - */ - public function getTeamMembers(?Closure $filter = null) : array - { - $teamMembers = []; - - foreach ($this->teamMembers as $key => $teamMember) { - $name = $teamMember['name'] ?? $key; - - $teamMembers[$name] = $teamMember; - } - - if ($filter !== null) { - $teamMembers = array_filter($teamMembers, $filter); - } - - ksort($teamMembers); - - return $teamMembers; - } - - /** - * @return mixed[] - */ - public function getActiveCoreTeamMembers() : array - { - return $this->getTeamMembers(static function (array $teamMember) { - $active = $teamMember['active'] ?? false; - $core = $teamMember['core'] ?? false; - - return $active && $core; - }); - } - - /** - * @return mixed[] - */ - public function getActiveDocumentationTeamMembers() : array - { - return $this->getTeamMembers(static function (array $teamMember) { - $active = $teamMember['active'] ?? false; - $documentation = $teamMember['documentation'] ?? false; - - return $active && $documentation; - }); - } - - /** - * @return mixed[] - */ - public function getInactiveTeamMembers() : array - { - return $this->getTeamMembers(static function (array $teamMember) { - $active = $teamMember['active'] ?? false; - - return $active === false; - }); - } - - /** - * @return mixed[] - */ - public function getAllProjectTeamMembers(Project $project) : array - { - return $this->getTeamMembers(static function (array $teamMember) use ($project) { - return in_array($project->getSlug(), $teamMember['projects'] ?? [], true); - }); - } - - /** - * @return mixed[] - */ - public function getActiveProjectTeamMembers(Project $project) : array - { - return $this->getTeamMembers(static function (array $teamMember) use ($project) { - $active = $teamMember['active'] ?? false; - - return $active && in_array($project->getSlug(), $teamMember['projects'] ?? [], true); - }); - } - - /** - * @return mixed[] - */ - public function getInactiveProjectTeamMembers(Project $project) : array - { - return $this->getTeamMembers(static function (array $teamMember) use ($project) { - $active = $teamMember['active'] ?? false; - - return ! $active && in_array($project->getSlug(), $teamMember['projects'] ?? [], true); - }); - } -} diff --git a/lib/Twig/MainExtension.php b/lib/Twig/MainExtension.php index 5746e74..3c581cc 100644 --- a/lib/Twig/MainExtension.php +++ b/lib/Twig/MainExtension.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Doctrine\Website\Twig; use Doctrine\Website\Assets\AssetIntegrityGenerator; -use Doctrine\Website\Projects\Project; +use Doctrine\Website\Model\Project; use Parsedown; use Twig_Extension; use Twig_SimpleFilter; diff --git a/lib/Twig/ProjectExtension.php b/lib/Twig/ProjectExtension.php index fedb675..6e18887 100644 --- a/lib/Twig/ProjectExtension.php +++ b/lib/Twig/ProjectExtension.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Doctrine\Website\Twig; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; +use Doctrine\Website\Repositories\ProjectRepository; use Twig_Extension; use Twig_SimpleFunction; use function file_exists; @@ -39,9 +39,9 @@ class ProjectExtension extends Twig_Extension ]; } - public function getProject(string $slug) : Project + public function getProject(string $docsSlug) : Project { - return $this->projectRepository->findOneBySlug($slug); + return $this->projectRepository->findOneByDocsSlug($docsSlug); } public function getUrlVersion(ProjectVersion $projectVersion, string $url, string $currentVersion) : ?string diff --git a/lib/WebsiteBuilder.php b/lib/WebsiteBuilder.php index 81ec903..e163d22 100644 --- a/lib/WebsiteBuilder.php +++ b/lib/WebsiteBuilder.php @@ -6,9 +6,9 @@ namespace Doctrine\Website; use Doctrine\Website\Builder\SourceFileBuilder; use Doctrine\Website\Builder\SourceFileRepository; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; +use Doctrine\Website\Repositories\ProjectRepository; use RuntimeException; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; @@ -122,7 +122,7 @@ class WebsiteBuilder throw new RuntimeException(sprintf( 'Failed building file "%s" with error "%s', $file->getWritePath(), - $e->getMessage() + $e->getMessage() . "\n\n" . $e->getTraceAsString() )); } } @@ -130,6 +130,7 @@ class WebsiteBuilder private function createProjectVersionAliases(string $buildDir) : void { + /** @var Project[] $projects */ $projects = $this->projectRepository->findAll(); foreach ($projects as $project) { diff --git a/source/index.html b/source/index.html index 546cb40..7c2d2f1 100644 --- a/source/index.html +++ b/source/index.html @@ -70,13 +70,13 @@ controller: ['Doctrine\Website\Controllers\HomepageController', 'index']

Many other popular PHP projects use libraries from Doctrine. Some use the full ORM and others may only use one small library such as the Inflector. Here are some projects that use Doctrine.

- {% for batch in whoUsesDoctrine|batch(3, 'and many more…') %} + {% for batch in doctrineUsers|batch(3, 'and many more…') %} - {% for project in batch %} - {% if project.url is defined %} - + {% for doctrineUser in batch %} + {% if doctrineUser.url is defined %} + {% else %} - + {% endif %} {% endfor %} diff --git a/source/team.html b/source/team.html deleted file mode 100644 index b1bb808..0000000 --- a/source/team.html +++ /dev/null @@ -1,23 +0,0 @@ ---- -layout: default -title: Doctrine Team -menuSlug: team -permalink: /team/index.html -controller: ['Doctrine\Website\Controllers\TeamController', 'index'] ---- - -

Core Team

- -
- {% include "team-members-list.html.twig" with {members:activeCoreTeamMembers} %} -
- -

Documentation Team

- -
- {% include "team-members-list.html.twig" with {members:activeDocumentationTeamMembers} %} -
- -

Inactive

- -{% include "team-members-short-list.html.twig" with {members:inactiveTeamMembers} %} diff --git a/source/team/contributors.html b/source/team/contributors.html new file mode 100644 index 0000000..ce6121e --- /dev/null +++ b/source/team/contributors.html @@ -0,0 +1,18 @@ +--- +layout: default +title: Doctrine Contributors +menuSlug: team +permalink: /team/contributors.html +controller: ['Doctrine\Website\Controllers\TeamController', 'contributors'] +--- + +

Contributors

+ +

+ In addition to the core maintainers, Doctrine has received contributions from {{ contributors|length }} + different people from all over the world. Could you be the next contributor? Head on over to the + Contributor Workflow to learn how to + contribute to your favorite Doctrine project today! +

+ +{% include "contributors-list.html.twig" with {contributors:contributors} %} diff --git a/source/team/maintainers.html b/source/team/maintainers.html new file mode 100644 index 0000000..7bbf4b9 --- /dev/null +++ b/source/team/maintainers.html @@ -0,0 +1,17 @@ +--- +layout: default +title: Doctrine Maintainers +menuSlug: team +permalink: /team/maintainers.html +controller: ['Doctrine\Website\Controllers\TeamController', 'maintainers'] +--- + +

Maintainers

+ +

+ Doctrine is maintained by a core group of {{ contributors|length }} developers. Each maintainer has + their own areas of responsibilities and together we are able to keep the various Doctrine projects + moving forward as the PHP ecosystem evolves. +

+ +{% include "maintainers-list.html.twig" with {contributors:contributors} %} diff --git a/templates/contributors-list.html.twig b/templates/contributors-list.html.twig new file mode 100644 index 0000000..e5d2c6d --- /dev/null +++ b/templates/contributors-list.html.twig @@ -0,0 +1,27 @@ +
    + {% for contributor in contributors %} +
  • + + + + {{ contributor.github }} + + + {% if contributor.teamMember %} +
      + {% if contributor.teamMember.twitter %} +
    • + {% endif %} + + {% if contributor.teamMember.website %} +
    • + {% endif %} + + {% if contributor.teamMember.github %} +
    • + {% endif %} +
    + {% endif %} +
  • + {% endfor %} +
diff --git a/templates/layouts/layout.html.twig b/templates/layouts/layout.html.twig index 162ce98..7d21317 100644 --- a/templates/layouts/layout.html.twig +++ b/templates/layouts/layout.html.twig @@ -184,8 +184,13 @@ - diff --git a/templates/layouts/project.html.twig b/templates/layouts/project.html.twig index 45896b7..4d9c42e 100644 --- a/templates/layouts/project.html.twig +++ b/templates/layouts/project.html.twig @@ -78,26 +78,15 @@ {% include "projects-short-list.html.twig" with {projects:integrationProjects} %} {% endif %} - {% if project.archived or not project.active %} - {% if allTeamMembers %} -

Team

+ {% if maintainers|length > 0 %} +

Maintainers

- {% include "team-members-short-list.html.twig" with {members:allTeamMembers} %} - {% endif %} + {% include "maintainers-list.html.twig" with {contributors:maintainers} %} + {% endif %} - {% else %} - - {% if activeTeamMembers %} -

Team

- - {% include "team-members-short-list.html.twig" with {members:activeTeamMembers} %} - {% endif %} - - {% if inactiveTeamMembers %} -

Inactive

- - {% include "team-members-short-list.html.twig" with {members:inactiveTeamMembers} %} - {% endif %} + {% if contributors|length > 0 %} +

Contributors

+ {% include "contributors-list.html.twig" with {contributors:contributors} %} {% endif %} {% endblock %} diff --git a/templates/maintainers-list.html.twig b/templates/maintainers-list.html.twig new file mode 100644 index 0000000..9934a62 --- /dev/null +++ b/templates/maintainers-list.html.twig @@ -0,0 +1,33 @@ + diff --git a/templates/projects-short-list.html.twig b/templates/projects-short-list.html.twig index d669da3..e57af5a 100644 --- a/templates/projects-short-list.html.twig +++ b/templates/projects-short-list.html.twig @@ -3,7 +3,7 @@
  • {% if project.isIntegration %} - + {% endif %} {{ project.name }} diff --git a/templates/team-members-list.html.twig b/templates/team-members-list.html.twig deleted file mode 100644 index 886e498..0000000 --- a/templates/team-members-list.html.twig +++ /dev/null @@ -1,26 +0,0 @@ -{% for member in members %} -
    -
    - {{ member.name }} -
    -
    {{ member.name ?? member.github }}
    - -
    -
      - {% if member.twitter is defined and member.twitter %} -
    • - {% endif %} - - {% if member.website is defined and member.website %} -
    • - {% endif %} - - {% if member.github is defined and member.github %} -
    • - {% endif %} -
    -
    -
    -
    -
    -{% endfor %} diff --git a/templates/team-members-short-list.html.twig b/templates/team-members-short-list.html.twig deleted file mode 100644 index f4f6859..0000000 --- a/templates/team-members-short-list.html.twig +++ /dev/null @@ -1,22 +0,0 @@ -
      - {% for member in members %} -
    • - - {{ member.name ?? member.github }}{% if member.name %} ({{ member.github }}){% endif %} - -
        - {% if member.twitter is defined and member.twitter %} -
      • - {% endif %} - - {% if member.website is defined and member.website %} -
      • - {% endif %} - - {% if member.github is defined and member.github %} -
      • - {% endif %} -
      -
    • - {% endfor %} -
    diff --git a/tests/Blog/BlogPostRepositoryTest.php b/tests/Blog/BlogPostRepositoryTest.php deleted file mode 100644 index 2d3290e..0000000 --- a/tests/Blog/BlogPostRepositoryTest.php +++ /dev/null @@ -1,165 +0,0 @@ - '/2018/09/01/test.html', - 'title' => 'Test Blog Post', - 'authorName' => 'Jonathan H. Wage', - 'authorEmail' => 'jonwage@gmail.com', - ]) - ); - - $blogPost = $this->blogPostRepository->find( - $sourceFile - ); - - self::assertSame('/2018/09/01/test.html', $blogPost->getUrl()); - self::assertSame('Test Blog Post', $blogPost->getTitle()); - self::assertSame('Jonathan H. Wage', $blogPost->getAuthorName()); - self::assertSame('jonwage@gmail.com', $blogPost->getAuthorEmail()); - self::assertSame('test', $blogPost->getContents()); - self::assertSame('2018-09-01', $blogPost->getDate()->format('Y-m-d')); - } - - public function testFindPaginatedPageOne() : void - { - $this->setUpFindAll(); - - $blogPosts = $this->blogPostRepository->findPaginated(1, 1); - - self::assertSame('/2018/09/02/test1.html', $blogPosts[0]->getUrl()); - self::assertSame('Test Blog Post', $blogPosts[0]->getTitle()); - self::assertSame('Jonathan H. Wage', $blogPosts[0]->getAuthorName()); - self::assertSame('jonwage@gmail.com', $blogPosts[0]->getAuthorEmail()); - self::assertSame('test1', $blogPosts[0]->getContents()); - self::assertSame('2018-09-02', $blogPosts[0]->getDate()->format('Y-m-d')); - - self::assertCount(1, $blogPosts); - } - - public function testFindPaginatedPageTwo() : void - { - $this->setUpFindAll(); - - $blogPosts = $this->blogPostRepository->findPaginated(2, 1); - - self::assertSame('/2018/09/01/test2.html', $blogPosts[0]->getUrl()); - self::assertSame('Test Blog Post', $blogPosts[0]->getTitle()); - self::assertSame('Jonathan H. Wage', $blogPosts[0]->getAuthorName()); - self::assertSame('jonwage@gmail.com', $blogPosts[0]->getAuthorEmail()); - self::assertSame('test2', $blogPosts[0]->getContents()); - self::assertSame('2018-09-01', $blogPosts[0]->getDate()->format('Y-m-d')); - - self::assertCount(1, $blogPosts); - } - - public function testFindPaginatedWithNegativePageThrowsInvalidArgumentException() : void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pagination parameters must be positive.'); - - $this->blogPostRepository->findPaginated(-1, 10); - } - - public function testFindPaginatedWithNegativePerPageThrowsInvalidArgumentException() : void - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Pagination parameters must be positive.'); - - $this->blogPostRepository->findPaginated(1, -10); - } - - public function testFindAll() : void - { - $this->setUpFindAll(); - - $blogPosts = $this->blogPostRepository->findAll(); - - self::assertCount(2, $blogPosts); - - self::assertSame('/2018/09/02/test1.html', $blogPosts[0]->getUrl()); - self::assertSame('Test Blog Post', $blogPosts[0]->getTitle()); - self::assertSame('Jonathan H. Wage', $blogPosts[0]->getAuthorName()); - self::assertSame('jonwage@gmail.com', $blogPosts[0]->getAuthorEmail()); - self::assertSame('test1', $blogPosts[0]->getContents()); - self::assertSame('2018-09-02', $blogPosts[0]->getDate()->format('Y-m-d')); - - self::assertSame('/2018/09/01/test2.html', $blogPosts[1]->getUrl()); - self::assertSame('Test Blog Post', $blogPosts[1]->getTitle()); - self::assertSame('Jonathan H. Wage', $blogPosts[1]->getAuthorName()); - self::assertSame('jonwage@gmail.com', $blogPosts[1]->getAuthorEmail()); - self::assertSame('test2', $blogPosts[1]->getContents()); - self::assertSame('2018-09-01', $blogPosts[1]->getDate()->format('Y-m-d')); - } - - protected function setUp() : void - { - $this->sourceFileRepository = $this->createMock(SourceFileRepository::class); - - $this->blogPostRepository = new BlogPostRepository( - $this->sourceFileRepository - ); - } - - private function setUpFindAll() : void - { - $sourceFile1 = new SourceFile( - 'md', - '/tmp/test1.html', - '/tmp/test1.html', - 'test1', - new SourceFileParameters([ - 'url' => '/2018/09/02/test1.html', - 'title' => 'Test Blog Post', - 'authorName' => 'Jonathan H. Wage', - 'authorEmail' => 'jonwage@gmail.com', - ]) - ); - - $sourceFile2 = new SourceFile( - 'md', - '/tmp/test.html', - '/tmp/test.html', - 'test2', - new SourceFileParameters([ - 'url' => '/2018/09/01/test2.html', - 'title' => 'Test Blog Post', - 'authorName' => 'Jonathan H. Wage', - 'authorEmail' => 'jonwage@gmail.com', - ]) - ); - - $files = [$sourceFile1, $sourceFile2]; - - $this->sourceFileRepository->expects(self::once()) - ->method('getFiles') - ->with('', 'source/blog') - ->willReturn($files); - } -} diff --git a/tests/DataSource/CriteriaMatcherTest.php b/tests/DataSource/CriteriaMatcherTest.php new file mode 100644 index 0000000..435b545 --- /dev/null +++ b/tests/DataSource/CriteriaMatcherTest.php @@ -0,0 +1,51 @@ + 'jwage'], + ['username' => 'jwage'] + ); + + self::assertTrue($criteriaMatcher->matches()); + } + + public function testEqualsFalse() : void + { + $criteriaMatcher = new CriteriaMatcher( + ['username' => 'jwage'], + ['username' => 'jonwage'] + ); + + self::assertFalse($criteriaMatcher->matches()); + } + + public function testContainsTrue() : void + { + $criteriaMatcher = new CriteriaMatcher( + ['projects' => ['$contains' => 'dbal']], + ['projects' => ['orm', 'dbal']] + ); + + self::assertTrue($criteriaMatcher->matches()); + } + + public function testContainsFalse() : void + { + $criteriaMatcher = new CriteriaMatcher( + ['projects' => ['$contains' => 'mongodb-odm']], + ['projects' => ['orm', 'dbal']] + ); + + self::assertFalse($criteriaMatcher->matches()); + } +} diff --git a/tests/DataSource/DataSourceObjectDataRepositoryTest.php b/tests/DataSource/DataSourceObjectDataRepositoryTest.php new file mode 100644 index 0000000..ecce327 --- /dev/null +++ b/tests/DataSource/DataSourceObjectDataRepositoryTest.php @@ -0,0 +1,136 @@ +objectManager = $this->createMock(ObjectManagerInterface::class); + $this->dataSource = $this->createMock(DataSource::class); + + $this->dataSourceObjectDataRepository = new DataSourceObjectDataRepository( + $this->objectManager, + $this->dataSource, + stdClass::class + ); + } + + public function testFindAll() : void + { + $rows = [ + ['row' => 1], + ['row' => 2], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals($rows, $this->dataSourceObjectDataRepository->findAll()); + } + + public function testFindByCriteria() : void + { + $rows = [ + ['username' => 'jwage'], + ['username' => 'ocramius'], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals([ + ['username' => 'ocramius'], + ], $this->dataSourceObjectDataRepository->findBy(['username' => 'ocramius'])); + } + + public function testFindByOrderBy() : void + { + $rows = [ + ['username' => 'jwage'], + ['username' => 'ocramius'], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals([ + ['username' => 'ocramius'], + ['username' => 'jwage'], + ], $this->dataSourceObjectDataRepository->findBy([], ['username' => 'desc'])); + } + + public function testFindByLimitAndOffset() : void + { + $rows = [ + ['username' => 'jwage'], + ['username' => 'ocramius'], + ['username' => 'andreas'], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals([ + ['username' => 'ocramius'], + ['username' => 'andreas'], + ], $this->dataSourceObjectDataRepository->findBy([], [], 2, 1)); + } + + public function testFindByLimit() : void + { + $rows = [ + ['username' => 'jwage'], + ['username' => 'ocramius'], + ['username' => 'andreas'], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals([ + ['username' => 'jwage'], + ], $this->dataSourceObjectDataRepository->findBy([], [], 1)); + } + + public function testFindByOffset() : void + { + $rows = [ + ['username' => 'jwage'], + ['username' => 'ocramius'], + ['username' => 'andreas'], + ]; + + $this->dataSource->expects(self::once()) + ->method('getSourceRows') + ->willReturn($rows); + + self::assertEquals([ + ['username' => 'ocramius'], + ['username' => 'andreas'], + ], $this->dataSourceObjectDataRepository->findBy([], [], null, 1)); + } +} diff --git a/tests/DataSource/SorterTest.php b/tests/DataSource/SorterTest.php new file mode 100644 index 0000000..755a422 --- /dev/null +++ b/tests/DataSource/SorterTest.php @@ -0,0 +1,189 @@ + 'asc']); + + $rows = [ + ['numComments' => 2], + ['numComments' => 1], + ]; + + usort($rows, $sorter); + + self::assertEquals([ + ['numComments' => 1], + ['numComments' => 2], + ], $rows); + } + + public function testSingleDesc() : void + { + $sorter = new Sorter(['numComments' => 'desc']); + + $rows = [ + ['numComments' => 1], + ['numComments' => 2], + ]; + + usort($rows, $sorter); + + self::assertEquals([ + ['numComments' => 2], + ['numComments' => 1], + ], $rows); + } + + public function testMultipleAsc() : void + { + $sorter = new Sorter(['numComments' => 'asc', 'name' => 'asc']); + + $rows = [ + [ + 'name' => 'Andreas', + 'numComments' => 1, + ], + [ + 'name' => 'Marco', + 'numComments' => 2, + ], + [ + 'name' => 'Jon', + 'numComments' => 2, + ], + ]; + + usort($rows, $sorter); + + self::assertEquals([ + [ + 'name' => 'Andreas', + 'numComments' => 1, + ], + [ + 'name' => 'Jon', + 'numComments' => 2, + ], + [ + 'name' => 'Marco', + 'numComments' => 2, + ], + ], $rows); + } + + public function testMultipleDesc() : void + { + $sorter = new Sorter(['numComments' => 'desc', 'name' => 'desc']); + + $rows = [ + [ + 'name' => 'Andreas', + 'numComments' => 2, + ], + [ + 'name' => 'Marco', + 'numComments' => 1, + ], + [ + 'name' => 'Jon', + 'numComments' => 1, + ], + ]; + + usort($rows, $sorter); + + self::assertEquals([ + [ + 'name' => 'Andreas', + 'numComments' => 2, + ], + [ + 'name' => 'Marco', + 'numComments' => 1, + ], + [ + 'name' => 'Jon', + 'numComments' => 1, + ], + ], $rows); + } + + public function testMultipleMixed() : void + { + $sorter = new Sorter(['numComments' => 'desc', 'name' => 'asc']); + + $rows = [ + [ + 'name' => 'Andreas', + 'numComments' => 2, + ], + [ + 'name' => 'Marco', + 'numComments' => 1, + ], + [ + 'name' => 'Jon', + 'numComments' => 1, + ], + ]; + + usort($rows, $sorter); + + self::assertEquals([ + [ + 'name' => 'Andreas', + 'numComments' => 2, + ], + [ + 'name' => 'Jon', + 'numComments' => 1, + ], + [ + 'name' => 'Marco', + 'numComments' => 1, + ], + ], $rows); + } + + public function testInvalidComparisonFieldThrowsInvalidArgumentException() : void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Unable to find comparison field username'); + + $sorter = new Sorter(['username' => 'asc']); + + $rows = [ + ['email' => 'test1@example.com'], + ['email' => 'test2@example.com'], + ]; + + usort($rows, $sorter); + } + + public function testInvalidOrderThrowsInvalidArgumentException() : void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('$order value of invalid is not accepted. Only a value of asc or desc is allowed.'); + + $sorter = new Sorter(['username' => 'invalid']); + } + + public function testEmptyOrderByThrowsInvalidArgumentException() : void + { + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('The Sorter class does not accept an empty $orderBy'); + + $sorter = new Sorter([]); + } +} diff --git a/tests/DataSources/BlogPostsTest.php b/tests/DataSources/BlogPostsTest.php new file mode 100644 index 0000000..e885792 --- /dev/null +++ b/tests/DataSources/BlogPostsTest.php @@ -0,0 +1,95 @@ + '/2018/09/02/test1.html', + 'title' => 'Test Blog Post', + 'authorName' => 'Jonathan H. Wage', + 'authorEmail' => 'jonwage@gmail.com', + ]) + ); + + $sourceFile2 = new SourceFile( + 'md', + '/tmp/test.html', + '/tmp/test.html', + 'test2', + new SourceFileParameters([ + 'url' => '/2018/09/01/test2.html', + 'title' => 'Test Blog Post', + 'authorName' => 'Jonathan H. Wage', + 'authorEmail' => 'jonwage@gmail.com', + ]) + ); + + $files = [$sourceFile1, $sourceFile2]; + + $this->sourceFileRepository->expects(self::once()) + ->method('getFiles') + ->with('', 'source/blog') + ->willReturn($files); + + $blogPostRows = $this->blogPosts->getSourceRows(); + + usort($blogPostRows, new Sorter(['date' => 'desc'])); + + $expected = [ + [ + 'url' => '/2018/09/02/test1.html', + 'title' => 'Test Blog Post', + 'authorName' => 'Jonathan H. Wage', + 'authorEmail' => 'jonwage@gmail.com', + 'contents' => 'test1', + 'date' => new DateTimeImmutable('2018-09-02'), + ], + [ + 'url' => '/2018/09/01/test2.html', + 'title' => 'Test Blog Post', + 'authorName' => 'Jonathan H. Wage', + 'authorEmail' => 'jonwage@gmail.com', + 'contents' => 'test2', + 'date' => new DateTimeImmutable('2018-09-01'), + ], + + ]; + + self::assertEquals($expected, $blogPostRows); + } + + protected function setUp() : void + { + $this->sourceFileRepository = $this->createMock(SourceFileRepository::class); + + $this->blogPosts = new BlogPosts( + $this->sourceFileRepository + ); + } +} diff --git a/tests/DataSources/ContributorsTest.php b/tests/DataSources/ContributorsTest.php new file mode 100644 index 0000000..71659c3 --- /dev/null +++ b/tests/DataSources/ContributorsTest.php @@ -0,0 +1,105 @@ +projectContributorRepository = $this->createMock(ProjectContributorRepository::class); + + $this->contributors = new Contributors($this->projectContributorRepository); + } + + public function testGetSourceRows() : void + { + $project1 = new Project([]); + $project2 = new Project([]); + + $jwageTeamMember = new TeamMember(); + $ocramiusTeamMember = new TeamMember(); + + $objectManager = $this->createMock(ObjectManagerInterface::class); + + $projectContributor1 = new ProjectContributor(); + $projectContributor1->hydrate([ + 'github' => 'jwage', + 'teamMember' => $jwageTeamMember, + 'avatarUrl' => 'https://avatars1.githubusercontent.com/u/97422?s=460&v=4', + 'numCommits' => 1, + 'numAdditions' => 1, + 'numDeletions' => 1, + 'project' => $project1, + ], $objectManager); + + $projectContributor2 = new ProjectContributor(); + $projectContributor2->hydrate([ + 'github' => 'jwage', + 'teamMember' => $jwageTeamMember, + 'avatarUrl' => 'https://avatars1.githubusercontent.com/u/97422?s=460&v=4', + 'numCommits' => 1, + 'numAdditions' => 1, + 'numDeletions' => 1, + 'project' => $project2, + ], $objectManager); + + $projectContributor3 = new ProjectContributor(); + $projectContributor3->hydrate([ + 'github' => 'ocramius', + 'teamMember' => $ocramiusTeamMember, + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 1, + 'numAdditions' => 1, + 'numDeletions' => 1, + 'project' => $project2, + ], $objectManager); + + $projectContributors = [$projectContributor1, $projectContributor2, $projectContributor3]; + + $this->projectContributorRepository->expects(self::once()) + ->method('findAll') + ->willReturn($projectContributors); + + $rows = $this->contributors->getSourceRows(); + + self::assertEquals([ + 'jwage' => [ + 'teamMember' => $jwageTeamMember, + 'isTeamMember' => true, + 'github' => 'jwage', + 'avatarUrl' => 'https://avatars1.githubusercontent.com/u/97422?s=460&v=4', + 'numCommits' => 2, + 'numAdditions' => 2, + 'numDeletions' => 2, + 'projects' => [$project1, $project2], + ], + 'ocramius' => [ + 'teamMember' => $ocramiusTeamMember, + 'isTeamMember' => true, + 'github' => 'ocramius', + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 1, + 'numAdditions' => 1, + 'numDeletions' => 1, + 'projects' => [$project2], + ], + ], $rows); + } +} diff --git a/tests/DataSources/DoctrineUsersTest.php b/tests/DataSources/DoctrineUsersTest.php new file mode 100644 index 0000000..4efe9d2 --- /dev/null +++ b/tests/DataSources/DoctrineUsersTest.php @@ -0,0 +1,29 @@ + 'Symfony', + 'url' => 'https://symfony.com', + ], + [ + 'name' => 'Laravel', + 'url' => 'https://laravel.com', + ], + ]; + + $doctrineUsers = new DoctrineUsers($rows); + + self::assertEquals($rows, $doctrineUsers->getSourceRows()); + } +} diff --git a/tests/DataSources/ProjectContributorsTest.php b/tests/DataSources/ProjectContributorsTest.php new file mode 100644 index 0000000..8eea7c5 --- /dev/null +++ b/tests/DataSources/ProjectContributorsTest.php @@ -0,0 +1,252 @@ +projectRepository = $this->createMock(ProjectRepository::class); + $this->teamMemberRepository = $this->createMock(TeamMemberRepository::class); + $this->githubProjectContributors = $this->createMock(GithubProjectContributors::class); + + $this->projectContributors = new ProjectContributors( + $this->projectRepository, + $this->teamMemberRepository, + $this->githubProjectContributors + ); + } + + public function testGetSourceRows() : void + { + $objectManager = $this->createMock(ObjectManagerInterface::class); + + $project1 = new Project(['slug' => 'orm']); + $project2 = new Project(['slug' => 'dbal']); + + $jwageTeamMember = $this->createMock(TeamMember::class); + + $jwageTeamMember->expects(self::at(0)) + ->method('isProjectMaintainer') + ->willReturn(true); + + $jwageTeamMember->expects(self::at(1)) + ->method('isProjectMaintainer') + ->willReturn(false); + + $ocramiusTeamMember = $this->createMock(TeamMember::class); + + $this->projectRepository->expects(self::once()) + ->method('findAll') + ->willReturn([$project1, $project2]); + + $this->githubProjectContributors->expects(self::at(0)) + ->method('getProjectContributors') + ->with($project1) + ->willReturn([ + [ + 'weeks' => [ + ['a' => 1, 'd' => 1], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'jwage', + 'avatar_url' => 'https://avatars1.githubusercontent.com/u/97422?s=60&v=4', + ], + 'total' => 5, + ], + [ + 'weeks' => [ + ['a' => 2, 'd' => 2], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'ocramius', + 'avatar_url' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + ], + 'total' => 10, + ], + [ + 'weeks' => [ + ['a' => 2, 'd' => 2], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'bob', + 'avatar_url' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + ], + 'total' => 10, + ], + ]); + + $this->githubProjectContributors->expects(self::at(1)) + ->method('getProjectContributors') + ->with($project2) + ->willReturn([ + [ + 'weeks' => [ + ['a' => 1, 'd' => 1], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'jwage', + 'avatar_url' => 'https://avatars1.githubusercontent.com/u/97422?s=60&v=4', + ], + 'total' => 5, + ], + [ + 'weeks' => [ + ['a' => 2, 'd' => 2], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'ocramius', + 'avatar_url' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + ], + 'total' => 10, + ], + [ + 'weeks' => [ + ['a' => 2, 'd' => 2], + ['a' => 2, 'd' => 3], + ], + 'author' => [ + 'login' => 'jim', + 'avatar_url' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + ], + 'total' => 10, + ], + ]); + + $this->teamMemberRepository->expects(self::at(0)) + ->method('findOneByGithub') + ->with('jwage') + ->willReturn($jwageTeamMember); + + $this->teamMemberRepository->expects(self::at(1)) + ->method('findOneByGithub') + ->with('ocramius') + ->willReturn($ocramiusTeamMember); + + $this->teamMemberRepository->expects(self::at(2)) + ->method('findOneByGithub') + ->with('bob') + ->willReturn(null); + + $this->teamMemberRepository->expects(self::at(3)) + ->method('findOneByGithub') + ->with('jwage') + ->willReturn($jwageTeamMember); + + $this->teamMemberRepository->expects(self::at(4)) + ->method('findOneByGithub') + ->with('ocramius') + ->willReturn($ocramiusTeamMember); + + $this->teamMemberRepository->expects(self::at(5)) + ->method('findOneByGithub') + ->with('jim') + ->willReturn(null); + + $rows = $this->projectContributors->getSourceRows(); + + self::assertEquals([ + [ + 'teamMember' => $jwageTeamMember, + 'isTeamMember' => true, + 'isMaintainer' => true, + 'projectSlug' => 'orm', + 'project' => $project1, + 'github' => 'jwage', + 'avatarUrl' => 'https://avatars1.githubusercontent.com/u/97422?s=60&v=4', + 'numCommits' => 5, + 'numAdditions' => 3, + 'numDeletions' => 4, + ], + [ + 'teamMember' => $ocramiusTeamMember, + 'isTeamMember' => true, + 'isMaintainer' => false, + 'projectSlug' => 'orm', + 'project' => $project1, + 'github' => 'ocramius', + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 10, + 'numAdditions' => 4, + 'numDeletions' => 5, + ], + [ + 'teamMember' => null, + 'isTeamMember' => false, + 'isMaintainer' => false, + 'projectSlug' => 'orm', + 'project' => $project1, + 'github' => 'bob', + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 10, + 'numAdditions' => 4, + 'numDeletions' => 5, + ], + [ + 'teamMember' => $jwageTeamMember, + 'isTeamMember' => true, + 'isMaintainer' => false, + 'projectSlug' => 'dbal', + 'project' => $project2, + 'github' => 'jwage', + 'avatarUrl' => 'https://avatars1.githubusercontent.com/u/97422?s=60&v=4', + 'numCommits' => 5, + 'numAdditions' => 3, + 'numDeletions' => 4, + ], + [ + 'teamMember' => $ocramiusTeamMember, + 'isTeamMember' => true, + 'isMaintainer' => false, + 'projectSlug' => 'dbal', + 'project' => $project2, + 'github' => 'ocramius', + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 10, + 'numAdditions' => 4, + 'numDeletions' => 5, + ], + [ + 'teamMember' => null, + 'isTeamMember' => false, + 'isMaintainer' => false, + 'projectSlug' => 'dbal', + 'project' => $project2, + 'github' => 'jim', + 'avatarUrl' => 'https://avatars0.githubusercontent.com/u/154256?s=460&v=4', + 'numCommits' => 10, + 'numAdditions' => 4, + 'numDeletions' => 5, + ], + ], $rows); + } +} diff --git a/tests/DataSources/ProjectsTest.php b/tests/DataSources/ProjectsTest.php new file mode 100644 index 0000000..0962974 --- /dev/null +++ b/tests/DataSources/ProjectsTest.php @@ -0,0 +1,72 @@ + 'doctrine2'], + ['repositoryName' => 'dbal'], + ]; + + /** @var ProjectDataReader|MockObject */ + private $projectDataReader; + + /** @var Projects */ + private $projects; + + protected function setUp() : void + { + $this->projectDataReader = $this->createMock(ProjectDataReader::class); + + $this->projects = new Projects($this->projectDataReader, $this->projectsData); + } + + public function testGetSourceRows() : void + { + $this->projectDataReader->expects(self::at(0)) + ->method('read') + ->with('doctrine2') + ->willReturn([ + 'name' => 'Object Relational Mapper', + 'repositoryName' => 'doctrine2', + ]); + + $this->projectDataReader->expects(self::at(1)) + ->method('read') + ->with('dbal') + ->willReturn([ + 'name' => 'Database Abstraction Layer', + 'repositoryName' => 'dbal', + ]); + + $projectRows = $this->projects->getSourceRows(); + + self::assertSame([ + [ + 'active' => true, + 'archived' => false, + 'hasDocs' => true, + 'integration' => false, + 'name' => 'Object Relational Mapper', + 'repositoryName' => 'doctrine2', + ], + [ + 'active' => true, + 'archived' => false, + 'hasDocs' => true, + 'integration' => false, + 'name' => 'Database Abstraction Layer', + 'repositoryName' => 'dbal', + ], + ], $projectRows); + } +} diff --git a/tests/DataSources/SitemapPagesTest.php b/tests/DataSources/SitemapPagesTest.php new file mode 100644 index 0000000..7cd86ed --- /dev/null +++ b/tests/DataSources/SitemapPagesTest.php @@ -0,0 +1,39 @@ +sitemapPages->getSourceRows(); + + usort($sitemapPageRows, new Sorter(['url' => 'asc'])); + + self::assertCount(5, $sitemapPageRows); + + self::assertSame(date('Y-m-d'), $sitemapPageRows[0]['date']->format('Y-m-d')); + + self::assertSame('/', $sitemapPageRows[0]['url']); + self::assertSame('/api/inflector.html', $sitemapPageRows[1]['url']); + self::assertSame('/api/orm.html', $sitemapPageRows[2]['url']); + self::assertSame('/projects/doctrine-inflector.html', $sitemapPageRows[3]['url']); + self::assertSame('/projects/doctrine-orm.html', $sitemapPageRows[4]['url']); + } + + protected function setUp() : void + { + $this->sitemapPages = new SitemapPages(__DIR__ . '/../source'); + } +} diff --git a/tests/DataSources/TeamMembersTest.php b/tests/DataSources/TeamMembersTest.php new file mode 100644 index 0000000..c7dfb47 --- /dev/null +++ b/tests/DataSources/TeamMembersTest.php @@ -0,0 +1,34 @@ +teamMembers = new TeamMembers([ + ['name' => 'ocramius'], + ['name' => 'jwage'], + ['name' => 'romanb'], + ]); + } + + public function testGetSourceRows() : void + { + $teamMemberRows = $this->teamMembers->getSourceRows(); + + self::assertSame([ + ['name' => 'ocramius'], + ['name' => 'jwage'], + ['name' => 'romanb'], + ], $teamMemberRows); + } +} diff --git a/tests/Docs/APIBuilderTest.php b/tests/Docs/APIBuilderTest.php index 9d31548..d4035fc 100644 --- a/tests/Docs/APIBuilderTest.php +++ b/tests/Docs/APIBuilderTest.php @@ -5,9 +5,9 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Docs; use Doctrine\Website\Docs\APIBuilder; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\ProcessFactory; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; use Doctrine\Website\Tests\TestCase; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/Docs/BuildDocsTest.php b/tests/Docs/BuildDocsTest.php index 74eb44a..7a4bd3e 100644 --- a/tests/Docs/BuildDocsTest.php +++ b/tests/Docs/BuildDocsTest.php @@ -10,16 +10,20 @@ use Doctrine\Website\Docs\RST\RSTBuilder; use Doctrine\Website\Docs\RST\RSTLanguage; use Doctrine\Website\Docs\RST\RSTLanguagesDetector; use Doctrine\Website\Docs\SearchIndexer; -use Doctrine\Website\Projects\Project; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; +use Doctrine\Website\Projects\ProjectDataRepository; use Doctrine\Website\Projects\ProjectGitSyncer; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Repositories\ProjectRepository; use Doctrine\Website\Tests\TestCase; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Output\OutputInterface; class BuildDocsTest extends TestCase { + /** @var ProjectDataRepository|MockObject */ + private $projectDataRepository; + /** @var ProjectRepository|MockObject */ private $projectRepository; @@ -43,14 +47,16 @@ class BuildDocsTest extends TestCase protected function setUp() : void { - $this->projectRepository = $this->createMock(ProjectRepository::class); - $this->projectGitSyncer = $this->createMock(ProjectGitSyncer::class); - $this->apiBuilder = $this->createMock(APIBuilder::class); - $this->rstLanguagesDetector = $this->createMock(RSTLanguagesDetector::class); - $this->rstBuilder = $this->createMock(RSTBuilder::class); - $this->searchIndexer = $this->createMock(SearchIndexer::class); + $this->projectDataRepository = $this->createMock(ProjectDataRepository::class); + $this->projectRepository = $this->createMock(ProjectRepository::class); + $this->projectGitSyncer = $this->createMock(ProjectGitSyncer::class); + $this->apiBuilder = $this->createMock(APIBuilder::class); + $this->rstLanguagesDetector = $this->createMock(RSTLanguagesDetector::class); + $this->rstBuilder = $this->createMock(RSTBuilder::class); + $this->searchIndexer = $this->createMock(SearchIndexer::class); $this->buildDocs = new BuildDocs( + $this->projectDataRepository, $this->projectRepository, $this->projectGitSyncer, $this->apiBuilder, diff --git a/tests/Docs/RST/RSTBuilderTest.php b/tests/Docs/RST/RSTBuilderTest.php index b6eab79..5fa21b2 100644 --- a/tests/Docs/RST/RSTBuilderTest.php +++ b/tests/Docs/RST/RSTBuilderTest.php @@ -11,8 +11,8 @@ use Doctrine\Website\Docs\RST\RSTCopier; use Doctrine\Website\Docs\RST\RSTFileRepository; use Doctrine\Website\Docs\RST\RSTLanguage; use Doctrine\Website\Docs\RST\RSTPostBuildProcessor; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\Tests\TestCase; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Filesystem\Filesystem; diff --git a/tests/Docs/SearchIndexerTest.php b/tests/Docs/SearchIndexerTest.php index 7fae4b4..56b3b77 100644 --- a/tests/Docs/SearchIndexerTest.php +++ b/tests/Docs/SearchIndexerTest.php @@ -12,8 +12,8 @@ use Doctrine\RST\HTML\Nodes\ParagraphNode; use Doctrine\RST\HTML\Nodes\TitleNode; use Doctrine\RST\Nodes\RawNode; use Doctrine\Website\Docs\SearchIndexer; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\Tests\TestCase; use PHPUnit\Framework\MockObject\MockObject; diff --git a/tests/FunctionalTest.php b/tests/FunctionalTest.php index 855c2d4..51d1c84 100644 --- a/tests/FunctionalTest.php +++ b/tests/FunctionalTest.php @@ -4,7 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Tests; -use Doctrine\Website\Projects\ProjectRepository; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Repositories\ProjectRepository; use SimpleXMLElement; use Symfony\Component\DomCrawler\Crawler; use function explode; @@ -104,7 +105,8 @@ class FunctionalTest extends TestCase self::assertValid('/contribute/website/index.html'); self::assertValid('/community/index.html'); self::assertValid('/blog/index.html'); - self::assertValid('/team/index.html'); + self::assertValid('/team/maintainers.html'); + self::assertValid('/team/contributors.html'); self::assertValid('/2018/04/06/new-website.html'); self::assertValid('/projects.html'); @@ -113,7 +115,10 @@ class FunctionalTest extends TestCase /** @var ProjectRepository $projectRepository */ $projectRepository = $container->get(ProjectRepository::class); - foreach ($projectRepository->findAll() as $project) { + /** @var Project[] $projects */ + $projects = $projectRepository->findAll(); + + foreach ($projects as $project) { // project homepage $crawler = self::assertValid(sprintf( '/projects/%s.html', diff --git a/tests/Github/GithubProjectContributorsTest.php b/tests/Github/GithubProjectContributorsTest.php new file mode 100644 index 0000000..1e7bd6a --- /dev/null +++ b/tests/Github/GithubProjectContributorsTest.php @@ -0,0 +1,105 @@ +filesystemCache = $this->createMock(FilesystemCache::class); + $this->githubClient = $this->createMock(Client::class); + + $this->githubProjectContributors = new GithubProjectContributors( + $this->filesystemCache, + $this->githubClient + ); + } + + public function testGetProjectContributors() : void + { + $id = 'doctrine-orm-contributors-data'; + + $expected = [['author' => ['login' => 'jwage']]]; + + $project = $this->createMock(Project::class); + + $project->expects(self::once()) + ->method('getSlug') + ->willReturn('orm'); + + $project->expects(self::once()) + ->method('getRepositoryName') + ->willReturn('doctrine2'); + + $this->filesystemCache->expects(self::once()) + ->method('contains') + ->with($id) + ->willReturn(false); + + $repo = $this->createMock(Repo::class); + + $this->githubClient->expects(self::once()) + ->method('api') + ->with('repo') + ->willReturn($repo); + + $repo->expects(self::once()) + ->method('statistics') + ->with('doctrine', 'doctrine2') + ->willReturn($expected); + + $this->filesystemCache->expects(self::once()) + ->method('save') + ->with($id, $expected, 86400); + + $projectContributors = $this->githubProjectContributors->getProjectContributors($project); + + self::assertEquals($expected, $projectContributors); + } + + public function testGetProjectContributorsCache() : void + { + $id = 'doctrine-orm-contributors-data'; + + $expected = [['author' => ['login' => 'jwage']]]; + + $project = $this->createMock(Project::class); + + $project->expects(self::once()) + ->method('getSlug') + ->willReturn('orm'); + + $this->filesystemCache->expects(self::once()) + ->method('contains') + ->with($id) + ->willReturn(true); + + $this->filesystemCache->expects(self::once()) + ->method('fetch') + ->with($id) + ->willReturn($expected); + + $projectContributors = $this->githubProjectContributors->getProjectContributors($project); + + self::assertEquals($expected, $projectContributors); + } +} diff --git a/tests/Blog/BlogPostTest.php b/tests/Model/BlogPostTest.php similarity index 95% rename from tests/Blog/BlogPostTest.php rename to tests/Model/BlogPostTest.php index e0e86d4..3993e21 100644 --- a/tests/Blog/BlogPostTest.php +++ b/tests/Model/BlogPostTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Doctrine\Website\Tests\Blog; +namespace Doctrine\Website\Tests\Model; use DateTimeImmutable; -use Doctrine\Website\Blog\BlogPost; +use Doctrine\Website\Model\BlogPost; use Doctrine\Website\Tests\TestCase; class BlogPostTest extends TestCase diff --git a/tests/Sitemap/SitemapPageTest.php b/tests/Model/SitemapPageTest.php similarity index 90% rename from tests/Sitemap/SitemapPageTest.php rename to tests/Model/SitemapPageTest.php index 1ae2e87..ce6fd8d 100644 --- a/tests/Sitemap/SitemapPageTest.php +++ b/tests/Model/SitemapPageTest.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Doctrine\Website\Tests\Sitemap; +namespace Doctrine\Website\Tests\Model; use DateTimeImmutable; -use Doctrine\Website\Sitemap\SitemapPage; +use Doctrine\Website\Model\SitemapPage; use Doctrine\Website\Tests\TestCase; class SitemapPageTest extends TestCase diff --git a/tests/Projects/ProjectDataReaderTest.php b/tests/Projects/ProjectDataReaderTest.php index cc8a1fb..003a301 100644 --- a/tests/Projects/ProjectDataReaderTest.php +++ b/tests/Projects/ProjectDataReaderTest.php @@ -39,6 +39,7 @@ class ProjectDataReaderTest extends TestCase 'description' => 'Test description', 'keywords' => ['keyword1', 'keyword2'], 'shortName' => 'test', + 'docsSlug' => 'test-project', ], $this->projectDataReader->read('test-project')); } @@ -61,6 +62,7 @@ class ProjectDataReaderTest extends TestCase ], ], ], + 'docsSlug' => 'no-project-json', ], $this->projectDataReader->read('no-project-json')); } @@ -93,7 +95,7 @@ class ProjectDataReaderTest extends TestCase [ [ 'repositoryName' => 'test-integration-project', - 'isIntegration' => true, + 'integration' => true, 'integrationType' => 'symfony', ], ], diff --git a/tests/Projects/ProjectFactoryTest.php b/tests/Projects/ProjectFactoryTest.php deleted file mode 100644 index b6ab411..0000000 --- a/tests/Projects/ProjectFactoryTest.php +++ /dev/null @@ -1,43 +0,0 @@ -projectDataReader = new ProjectDataReader(__DIR__ . '/../test-projects', [], []); - - $this->projectFactory = new ProjectFactory($this->projectDataReader); - } - - public function testCreate() : void - { - $project = $this->projectFactory->create('no-project-json'); - - self::assertSame('no-project-json', $project->getRepositoryName()); - } - - public function testCreateWithDoctrineProjectJson() : void - { - $project = $this->projectFactory->create('test-project'); - - self::assertSame('test-project', $project->getRepositoryName()); - self::assertSame('test', $project->getShortName()); - self::assertSame('doctrine/test-project', $project->getComposerPackageName()); - self::assertSame('Test description', $project->getDescription()); - self::assertSame(['keyword1', 'keyword2'], $project->getKeywords()); - } -} diff --git a/tests/Projects/ProjectGitSyncerTest.php b/tests/Projects/ProjectGitSyncerTest.php index 13a61e4..ce39578 100644 --- a/tests/Projects/ProjectGitSyncerTest.php +++ b/tests/Projects/ProjectGitSyncerTest.php @@ -4,10 +4,10 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Projects; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\ProcessFactory; -use Doctrine\Website\Projects\Project; use Doctrine\Website\Projects\ProjectGitSyncer; -use Doctrine\Website\Projects\ProjectVersion; use Doctrine\Website\Tests\TestCase; use PHPUnit\Framework\MockObject\MockObject; use function sprintf; diff --git a/tests/Projects/ProjectRepositoryTest.php b/tests/Projects/ProjectRepositoryTest.php deleted file mode 100644 index c325d29..0000000 --- a/tests/Projects/ProjectRepositoryTest.php +++ /dev/null @@ -1,78 +0,0 @@ - 'doctrine2'], - ['repositoryName' => 'dbal'], - ]; - - /** @var ProjectFactory */ - private $projectFactory; - - /** @var ProjectRepository */ - private $projectRepository; - - protected function setUp() : void - { - $this->projectFactory = $this->createMock(ProjectFactory::class); - - $project1 = new Project([ - 'name' => 'ORM', - 'slug' => 'orm', - 'docsSlug' => 'doctrine-orm', - ]); - - $project2 = new Project([ - 'name' => 'DBAL', - 'slug' => 'dbal', - 'docsSlug' => 'doctrine-dbal', - ]); - - $this->projectFactory->expects(self::at(0)) - ->method('create') - ->with('doctrine2') - ->willReturn($project1); - - $this->projectFactory->expects(self::at(1)) - ->method('create') - ->with('dbal') - ->willReturn($project2); - - $this->projectRepository = new ProjectRepository($this->projectsData, $this->projectFactory); - } - - public function testFindOneBySlug() : void - { - $orm = $this->projectRepository->findOneBySlug('orm'); - - self::assertSame('ORM', $orm->getName()); - - $orm = $this->projectRepository->findOneBySlug('doctrine-orm'); - - self::assertSame('ORM', $orm->getName()); - - $dbal = $this->projectRepository->findOneBySlug('dbal'); - - self::assertSame('DBAL', $dbal->getName()); - - $dbal = $this->projectRepository->findOneBySlug('doctrine-dbal'); - - self::assertSame('DBAL', $dbal->getName()); - } - - public function testFindAll() : void - { - self::assertCount(2, $this->projectRepository->findAll()); - } -} diff --git a/tests/Projects/ProjectTest.php b/tests/Projects/ProjectTest.php index 63d6afb..882a1b8 100644 --- a/tests/Projects/ProjectTest.php +++ b/tests/Projects/ProjectTest.php @@ -4,8 +4,8 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Projects; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\Tests\TestCase; use InvalidArgumentException; use function assert; diff --git a/tests/Projects/ProjectVersionTest.php b/tests/Projects/ProjectVersionTest.php index c00bc68..3c5c0c8 100644 --- a/tests/Projects/ProjectVersionTest.php +++ b/tests/Projects/ProjectVersionTest.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Projects; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\ProjectVersion; use Doctrine\Website\Tests\TestCase; class ProjectVersionTest extends TestCase diff --git a/tests/Sitemap/SitemapPageRepositoryTest.php b/tests/Sitemap/SitemapPageRepositoryTest.php deleted file mode 100644 index b75a876..0000000 --- a/tests/Sitemap/SitemapPageRepositoryTest.php +++ /dev/null @@ -1,35 +0,0 @@ -sitemapPageRepository->findAll(); - - self::assertCount(5, $sitemapPages); - - self::assertSame(date('Y-m-d'), $sitemapPages[0]->getDate()->format('Y-m-d')); - - self::assertSame('/', $sitemapPages[0]->getUrl()); - self::assertSame('/projects/doctrine-inflector.html', $sitemapPages[1]->getUrl()); - self::assertSame('/projects/doctrine-orm.html', $sitemapPages[2]->getUrl()); - self::assertSame('/api/inflector.html', $sitemapPages[3]->getUrl()); - self::assertSame('/api/orm.html', $sitemapPages[4]->getUrl()); - } - - protected function setUp() : void - { - $this->sitemapPageRepository = new SitemapPageRepository(__DIR__ . '/../source'); - } -} diff --git a/tests/Team/TeamRepositoryTest.php b/tests/Team/TeamRepositoryTest.php deleted file mode 100644 index 4204151..0000000 --- a/tests/Team/TeamRepositoryTest.php +++ /dev/null @@ -1,102 +0,0 @@ -teamRepository = new TeamRepository([ - 'ocramius' => [ - 'active' => true, - 'core' => true, - 'projects' => ['orm'], - ], - 'jwage' => [ - 'active' => true, - 'documentation' => true, - 'projects' => ['orm'], - ], - 'romanb' => [ - 'active' => false, - 'projects' => ['orm'], - ], - ]); - } - - public function testGetTeamMembers() : void - { - $teamMembers = $this->teamRepository->getTeamMembers(); - - self::assertSame([ - 'jwage', - 'ocramius', - 'romanb', - ], array_keys($teamMembers)); - } - - public function testGetActiveCoreTeamMembers() : void - { - $teamMembers = $this->teamRepository->getActiveCoreTeamMembers(); - - self::assertSame(['ocramius'], array_keys($teamMembers)); - } - - public function testGetActiveDocumentationTeamMembers() : void - { - $teamMembers = $this->teamRepository->getActiveDocumentationTeamMembers(); - - self::assertSame(['jwage'], array_keys($teamMembers)); - } - - public function testGetInactiveTeamMembers() : void - { - $teamMembers = $this->teamRepository->getInactiveTeamMembers(); - - self::assertSame(['romanb'], array_keys($teamMembers)); - } - - public function testGetAllProjectTeamMembers() : void - { - $project = new Project(['slug' => 'orm']); - - $teamMembers = $this->teamRepository->getAllProjectTeamMembers($project); - - self::assertSame([ - 'jwage', - 'ocramius', - 'romanb', - ], array_keys($teamMembers)); - } - - public function testGetActiveProjectTeamMembers() : void - { - $project = new Project(['slug' => 'orm']); - - $teamMembers = $this->teamRepository->getActiveProjectTeamMembers($project); - - self::assertSame([ - 'jwage', - 'ocramius', - ], array_keys($teamMembers)); - } - - public function testGetInactiveProjectTeamMembers() : void - { - $project = new Project(['slug' => 'orm']); - - $teamMembers = $this->teamRepository->getInactiveProjectTeamMembers($project); - - self::assertSame(['romanb'], array_keys($teamMembers)); - } -} diff --git a/tests/Twig/MainExtensionTest.php b/tests/Twig/MainExtensionTest.php index f733fea..17eab07 100644 --- a/tests/Twig/MainExtensionTest.php +++ b/tests/Twig/MainExtensionTest.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Twig; use Doctrine\Website\Assets\AssetIntegrityGenerator; -use Doctrine\Website\Projects\Project; +use Doctrine\Website\Model\Project; use Doctrine\Website\Tests\TestCase; use Doctrine\Website\Twig\MainExtension; use Parsedown; diff --git a/tests/Twig/ProjectExtensionTest.php b/tests/Twig/ProjectExtensionTest.php index 3f80f88..4c81c03 100644 --- a/tests/Twig/ProjectExtensionTest.php +++ b/tests/Twig/ProjectExtensionTest.php @@ -4,9 +4,9 @@ declare(strict_types=1); namespace Doctrine\Website\Tests\Twig; -use Doctrine\Website\Projects\Project; -use Doctrine\Website\Projects\ProjectRepository; -use Doctrine\Website\Projects\ProjectVersion; +use Doctrine\Website\Model\Project; +use Doctrine\Website\Model\ProjectVersion; +use Doctrine\Website\Repositories\ProjectRepository; use Doctrine\Website\Tests\TestCase; use Doctrine\Website\Twig\ProjectExtension; use PHPUnit\Framework\MockObject\MockObject; @@ -37,7 +37,7 @@ class ProjectExtensionTest extends TestCase $project = new Project([]); $this->projectRepository->expects(self::once()) - ->method('findOneBySlug') + ->method('findOneByDocsSlug') ->with('orm') ->willReturn($project); diff --git a/tests/WebsiteBuilderTest.php b/tests/WebsiteBuilderTest.php index fb52711..fe4bfa9 100644 --- a/tests/WebsiteBuilderTest.php +++ b/tests/WebsiteBuilderTest.php @@ -7,7 +7,7 @@ namespace Doctrine\Website\Tests; use Doctrine\Website\Builder\SourceFileBuilder; use Doctrine\Website\Builder\SourceFileRepository; use Doctrine\Website\ProcessFactory; -use Doctrine\Website\Projects\ProjectRepository; +use Doctrine\Website\Repositories\ProjectRepository; use Doctrine\Website\WebsiteBuilder; use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Output\OutputInterface;
  • {{ project.name }}{{ doctrineUser.name }}{{ project|raw }}{{ doctrineUser|raw }}