diff --git a/.gitignore b/.gitignore index 7927f7cb00d80a5373e39436d2290485d34371ee..9d9abe2e5f90846aa427eaff3e7c8710634547bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ +includes/config.php + trac-to-gitlab.phar -vendor/ +vendor/* puli.phar puli.json .puli/ -# JetBrains -.idea \ No newline at end of file +.idea +composer.lock diff --git a/composer.json b/composer.json index f7ac8686eb58ebbdf25d1440a708246c8b556974..5d7402e48d3cb4d38df9ba8e3de09c5bfcb77b94 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,6 @@ "ext-json": "*", "m4tthumphrey/php-gitlab-api": "9.9.0", "fguillot/json-rpc": "1.0.0", - "ulrichsg/getopt-php": "2.3.0", "php-http/guzzle6-adapter": "^1.1" }, "autoload": { diff --git a/composer.lock b/composer.lock index f88e36a1542a3fae506a2908931526db1d645509..eefd4507988f9d02cb7635e32a131df2ee43d2aa 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": "ab03c7dccb8626cc2bb2d78678bf1a36", + "content-hash": "a004bc34bf09724ebf546d41f934ddb7", "packages": [ { "name": "clue/stream-filter", @@ -276,189 +276,6 @@ ], "time": "2017-03-20T17:10:46+00:00" }, - { - "name": "http-interop/http-factory", - "version": "0.3.0", - "source": { - "type": "git", - "url": "https://github.com/http-interop/http-factory.git", - "reference": "c2587cc0a6f74987fefb5b8074acfd32c69a4b0f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/http-interop/http-factory/zipball/c2587cc0a6f74987fefb5b8074acfd32c69a4b0f", - "reference": "c2587cc0a6f74987fefb5b8074acfd32c69a4b0f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Interop\\Http\\Factory\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ], - "time": "2017-03-24T14:48:51+00:00" - }, - { - "name": "justinrainbow/json-schema", - "version": "1.6.1", - "source": { - "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/cc84765fb7317f6b07bd8ac78364747f95b86341", - "reference": "cc84765fb7317f6b07bd8ac78364747f95b86341", - "shasum": "" - }, - "require": { - "php": ">=5.3.29" - }, - "require-dev": { - "json-schema/json-schema-test-suite": "1.1.0", - "phpdocumentor/phpdocumentor": "~2", - "phpunit/phpunit": "~3.7" - }, - "bin": [ - "bin/validate-json" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "autoload": { - "psr-4": { - "JsonSchema\\": "src/JsonSchema/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Bruno Prieto Reis", - "email": "bruno.p.reis@gmail.com" - }, - { - "name": "Justin Rainbow", - "email": "justin.rainbow@gmail.com" - }, - { - "name": "Igor Wiedler", - "email": "igor@wiedler.ch" - }, - { - "name": "Robert Schönthal", - "email": "seroscho@googlemail.com" - } - ], - "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", - "keywords": [ - "json", - "schema" - ], - "time": "2016-01-25T15:43:01+00:00" - }, - { - "name": "kriswallsmith/buzz", - "version": "v0.17.1", - "source": { - "type": "git", - "url": "https://github.com/kriswallsmith/Buzz.git", - "reference": "00d4b3022f1c519b295a4ca0f46e1b91ff3d65f3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/kriswallsmith/Buzz/zipball/00d4b3022f1c519b295a4ca0f46e1b91ff3d65f3", - "reference": "00d4b3022f1c519b295a4ca0f46e1b91ff3d65f3", - "shasum": "" - }, - "require": { - "nyholm/psr7": "^0.3", - "php": "^7.1", - "php-http/httplug": "^1.1", - "psr/http-client": "^0.1", - "psr/http-message": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0" - }, - "provide": { - "php-http/client-implementation": "1.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.11", - "php-http/client-integration-tests": "^0.6.2", - "phpunit/phpunit": "^6.5.7", - "psr/log": "^1.0", - "symfony/phpunit-bridge": "^4.0" - }, - "suggest": { - "ext-curl": "*" - }, - "type": "library", - "autoload": { - "psr-4": { - "Buzz\\": "lib" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kris Wallsmith", - "email": "kris.wallsmith@gmail.com", - "homepage": "http://kriswallsmith.net/" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "http://tnyholm.se/" - } - ], - "description": "Lightweight HTTP client", - "homepage": "https://github.com/kriswallsmith/Buzz", - "keywords": [ - "curl", - "http client" - ], - "time": "2018-04-05T08:07:12+00:00" - }, { "name": "m4tthumphrey/php-gitlab-api", "version": "9.9.0", @@ -527,108 +344,6 @@ ], "time": "2018-04-24T07:37:31+00:00" }, - { - "name": "nyholm/psr7", - "version": "0.3.0", - "source": { - "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "ec2c453decfc5f8ee5a8cf43694b8ca392503d32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/ec2c453decfc5f8ee5a8cf43694b8ca392503d32", - "reference": "ec2c453decfc5f8ee5a8cf43694b8ca392503d32", - "shasum": "" - }, - "require": { - "http-interop/http-factory": "^0.3", - "php": "^7.1", - "php-http/message-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "http-interop/http-factory-tests": "dev-master", - "php-http/psr7-integration-tests": "dev-master", - "phpunit/phpunit": "^7.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Nyholm\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com" - } - ], - "description": "A fast PHP7 implementation of PSR-7", - "homepage": "http://tnyholm.se", - "keywords": [ - "psr-17", - "psr-7" - ], - "time": "2018-02-06T12:01:53+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.17", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "time": "2018-07-04T16:31:37+00:00" - }, { "name": "php-http/client-common", "version": "1.7.0", @@ -1097,55 +812,6 @@ ], "time": "2016-01-26T13:27:02+00:00" }, - { - "name": "psr/http-client", - "version": "0.1.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "d4d3ec04b034120b0591ad9722a4c2be33a7dfec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/d4d3ec04b034120b0591ad9722a4c2be33a7dfec", - "reference": "d4d3ec04b034120b0591ad9722a4c2be33a7dfec", - "shasum": "" - }, - "require": { - "php": "^7.0", - "psr/http-message": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ], - "time": "2018-02-03T12:55:20+00:00" - }, { "name": "psr/http-message", "version": "1.0.1", @@ -1197,32 +863,35 @@ "time": "2016-08-06T14:39:51+00:00" }, { - "name": "psr/log", - "version": "1.0.2", + "name": "symfony/options-resolver", + "version": "v4.1.1", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", + "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.1.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "4.1-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1230,855 +899,22 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Symfony OptionsResolver Component", + "homepage": "https://symfony.com", "keywords": [ - "log", - "psr", - "psr-3" + "config", + "configuration", + "options" ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "puli/composer-plugin", - "version": "1.0.0-beta10", - "source": { - "type": "git", - "url": "https://github.com/puli/composer-plugin.git", - "reference": "89f1d4df4cc24dc8025e3afb98b5fab0bd2df831" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/puli/composer-plugin/zipball/89f1d4df4cc24dc8025e3afb98b5fab0bd2df831", - "reference": "89f1d4df4cc24dc8025e3afb98b5fab0bd2df831", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3.9|^7.0", - "puli/discovery": "^1.0-beta9", - "puli/repository": "^1.0-beta9", - "puli/url-generator": "^1.0-beta4", - "symfony/filesystem": "^2.3|^3.0", - "symfony/process": "^2.3|^3.0", - "webmozart/assert": "^1.0", - "webmozart/json": "^1.2.2", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "composer/composer": "^1.0-alpha10", - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "webmozart/glob": "^4.0" - }, - "type": "composer-plugin", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - }, - "class": "Puli\\ComposerPlugin\\PuliPlugin" - }, - "autoload": { - "psr-4": { - "Puli\\ComposerPlugin\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Integrates Composer into the Puli package manager.", - "homepage": "http://puli.io", - "time": "2016-03-31T12:15:22+00:00" - }, - { - "name": "puli/discovery", - "version": "1.0.0-beta9", - "source": { - "type": "git", - "url": "https://github.com/puli/discovery.git", - "reference": "3fcb42bbbf27e7baa6d978c93be966ee4c2f6085" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/puli/discovery/zipball/3fcb42bbbf27e7baa6d978c93be966ee4c2f6085", - "reference": "3fcb42bbbf27e7baa6d978c93be966ee4c2f6085", - "shasum": "" - }, - "require": { - "php": "^5.3.9|^7.0", - "ramsey/uuid": "^2.8", - "webmozart/assert": "^1.0", - "webmozart/expression": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "puli/repository": "^1.0-beta9", - "sebastian/version": "^1.0.1", - "webmozart/json": "^1.2", - "webmozart/key-value-store": "^1.0-beta7" - }, - "suggest": { - "puli/repository": "to bind and discover Puli resources", - "webmozart/json": "to use the JSON discovery", - "webmozart/key-value-store": "to use the key-value store discovery" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Puli\\Discovery\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Publishes and discovers artifacts across Puli packages.", - "homepage": "http://puli.io", - "time": "2016-01-14T10:18:41+00:00" - }, - { - "name": "puli/repository", - "version": "1.0.0-beta10", - "source": { - "type": "git", - "url": "https://github.com/puli/repository.git", - "reference": "2b3136f62c81bf1d6f0fbdbda62c199524eab65d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/puli/repository/zipball/2b3136f62c81bf1d6f0fbdbda62c199524eab65d", - "reference": "2b3136f62c81bf1d6f0fbdbda62c199524eab65d", - "shasum": "" - }, - "require": { - "php": "^5.3.9|^7.0", - "psr/log": "^1.0", - "webmozart/assert": "^1.0", - "webmozart/glob": "^4.1", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.0|^3.0", - "webmozart/json": "^1.2.1", - "webmozart/key-value-store": "^1.0-beta7" - }, - "suggest": { - "symfony/filesystem": "to use the filesystem repository", - "webmozart/json": "to use the JSON repositories", - "webmozart/key-value-store": "to use the key-value store change stream" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "psr-4": { - "Puli\\Repository\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A filesystem-like repository for storing arbitrary resources.", - "homepage": "http://puli.io", - "time": "2016-02-05T10:12:35+00:00" - }, - { - "name": "puli/url-generator", - "version": "1.0.0-beta4", - "source": { - "type": "git", - "url": "https://github.com/puli/url-generator.git", - "reference": "b6c0bfb678dde9a2f8ece661f894c9f39e62dcc2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/puli/url-generator/zipball/b6c0bfb678dde9a2f8ece661f894c9f39e62dcc2", - "reference": "b6c0bfb678dde9a2f8ece661f894c9f39e62dcc2", - "shasum": "" - }, - "require": { - "php": "^5.3.9|^7.0", - "puli/discovery": "^1.0-beta9", - "puli/repository": "^1.0-beta9", - "webmozart/glob": "^4.0", - "webmozart/path-util": "^2.3" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Puli\\UrlGenerator\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Generates URLs for public Puli resources.", - "homepage": "http://puli.io", - "keywords": [ - "asset", - "public", - "puli", - "resource", - "url" - ], - "time": "2016-01-14T10:30:17+00:00" - }, - { - "name": "ramsey/uuid", - "version": "2.9.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "b2ef4dd9584268d73f92f752a62bc24cd534dc9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/b2ef4dd9584268d73f92f752a62bc24cd534dc9a", - "reference": "b2ef4dd9584268d73f92f752a62bc24cd534dc9a", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": ">=5.3.3" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "doctrine/dbal": ">=2.3", - "jakub-onderka/php-parallel-lint": "^0.9.0", - "moontoast/math": "~1.1", - "phpunit/phpunit": "~4.1|~5.0", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "^2.3", - "symfony/console": "~2.3|~3.0" - }, - "suggest": { - "doctrine/dbal": "Allow the use of a UUID as doctrine field type.", - "moontoast/math": "Support for converting UUID to 128-bit integer (in string form).", - "symfony/console": "Support for use of the bin/uuid command line tool." - }, - "bin": [ - "bin/uuid" - ], - "type": "library", - "autoload": { - "psr-4": { - "Rhumsaa\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marijn Huizendveld", - "email": "marijn.huizendveld@gmail.com" - }, - { - "name": "Ben Ramsey", - "homepage": "http://benramsey.com" - } - ], - "description": "A PHP 5.3+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).", - "homepage": "https://github.com/ramsey/uuid", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "time": "2016-03-22T18:20:19+00:00" - }, - { - "name": "seld/jsonlint", - "version": "1.7.1", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/d15f59a67ff805a44c50ea0516d2341740f81a38", - "reference": "d15f59a67ff805a44c50ea0516d2341740f81a38", - "shasum": "" - }, - "require": { - "php": "^5.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "bin": [ - "bin/jsonlint" - ], - "type": "library", - "autoload": { - "psr-4": { - "Seld\\JsonLint\\": "src/Seld/JsonLint/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" - } - ], - "description": "JSON Linter", - "keywords": [ - "json", - "linter", - "parser", - "validator" - ], - "time": "2018-01-24T12:46:19+00:00" - }, - { - "name": "symfony/filesystem", - "version": "v3.4.12", - "source": { - "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "reference": "8a721a5f2553c6c3482b1c5b22ed60fe94dd63ed", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Filesystem\\": "" - }, - "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 Filesystem Component", - "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v4.1.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", - "reference": "45cdcc8a96ef92b43a50723e6d1f5f83096e8cef", - "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-05-31T10:17:53+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "reference": "7cc359f1b7b80fc25ed7796be7d96adc9b354bae", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-04-30T19:57:29+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.12", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/acc5a37c706ace827962851b69705b24e71ca17c", - "reference": "acc5a37c706ace827962851b69705b24e71ca17c", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - }, - "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 Process Component", - "homepage": "https://symfony.com", - "time": "2018-05-30T04:24:30+00:00" - }, - { - "name": "ulrichsg/getopt-php", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/getopt-php/getopt-php.git", - "reference": "a51554a16e206a6642bf1a0d7d1e4378ec2ba980" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/getopt-php/getopt-php/zipball/a51554a16e206a6642bf1a0d7d1e4378ec2ba980", - "reference": "a51554a16e206a6642bf1a0d7d1e4378ec2ba980", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "3.7.*" - }, - "type": "library", - "autoload": { - "psr-0": { - "Ulrichsg\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ulrich Schmidt-Goertz", - "email": "ulrich@schmidt-goertz.de" - } - ], - "description": "Command line arguments parser for PHP 5.3", - "homepage": "http://ulrichsg.github.io/getopt-php", - "time": "2015-03-28T14:09:20+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-01-29T19:49:41+00:00" - }, - { - "name": "webmozart/expression", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/expression.git", - "reference": "35c222fc49533894228e1240cc844ae91d6a9ef2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/expression/zipball/35c222fc49533894228e1240cc844ae91d6a9ef2", - "reference": "35c222fc49533894228e1240cc844ae91d6a9ef2", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Expression\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Formulate expressions and search criteria using PHP objects.", - "keywords": [ - "criteria", - "expression", - "filter", - "formula" - ], - "time": "2015-12-17T10:43:13+00:00" - }, - { - "name": "webmozart/glob", - "version": "4.1.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/glob.git", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/glob/zipball/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "reference": "3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe", - "shasum": "" - }, - "require": { - "php": "^5.3.3|^7.0", - "webmozart/path-util": "^2.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.1-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Glob\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A PHP implementation of Ant's glob.", - "time": "2015-12-29T11:14:33+00:00" - }, - { - "name": "webmozart/json", - "version": "1.2.2", - "source": { - "type": "git", - "url": "https://github.com/webmozart/json.git", - "reference": "a1fb3da904b8364e3db47eed68f76bfb6cd0031a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/json/zipball/a1fb3da904b8364e3db47eed68f76bfb6cd0031a", - "reference": "a1fb3da904b8364e3db47eed68f76bfb6cd0031a", - "shasum": "" - }, - "require": { - "justinrainbow/json-schema": "^1.6", - "php": "^5.3.3|^7.0", - "seld/jsonlint": "^1.0", - "webmozart/path-util": "^2.3" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1", - "symfony/filesystem": "^2.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Json\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust JSON decoder/encoder with support for schema validation.", - "time": "2016-01-14T12:11:46+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "time": "2015-12-17T08:42:14+00:00" + "time": "2018-05-31T10:17:53+00:00" } ], "packages-dev": [], diff --git a/config.json b/config.json deleted file mode 100644 index 75a4921800daa073138569902111c83012eb18be..0000000000000000000000000000000000000000 --- a/config.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "gitlab-access-token": "se7cRwBAyySpFnzWmk7a" -} diff --git a/convert.php b/convert.php new file mode 100755 index 0000000000000000000000000000000000000000..5211ca261e5bcf82b88f17a4a812a269d0cb6007 --- /dev/null +++ b/convert.php @@ -0,0 +1,14 @@ +#!/usr/bin/env php +<?php +require_once __DIR__ . '/vendor/autoload.php'; + +$config = require __DIR__ . '/includes/config.php'; +$steps = [ + 1 => __DIR__ . '/steps/convert-tickets-to-issues.php', +// 2 => '', +]; + +$result = []; +foreach ($steps as $number => $step) { + $result[$number] = require $step; +} diff --git a/includes/config.php b/includes/config.php new file mode 100644 index 0000000000000000000000000000000000000000..4b63c2f57773583b8e57827a112c004ed425993a --- /dev/null +++ b/includes/config.php @@ -0,0 +1,15 @@ +<?php +return [ + // Trac + 'trac-url' => 'https://tleilax:v0i8s1a5@develop.studip.de/trac/login', + 'trac-query' => 'id=8682', + + // GitLab + 'gitlab-url' => 'http://gitlabdev01.virt.uni-oldenburg.de', + 'gitlab-project' => 'studip/trunk', + 'gitlab-access-token' => 'se7cRwBAyySpFnzWmk7a', + 'gitlab-admin-token' => true, + + // Conversion settings + 'create-trac-links' => true, +]; diff --git a/includes/config.php.dist b/includes/config.php.dist new file mode 100644 index 0000000000000000000000000000000000000000..be7b499ed95ba78290a76e2fdbca2fede50e5672 --- /dev/null +++ b/includes/config.php.dist @@ -0,0 +1,15 @@ +<?php +return [ + // Trac + 'trac-url' => 'https://<username>:<password>@develop.studip.de/trac/login', + 'trac-query' => 'id=8682', + + // GitLab + 'gitlab-url' => 'http://gitlabdev01.virt.uni-oldenburg.de', + 'gitlab-project' => 'studip/trunk', + 'gitlab-access-token' => '<gitlab-token>', + 'gitlab-admin-token' => true, + + // Conversion settings + 'create-trac-links' => true, +]; diff --git a/includes/trac-users.txt b/includes/trac-users.txt new file mode 100644 index 0000000000000000000000000000000000000000..48f3169deb6f9d6ddb4eb2a8ee455b1d04beb58a --- /dev/null +++ b/includes/trac-users.txt @@ -0,0 +1,105 @@ +(no author) = No Author <none@author> +Arne = Arne Schröder <schroeder@data-quest.de> +arne = Arne Schröder <schroeder@data-quest.de> +BlackScorp = Witali Mik <mik@data-quest.de> +Constrictor = Chris Schierholz <chris.schierholz1@uni-oldenburg.de> +Fadi = Fadi <Fadi> +Judit = Judit <jsauerla@uni-osnabrueck.de> +JulianDierker = Julian Dierker <jdierker@uos.de> +KleinAnna = Anna Hruska <hruska@elsa.uni-hannover.de> +Krassmus = Rasmus Fuhse <fuhse@data-quest.de> +Nokianalgesie = Henry Röper <henry.roeper@uni-oldenburg.de> +aklassen = André Klaßen <andre@gundk.it> +albrechtj = Jens Albrecht <albrecht@elsa.uni-hannover.de> +andrenoack = André Noack <noackorama@gmail.com> +anoack = anoack <noackorama@gmail.com> +ansgar = Ansgar Bockstiegel <ansgar.bockstiegel@uni-osnabrueck.de> +arnewolf = arnewolf <arnewolf> +asudau = asudau <asudau> +awillner = awillner <awillner> +bvolkman = bvolkman <bvolkman> +bzeiss = bzeiss <bzeiss> +cbauer = cbauer <cbauer> +cflothma = Christian Flothmann <cflothma@uos.de> +chempel = chempel <chempel> +chueser = Christian Hüser <chueser@uos.de> +ckater = Cornelis Kater <info@ckater.de> +claraleinchen = Clara Hruska <clara.hruska@elsa.uni-hannover.de> +croser = Cornelia Roser <roser@hawk-hhg.de> +dabraham = dabraham <dabraham> +davka = David Siegfried <david.siegfried@uni-vechta.de> +dkreke = Dominik Kreke <d.kreke@gmx.de> +dofeldsc = Dominik Feldschnieders <dofeldsc@uos.de> +dreil = dreil <dreil> +dweber = dweber <dweber> +elau = elau <elau> +elmar = Elmar Ludwig <elmar.ludwig@uos.de> +fl00 = Florian Bieringer <florian.bieringer@uni-passau.de> +follerma = Frank Ollermann <follerma@uos.de> +hackl = Thomas Hackl <thomas.hackl@uni-passau.de> +hartge = Timo Hartge <hartge@data-quest.de> +hkletti = Helge Kletti <kletti@elsa.uni-hannover.de> +ischille = Ines Schiller <ischille@uos.de> +jankul = jankul <jankul> +jbickman = Johannes Bickmann <jbickman@uos.de> +jbickman = jbickman <jbickman> +jjss = jjss <jens.schmelzer@fh-jena.de> +jleissner = Jan-Frederik Leissner, Uni Osnabrück <jleissner@uos.de> +kgressho = Kristine Greßhöner <kgressho@uni-osnabrueck.de> +krassmus = Rasmus Fuhse <fuhse@data-quest.de> +krechtern = Kai Rechtern <kairechtern@gmail.com> +legolas = Gerd Hoffmann <gerd.hoffmann@uni-oldenburg.de> +lennartg = lennartg <lennartg> +ludwig = ludwig <ludwig> +manschwa = Manuel Schwarz <manschwa@uos.de> +matauten = Martin Tautenhahn <m.tautenhahn@tu-braunschweig.de> +mbohnsa = mbohnsa <mbohnsa> +mcohrs = mcohrs <mcohrs> +mdiedric = Marco Diedrich <mdiedric@uos.de> +meister_philipp = Philipp Schüttlöffel <pschuet@gmail.com> +mgieseki = Martin Gieseking <martin.gieseking@uos.de> +mlunzena = Marcus Lunzenauer <mlunzena@uos.de> +mriehe = Michael Riehemann <michael.riehemann@uni-oldenburg.de> +mrunge = mrunge <mrunge> +msievers = msievers <msievers> +mstrat = Martin Stratmann <martin@herrstratmann.de> +mstratmann = Martin Stratmann <martin@herrstratmann.de> +nadine = nadine Werner <mail_to_nadine@gmx.de> +ndettmer = Niklas Dettmer <ndettmer@uos.de> +netomer = netomer <netomer> +nimuelle = Nico Müller <nico.mueller@uni-oldenburg.de> +nkwindisch = nkwindisch <nkwindisch> +obrakel = obrakel <obrakel> +oelkers = Dirk Oelkers <d.oelkers@fh-wolfenbuettel.de> +oelkersd = Dirk Oelkers <d.oelkers@fh-wolfenbuettel.de> +phuegelm = phuegelm <phuegelm> +pitgrap = Michael Riehemann <michael.riehemann@uni-oldenburg.de> +pschuettl = pschuettl <pschuettl> +pthiene = Peter Thienel <thienel@data-quest.de> +pthienel = Peter Thienel <thienel@data-quest.de> +range = Meike Range <meikerange91@googlemail.com> +roepke = roepke <roepke> +root = root <root> +rstockm = rstockm <rstockm> +salakovic = Nejla Salakovic <salakovic@zqs.uni-hannover.de> +saschaef = Sascha Schäfer <saschaef@uni-osnabrueck.de> +sbrummer = Sönke Brummerloh <sbrummer@uni-osnabrueck.de> +schmelzer = schmelzer <schmelzer> +sewert = sewert <sewert@uos.de> +shilgen = Simone Hilgen <shilgen@uos.de> +shobert = shobert <shobert> +sosterloh = Stefan Osterloh <s.osterloh@uni-oldenburg.de> +ssuchi = Stefan Suchi <suchi@data-quest.de> +strehl = strehl <strehl> +strohm = strohm <strohm> +suchi = Stefan Suchi <suchi@data-quest.de> +sziemke = Sebastian Ziemke <sziemke@uos.de> +tgloeggl = Till Glöggler <tgloeggl@uni-osnabrueck.de> +theinrich = theinrich <theinrich> +tleilax = Jan-Hendrik Willms <tleilax+studip@gmail.com> +tthelen = Tobias Thelen <tobias.thelen@uni-osnabrueck.de> +vchuravy = Valentin Churavy <vchuravy@uos.de> +voteproject = voteproject <voteproject> +wilson = wilson <wilson> +wolfram = Dennis Wolfram <post@dennis-wolfram.de> +zabbarob = zabbarob <zabbarob> diff --git a/migrate.php b/migrate.php deleted file mode 100755 index 0bf6b0109885c3827a6a05d7394050203e3c1069..0000000000000000000000000000000000000000 --- a/migrate.php +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env php -<?php - -require_once "vendor/autoload.php"; - -use Trac2GitLab\Migration; -use Ulrichsg\Getopt\Getopt; -use Ulrichsg\Getopt\Option; - -define('GITLAB_PRIVATE_TOKEN', 'zBCqafqiWotFzaPYinQu'); - -$getopt = new Getopt(array( - array('t', 'trac', Getopt::REQUIRED_ARGUMENT, 'Trac URL'), - array('g', 'gitlab', Getopt::REQUIRED_ARGUMENT, 'GitLab URL'), - array('k', 'token', Getopt::OPTIONAL_ARGUMENT, 'GitLab API private token'), - array('p', 'project', Getopt::REQUIRED_ARGUMENT, 'GitLab project to which the tickets should be migrated'), - - // Both are optional, but at least must be present: - array('c', 'component', Getopt::OPTIONAL_ARGUMENT, 'Migrate open tickets of a specific Trac component'), - array('q', 'query', Getopt::OPTIONAL_ARGUMENT, 'Migrate all tickets matching this Trac query (e.g. "id=1234" or "status=!closed&owner=dachaz")'), - - // Trully optional - array('m', 'map', Getopt::OPTIONAL_ARGUMENT, 'Map of trac usernames to git usernames in the following format "tracUserA=gitUserX,tracUserB=gitUserY"'), - array('a', 'admin', Getopt::NO_ARGUMENT, 'Indicates that the GitLab token is from an admin user and as such tries to migrate the ticket reporter as well. If the reporter is not part of the provided GitLab project, the reporter will be set to the Admin user owning the token.'), - array('l', 'link', Getopt::NO_ARGUMENT, 'Create a link back to the original Trac ticket in the migrated issue'), - array('v', 'version', Getopt::NO_ARGUMENT, 'Just shows the version') -)); - -$issue_mapping = []; -try { - $getopt->parse(); - - if ($getopt->getOption('version')) { - echo 'Trac to Gitlab v' . getVersion() . "\n"; - exit(0); - } - - // Validate the parameters - validateRequired($getopt, array('trac', 'gitlab', 'project')); - if (is_null($getopt->getOption('component')) && is_null($getopt->getOption('query'))) { - throw new UnexpectedValueException("At least one of 'component' or 'query' must have a value"); - } - - // Convert user mapping from string to array - $userMapping = array(); - if (!is_null($getopt->getOption('map'))) { - if(preg_match('/(.+?=.+?,?)+/', $getopt->getOption('map')) == false) { - throw new UnexpectedValueException("Invalid format for 'map' option"); - } - - foreach(explode(',', $getopt->getOption('map')) as $mapping) { - $mappingArray = explode('=', $mapping); - $userMapping[$mappingArray[0]] = $mappingArray[1]; - } - } - - // Actually migrate - $migration = new Migration($getopt->getOption('gitlab'), $getopt->getOption('token') ?: GITLAB_PRIVATE_TOKEN, $getopt->getOption('admin'), $getopt->getOption('trac'), $getopt->getOption('link'), $userMapping); - // If we have a component, migrate it - if (!is_null($getopt->getOption('component'))) { - $issue_mapping = $migration->migrateComponent($getopt->getOption('component'), $getopt->getOption('project')); - } - // If we have a custom query, migrate it - if (!is_null($getopt->getOption('query'))) { - $issue_mapping = $migration->migrateQuery($getopt->getOption('query'), $getopt->getOption('project')); - } -} catch (UnexpectedValueException $e) { - echo "Error: ".$e->getMessage()."\n"; - echo $getopt->getHelpText(); - exit(1); -} catch (\Gitlab\Exception\RuntimeException $e) { - echo "GitLab Error: ".$e->getMessage()."\n"; - exit(1); -} catch (\JsonRPC\AccessDeniedException $e) { - echo "Trac Error: ".$e->getMessage()."\n"; - exit(1); -} catch (\JsonRPC\ConnectionFailureException $e) { - echo "Trac Error: ".$e->getMessage()."\n"; - exit(1); -} catch (\JsonRPC\ServerErrorException $e) { - echo "Trac Error: ".$e->getMessage()."\n"; - exit(1); -} - -function validateRequired($getopt, $requiredParams) { - foreach($requiredParams as $param) { - if (is_null($getopt->getOption($param))) { - throw new UnexpectedValueException("Option '$param' must have a value"); - } - } -} - -function getVersion() { - $str = file_get_contents('composer.json'); - $json = json_decode($str, true); - return $json['version']; -} - -?> diff --git a/steps/convert-tickets-to-issues.php b/steps/convert-tickets-to-issues.php new file mode 100644 index 0000000000000000000000000000000000000000..f0232b82aabafb748f9a3f8b7540630a38523786 --- /dev/null +++ b/steps/convert-tickets-to-issues.php @@ -0,0 +1,18 @@ +<?php +use Trac2GitLab\Migration; + +$issue_mapping = []; + +// Actually migrate +$migration = new Migration( + $config['gitlab-url'], + $config['gitlab-access-token'], + $config['gitlab-admin-token'], + $config['trac-url'], + $config['create-trac-links'], + $userMapping = [] +); +return $migration->migrateQuery( + $config['trac-query'], + $config['gitlab-project'] +); diff --git a/vendor/m4tthumphrey/php-gitlab-api/.travis.yml b/vendor/m4tthumphrey/php-gitlab-api/.travis.yml deleted file mode 100644 index 17367d5ba6c166ba50df64873f21710e0128296b..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: php - -php: - - 5.3.3 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - -before_script: - - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-source - -script: - - vendor/bin/phpunit --verbose --coverage-text diff --git a/vendor/m4tthumphrey/php-gitlab-api/README.md b/vendor/m4tthumphrey/php-gitlab-api/README.md deleted file mode 100644 index 157474446d98b127386dc2b7da8e30e7d26af079..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/README.md +++ /dev/null @@ -1,98 +0,0 @@ -A PHP wrapper for use with the [Gitlab API](https://github.com/gitlabhq/gitlabhq/tree/master/doc/api). -============== - -[](https://travis-ci.org/m4tthumphrey/php-gitlab-api) - -Based on [php-github-api](https://github.com/m4tthumphrey/php-github-api) and code from [KnpLabs](https://github.com/KnpLabs/php-github-api). - -Installation ------------- -Install Composer - -``` -$ curl -sS https://getcomposer.org/installer | php -$ sudo mv composer.phar /usr/local/bin/composer -``` - -Add the following to your require block in composer.json config. Note: be careful when using the `dev-master` tag as this may have unexpected results depending on your version of Gitlab. See the Versioning section below for more information. - -``` -"m4tthumphrey/php-gitlab-api": "dev-master" -``` - -Include Composer's autoloader: - - -```php -require_once dirname(__DIR__).'/vendor/autoload.php'; -``` - -Versioning ----------- - -From the 6.0 stable release of Gitlab, I shall now be matching the client version with the Gitlab version. For example when Gitlab 6.1 is released I will release version 6.1.0 of the API client. If I need to make future updates to the client before the next API version is released. I will simply use a 3th build version. For example `6.1.1`, `6.1.2` etc. It is recommended that you keep your composer file up to date depending on what version of Gitlab you are currently running. So if you are using 6.0, you should required `6.0.*`; 6.1 should be `6.1.*` etc etc. - -General API Usage ------------------ - -```php -$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here -$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here - -$project = $client->api('projects')->create('My Project', array( - 'description' => 'This is a project', - 'issues_enabled' => false -)); - -``` - -Model Usage ------------ - -You can also use the library in an object oriented manner. - -```php -$client = new \Gitlab\Client('http://git.yourdomain.com/api/v3/'); // change here -$client->authenticate('your_gitlab_token_here', \Gitlab\Client::AUTH_URL_TOKEN); // change here -``` - -Creating a new project - -```php -$project = \Gitlab\Model\Project::create($client, 'My Project', array( - 'description' => 'This is my project', - 'issues_enabled' => false -)); - -$project->addHook('http://mydomain.com/hook/push/1'); -``` - -Creating a new issue - -```php -$project = new \Gitlab\Model\Project(1, $client); -$issue = $project->createIssue('This does not work..', array( - 'description' => 'This doesnt work properly. Please fix', - 'assignee_id' => 2 -)); -``` - -Closing that issue - -```php -$issue->close(); -``` - -You get the idea! Take a look around and please feel free to report any bugs. - -Framework Integrations ----------------------- -- **Symfony** - https://github.com/Zeichen32/GitLabApiBundle -- **Laravel** - https://github.com/vinkla/gitlab - -If you have integrated GitLab into a popular PHP framework let us know! - -Contributing ------------- - -There are many parts of Gitlab that I have not added to this as it was originally created for personal use, hence the lack of tests. Feel free to fork and add new functionality and tests, I'll gladly accept decent pull requests. diff --git a/vendor/m4tthumphrey/php-gitlab-api/composer.json b/vendor/m4tthumphrey/php-gitlab-api/composer.json deleted file mode 100644 index 7a18f08754f47b41ec39183ec8c7cc1afeb8842d..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "m4tthumphrey/php-gitlab-api", - "type": "library", - "description": "GitLab API client", - "homepage": "https://github.com/m4tthumphrey/php-gitlab-api", - "keywords": ["gitlab", "api"], - "license": "MIT", - "authors": [ - { - "name": "Matt Humphrey", - "homepage": "http://m4tt.io" - }, - { - "name": "KnpLabs Team", - "homepage": "http://knplabs.com" - }, - { - "name": "Thibault Duplessis", - "email": "thibault.duplessis@gmail.com", - "homepage": "http://ornicar.github.com" - } - ], - "require": { - "php": ">=5.3.2", - "ext-curl": "*", - "kriswallsmith/buzz": ">=0.7" - }, - "require-dev": { - "phpunit/phpunit": "~4.5" - }, - "autoload": { - "psr-0": { "Gitlab\\": "lib/" } - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/AbstractApi.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/AbstractApi.php deleted file mode 100644 index 71b91e0c5cb0bbf6e0757497dfdbbe39b7aaa332..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/AbstractApi.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php namespace Gitlab\Api; - -use Gitlab\Client; - -/** - * Abstract class for Api classes - * - * @author Joseph Bielawski <stloyd@gmail.com> - * @author Matt Humphrey <matt@m4tt.co> - */ -abstract class AbstractApi -{ - /** - * Default entries per page - */ - const PER_PAGE = 20; - - /** - * The client - * - * @var Client - */ - protected $client; - - /** - * @param Client $client - */ - public function __construct(Client $client) - { - $this->client = $client; - } - - /** - * @return $this - * @codeCoverageIgnore - */ - public function configure() - { - return $this; - } - - /** - * @param string $path - * @param array $parameters - * @param array $requestHeaders - * @return mixed - */ - protected function get($path, array $parameters = array(), $requestHeaders = array()) - { - $response = $this->client->getHttpClient()->get($path, $parameters, $requestHeaders); - - return $response->getContent(); - } - - /** - * @param string $path - * @param array $parameters - * @param array $requestHeaders - * @return mixed - */ - protected function post($path, array $parameters = array(), $requestHeaders = array()) - { - $response = $this->client->getHttpClient()->post($path, $parameters, $requestHeaders); - - return $response->getContent(); - } - - /** - * @param string $path - * @param array $parameters - * @param array $requestHeaders - * @return mixed - */ - protected function patch($path, array $parameters = array(), $requestHeaders = array()) - { - $response = $this->client->getHttpClient()->patch($path, $parameters, $requestHeaders); - - return $response->getContent(); - } - - /** - * @param string $path - * @param array $parameters - * @param array $requestHeaders - * @return mixed - */ - protected function put($path, array $parameters = array(), $requestHeaders = array()) - { - $response = $this->client->getHttpClient()->put($path, $parameters, $requestHeaders); - - return $response->getContent(); - } - - /** - * @param string $path - * @param array $parameters - * @param array $requestHeaders - * @return mixed - */ - protected function delete($path, array $parameters = array(), $requestHeaders = array()) - { - $response = $this->client->getHttpClient()->delete($path, $parameters, $requestHeaders); - - return $response->getContent(); - } - - /** - * @param int $id - * @param string $path - * @return string - */ - protected function getProjectPath($id, $path) - { - return 'projects/'.$this->encodePath($id).'/'.$path; - } - - /** - * @param string $path - * @return string - */ - protected function encodePath($path) - { - $path = rawurlencode($path); - - return str_replace('.', '%2E', $path); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Groups.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Groups.php deleted file mode 100644 index 551034f9aaba7e7b2507d0060e13a7b84bc2ba0d..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Groups.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php namespace Gitlab\Api; - -class Groups extends AbstractApi -{ - /** - * @param int $page - * @param int $per_page - * @return mixed - */ - public function all($page = 1, $per_page = self::PER_PAGE) - { - return $this->get('groups', array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param string $query - * @param int $page - * @param int $per_page - * @return mixed - */ - public function search($query, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get('groups?search='.$this->encodePath($query), array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $id - * @return mixed - */ - public function show($id) - { - return $this->get('groups/'.$this->encodePath($id)); - } - - /** - * @param string $name - * @param string $path - * @param string $description - * @return mixed - */ - public function create($name, $path, $description = null) - { - return $this->post('groups', array( - 'name' => $name, - 'path' => $path, - 'description' => $description - )); - } - - /** - * @param int $group_id - * @return mixed - */ - public function remove($group_id) - { - return $this->delete('groups/'.$this->encodePath($group_id)); - } - - /** - * @param int $group_id - * @param int $project_id - * @return mixed - */ - public function transfer($group_id, $project_id) - { - return $this->post('groups/'.$this->encodePath($group_id).'/projects/'.$this->encodePath($project_id)); - } - - /** - * @param int $id - * @param int $page - * @param int $per_page - * @return mixed - */ - public function members($id, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get('groups/'.$this->encodePath($id).'/members', array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $group_id - * @param int $user_id - * @param int $access_level - * @return mixed - */ - public function addMember($group_id, $user_id, $access_level) - { - return $this->post('groups/'.$this->encodePath($group_id).'/members', array( - 'user_id' => $user_id, - 'access_level' => $access_level - )); - } - - /** - * @param int $group_id - * @param int $user_id - * @param int $access_level - * @return mixed - */ - public function saveMember($group_id, $user_id, $access_level) - { - return $this->put('groups/'.$this->encodePath($group_id).'/members/'.$this->encodePath($user_id), array( - 'access_level' => $access_level - )); - } - - /** - * @param int $group_id - * @param int $user_id - * @return mixed - */ - public function removeMember($group_id, $user_id) - { - return $this->delete('groups/'.$this->encodePath($group_id).'/members/'.$this->encodePath($user_id)); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Issues.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Issues.php deleted file mode 100644 index 86dd78b4bc98f9601626912670d5cbb95b671e93..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Issues.php +++ /dev/null @@ -1,108 +0,0 @@ -<?php namespace Gitlab\Api; - -class Issues extends AbstractApi -{ - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param array $params - * @return mixed - */ - public function all($project_id = null, $page = 1, $per_page = self::PER_PAGE, array $params = array()) - { - $path = $project_id === null ? 'issues' : $this->getProjectPath($project_id, 'issues'); - - $params = array_intersect_key($params, array('labels' => '', 'state' => '', 'sort' => '', 'order_by' => '')); - $params = array_merge(array( - 'page' => $page, - 'per_page' => $per_page - ), $params); - - return $this->get($path, $params); - } - - /** - * @param int $project_id - * @param int $issue_id - * @return mixed - */ - public function show($project_id, $issue_id) - { - return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id))); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function create($project_id, array $params) - { - return $this->post($this->getProjectPath($project_id, 'issues'), $params); - } - - /** - * @param int $project_id - * @param int $issue_id - * @param array $params - * @return mixed - */ - public function update($project_id, $issue_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)), $params); - } - - /** - * @param int $project_id - * @param int $issue_id - * @return mixed - */ - public function showComments($project_id, $issue_id) - { - return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes'); - } - - /** - * @param int $project_id - * @param int $issue_id - * @param int $note_id - * @return mixed - */ - public function showComment($project_id, $issue_id, $note_id) - { - return $this->get($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id)).'/notes/'.$this->encodePath($note_id)); - } - - /** - * @param int $project_id - * @param int $issue_id - * @param string|array $body - * @return mixed - */ - public function addComment($project_id, $issue_id, $body) - { - // backwards compatibility - if (is_array($body)) { - $params = $body; - } else { - $params = array('body' => $body); - } - - return $this->post($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes'), $params); - } - - /** - * @param int $project_id - * @param int $issue_id - * @param int $note_id - * @param string $body - * @return mixed - */ - public function updateComment($project_id, $issue_id, $note_id, $body) - { - return $this->put($this->getProjectPath($project_id, 'issues/'.$this->encodePath($issue_id).'/notes/'.$this->encodePath($note_id)), array( - 'body' => $body - )); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/MergeRequests.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/MergeRequests.php deleted file mode 100644 index d7ef4c156cb132f27675ddb9c45930a0f5a8880d..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/MergeRequests.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php namespace Gitlab\Api; - -class MergeRequests extends AbstractApi -{ - const STATE_ALL = 'all'; - const STATE_MERGED = 'merged'; - const STATE_OPENED = 'opened'; - const STATE_CLOSED = 'closed'; - - const ORDER_BY = 'created_at'; - const SORT = 'asc'; - - /** - * @param int $project_id - * @param string $state - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function getList($project_id, $state = self::STATE_ALL, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->get($this->getProjectPath($project_id, 'merge_requests'), array( - 'page' => $page, - 'per_page' => $per_page, - 'state' => $state, - 'order_by' => $order_by, - 'sort' => $sort - )); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function all($project_id, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->getList($project_id, self::STATE_ALL, $page, $per_page, $order_by, $sort); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function merged($project_id, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->getList($project_id, self::STATE_MERGED, $page, $per_page, $order_by, $sort); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function opened($project_id, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->getList($project_id, self::STATE_OPENED, $page, $per_page, $order_by, $sort); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function closed($project_id, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->getList($project_id, self::STATE_CLOSED, $page, $per_page, $order_by, $sort); - } - - /** - * @param int $project_id - * @param int $mr_id - * @return mixed - */ - public function show($project_id, $mr_id) - { - return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id))); - } - - /** - * @param int $project_id - * @param string $source - * @param string $target - * @param string $title - * @param int $assignee - * @param int $target_project_id - * @param string $description - * @return mixed - */ - public function create($project_id, $source, $target, $title, $assignee = null, $target_project_id = null, $description = null) - { - return $this->post($this->getProjectPath($project_id, 'merge_requests'), array( - 'source_branch' => $source, - 'target_branch' => $target, - 'title' => $title, - 'assignee_id' => $assignee, - 'target_project_id' => $target_project_id, - 'description' => $description - )); - } - - /** - * @param int $project_id - * @param int $mr_id - * @param array $params - * @return mixed - */ - public function update($project_id, $mr_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id)), $params); - } - - /** - * @param int $project_id - * @param int $mr_id - * @param string $message - * @return mixed - */ - public function merge($project_id, $mr_id, $message = null) - { - if (is_array($message)) { - $params = $message; - } else { - $params = array('merge_commit_message' => $message); - } - - return $this->put($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/merge'), $params); - } - - /** - * @param int $project_id - * @param int $mr_id - * @return mixed - */ - public function showComments($project_id, $mr_id) - { - return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/comments')); - } - - /** - * @param int $project_id - * @param int $mr_id - * @param int $note - * @return mixed - */ - public function addComment($project_id, $mr_id, $note) - { - return $this->post($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/comments'), array( - 'note' => $note - )); - } - - /** - * @param int $project_id - * @param int $mr_id - * @return mixed - */ - public function changes($project_id, $mr_id) - { - return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/changes')); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Milestones.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Milestones.php deleted file mode 100644 index 3b15281834e07651e1a2cb6d75504beaf78629ac..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Milestones.php +++ /dev/null @@ -1,59 +0,0 @@ -<?php namespace Gitlab\Api; - -class Milestones extends AbstractApi -{ - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @return mixed - */ - public function all($project_id, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get($this->getProjectPath($project_id, 'milestones'), array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $project_id - * @param int $milestone_id - * @return mixed - */ - public function show($project_id, $milestone_id) - { - return $this->get($this->getProjectPath($project_id, 'milestones/'.$this->encodePath($milestone_id))); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function create($project_id, array $params) - { - return $this->post($this->getProjectPath($project_id, 'milestones'), $params); - } - - /** - * @param int $project_id - * @param int $milestone_id - * @param array $params - * @return mixed - */ - public function update($project_id, $milestone_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'milestones/'.$this->encodePath($milestone_id)), $params); - } - - /** - * @param int $project_id - * @param int $milestone_id - * @return mixed - */ - public function issues($project_id, $milestone_id) - { - return $this->get($this->getProjectPath($project_id, 'milestones/'.$this->encodePath($milestone_id).'/issues')); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/ProjectNamespaces.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/ProjectNamespaces.php deleted file mode 100644 index 480fa79c88097df77b99386a32e408f67552f070..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/ProjectNamespaces.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php namespace Gitlab\Api; - -class ProjectNamespaces extends AbstractApi -{ - /** - * @param int $page - * @param int $per_page - * @return mixed - */ - public function all($page = 1, $per_page = self::PER_PAGE) - { - return $this->get('namespaces', array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param string $terms - * @param int $page - * @param int $per_page - * @return mixed - */ - public function search($terms, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get('namespaces', array( - 'search' => $terms, - 'page' => $page, - 'per_page' => $per_page - )); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Projects.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Projects.php deleted file mode 100644 index 45104d5083e50319726c290748b44a519a551928..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Projects.php +++ /dev/null @@ -1,388 +0,0 @@ -<?php namespace Gitlab\Api; - -class Projects extends AbstractApi -{ - const ORDER_BY = 'created_at'; - const SORT = 'asc'; - - /** - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function all($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->get('projects/all', array( - 'page' => $page, - 'per_page' => $per_page, - 'order_by' => $order_by, - 'sort' => $sort - )); - } - - /** - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function accessible($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->get('projects', array( - 'page' => $page, - 'per_page' => $per_page, - 'order_by' => $order_by, - 'sort' => $sort - )); - } - - /** - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function owned($page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->get('projects/owned', array( - 'page' => $page, - 'per_page' => $per_page, - 'order_by' => $order_by, - 'sort' => $sort - )); - } - - /** - * @param string $query - * @param int $page - * @param int $per_page - * @param string $order_by - * @param string $sort - * @return mixed - */ - public function search($query, $page = 1, $per_page = self::PER_PAGE, $order_by = self::ORDER_BY, $sort = self::SORT) - { - return $this->get('projects/search/'.$this->encodePath($query), array( - 'page' => $page, - 'per_page' => $per_page, - 'order_by' => $order_by, - 'sort' => $sort - )); - } - - /** - * @param int $project_id - * @return mixed - */ - public function show($project_id) - { - return $this->get('projects/'.$this->encodePath($project_id)); - } - - /** - * @param string $name - * @param array $params - * @return mixed - */ - public function create($name, array $params = array()) - { - $params['name'] = $name; - - return $this->post('projects', $params); - } - - /** - * @param int $user_id - * @param string $name - * @param array $params - * @return mixed - */ - public function createForUser($user_id, $name, array $params = array()) - { - $params['name'] = $name; - - return $this->post('projects/user/'.$this->encodePath($user_id), $params); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function update($project_id, array $params) - { - return $this->put('projects/'.$this->encodePath($project_id), $params); - } - - /** - * @param int $project_id - * @return mixed - */ - public function remove($project_id) - { - return $this->delete('projects/'.$this->encodePath($project_id)); - } - - /** - * @param int $project_id - * @param string $username_query - * @return mixed - */ - public function members($project_id, $username_query = null) - { - return $this->get($this->getProjectPath($project_id, 'members'), array( - 'query' => $username_query - )); - } - - /** - * @param int $project_id - * @param int $user_id - * @return mixed - */ - public function member($project_id, $user_id) - { - return $this->get($this->getProjectPath($project_id, 'members/'.$this->encodePath($user_id))); - } - - /** - * @param int $project_id - * @param int $user_id - * @param int $access_level - * @return mixed - */ - public function addMember($project_id, $user_id, $access_level) - { - return $this->post($this->getProjectPath($project_id, 'members'), array( - 'user_id' => $user_id, - 'access_level' => $access_level - )); - } - - /** - * @param int $project_id - * @param int $user_id - * @param int $access_level - * @return mixed - */ - public function saveMember($project_id, $user_id, $access_level) - { - return $this->put($this->getProjectPath($project_id, 'members/'.urldecode($user_id)), array( - 'access_level' => $access_level - )); - } - - /** - * @param int $project_id - * @param int $user_id - * @return mixed - */ - public function removeMember($project_id, $user_id) - { - return $this->delete($this->getProjectPath($project_id, 'members/'.urldecode($user_id))); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @return mixed - */ - public function hooks($project_id, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get($this->getProjectPath($project_id, 'hooks'), array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $project_id - * @param int $hook_id - * @return mixed - */ - public function hook($project_id, $hook_id) - { - return $this->get($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id))); - } - - /** - * @param int $project_id - * @param string $url - * @param array $params - * @return mixed - */ - public function addHook($project_id, $url, array $params = array()) - { - if (empty($params)) { - $params = array('push_events' => true); - } - - $params['url'] = $url; - - return $this->post($this->getProjectPath($project_id, 'hooks'), $params); - } - - /** - * @param int $project_id - * @param int $hook_id - * @param array $params - * @return mixed - */ - public function updateHook($project_id, $hook_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id)), $params); - } - - /** - * @param int $project_id - * @param int $hook_id - * @return mixed - */ - public function removeHook($project_id, $hook_id) - { - return $this->delete($this->getProjectPath($project_id, 'hooks/'.$this->encodePath($hook_id))); - } - - /** - * @param int $project_id - * @return mixed - */ - public function keys($project_id) - { - return $this->get($this->getProjectPath($project_id, 'keys')); - } - - /** - * @param int $project_id - * @param int $key_id - * @return mixed - */ - public function key($project_id, $key_id) - { - return $this->get($this->getProjectPath($project_id, 'keys/'.$this->encodePath($key_id))); - } - - /** - * @param int $project_id - * @param string $title - * @param string $key - * @return mixed - */ - public function addKey($project_id, $title, $key) - { - return $this->post($this->getProjectPath($project_id, 'keys'), array( - 'title' => $title, - 'key' => $key - )); - } - - /** - * @param int $project_id - * @param int $key_id - * @return mixed - */ - public function removeKey($project_id, $key_id) - { - return $this->delete($this->getProjectPath($project_id, 'keys/'.$this->encodePath($key_id))); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @return mixed - */ - public function events($project_id, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get($this->getProjectPath($project_id, 'events'), array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $project_id - * @return mixed - */ - public function labels($project_id) - { - return $this->get($this->getProjectPath($project_id, 'labels')); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function addLabel($project_id, array $params) - { - return $this->post($this->getProjectPath($project_id, 'labels'), $params); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function updateLabel($project_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'labels'), $params); - } - - /** - * @param int $project_id - * @param string $name - * @return mixed - */ - public function removeLabel($project_id, $name) - { - return $this->delete($this->getProjectPath($project_id, 'labels'), array( - 'name' => $name - )); - } - - /** - * @param int $project_id - * @param int $forked_project_id - * @return mixed - */ - public function createForkRelation($project_id, $forked_project_id) - { - return $this->post($this->getProjectPath($project_id, 'fork/'.$this->encodePath($forked_project_id))); - } - - /** - * @param int $project_id - * @return mixed - */ - public function removeForkRelation($project_id) - { - return $this->delete($this->getProjectPath($project_id, 'fork')); - } - - /** - * @param int $project_id - * @param string $service_name - * @param array $params - * @return mixed - */ - public function setService($project_id, $service_name, array $params = array()) - { - return $this->put($this->getProjectPath($project_id, 'services/'.$this->encodePath($service_name)), $params); - } - - /** - * @param int $project_id - * @param string $service_name - * @return mixed - */ - public function removeService($project_id, $service_name) - { - return $this->delete($this->getProjectPath($project_id, 'services/'.$this->encodePath($service_name))); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Repositories.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Repositories.php deleted file mode 100644 index 83e91eff52ab9efee45e14b104b922f766e37a9c..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Repositories.php +++ /dev/null @@ -1,284 +0,0 @@ -<?php namespace Gitlab\Api; - -class Repositories extends AbstractApi -{ - /** - * @param int $project_id - * @return mixed - */ - public function branches($project_id) - { - return $this->get($this->getProjectPath($project_id, 'repository/branches')); - } - - /** - * @param int $project_id - * @param int $branch_id - * @return mixed - */ - public function branch($project_id, $branch_id) - { - return $this->get($this->getProjectPath($project_id, 'repository/branches/'.$this->encodeBranch($branch_id))); - } - - /** - * @param int $project_id - * @param string $branch_name - * @param string $ref - * @return mixed - */ - public function createBranch($project_id, $branch_name, $ref) - { - return $this->post($this->getProjectPath($project_id, 'repository/branches'), array( - 'branch_name' => $branch_name, - 'ref' => $ref - )); - } - - /** - * @param int $project_id - * @param string $branch_name - * @return mixed - */ - public function deleteBranch($project_id, $branch_name) - { - return $this->delete($this->getProjectPath($project_id, 'repository/branches/'.$this->encodeBranch($branch_name))); - } - - /** - * @param int $project_id - * @param string $branch_name - * @return mixed - */ - public function protectBranch($project_id, $branch_name) - { - return $this->put($this->getProjectPath($project_id, 'repository/branches/'.$this->encodeBranch($branch_name).'/protect')); - } - - /** - * @param int $project_id - * @param string $branch_name - * @return mixed - */ - public function unprotectBranch($project_id, $branch_name) - { - return $this->put($this->getProjectPath($project_id, 'repository/branches/'.$this->encodeBranch($branch_name).'/unprotect')); - } - - /** - * @param int $project_id - * @return mixed - */ - public function tags($project_id) - { - return $this->get($this->getProjectPath($project_id, 'repository/tags')); - } - - /** - * @param int $project_id - * @param string $name - * @param string $ref - * @param string $message - * @return mixed - */ - public function createTag($project_id, $name, $ref, $message = null) - { - return $this->post($this->getProjectPath($project_id, 'repository/tags'), array( - 'tag_name' => $name, - 'ref' => $ref, - 'message' => $message - )); - } - - /** - * @param int $project_id - * @param int $page - * @param int $per_page - * @param null $ref_name - * @return mixed - */ - public function commits($project_id, $page = 0, $per_page = self::PER_PAGE, $ref_name = null) - { - return $this->get($this->getProjectPath($project_id, 'repository/commits'), array( - 'page' => $page, - 'per_page' => $per_page, - 'ref_name' => $ref_name - )); - } - - /** - * @param int $project_id - * @param $sha - * @return mixed - */ - public function commit($project_id, $sha) - { - return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha))); - } - - /** - * @param int $project_id - * @param string $sha - * @param int $page - * @param int $per_page - * @return mixed - */ - public function commitComments($project_id, $sha, $page = 0, $per_page = self::PER_PAGE) - { - return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/comments'), array( - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $project_id - * @param string $sha - * @param string $note - * @param array $params - * @return mixed - */ - public function createCommitComment($project_id, $sha, $note, array $params = array()) - { - $params['note'] = $note; - - return $this->post($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/comments'), $params); - } - - /** - * @param int $project_id - * @param string $fromShaOrMaster - * @param string $toShaOrMaster - * @return mixed - */ - public function compare($project_id, $fromShaOrMaster, $toShaOrMaster) - { - return $this->get($this->getProjectPath( - $project_id, - 'repository/compare?from='.$this->encodeBranch($fromShaOrMaster).'&to='.$this->encodeBranch($toShaOrMaster) - )); - } - - /** - * @param int $project_id - * @param string $sha - * @return string - */ - public function diff($project_id, $sha) - { - return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/diff')); - } - - /** - * @param int $project_id - * @param array $params - * @return mixed - */ - public function tree($project_id, array $params = array()) - { - return $this->get($this->getProjectPath($project_id, 'repository/tree'), $params); - } - - /** - * @param int $project_id - * @param string $sha - * @param string $filepath - * @return mixed - */ - public function blob($project_id, $sha, $filepath) - { - return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/blob'), array( - 'filepath' => $filepath - )); - } - - /** - * @param int $project_id - * @param string $file_path - * @param string $ref - * @return mixed - */ - public function getFile($project_id, $file_path, $ref) - { - return $this->get($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, - 'ref' => $ref - )); - } - - /** - * @param int $project_id - * @param string $file_path - * @param string $content - * @param string $branch_name - * @param string $commit_message - * @param string $encoding - * @return mixed - */ - public function createFile($project_id, $file_path, $content, $branch_name, $commit_message, $encoding = null) - { - return $this->post($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, - 'branch_name' => $branch_name, - 'content' => $content, - 'commit_message' => $commit_message, - 'encoding' => $encoding - )); - } - - /** - * @param int $project_id - * @param string $file_path - * @param string $content - * @param string $branch_name - * @param string $commit_message - * @param string $encoding - * @return mixed - */ - public function updateFile($project_id, $file_path, $content, $branch_name, $commit_message, $encoding = null) - { - return $this->put($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, - 'branch_name' => $branch_name, - 'content' => $content, - 'commit_message' => $commit_message, - 'encoding' => $encoding - )); - } - - /** - * @param int $project_id - * @param string $file_path - * @param string $branch_name - * @param string $commit_message - * @return mixed - */ - public function deleteFile($project_id, $file_path, $branch_name, $commit_message) - { - return $this->delete($this->getProjectPath($project_id, 'repository/files'), array( - 'file_path' => $file_path, - 'branch_name' => $branch_name, - 'commit_message' => $commit_message - )); - } - - /** - * @param int $project_id - * @return mixed - */ - public function contributors($project_id) - { - return $this->get($this->getProjectPath($project_id, 'repository/contributors')); - } - - /** - * @param string $path - * @return string - */ - protected function encodeBranch($path) - { - $path = $this->encodePath($path); - - return str_replace('%2F', '/', $path); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Snippets.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Snippets.php deleted file mode 100644 index 00921128c8922b3354885c8ddf48a27b08d165f0..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Snippets.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php namespace Gitlab\Api; - -class Snippets extends AbstractApi -{ - /** - * @param int $project_id - * @return mixed - */ - public function all($project_id) - { - return $this->get($this->getProjectPath($project_id, 'snippets')); - } - - /** - * @param int $project_id - * @param int $snippet_id - * @return mixed - */ - public function show($project_id, $snippet_id) - { - return $this->get($this->getProjectPath($project_id, 'snippets/'.$this->encodePath($snippet_id))); - } - - /** - * @param int $project_id - * @param string $title - * @param string $filename - * @param string $code - * @return mixed - */ - public function create($project_id, $title, $filename, $code) - { - return $this->post($this->getProjectPath($project_id, 'snippets'), array( - 'title' => $title, - 'file_name' => $filename, - 'code' => $code - )); - } - - /** - * @param int $project_id - * @param int $snippet_id - * @param array $params - * @return mixed - */ - public function update($project_id, $snippet_id, array $params) - { - return $this->put($this->getProjectPath($project_id, 'snippets/'.$this->encodePath($snippet_id)), $params); - } - - /** - * @param int $project_id - * @param int $snippet_id - * @return string - */ - public function content($project_id, $snippet_id) - { - return $this->get($this->getProjectPath($project_id, 'snippets/'.$this->encodePath($snippet_id).'/raw')); - } - - /** - * @param int $project_id - * @param int $snippet_id - * @return mixed - */ - public function remove($project_id, $snippet_id) - { - return $this->delete($this->getProjectPath($project_id, 'snippets/'.$this->encodePath($snippet_id))); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/SystemHooks.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/SystemHooks.php deleted file mode 100644 index b21fd0908ffc06c29befeff674a3432fcfd7b888..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/SystemHooks.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php namespace Gitlab\Api; - -class SystemHooks extends AbstractApi -{ - /** - * @return mixed - */ - public function all() - { - return $this->get('hooks'); - } - - /** - * @param string $url - * @return mixed - */ - public function create($url) - { - return $this->post('hooks', array( - 'url' => $url - )); - } - - /** - * @param int $id - * @return mixed - */ - public function test($id) - { - return $this->get('hooks/'.$this->encodePath($id)); - } - - /** - * @param int $id - * @return mixed - */ - public function remove($id) - { - return $this->delete('hooks/'.$this->encodePath($id)); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Users.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Users.php deleted file mode 100644 index 2fa1d88c3799c86153f9eed609d4d8ec0ea67343..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Api/Users.php +++ /dev/null @@ -1,210 +0,0 @@ -<?php namespace Gitlab\Api; - -class Users extends AbstractApi -{ - /** - * @param null|true $active - * @param int $page - * @param int $per_page - * @return mixed - */ - public function all($active = null, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get('users', array( - 'active' => $active, - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param string $query - * @param null|true $active - * @param int $page - * @param int $per_page - * @return mixed - */ - public function search($query, $active = null, $page = 1, $per_page = self::PER_PAGE) - { - return $this->get('users', array( - 'search' => $query, - 'active' => $active, - 'page' => $page, - 'per_page' => $per_page - )); - } - - /** - * @param int $id - * @return mixed - */ - public function show($id) - { - return $this->get('users/'.$this->encodePath($id)); - } - - /** - * @param string $email - * @param string $password - * @param array $params - * @return mixed - */ - public function create($email, $password, array $params = array()) - { - $params['email'] = $email; - $params['password'] = $password; - - return $this->post('users', $params); - } - - /** - * @param int $id - * @param array $params - * @return mixed - */ - public function update($id, array $params) - { - return $this->put('users/'.$this->encodePath($id), $params); - } - - /** - * @param int $id - * @return mixed - */ - public function remove($id) - { - return $this->delete('users/'.$this->encodePath($id)); - } - - /** - * @param int $id - * @return mixed - */ - public function block($id) - { - return $this->put('users/'.$this->encodePath($id).'/block'); - } - - /** - * @param int $id - * @return mixed - */ - public function unblock($id) - { - return $this->put('users/'.$this->encodePath($id).'/unblock'); - } - - /** - * @param string $emailOrUsername - * @param string $password - * @return mixed - */ - public function session($emailOrUsername, $password) - { - return $this->post('session', array( - 'login' => $emailOrUsername, - 'email' => $emailOrUsername, - 'password' => $password - )); - } - - /** - * @param string $email - * @param string $password - * @return mixed - */ - public function login($email, $password) - { - return $this->session($email, $password); - } - - /** - * @return mixed - */ - public function me() - { - return $this->get('user'); - } - - /** - * @return mixed - */ - public function keys() - { - return $this->get('user/keys'); - } - - /** - * @param int $id - * @return mixed - */ - public function key($id) - { - return $this->get('user/keys/'.$this->encodePath($id)); - } - - /** - * @param string $title - * @param string $key - * @return mixed - */ - public function createKey($title, $key) - { - return $this->post('user/keys', array( - 'title' => $title, - 'key' => $key - )); - } - - /** - * @param int $id - * @return mixed - */ - public function removeKey($id) - { - return $this->delete('user/keys/'.$this->encodePath($id)); - } - - /** - * @param int $user_id - * @return mixed - */ - public function userKeys($user_id) - { - return $this->get('users/'.$this->encodePath($user_id).'/keys'); - } - - /* - * @param int $user_id - * @param int $key_id - * @return mixed - */ - public function userKey($user_id, $key_id) - { - return $this->get('users/'.$this->encodePath($user_id).'/keys/'.$this->encodePath($key_id)); - } - - /** - * @param int $user_id - * @param string $title - * @param string $key - * @return mixed - */ - public function createKeyForUser($user_id, $title, $key) - { - return $this->post('users/'.$this->encodePath($user_id).'/keys', array( - 'title' => $title, - 'key' => $key - )); - } - - /** - * @param int $user_id - * @param int $key_id - * @return mixed - */ - public function removeUserKey($user_id, $key_id) - { - return $this->delete('users/'.$this->encodePath($user_id).'/keys/'.$this->encodePath($key_id)); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Client.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Client.php deleted file mode 100644 index af6a694175548a59aed8dcdb8e4e681481be4f5d..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Client.php +++ /dev/null @@ -1,272 +0,0 @@ -<?php namespace Gitlab; - -use Buzz\Client\Curl; -use Buzz\Client\ClientInterface; - -use Gitlab\Api\AbstractApi; -use Gitlab\Exception\InvalidArgumentException; -use Gitlab\HttpClient\HttpClient; -use Gitlab\HttpClient\HttpClientInterface; -use Gitlab\HttpClient\Listener\AuthListener; - -/** - * Simple API wrapper for Gitlab - * - * @author Matt Humphrey <matt@m4tt.co> - * - * @property-read \Gitlab\Api\Groups $groups - * @property-read \Gitlab\Api\Issues $issues - * @property-read \Gitlab\Api\MergeRequests $merge_requests - * @property-read \Gitlab\Api\MergeRequests $mr - * @property-read \Gitlab\Api\Milestones $milestones - * @property-read \Gitlab\Api\Milestones $ms - * @property-read \Gitlab\Api\ProjectNamespaces $namespaces - * @property-read \Gitlab\Api\ProjectNamespaces $ns - * @property-read \Gitlab\Api\Projects $projects - * @property-read \Gitlab\Api\Repositories $repositories - * @property-read \Gitlab\Api\Repositories $repo - * @property-read \Gitlab\Api\Snippets $snippets - * @property-read \Gitlab\Api\SystemHooks $hooks - * @property-read \Gitlab\Api\SystemHooks $system_hooks - * @property-read \Gitlab\Api\Users $users - */ -class Client -{ - /** - * Constant for authentication method. Indicates the default, but deprecated - * login with username and token in URL. - */ - const AUTH_URL_TOKEN = 'url_token'; - - /** - * Constant for authentication method. Indicates the new login method with - * with username and token via HTTP Authentication. - */ - const AUTH_HTTP_TOKEN = 'http_token'; - - /** - * Constant for authentication method. Indicates the OAuth method with a key - * obtain using Gitlab's OAuth provider. - */ - const AUTH_OAUTH_TOKEN = 'oauth_token'; - - /** - * @var array - */ - private $options = array( - 'user_agent' => 'php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)', - 'timeout' => 60 - ); - - private $baseUrl; - - /** - * The Buzz instance used to communicate with Gitlab - * - * @var HttpClient - */ - private $httpClient; - - /** - * Instantiate a new Gitlab client - * - * @param string $baseUrl - * @param null|ClientInterface $httpClient Buzz client - */ - public function __construct($baseUrl, ClientInterface $httpClient = null) - { - $httpClient = $httpClient ?: new Curl(); - $httpClient->setTimeout($this->options['timeout']); - $httpClient->setVerifyPeer(false); - - $this->baseUrl = $baseUrl; - $this->httpClient = new HttpClient($this->baseUrl, $this->options, $httpClient); - } - - /** - * @param string $name - * - * @return AbstractApi|mixed - * @throws InvalidArgumentException - */ - public function api($name) - { - switch ($name) { - - case 'groups': - $api = new Api\Groups($this); - break; - - case 'issues': - $api = new Api\Issues($this); - break; - - case 'mr': - case 'merge_requests': - $api = new Api\MergeRequests($this); - break; - - case 'milestones': - case 'ms': - $api = new Api\Milestones($this); - break; - - case 'namespaces': - case 'ns': - $api = new Api\ProjectNamespaces($this); - break; - - case 'projects': - $api = new Api\Projects($this); - break; - - case 'repo': - case 'repositories': - $api = new Api\Repositories($this); - break; - - case 'snippets': - $api = new Api\Snippets($this); - break; - - case 'hooks': - case 'system_hooks': - $api = new Api\SystemHooks($this); - break; - - case 'users': - $api = new Api\Users($this); - break; - - default: - throw new InvalidArgumentException('Invalid endpoint: "'.$name.'"'); - - } - - return $api; - } - - /** - * Authenticate a user for all next requests - * - * @param string $token Gitlab private token - * @param string $authMethod One of the AUTH_* class constants - * @param string $sudo - * @return $this - */ - public function authenticate($token, $authMethod = self::AUTH_URL_TOKEN, $sudo = null) - { - $this->httpClient->addListener( - new AuthListener( - $authMethod, - $token, - $sudo - ) - ); - - return $this; - } - - /** - * @return HttpClient - */ - public function getHttpClient() - { - return $this->httpClient; - } - - /** - * @param HttpClientInterface $httpClient - * @return $this - */ - public function setHttpClient(HttpClientInterface $httpClient) - { - $this->httpClient = $httpClient; - - return $this; - } - - /** - * @param string $url - * @return $this - */ - public function setBaseUrl($url) - { - $this->baseUrl = $url; - - return $this; - } - - /** - * @return string - */ - public function getBaseUrl() - { - return $this->baseUrl; - } - - /** - * Clears used headers - * - * @return $this - */ - public function clearHeaders() - { - $this->httpClient->clearHeaders(); - - return $this; - } - - /** - * @param array $headers - * @return $this - */ - public function setHeaders(array $headers) - { - $this->httpClient->setHeaders($headers); - - return $this; - } - - /** - * @param string $name - * - * @return mixed - * - * @throws InvalidArgumentException - */ - public function getOption($name) - { - if (!array_key_exists($name, $this->options)) { - throw new InvalidArgumentException(sprintf('Undefined option called: "%s"', $name)); - } - - return $this->options[$name]; - } - - /** - * @param string $name - * @param mixed $value - * @throws InvalidArgumentException - * @return $this - */ - public function setOption($name, $value) - { - if (!array_key_exists($name, $this->options)) { - throw new InvalidArgumentException(sprintf('Undefined option called: "%s"', $name)); - } - - $this->options[$name] = $value; - - return $this; - } - - /** - * @param string $api - * @return AbstractApi - */ - public function __get($api) - { - return $this->api($api); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ErrorException.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ErrorException.php deleted file mode 100644 index 322a7082da842e0a605b6ade666f9ecc23f54aec..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ErrorException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php namespace Gitlab\Exception; - -/** - * ErrorException - * - * @author Joseph Bielawski <stloyd@gmail.com> - */ -class ErrorException extends \ErrorException -{ - -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/InvalidArgumentException.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/InvalidArgumentException.php deleted file mode 100644 index 892a6dc4bd945fbe0ff6889d93aeb9f45906c721..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php namespace Gitlab\Exception; - -/** - * InvalidArgumentException - * - * @author Joseph Bielawski <stloyd@gmail.com> - */ -class InvalidArgumentException extends \InvalidArgumentException -{ - -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/MissingArgumentException.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/MissingArgumentException.php deleted file mode 100644 index f157b49d1e5a263071e637a0f376d417476757dc..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/MissingArgumentException.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php namespace Gitlab\Exception; - -/** - * MissingArgumentException - * - * @author Joseph Bielawski <stloyd@gmail.com> - */ -class MissingArgumentException extends ErrorException -{ - public function __construct($required, $code = 0, $previous = null) - { - if (is_string($required)) { - $required = array($required); - } - - parent::__construct(sprintf('One or more of required ("%s") parameters is missing!', implode('", "', $required)), $code, $previous); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/RuntimeException.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/RuntimeException.php deleted file mode 100644 index 9d938e2cc3948e6c7858fc020d4cb753d828f709..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/RuntimeException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php namespace Gitlab\Exception; - -/** - * RuntimeException - * - * @author Joseph Bielawski <stloyd@gmail.com> - */ -class RuntimeException extends \RuntimeException -{ - -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ValidationFailedException.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ValidationFailedException.php deleted file mode 100644 index 9ce6635fe58795a4b740ea1a8208d04cfac8d2bd..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Exception/ValidationFailedException.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php namespace Gitlab\Exception; - -/** - * ValidationFailedException - * - * @author Joseph Bielawski <stloyd@gmail.com> - */ -class ValidationFailedException extends ErrorException -{ - -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClient.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClient.php deleted file mode 100644 index 974b57ad8a9566b8099c6f42ae755d7d1ad0bfc5..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClient.php +++ /dev/null @@ -1,213 +0,0 @@ -<?php namespace Gitlab\HttpClient; - -use Buzz\Client\ClientInterface; -use Buzz\Listener\ListenerInterface; - -use Gitlab\Exception\ErrorException; -use Gitlab\Exception\RuntimeException; -use Gitlab\HttpClient\Listener\ErrorListener; -use Gitlab\HttpClient\Message\Request; -use Gitlab\HttpClient\Message\Response; - -/** - * Performs requests on Gitlab API. API documentation should be self-explanatory. - * - * @author Joseph Bielawski <stloyd@gmail.com> - * @author Matt Humphrey <matt@m4tt.co> - */ -class HttpClient implements HttpClientInterface -{ - /** - * @var array - */ - protected $options = array( - 'user_agent' => 'php-gitlab-api (http://github.com/m4tthumphrey/php-gitlab-api)', - 'timeout' => 10, - ); - - /** - * @var string - */ - protected $baseUrl; - - /** - * @var ListenerInterface[] - */ - protected $listeners = array(); - /** - * @var array - */ - protected $headers = array(); - - /** - * @var Response - */ - private $lastResponse; - - /** - * @var Request - */ - private $lastRequest; - - /** - * @param string $baseUrl - * @param array $options - * @param ClientInterface $client - */ - public function __construct($baseUrl, array $options, ClientInterface $client) - { - $this->baseUrl = $baseUrl; - $this->options = array_merge($this->options, $options); - $this->client = $client; - - $this->addListener(new ErrorListener($this->options)); - - $this->clearHeaders(); - } - - /** - * {@inheritDoc} - */ - public function setOption($name, $value) - { - $this->options[$name] = $value; - } - - /** - * {@inheritDoc} - */ - public function setHeaders(array $headers) - { - $this->headers = array_merge($this->headers, $headers); - } - - /** - * Clears used headers - */ - public function clearHeaders() - { - $this->headers = array(); - } - - /** - * @param ListenerInterface $listener - */ - public function addListener(ListenerInterface $listener) - { - $this->listeners[get_class($listener)] = $listener; - } - - /** - * {@inheritDoc} - */ - public function get($path, array $parameters = array(), array $headers = array()) - { - if (0 < count($parameters)) { - $path .= (false === strpos($path, '?') ? '?' : '&').http_build_query($parameters, '', '&'); - } - - return $this->request($path, array(), 'GET', $headers); - } - - /** - * {@inheritDoc} - */ - public function post($path, array $parameters = array(), array $headers = array()) - { - return $this->request($path, $parameters, 'POST', $headers); - } - - /** - * {@inheritDoc} - */ - public function patch($path, array $parameters = array(), array $headers = array()) - { - return $this->request($path, $parameters, 'PATCH', $headers); - } - - /** - * {@inheritDoc} - */ - public function delete($path, array $parameters = array(), array $headers = array()) - { - return $this->request($path, $parameters, 'DELETE', $headers); - } - - /** - * {@inheritDoc} - */ - public function put($path, array $parameters = array(), array $headers = array()) - { - return $this->request($path, $parameters, 'PUT', $headers); - } - - /** - * {@inheritDoc} - */ - public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array()) - { - $path = trim($this->baseUrl.$path, '/'); - - $request = $this->createRequest($httpMethod, $path); - $request->addHeaders($headers); - $request->setContent(http_build_query($parameters)); - - $hasListeners = 0 < count($this->listeners); - if ($hasListeners) { - foreach ($this->listeners as $listener) { - $listener->preSend($request); - } - } - - $response = new Response(); - - try { - $this->client->send($request, $response); - } catch (\LogicException $e) { - throw new ErrorException($e->getMessage()); - } catch (\RuntimeException $e) { - throw new RuntimeException($e->getMessage()); - } - - $this->lastRequest = $request; - $this->lastResponse = $response; - - if ($hasListeners) { - foreach ($this->listeners as $listener) { - $listener->postSend($request, $response); - } - } - - return $response; - } - - /** - * @return Request - */ - public function getLastRequest() - { - return $this->lastRequest; - } - - /** - * @return Response - */ - public function getLastResponse() - { - return $this->lastResponse; - } - - /** - * @param string $httpMethod - * @param string $url - * @return Request - */ - private function createRequest($httpMethod, $url) - { - $request = new Request($httpMethod); - $request->setHeaders($this->headers); - $request->fromUrl($url); - - return $request; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClientInterface.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClientInterface.php deleted file mode 100644 index ef268017b9b31caac1e9065cdd9a567fae05ab60..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/HttpClientInterface.php +++ /dev/null @@ -1,97 +0,0 @@ -<?php namespace Gitlab\HttpClient; - -use Gitlab\Exception\InvalidArgumentException; - -/** - * Performs requests on Gitlab API. API documentation should be self-explanatory. - * - * @author Joseph Bielawski <stloyd@gmail.com> - * @author Matt Humphrey <matt@m4tt.co> - */ -interface HttpClientInterface -{ - /** - * Send a GET request - * - * @param string $path Request path - * @param array $parameters GET Parameters - * @param array $headers Reconfigure the request headers for this call only - * - * @return array Data - */ - public function get($path, array $parameters = array(), array $headers = array()); - - /** - * Send a POST request - * - * @param string $path Request path - * @param array $parameters POST Parameters - * @param array $headers Reconfigure the request headers for this call only - * - * @return array Data - */ - public function post($path, array $parameters = array(), array $headers = array()); - - /** - * Send a PATCH request - * - * @param string $path Request path - * @param array $parameters PATCH Parameters - * @param array $headers Reconfigure the request headers for this call only - * - * @return array Data - */ - public function patch($path, array $parameters = array(), array $headers = array()); - - /** - * Send a PUT request - * - * @param string $path Request path - * @param array $parameters PUT Parameters - * @param array $headers Reconfigure the request headers for this call only - * - * @return array Data - */ - public function put($path, array $parameters = array(), array $headers = array()); - - /** - * Send a DELETE request - * - * @param string $path Request path - * @param array $parameters DELETE Parameters - * @param array $headers Reconfigure the request headers for this call only - * - * @return array Data - */ - public function delete($path, array $parameters = array(), array $headers = array()); - - /** - * Send a request to the server, receive a response, - * decode the response and returns an associative array - * - * @param string $path Request API path - * @param array $parameters Parameters - * @param string $httpMethod HTTP method to use - * @param array $headers Request headers - * - * @return array Data - */ - public function request($path, array $parameters = array(), $httpMethod = 'GET', array $headers = array()); - - /** - * Change an option value. - * - * @param string $name The option name - * @param mixed $value The value - * - * @throws InvalidArgumentException - */ - public function setOption($name, $value); - - /** - * Set HTTP headers - * - * @param array $headers - */ - public function setHeaders(array $headers); -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/AuthListener.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/AuthListener.php deleted file mode 100644 index 27164112280cd918457cbaa4af00b0fc4afc453c..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/AuthListener.php +++ /dev/null @@ -1,95 +0,0 @@ -<?php namespace Gitlab\HttpClient\Listener; - -use Gitlab\Client; -use Gitlab\Exception\InvalidArgumentException; - -use Buzz\Listener\ListenerInterface; -use Buzz\Message\MessageInterface; -use Buzz\Message\RequestInterface; -use Buzz\Util\Url; - -/** - * @author Joseph Bielawski <stloyd@gmail.com> - * @author Matt Humphrey <matt@m4tt.co> - */ -class AuthListener implements ListenerInterface -{ - /** - * @var string - */ - private $method; - - /** - * @var string - */ - private $token; - - /** - * @var string|null - */ - private $sudo; - - /** - * @param string $method - * @param string $token - * @param string|null $sudo - */ - public function __construct($method, $token, $sudo = null) - { - $this->method = $method; - $this->token = $token; - $this->sudo = $sudo; - } - - /** - * {@inheritDoc} - * - * @throws InvalidArgumentException - */ - public function preSend(RequestInterface $request) - { - // Skip by default - if (null === $this->method) { - return; - } - - switch ($this->method) { - case Client::AUTH_HTTP_TOKEN: - $request->addHeader('PRIVATE-TOKEN: '.$this->token); - if (!is_null($this->sudo)) { - $request->addHeader('SUDO: '.$this->sudo); - } - break; - - case Client::AUTH_URL_TOKEN: - $url = $request->getUrl(); - - $query = array( - 'private_token' => $this->token - ); - - if (!is_null($this->sudo)) { - $query['sudo'] = $this->sudo; - } - - $url .= (false === strpos($url, '?') ? '?' : '&').utf8_encode(http_build_query($query, '', '&')); - - $request->fromUrl(new Url($url)); - break; - - case Client::AUTH_OAUTH_TOKEN: - $request->addHeader('Authorization: Bearer '.$this->token); - if (!is_null($this->sudo)) { - $request->addHeader('SUDO: '.$this->sudo); - } - break; - } - } - - /** - * {@inheritDoc} - */ - public function postSend(RequestInterface $request, MessageInterface $response) - { - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/ErrorListener.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/ErrorListener.php deleted file mode 100644 index 4ec931cbb24c16df98cd429ec08ad552cc5d62fa..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Listener/ErrorListener.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php namespace Gitlab\HttpClient\Listener; - -use Buzz\Listener\ListenerInterface; -use Buzz\Message\MessageInterface; -use Buzz\Message\RequestInterface; -use Gitlab\Exception\ErrorException; -use Gitlab\Exception\RuntimeException; - -/** - * @author Joseph Bielawski <stloyd@gmail.com> - * @author Matt Humphrey <git@m4tt.co> - */ -class ErrorListener implements ListenerInterface -{ - /** - * @var array - */ - private $options; - - /** - * @param array $options - */ - public function __construct(array $options) - { - $this->options = $options; - } - - /** - * {@inheritDoc} - */ - public function preSend(RequestInterface $request) - { - } - - /** - * {@inheritDoc} - */ - public function postSend(RequestInterface $request, MessageInterface $response) - { - /** @var $response \Gitlab\HttpClient\Message\Response */ - if ($response->isClientError() || $response->isServerError()) { - $content = $response->getContent(); - if (is_array($content) && isset($content['message'])) { - if (400 == $response->getStatusCode()) { - $message = $this->parseMessage($content['message']); - - throw new ErrorException($message, 400); - } - } - - $errorMessage = null; - if (isset($content['error'])) { - $errorMessage = implode("\n", $content['error']); - } elseif (isset($content['message'])) { - $errorMessage = $this->parseMessage($content['message']); - } else { - $errorMessage = $content; - } - - throw new RuntimeException($errorMessage, $response->getStatusCode()); - } - } - - /** - * @param mixed $message - * @return string - */ - protected function parseMessage($message) - { - $string = $message; - - if (is_array($message)) { - $format = '"%s" %s'; - $errors = array(); - - foreach ($message as $field => $messages) { - if (is_array($messages)) { - $messages = array_unique($messages); - foreach ($messages as $error) { - $errors[] = sprintf($format, $field, $error); - } - } elseif (is_integer($field)) { - $errors[] = $messages; - } else { - $errors[] = sprintf($format, $field, $messages); - } - } - - $string = implode(', ', $errors); - } - - return $string; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Request.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Request.php deleted file mode 100644 index 41a950f35f3292a50ec7a06a4d4440ce3a20eadc..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Request.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php namespace Gitlab\HttpClient\Message; - -use Buzz\Message\Request as BaseRequest; - -class Request extends BaseRequest -{ - -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Response.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Response.php deleted file mode 100644 index cfe7823f57240926abc2c441c266749dd7ca41b0..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/HttpClient/Message/Response.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php namespace Gitlab\HttpClient\Message; - -use Buzz\Message\Response as BaseResponse; - -class Response extends BaseResponse -{ - /** - * {@inheritDoc} - */ - public function getContent() - { - $response = parent::getContent(); - - if ($this->getHeader('Content-Type') === 'application/json') { - $content = json_decode($response, true); - - if (JSON_ERROR_NONE !== json_last_error()) { - return $response; - } - - return $content; - } - - return $response; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/AbstractModel.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/AbstractModel.php deleted file mode 100644 index 7c11d4b21eb6c62f03ac12525ac7a1ee1b8179b6..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/AbstractModel.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; -use Gitlab\Exception\RuntimeException; -use Gitlab\Api\AbstractApi; - -abstract class AbstractModel -{ - /** - * @var array - */ - protected static $properties; - - /** - * @var array - */ - protected $data = array(); - - /** - * @var Client - */ - protected $client; - - /** - * @return Client - */ - public function getClient() - { - return $this->client; - } - - /** - * @param Client $client - * @return $this - */ - public function setClient(Client $client = null) - { - if (null !== $client) { - $this->client = $client; - } - - return $this; - } - - /** - * @param string $api - * @return AbstractApi|mixed - */ - public function api($api) - { - return $this->getClient()->api($api); - } - - /** - * @param array $data - * @return $this - */ - protected function hydrate(array $data = array()) - { - if (!empty($data)) { - foreach ($data as $field => $value) { - $this->setData($field, $value); - } - } - - return $this; - } - - /** - * @param string $field - * @param mixed $value - * @return $this - */ - protected function setData($field, $value) - { - if (in_array($field, static::$properties)) { - $this->data[$field] = $value; - } - - return $this; - } - - /** - * @return array - */ - public function getData() - { - return $this->data; - } - - /** - * @param string $property - * @param mixed $value - * @throws RuntimeException - */ - public function __set($property, $value) - { - throw new RuntimeException('Model properties are immutable'); - } - - /** - * @param string $property - * @return mixed - */ - public function __get($property) - { - if (!in_array($property, static::$properties)) { - throw new RuntimeException(sprintf( - 'Property "%s" does not exist for %s object', - $property, get_called_class() - )); - } - - if (isset($this->data[$property])) { - return $this->data[$property]; - } - - return null; - } - - /** - * @param string $property - * @return bool - */ - public function __isset($property) - { - return isset($this->data[$property]); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Branch.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Branch.php deleted file mode 100644 index b5de63f7450e6a67477691ed28b86ea738a90a30..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Branch.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; -use Gitlab\Api\AbstractApi as Api; - -/** - * Class Branch - * - * @property-read string $name - * @property-read bool $protected - * @property-read Commit $commit - * @property-read Project $project - */ -class Branch extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'name', - 'commit', - 'project', - 'protected' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Branch - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $branch = new static($project, $data['name'], $client); - - if (isset($data['commit'])) { - $data['commit'] = Commit::fromArray($client, $project, $data['commit']); - } - - return $branch->hydrate($data); - } - - /** - * @param Project $project - * @param string $name - * @param Client $client - */ - public function __construct(Project $project, $name = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('name', $name); - } - - /** - * @return Branch - */ - public function show() - { - $data = $this->api('repositories')->branch($this->project->id, $this->name); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return Branch - */ - public function protect() - { - $data = $this->api('repositories')->protectBranch($this->project->id, $this->name); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return Branch - */ - public function unprotect() - { - $data = $this->api('repositories')->unprotectBranch($this->project->id, $this->name); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return bool - */ - public function delete() - { - $this->api('repositories')->deleteBranch($this->project->id, $this->name); - - return true; - } - - /** - * @param int $page - * @param int $per_page - * @return Commit[] - */ - public function commits($page = 1, $per_page = Api::PER_PAGE) - { - return $this->project->commits($page, $per_page, $this->name); - } - - /** - * @param string $file_path - * @param string $content - * @param string $commit_message - * @return File - */ - public function createFile($file_path, $content, $commit_message) - { - $data = $this->api('repositories')->createFile($this->project->id, $file_path, $content, $this->name, $commit_message); - - return File::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param string $file_path - * @param string $content - * @param string $commit_message - * @return File - */ - public function updateFile($file_path, $content, $commit_message) - { - $data = $this->api('repositories')->updateFile($this->project->id, $file_path, $content, $this->name, $commit_message); - - return File::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param string $file_path - * @param string $commit_message - * @return bool - */ - public function deleteFile($file_path, $commit_message) - { - $this->api('repositories')->deleteFile($this->project->id, $file_path, $this->name, $commit_message); - - return true; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Commit.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Commit.php deleted file mode 100644 index 9b007325515feff26f7a49e1269403fd331180e2..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Commit.php +++ /dev/null @@ -1,86 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Commit - * - * @property-read string $id - * @property-read string $short_id - * @property-read string $title - * @property-read string $message - * @property-read string $author_name - * @property-read string $author_email - * @property-read string $authored_date - * @property-read string $committed_date - * @property-read string $created_at - * @property-read Commit[] $parents - * @property-read Node[] $tree - * @property-read User $committer - * @property-read User $author - * @property-read Project $project - */ -class Commit extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'short_id', - 'parents', - 'tree', - 'title', - 'message', - 'author', - 'author_name', - 'author_email', - 'committer', - 'authored_date', - 'committed_date', - 'created_at', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Commit - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $commit = new static($project, $data['id'], $client); - - if (isset($data['parents'])) { - $parents = array(); - foreach ($data['parents'] as $parent) { - $parents[] = static::fromArray($client, $project, $parent); - } - - $data['parents'] = $parents; - } - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - if (isset($data['committer'])) { - $data['committer'] = User::fromArray($client, $data['committer']); - } - - return $commit->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/CommitNote.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/CommitNote.php deleted file mode 100644 index 4b455c7f160979748b8cd1744bfcedbc14b2abfd..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/CommitNote.php +++ /dev/null @@ -1,50 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class CommitNote - * - * @property-read string $note - * @property-read string $path - * @property-read string $line - * @property-read string $line_type - * @property-read User $author - */ -class CommitNote extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'note', - 'path', - 'line', - 'line_type', - 'author' - ); - - /** - * @param Client $client - * @param array $data - * @return CommitNote - */ - public static function fromArray(Client $client, array $data) - { - $comment = new static($client); - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - return $comment->hydrate($data); - } - - /** - * @param Client $client - */ - public function __construct(Client $client = null) - { - $this->setClient($client); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Comparison.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Comparison.php deleted file mode 100644 index 27901829d5b6b1673677f911f9b33816ead635f9..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Comparison.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Comparison - * - * @property-read bool $compare_timeout - * @property-read bool $compare_same_ref - * @property-read Commit $commit - * @property-read Commit[] $commits - * @property-read Diff[] $diffs - * @property-read Project $project - */ -class Comparison extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'commit', - 'commits', - 'diffs', - 'compare_timeout', - 'compare_same_ref', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Comparison - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $file = new static($project, $client); - - if (isset($data['commit'])) { - $data['commit'] = Commit::fromArray($client, $project, $data['commit']); - } - - if (isset($data['commits'])) { - $commits = array(); - foreach ($data['commits'] as $commit) { - $commits[] = Commit::fromArray($client, $project, $commit); - } - - $data['commits'] = $commits; - } - - if (isset($data['diffs'])) { - $diffs = array(); - foreach ($data['diffs'] as $diff) { - $diffs[] = Diff::fromArray($client, $project, $diff); - } - - $data['diffs'] = $diffs; - } - - return $file->hydrate($data); - } - - /** - * @param Project $project - * @param Client $client - */ - public function __construct(Project $project, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Contributor.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Contributor.php deleted file mode 100644 index 658da48bcfc634bb58db54ac959a168d9f0e4119..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Contributor.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Contributor - * - * @property-read string $name - * @property-read string $email - * @property-read int $commits - * @property-read int $additions - * @property-read int $deletions - * @property-read Project $project - */ -class Contributor extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'name', - 'email', - 'commits', - 'additions', - 'deletions', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Contributor - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $contributor = new static($project, $client); - - return $contributor->hydrate($data); - } - - /** - * @param Project $project - * @param Client $client - */ - public function __construct(Project $project, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Diff.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Diff.php deleted file mode 100644 index 5fd95d5ac62a250a04fd07aed5c85624009d75cb..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Diff.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Diff - * - * @property-read string $old_path - * @property-read string $new_path - * @property-read string $a_mode - * @property-read string $b_mode - * @property-read string $diff - * @property-read bool $new_file - * @property-read bool $renamed_file - * @property-read bool $deleted_file - * @property-read Project $project - */ -class Diff extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'old_path', - 'new_path', - 'a_mode', - 'b_mode', - 'diff', - 'new_file', - 'renamed_file', - 'deleted_file', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Diff - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $diff = new static($project, $client); - - return $diff->hydrate($data); - } - - /** - * @param Project $project - * @param Client $client - */ - public function __construct(Project $project, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - } - - /** - * @return string - */ - public function __toString() - { - return $this->diff; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Event.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Event.php deleted file mode 100644 index 83565e174da9bebd2b611b814ea43c58910a790a..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Event.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Event - * - * @property-read string $title - * @property-read int $id - * @property-read string $action_name - * @property-read string $data - * @property-read int $target_id - * @property-read string $target_type - * @property-read string $target_title - * @property-read int $author_id - * @property-read string $author_username - * @property-read User $author - * @property-read Project $project - */ -class Event extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'title', - 'project_id', - 'action_name', - 'target_id', - 'target_type', - 'author_id', - 'author_username', - 'data', - 'target_title', - 'author', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Event - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $event = new static($project, $client); - - if (isset($data['author_id'])) { - $data['author'] = new User($data['author_id'], $client); - } - - return $event->hydrate($data); - } - - /** - * @param Project $project - * @param Client $client - */ - public function __construct(Project $project, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/File.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/File.php deleted file mode 100644 index b2edac1273e5e11c2b53c3b8283307905829a0a2..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/File.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class File - * - * @property-read string $file_path - * @property-read string $branch_name - * @property-read Project $project - */ -class File extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'project', - 'file_path', - 'branch_name' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return File - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $file = new static($project, $data['file_path'], $client); - - return $file->hydrate($data); - } - - /** - * @param Project $project - * @param string $file_path - * @param Client $client - */ - public function __construct(Project $project, $file_path = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('file_path', $file_path); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Group.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Group.php deleted file mode 100644 index 614d50ffb82e1c42fafaeb1b0ffe5984846f5522..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Group.php +++ /dev/null @@ -1,128 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Group - * - * @property-read int $id - * @property-read string $name - * @property-read string $path - * @property-read string $description - * @property-read Project[] $projects - */ -class Group extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'name', - 'path', - 'description', - 'projects' - ); - - /** - * @param Client $client - * @param array $data - * @return Group - */ - public static function fromArray(Client $client, array $data) - { - $group = new static($data['id'], $client); - - if (isset($data['projects'])) { - $projects = array(); - foreach ($data['projects'] as $project) { - $projects[] = Project::fromArray($client, $project); - } - $data['projects'] = $projects; - } - - return $group->hydrate($data); - } - - /** - * @param Client $client - * @param string $name - * @param string $path - * @return Group - */ - public static function create(Client $client, $name, $path) - { - $data = $client->api('groups')->create($name, $path); - - return static::fromArray($client, $data); - } - - /** - * @param int $id - * @param Client $client - */ - public function __construct($id, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - } - - /** - * @return Group - */ - public function show() - { - $data = $this->api('groups')->show($this->id); - - return Group::fromArray($this->getClient(), $data); - } - - /** - * @param int $project_id - * @return Group - */ - public function transfer($project_id) - { - $data = $this->api('groups')->transfer($this->id, $project_id); - - return Group::fromArray($this->getClient(), $data); - } - - /** - * @return User[] - */ - public function members() - { - $data = $this->api('groups')->members($this->id); - - $members = array(); - foreach ($data as $member) { - $members[] = User::fromArray($this->getClient(), $member); - } - - return $members; - } - - /** - * @param int $user_id - * @param int $access_level - * @return User - */ - public function addMember($user_id, $access_level) - { - $data = $this->api('groups')->addMember($this->id, $user_id, $access_level); - - return User::fromArray($this->getClient(), $data); - } - - /** - * @param int $user_id - * @return bool - */ - public function removeMember($user_id) - { - $this->api('groups')->removeMember($this->id, $user_id); - - return true; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Hook.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Hook.php deleted file mode 100644 index 15bda3992286825d86ce990aee0804b963ab908d..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Hook.php +++ /dev/null @@ -1,76 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Hook - * - * @property-read int $id - * @property-read string $url - * @property-read string $created_at - */ -class Hook extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'url', - 'created_at' - ); - - /** - * @param Client $client - * @param array $data - * @return Hook - */ - public static function fromArray(Client $client, array $data) - { - $hook = new static($data['id'], $client); - - return $hook->hydrate($data); - } - - /** - * @param Client $client - * @param string $url - * @return Hook - */ - public static function create(Client $client, $url) - { - $data = $client->api('system_hooks')->create($url); - - return static::fromArray($client, $data); - } - - /** - * @param int $id - * @param Client $client - */ - public function __construct($id, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - } - - /** - * @return bool - */ - public function test() - { - $this->api('system_hooks')->test($this->id); - - return true; - } - - /** - * @return bool - */ - public function delete() - { - $this->api('system_hooks')->remove($this->id); - - return true; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Issue.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Issue.php deleted file mode 100644 index 86c7e2adda52c211fabbd724fe239536041df565..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Issue.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Issue - * - * @property-read int $id - * @property-read int $iid - * @property-read int $project_id, - * @property-read string $title - * @property-read string $description - * @property-read array $labels - * @property-read bool $closed - * @property-read string $updated_at - * @property-read string $created_at - * @property-read string $state - * @property-read User $assignee - * @property-read User $author - * @property-read Milestone $milestone - * @property-read Project $project - */ -class Issue extends AbstractModel implements Noteable -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'iid', - 'project_id', - 'title', - 'description', - 'labels', - 'milestone', - 'assignee', - 'author', - 'closed', - 'updated_at', - 'created_at', - 'project', - 'state' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Issue - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $issue = new static($project, $data['id'], $client); - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - if (isset($data['assignee'])) { - $data['assignee'] = User::fromArray($client, $data['assignee']); - } - - return $issue->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } - - /** - * @return Issue - */ - public function show() - { - $data = $this->api('issues')->show($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param array $params - * @return Issue - */ - public function update(array $params) - { - $data = $this->api('issues')->update($this->project->id, $this->id, $params); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param string $comment - * @return Issue - */ - public function close($comment = null) - { - if ($comment) { - $this->addComment($comment); - } - - return $this->update(array( - 'state_event' => 'close' - )); - } - - /** - * @return Issue - */ - public function open() - { - return $this->update(array( - 'state_event' => 'reopen' - )); - } - - /** - * @return Issue - */ - public function reopen() - { - return $this->open(); - } - - /** - * @param string $comment - * @return Note - */ - public function addComment($comment) - { - $data = $this->api('issues')->addComment($this->project->id, $this->id, array( - 'body' => $comment - )); - - return Note::fromArray($this->getClient(), $this, $data); - } - - /** - * @return Note[] - */ - public function showComments() - { - $notes = array(); - $data = $this->api('issues')->showComments($this->project->id, $this->id); - - foreach ($data as $note) { - $notes[] = Note::fromArray($this->getClient(), $this, $note); - } - - return $notes; - } - - /** - * @return bool - */ - public function isClosed() - { - if ($this->state == 'closed') { - return true; - } - - return false; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Key.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Key.php deleted file mode 100644 index 5e6aebfa58ca38c68f91ff412874ff041d8a1015..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Key.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Key - * - * @property-read int $id - * @property-read string $title - * @property-read string $key - * @property-read string $created_at - */ -class Key extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'title', - 'key', - 'created_at' - ); - - /** - * @param Client $client - * @param array $data - * @return Key - */ - public static function fromArray(Client $client, array $data) - { - $key = new static($client); - - return $key->hydrate($data); - } - - /** - * @param Client $client - */ - public function __construct(Client $client = null) - { - $this->setClient($client); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Label.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Label.php deleted file mode 100644 index 5c8a2091984e77c06616581f8e6ae69ed7b663fb..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Label.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Label - * - * @property-read string $name - * @property-read string $color - */ -class Label extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'name', - 'color' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Label - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $label = new static($project, $client); - - return $label->hydrate($data); - } - - /** - * @param Project $project - * @param Client $client - */ - public function __construct(Project $project, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/MergeRequest.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/MergeRequest.php deleted file mode 100644 index 73eaa49ef9cbdd8b014e1ce86e6b7ac8b7fad273..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/MergeRequest.php +++ /dev/null @@ -1,225 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class MergeRequest - * - * @property-read int $id - * @property-read int $iid - * @property-read string $target_branch - * @property-read string $source_branch - * @property-read int $project_id - * @property-read string $title - * @property-read bool $closed - * @property-read bool $merged - * @property-read string $state - * @property-read int $source_project_id - * @property-read int $target_project_id - * @property-read int $upvotes - * @property-read int $downvotes - * @property-read array $labels - * @property-read User $author - * @property-read User $assignee - * @property-read Project $project - * @property-read Milestone $milestone - * @property-read File[] $files - */ -class MergeRequest extends AbstractModel implements Noteable -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'iid', - 'target_branch', - 'source_branch', - 'project_id', - 'title', - 'closed', - 'merged', - 'author', - 'assignee', - 'project', - 'state', - 'source_project_id', - 'target_project_id', - 'upvotes', - 'downvotes', - 'labels', - 'milestone', - 'files' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return MergeRequest - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $mr = new static($project, $data['id'], $client); - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - if (isset($data['assignee'])) { - $data['assignee'] = User::fromArray($client, $data['assignee']); - } - - if (isset($data['milestone'])) { - $data['milestone'] = Milestone::fromArray($client, $project, $data['milestone']); - } - - if (isset($data['files'])) { - $files = array(); - foreach ($data['files'] as $file) { - $files[] = File::fromArray($client, $project, $file); - } - - $data['files'] = $files; - } - - return $mr->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } - - /** - * @return MergeRequest - */ - public function show() - { - $data = $this->api('mr')->show($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param array $params - * @return MergeRequest - */ - public function update(array $params) - { - $data = $this->api('mr')->update($this->project->id, $this->id, $params); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param string $comment - * @return MergeRequest - */ - public function close($comment = null) - { - if ($comment) { - $this->addComment($comment); - } - - return $this->update(array( - 'state_event' => 'close' - )); - } - - /** - * @return MergeRequest - */ - public function reopen() - { - return $this->update(array( - 'state_event' => 'reopen' - )); - } - - /** - * @return MergeRequest - */ - public function open() - { - return $this->reopen(); - } - - /** - * @param string $message - * @return MergeRequest - */ - public function merge($message = null) - { - $data = $this->api('mr')->merge($this->project->id, $this->id, array( - 'merge_commit_message' => $message - )); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return MergeRequest - */ - public function merged() - { - return $this->update(array( - 'state_event' => 'merge' - )); - } - - /** - * @param string $comment - * @return Note - */ - public function addComment($comment) - { - $data = $this->api('mr')->addComment($this->project->id, $this->id, $comment); - - return Note::fromArray($this->getClient(), $this, $data); - } - - /** - * @return Note[] - */ - public function showComments() - { - $notes = array(); - $data = $this->api('mr')->showComments($this->project->id, $this->id); - - foreach ($data as $note) { - $notes[] = Note::fromArray($this->getClient(), $this, $note); - } - - return $notes; - } - - /** - * @return bool - */ - public function isClosed() - { - if (in_array($this->state, array('closed', 'merged'))) { - return true; - } - - return false; - } - - /** - * @return MergeRequest - */ - public function changes() - { - $data = $this->api('mr')->changes($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Milestone.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Milestone.php deleted file mode 100644 index c59afca38bf63f02c65335b55c5112d15e56ffd8..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Milestone.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Milestone - * - * @property-read int $id - * @property-read int $iid - * @property-read int $project_id - * @property-read string $title - * @property-read string $description - * @property-read string $due_date - * @property-read string $state - * @property-read bool $closed - * @property-read string $updated_at - * @property-read string $created_at - * @property-read Project $project - */ -class Milestone extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'iid', - 'project', - 'project_id', - 'title', - 'description', - 'due_date', - 'state', - 'closed', - 'updated_at', - 'created_at' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Milestone - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $milestone = new static($project, $data['id'], $client); - - return $milestone->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - $this->setData('project', $project); - } - - /** - * @return Milestone - */ - public function show() - { - $data = $this->api('milestones')->show($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param array $params - * @return Milestone - */ - public function update(array $params) - { - $data = $this->api('milestones')->update($this->project->id, $this->id, $params); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return Milestone - */ - public function complete() - { - return $this->update(array('closed' => true)); - } - - /** - * @return Milestone - */ - public function incomplete() - { - return $this->update(array('closed' => false)); - } - - /** - * @return Issue[] - */ - public function issues() - { - $data = $this->api('milestones')->issues($this->project->id, $this->id); - - $issues = array(); - foreach ($data as $issue) { - $issues[] = Issue::fromArray($this->getClient(), $this->project, $issue); - } - - return $issues; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Node.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Node.php deleted file mode 100644 index 8add42a07ae3d06578a7bdfe92e36c81de77b220..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Node.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Node - * - * @property-read string $name - * @property-read string $type - * @property-read string $mode - * @property-read int $id - * @property-read Project $project - */ -class Node extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'name', - 'type', - 'mode', - 'id', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Node - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $node = new static($project, $data['id'], $client); - - return $node->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id = null, Client $client) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Note.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Note.php deleted file mode 100644 index 36afeb1326ed80b72bc6828b8d6d0fd69d17b69f..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Note.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Note - * - * @property-read User $author - * @property-read string $body - * @property-read string $created_at - * @property-read string $updated_at - * @property-read string $parent_type - * @property-read Issue|MergeRequest $parent - * @property-read string $attachment - */ -class Note extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'author', - 'body', - 'created_at', - 'updated_at', - 'parent_type', - 'parent', - 'attachment' - ); - - /** - * @param Client $client - * @param Noteable $type - * @param array $data - * @return mixed - */ - public static function fromArray(Client $client, Noteable $type, array $data) - { - $comment = new static($type, $client); - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - return $comment->hydrate($data); - } - - /** - * @param Noteable $type - * @param Client $client - */ - public function __construct(Noteable $type, Client $client = null) - { - $this->setClient($client); - $this->setData('parent_type', get_class($type)); - $this->setData('parent', $type); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Noteable.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Noteable.php deleted file mode 100644 index 11e2cb6506d4b83e9e6f98875e6de834447ba4d1..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Noteable.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php namespace Gitlab\Model; - -interface Noteable -{ - /** - * @param string $comment - * @return Note - */ - public function addComment($comment); - - /** - * @return Note[] - */ - public function showComments(); - - /** - * @param string $comment - * @return static - */ - public function close($comment = null); - - /** - * @return static - */ - public function open(); - - /** - * @return static - */ - public function reopen(); - - /** - * @return bool - */ - public function isClosed(); -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Project.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Project.php deleted file mode 100644 index 1fd4912e512237c9740237d19b9a7c8dd0ee726e..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Project.php +++ /dev/null @@ -1,1034 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Api\MergeRequests; -use Gitlab\Client; -use Gitlab\Api\AbstractApi as Api; - -/** - * Class Project - * - * @property-read int $id - * @property-read string $code - * @property-read string $name - * @property-read string $name_with_namespace - * @property-read string $description - * @property-read string $path - * @property-read string $path_with_namespace - * @property-read string $ssh_url_to_repo - * @property-read string $http_url_to_repo - * @property-read string $web_url - * @property-read string $default_branch - * @property-read bool $private - * @property-read bool $public - * @property-read bool $issues_enabled - * @property-read bool $merge_requests_enabled - * @property-read bool $wall_enabled - * @property-read bool $wiki_enabled - * @property-read bool $snippets_enabled - * @property-read string $created_at - * @property-read int $greatest_access_level - * @property-read string $last_activity_at - * @property-read string $tag_list - * @property-read User $owner - * @property-read ProjectNamespace $namespace - */ -class Project extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'code', - 'name', - 'name_with_namespace', - 'namespace', - 'description', - 'path', - 'path_with_namespace', - 'ssh_url_to_repo', - 'http_url_to_repo', - 'web_url', - 'default_branch', - 'owner', - 'private', - 'public', - 'issues_enabled', - 'merge_requests_enabled', - 'wall_enabled', - 'wiki_enabled', - 'created_at', - 'greatest_access_level', - 'last_activity_at', - 'snippets_enabled', - 'tag_list' - ); - - /** - * @param Client $client - * @param array $data - * @return Project - */ - public static function fromArray(Client $client, array $data) - { - $project = new static($data['id']); - $project->setClient($client); - - if (isset($data['owner'])) { - $data['owner'] = User::fromArray($client, $data['owner']); - } - - if (isset($data['namespace']) && is_array($data['namespace'])) { - $data['namespace'] = ProjectNamespace::fromArray($client, $data['namespace']); - } - - return $project->hydrate($data); - } - - /** - * @param Client $client - * @param string $name - * @param array $params - * @return Project - */ - public static function create(Client $client, $name, array $params = array()) - { - $data = $client->api('projects')->create($name, $params); - - return static::fromArray($client, $data); - } - - /** - * @param int $user_id - * @param Client $client - * @param string $name - * @param array $params - * @return Project - */ - public static function createForUser($user_id, Client $client, $name, array $params = array()) - { - $data = $client->api('projects')->createForUser($user_id, $name, $params); - - return static::fromArray($client, $data); - } - /** - * @param int $id - * @param Client $client - */ - public function __construct($id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - } - - /** - * @return Project - */ - public function show() - { - $data = $this->api('projects')->show($this->id); - - return static::fromArray($this->getClient(), $data); - } - - /** - * @param array $params - * @return Project - */ - public function update(array $params) - { - $data = $this->api('projects')->update($this->id, $params); - - return static::fromArray($this->getClient(), $data); - } - - /** - * @return bool - */ - public function remove() - { - $this->api('projects')->remove($this->id); - - return true; - } - - /** - * @param string $username_query - * @return User[] - */ - public function members($username_query = null) - { - $data = $this->api('projects')->members($this->id, $username_query); - - $members = array(); - foreach ($data as $member) { - $members[] = User::fromArray($this->getClient(), $member); - } - - return $members; - } - - /** - * @param int $user_id - * @return User - */ - public function member($user_id) - { - $data = $this->api('projects')->member($this->id, $user_id); - - return User::fromArray($this->getClient(), $data); - } - - /** - * @param int $user_id - * @param int $access_level - * @return User - */ - public function addMember($user_id, $access_level) - { - $data = $this->api('projects')->addMember($this->id, $user_id, $access_level); - - return User::fromArray($this->getClient(), $data); - } - - /** - * @param int $user_id - * @param int $access_level - * @return User - */ - public function saveMember($user_id, $access_level) - { - $data = $this->api('projects')->saveMember($this->id, $user_id, $access_level); - - return User::fromArray($this->getClient(), $data); - } - - /** - * @param int $user_id - * @return bool - */ - public function removeMember($user_id) - { - $this->api('projects')->removeMember($this->id, $user_id); - - return true; - } - - /** - * @param int $page - * @param int $per_page - * @return ProjectHook[] - */ - public function hooks($page = 1, $per_page = Api::PER_PAGE) - { - $data = $this->api('projects')->hooks($this->id, $page, $per_page); - - $hooks = array(); - foreach ($data as $hook) { - $hooks[] = ProjectHook::fromArray($this->getClient(), $this, $hook); - } - - return $hooks; - } - - /** - * @param int $id - * @return ProjectHook - */ - public function hook($id) - { - $hook = new ProjectHook($this, $id, $this->getClient()); - - return $hook->show(); - } - - /** - * @param string $url - * @param array $events - * @return ProjectHook - */ - public function addHook($url, array $events = array()) - { - $data = $this->api('projects')->addHook($this->id, $url, $events); - - return ProjectHook::fromArray($this->getClient(), $this, $data); - } - - /** - * @param int $hook_id - * @param array $params - * @return mixed - */ - public function updateHook($hook_id, array $params) - { - $hook = new ProjectHook($this, $hook_id, $this->getClient()); - - return $hook->update($params); - } - - /** - * @param int $hook_id - * @return bool - */ - public function removeHook($hook_id) - { - $hook = new ProjectHook($this, $hook_id, $this->getClient()); - - return $hook->delete(); - } - - /** - * @return Key[] - */ - public function keys() - { - $data = $this->api('projects')->keys($this->id); - - $keys = array(); - foreach ($data as $key) { - $hooks[] = Key::fromArray($this->getClient(), $key); - } - - return $keys; - } - - /** - * @param int $key_id - * @return Key - */ - public function key($key_id) - { - $data = $this->api('projects')->key($this->id, $key_id); - - return Key::fromArray($this->getClient(), $data); - } - - /** - * @param string $title - * @param string $key - * @return Key - */ - public function addKey($title, $key) - { - $data = $this->api('projects')->addKey($this->id, $title, $key); - - return Key::fromArray($this->getClient(), $data); - } - - /** - * @param string $key_id - * @return bool - */ - public function removeKey($key_id) - { - $this->api('projects')->removeKey($this->id, $key_id); - - return true; - } - - /** - * @param string $name - * @param string $ref - * @return Branch - */ - public function createBranch($name, $ref) - { - $data = $this->api('repositories')->createBranch($this->id, $name, $ref); - - return Branch::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $name - * @return bool - */ - public function deleteBranch($name) - { - $this->api('repositories')->deleteBranch($this->id, $name); - - return true; - } - - /** - * @return Branch[] - */ - public function branches() - { - $data = $this->api('repo')->branches($this->id); - - $branches = array(); - foreach ($data as $branch) { - $branches[] = Branch::fromArray($this->getClient(), $this, $branch); - } - - return $branches; - } - - /** - * @param string $branch_name - * @return Branch - */ - public function branch($branch_name) - { - $branch = new Branch($this, $branch_name); - $branch->setClient($this->getClient()); - - return $branch->show(); - } - - /** - * @param string $branch_name - * @return Branch - */ - public function protectBranch($branch_name) - { - $branch = new Branch($this, $branch_name); - $branch->setClient($this->getClient()); - - return $branch->protect(); - } - - /** - * @param string $branch_name - * @return Branch - */ - public function unprotectBranch($branch_name) - { - $branch = new Branch($this, $branch_name); - $branch->setClient($this->getClient()); - - return $branch->unprotect(); - } - - /** - * @return Tag[] - */ - public function tags() - { - $data = $this->api('repo')->tags($this->id); - - $tags = array(); - foreach ($data as $tag) { - $tags[] = Tag::fromArray($this->getClient(), $this, $tag); - } - - return $tags; - } - - /** - * @param int $page - * @param int $per_page - * @param string $ref_name - * @return Commit[] - */ - public function commits($page = 0, $per_page = Api::PER_PAGE, $ref_name = null) - { - $data = $this->api('repo')->commits($this->id, $page, $per_page, $ref_name); - - $commits = array(); - foreach ($data as $commit) { - $commits[] = Commit::fromArray($this->getClient(), $this, $commit); - } - - return $commits; - } - - /** - * @param string $sha - * @return Commit - */ - public function commit($sha) - { - $data = $this->api('repo')->commit($this->id, $sha); - - return Commit::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $ref - * @param int $page - * @param int $per_page - * @return Commit[] - */ - public function commitComments($ref, $page = 0, $per_page = Api::PER_PAGE) - { - $data = $this->api('repo')->commitComments($this->id, $ref, $page, $per_page); - - $comments = array(); - foreach ($data as $comment) { - $comments[] = CommitNote::fromArray($this->getClient(), $comment); - } - - return $comments; - } - - /** - * @param string $ref - * @param string $note - * @param array $params - * @return CommitNote - */ - public function createCommitComment($ref, $note, array $params = array()) - { - $data = $this->api('repo')->createCommitComment($this->id, $ref, $note, $params); - - return CommitNote::fromArray($this->getClient(), $data); - } - - /** - * @param string $sha - * @return string - */ - public function diff($sha) - { - return $this->api('repo')->diff($this->id, $sha); - } - - /** - * @param string $from - * @param string $to - * @return Comparison - */ - public function compare($from, $to) - { - $data = $this->api('repo')->compare($this->id, $from, $to); - - return Comparison::fromArray($this->getClient(), $this, $data); - } - - /** - * @param array $params - * @return Node[] - */ - public function tree(array $params = array()) - { - $data = $this->api('repo')->tree($this->id, $params); - - $tree = array(); - foreach ($data as $node) { - $tree[] = Node::fromArray($this->getClient(), $this, $node); - } - - return $tree; - } - - /** - * @param string $sha - * @param string $filepath - * @return string - */ - public function blob($sha, $filepath) - { - return $this->api('repo')->blob($this->id, $sha, $filepath); - } - - /** - * @param string $file_path - * @param string $content - * @param string $branch_name - * @param string $commit_message - * @return File - */ - public function createFile($file_path, $content, $branch_name, $commit_message) - { - $data = $this->api('repo')->createFile($this->id, $file_path, $content, $branch_name, $commit_message); - - return File::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $file_path - * @param string $content - * @param string $branch_name - * @param string $commit_message - * @return File - */ - public function updateFile($file_path, $content, $branch_name, $commit_message) - { - $data = $this->api('repo')->updateFile($this->id, $file_path, $content, $branch_name, $commit_message); - - return File::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $file_path - * @param string $branch_name - * @param string $commit_message - * @return bool - */ - public function deleteFile($file_path, $branch_name, $commit_message) - { - $this->api('repo')->deleteFile($this->id, $file_path, $branch_name, $commit_message); - - return true; - } - - /** - * @param int $page - * @param int $per_page - * @return Event[] - */ - public function events($page = 1, $per_page = Api::PER_PAGE) - { - $data = $this->api('projects')->events($this->id, $page, $per_page); - - $events = array(); - foreach ($data as $event) { - $events[] = Event::fromArray($this->getClient(), $this, $event); - } - - return $events; - } - - /** - * @param int $page - * @param int $per_page - * @param string $state - * @return MergeRequest[] - */ - public function mergeRequests($page = 1, $per_page = Api::PER_PAGE, $state = MergeRequests::STATE_ALL) - { - $data = $this->api('mr')->$state($this->id, $page, $per_page); - - $mrs = array(); - foreach ($data as $mr) { - $mrs[] = MergeRequest::fromArray($this->getClient(), $this, $mr); - } - - return $mrs; - } - - /** - * @param int $id - * @return MergeRequest - */ - public function mergeRequest($id) - { - $mr = new MergeRequest($this, $id, $this->getClient()); - - return $mr->show(); - } - - /** - * @param string $source - * @param string $target - * @param string $title - * @param int $assignee - * @param string $description - * @return MergeRequest - */ - public function createMergeRequest($source, $target, $title, $assignee = null, $description = null) - { - $data = $this->api('mr')->create($this->id, $source, $target, $title, $assignee, null, $description); - - return MergeRequest::fromArray($this->getClient(), $this, $data); - } - - /** - * @param int $id - * @param array $params - * @return MergeRequest - */ - public function updateMergeRequest($id, array $params) - { - $mr = new MergeRequest($this, $id, $this->getClient()); - - return $mr->update($params); - } - - /** - * @param int $id - * @return MergeRequest - */ - public function closeMergeRequest($id) - { - $mr = new MergeRequest($this, $id, $this->getClient()); - - return $mr->close(); - } - - /** - * @param int $id - * @return MergeRequest - */ - public function openMergeRequest($id) - { - $mr = new MergeRequest($this, $id, $this->getClient()); - - return $mr->reopen(); - } - - /** - * @param int $id - * @return MergeRequest - */ - public function mergeMergeRequest($id) - { - $mr = new MergeRequest($this, $id, $this->getClient()); - - return $mr->merge(); - } - - /** - * @param int $page - * @param int $per_page - * @return Issue[] - */ - public function issues($page = 1, $per_page = Api::PER_PAGE) - { - $data = $this->api('issues')->all($this->id, $page, $per_page); - - $issues = array(); - foreach ($data as $issue) { - $issues[] = Issue::fromArray($this->getClient(), $this, $issue); - } - - return $issues; - } - - /** - * @param string $title - * @param array $params - * @return Issue - */ - public function createIssue($title, array $params = array()) - { - $params['title'] = $title; - $data = $this->api('issues')->create($this->id, $params); - - return Issue::fromArray($this->getClient(), $this, $data); - } - - /** - * @param int $id - * @return Issue - */ - public function issue($id) - { - $issue = new Issue($this, $id, $this->getClient()); - - return $issue->show(); - } - - /** - * @param int $id - * @param array $params - * @return Issue - */ - public function updateIssue($id, array $params) - { - $issue = new Issue($this, $id, $this->getClient()); - - return $issue->update($params); - } - - /** - * @param int $id - * @param string $comment - * @return Issue - */ - public function closeIssue($id, $comment = null) - { - $issue = new Issue($this, $id, $this->getClient()); - - return $issue->close($comment); - } - - /** - * @param int $id - * @return Issue - */ - public function openIssue($id) - { - $issue = new Issue($this, $id, $this->getClient()); - - return $issue->open(); - } - - /** - * @param int $page - * @param int $per_page - * @return Milestone[] - */ - public function milestones($page = 1, $per_page = Api::PER_PAGE) - { - $data = $this->api('milestones')->all($this->id, $page, $per_page); - - $milestones = array(); - foreach ($data as $milestone) { - $milestones[] = Milestone::fromArray($this->getClient(), $this, $milestone); - } - - return $milestones; - } - - /** - * @param string $title - * @param array $params - * @return Milestone - */ - public function createMilestone($title, array $params = array()) - { - $params['title'] = $title; - $data = $this->api('milestones')->create($this->id, $params); - - return Milestone::fromArray($this->getClient(), $this, $data); - } - - /** - * @param int $id - * @return Milestone - */ - public function milestone($id) - { - $milestone = new Milestone($this, $id, $this->getClient()); - - return $milestone->show(); - } - - /** - * @param int $id - * @param array $params - * @return Milestone - */ - public function updateMilestone($id, array $params) - { - $milestone = new Milestone($this, $id, $this->getClient()); - - return $milestone->update($params); - } - - /** - * @param int $id - * @return Issue[] - */ - public function milestoneIssues($id) - { - $milestone = new Milestone($this, $id, $this->getClient()); - - return $milestone->issues(); - } - - /** - * @return Snippet[] - */ - public function snippets() - { - $data = $this->api('snippets')->all($this->id); - - $snippets = array(); - foreach ($data as $snippet) { - $snippets[] = Snippet::fromArray($this->getClient(), $this, $snippet); - } - - return $snippets; - } - - /** - * @param string $title - * @param string $filename - * @param string $code - * @param string $lifetime - * @return Snippet - */ - public function createSnippet($title, $filename, $code, $lifetime = null) - { - $data = $this->api('snippets')->create($this->id, $title, $filename, $code, $lifetime); - - return Snippet::fromArray($this->getClient(), $this, $data); - } - - /** - * @param int $id - * @return Snippet - */ - public function snippet($id) - { - $snippet = new Snippet($this, $id, $this->getClient()); - - return $snippet->show(); - } - - /** - * @param int $id - * @return Snippet - */ - public function snippetContent($id) - { - $snippet = new Snippet($this, $id, $this->getClient()); - - return $snippet->content(); - } - - /** - * @param int $id - * @param array $params - * @return Snippet - */ - public function updateSnippet($id, array $params) - { - $snippet = new Snippet($this, $id, $this->getClient()); - - return $snippet->update($params); - } - - /** - * @param int $id - * @return bool - */ - public function removeSnippet($id) - { - $snippet = new Snippet($this, $id, $this->getClient()); - - return $snippet->remove(); - } - - /** - * @param int $group_id - * @return Group - */ - public function transfer($group_id) - { - $group = new Group($group_id, $this->getClient()); - - return $group->transfer($this->id); - } - - /** - * @param int $id - * @return Project - */ - public function forkTo($id) - { - $data = $this->api('projects')->createForkRelation($id, $this->id); - - return Project::fromArray($this->getClient(), $data); - } - - /** - * @param int $id - * @return Project - */ - public function forkFrom($id) - { - return $this->createForkRelation($id); - } - - /** - * @param int $id - * @return Project - */ - public function createForkRelation($id) - { - $data = $this->api('projects')->createForkRelation($this->id, $id); - - return Project::fromArray($this->getClient(), $data); - } - - /** - * @return bool - */ - public function removeForkRelation() - { - $this->api('projects')->removeForkRelation($this->id); - - return true; - } - - /** - * @param string $service_name - * @param array $params - * @return bool - */ - public function setService($service_name, array $params = array()) - { - $this->api('projects')->setService($this->id, $service_name, $params); - - return true; - } - - /** - * @param string $service_name - * @return bool - */ - public function removeService($service_name) - { - $this->api('projects')->removeService($this->id, $service_name); - - return true; - } - - /** - * @return Label[] - */ - public function labels() - { - $data = $this->api('projects')->labels($this->id); - - $labels = array(); - foreach ($data as $label) { - $labels[] = Label::fromArray($this->getClient(), $this, $label); - } - - return $labels; - } - - /** - * @param string $name - * @param string $color - * @return Label - */ - public function addLabel($name, $color) - { - $data = $this->api('projects')->addLabel($this->id, array( - 'name' => $name, - 'color' => $color - )); - - return Label::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $name - * @param array $params - * @return Label - */ - public function updateLabel($name, array $params) - { - if (isset($params['name'])) { - $params['new_name'] = $params['name']; - } - - $params['name'] = $name; - - $data = $this->api('projects')->updateLabel($this->id, $params); - - return Label::fromArray($this->getClient(), $this, $data); - } - - /** - * @param string $name - * @return bool - */ - public function removeLabel($name) - { - $this->api('projects')->removeLabel($this->id, $name); - - return true; - } - - /** - * @return array - */ - public function contributors() - { - $data = $this->api('repo')->contributors($this->id); - - $contributors = array(); - foreach ($data as $contributor) { - $contributors[] = Contributor::fromArray($this->getClient(), $this, $contributor); - } - - return $contributors; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectHook.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectHook.php deleted file mode 100644 index a235bff8313f175f3b90ffe5cd21a3f401026c8c..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectHook.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class ProjectHook - * - * @property-read int $id - * @property-read string $url - * @property-read int $project_id - * @property-read bool $push_events - * @property-read bool $issues_events - * @property-read bool $merge_requests_events - * @property-read bool $tag_push_events - * @property-read string $created_at - * @property-read Project $project - */ -class ProjectHook extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'project', - 'url', - 'project_id', - 'push_events', - 'issues_events', - 'merge_requests_events', - 'tag_push_events', - 'created_at' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return ProjectHook - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $hook = new static($project, $data['id'], $client); - - return $hook->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } - - /** - * @return ProjectHook - */ - public function show() - { - $data = $this->api('projects')->hook($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return bool - */ - public function delete() - { - $this->api('projects')->removeHook($this->project->id, $this->id); - - return true; - } - - /** - * @return bool - */ - public function remove() - { - return $this->delete(); - } - - /** - * @param array $params - * @return ProjectHook - */ - public function update(array $params) - { - $data = $this->api('projects')->updateHook($this->project->id, $this->id, $params); - - return static::fromArray($this->getClient(), $this->project, $data); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectNamespace.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectNamespace.php deleted file mode 100644 index 9e3aee4ed5a366635a4b8165ca73dc91fb74ee9b..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/ProjectNamespace.php +++ /dev/null @@ -1,55 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class ProjectNamespace - * - * @property-read int $id - * @property-read string $name - * @property-read string $path - * @property-read string $kind - * @property-read int $owner_id - * @property-read string $created_at - * @property-read string $updated_at - * @property-read string $description - */ -class ProjectNamespace extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'name', - 'path', - 'kind', - 'owner_id', - 'created_at', - 'updated_at', - 'description' - ); - - /** - * @param Client $client - * @param array $data - * @return ProjectNamespace - */ - public static function fromArray(Client $client, array $data) - { - $project = new static($data['id']); - $project->setClient($client); - - return $project->hydrate($data); - } - - /** - * @param int $id - * @param Client $client - */ - public function __construct($id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Session.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Session.php deleted file mode 100644 index f9b8177beff6844a93708abdb11ad6c50e947cfc..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Session.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Session - * - * @property-read int $id - * @property-read string $email - * @property-read string $name - * @property-read string $private_token - * @property-read string $created_at - * @property-read bool $blocked - */ -class Session extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'email', - 'name', - 'private_token', - 'created_at', - 'blocked' - ); - - /** - * @param Client $client - * @param array $data - * @return Session - */ - public static function fromArray(Client $client, array $data) - { - $session = new static($client); - - return $session->hydrate($data); - } - - /** - * @param Client $client - */ - public function __construct(Client $client = null) - { - $this->setClient($client); - } - - /** - * @return User - */ - public function me() - { - $data = $this->api('users')->show(); - - return User::fromArray($this->getClient(), $data); - } - - /** - * @param string $email - * @param string $password - * @return $this - */ - public function login($email, $password) - { - $data = $this->api('users')->session($email, $password); - - return $this->hydrate($data); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Snippet.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Snippet.php deleted file mode 100644 index 5d20e0dbf729a5201306703aad054b17b48f6fff..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Snippet.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Snippet - * - * @property-read int $id - * @property-read string $title - * @property-read string $file_name - * @property-read string $expires_at - * @property-read string $updated_at - * @property-read string $created_at - * @property-read Project $project - * @property-read User $author - */ -class Snippet extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'title', - 'file_name', - 'author', - 'expires_at', - 'updated_at', - 'created_at', - 'project' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Snippet - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $snippet = new static($project, $data['id'], $client); - - if (isset($data['author'])) { - $data['author'] = User::fromArray($client, $data['author']); - } - - return $snippet->hydrate($data); - } - - /** - * @param Project $project - * @param int $id - * @param Client $client - */ - public function __construct(Project $project, $id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('id', $id); - } - - /** - * @return Snippet - */ - public function show() - { - $data = $this->api('snippets')->show($this->project->id, $this->id); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @param array $params - * @return Snippet - */ - public function update(array $params) - { - $data = $this->api('snippets')->update($this->project->id, $this->id, $params); - - return static::fromArray($this->getClient(), $this->project, $data); - } - - /** - * @return string - */ - public function content() - { - return $this->api('snippets')->content($this->project->id, $this->id); - } - - /** - * @return bool - */ - public function remove() - { - $this->api('snippets')->remove($this->project->id, $this->id); - - return true; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Tag.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Tag.php deleted file mode 100644 index 6028b3da5882dda97d6259d0d61082ad849cc2e8..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/Tag.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class Tag - * - * @property-read string $name - * @property-read bool $protected - * @property-read Commit $commit - * @property-read Project $project - */ -class Tag extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'name', - 'commit', - 'project', - 'protected' - ); - - /** - * @param Client $client - * @param Project $project - * @param array $data - * @return Tag - */ - public static function fromArray(Client $client, Project $project, array $data) - { - $branch = new static($project, $data['name'], $client); - - if (isset($data['commit'])) { - $data['commit'] = Commit::fromArray($client, $project, $data['commit']); - } - - return $branch->hydrate($data); - } - - /** - * @param Project $project - * @param string $name - * @param Client $client - */ - public function __construct(Project $project, $name = null, Client $client = null) - { - $this->setClient($client); - $this->setData('project', $project); - $this->setData('name', $name); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/User.php b/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/User.php deleted file mode 100644 index 5ffffc16e269a426e76a09df7d0b1b83e797b3e5..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/lib/Gitlab/Model/User.php +++ /dev/null @@ -1,227 +0,0 @@ -<?php namespace Gitlab\Model; - -use Gitlab\Client; - -/** - * Class User - * - * @property-read int $id - * @property-read string $email - * @property-read string $password - * @property-read string $username - * @property-read string $name - * @property-read string $bio - * @property-read string $skype - * @property-read string $linkedin - * @property-read string $twitter - * @property-read bool $dark_scheme - * @property-read int $theme_id - * @property-read int $color_scheme_id - * @property-read bool $blocked - * @property-read int $access_level - * @property-read string $created_at - * @property-read string $extern_uid - * @property-read string $provider - * @property-read string $state - * @property-read bool $is_admin - * @property-read bool $can_create_group - * @property-read bool $can_create_project - * @property-read string $avatar_url - * @property-read string $current_sign_in_at - * @property-read bool $two_factor_enabled - */ -class User extends AbstractModel -{ - /** - * @var array - */ - protected static $properties = array( - 'id', - 'email', - 'password', - 'username', - 'name', - 'bio', - 'skype', - 'linkedin', - 'twitter', - 'dark_scheme', - 'theme_id', - 'color_scheme_id', - 'blocked', - 'projects_limit', - 'access_level', - 'created_at', - 'extern_uid', - 'provider', - 'state', - 'is_admin', - 'can_create_group', - 'can_create_project', - 'avatar_url', - 'current_sign_in_at', - 'two_factor_enabled' - ); - - /** - * @param Client $client - * @param array $data - * @return User - */ - public static function fromArray(Client $client, array $data) - { - $id = isset($data['id']) ? $data['id'] : 0; - - $user = new static($id, $client); - - return $user->hydrate($data); - } - - /** - * @param Client $client - * @param string $email - * @param string $password - * @param array $params - * @return User - */ - public static function create(Client $client, $email, $password, array $params = array()) - { - $data = $client->api('users')->create($email, $password, $params); - - return static::fromArray($client, $data); - } - - /** - * @param int $id - * @param Client $client - */ - public function __construct($id = null, Client $client = null) - { - $this->setClient($client); - $this->setData('id', $id); - } - - /** - * @return User - */ - public function show() - { - $data = $this->api('users')->show($this->id); - - return static::fromArray($this->getClient(), $data); - } - - /** - * @param array $params - * @return User - */ - public function update(array $params) - { - $data = $this->api('users')->update($this->id, $params); - - return static::fromArray($this->getClient(), $data); - } - - /** - * @return bool - */ - public function remove() - { - $this->api('users')->remove($this->id); - - return true; - } - - /** - * @return bool - */ - public function block() - { - $this->api('users')->block($this->id); - - return true; - } - - /** - * @return bool - */ - public function unblock() - { - $this->api('users')->unblock($this->id); - - return true; - } - - /** - * @return Key[] - */ - public function keys() - { - $data = $this->api('users')->keys(); - - $keys = array(); - foreach ($data as $key) { - $keys[] = Key::fromArray($this->getClient(), $key); - } - - return $keys; - } - - /** - * @param string $title - * @param string $key - * @return Key - */ - public function createKey($title, $key) - { - $data = $this->api('users')->createKey($title, $key); - - return Key::fromArray($this->getClient(), $data); - } - - /** - * @param string $title - * @param string $key - * @return Key - */ - public function createKeyForUser($user_id, $title, $key) - { - $data = $this->api('users')->createKeyForUser($user_id, $title, $key); - - return Key::fromArray($this->getClient(), $data); - } - - /** - * @param int $id - * @return bool - */ - public function removeKey($id) - { - $this->api('users')->removeKey($id); - - return true; - } - - /** - * @param int $group_id - * @param int $access_level - * @return User - */ - public function addToGroup($group_id, $access_level) - { - $group = new Group($group_id, $this->getClient()); - - return $group->addMember($this->id, $access_level); - } - - /** - * @param int $group_id - * @return bool - */ - public function removeFromGroup($group_id) - { - $group = new Group($group_id, $this->getClient()); - - return $group->removeMember($this->id); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/phpunit.xml.dist b/vendor/m4tthumphrey/php-gitlab-api/phpunit.xml.dist deleted file mode 100644 index e01386f15e1d1938f4f166c60ffdb9a2d34f418c..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/phpunit.xml.dist +++ /dev/null @@ -1,25 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<phpunit backupGlobals="false" - backupStaticAttributes="false" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false" - syntaxCheck="false" - bootstrap="test/bootstrap.php" - > - <testsuites> - <testsuite name="php-gitlab-api Test Suite"> - <directory>./test/Gitlab/</directory> - </testsuite> - </testsuites> - - <filter> - <whitelist> - <directory suffix=".php">./lib/Gitlab/</directory> - </whitelist> - </filter> -</phpunit> \ No newline at end of file diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/AbstractApiTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/AbstractApiTest.php deleted file mode 100644 index 2b3374f4eed4c3a1549172c0413b7d3881b9936b..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/AbstractApiTest.php +++ /dev/null @@ -1,177 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; -use Gitlab\Client; -use Gitlab\HttpClient\Message\Response; - -class AbstractApiTest extends TestCase -{ - /** - * @test - */ - public function shouldPassGETRequestToClient() - { - $response = $this->getResponse('value'); - - $httpClient = $this->getHttpMock(); - $httpClient - ->expects($this->any()) - ->method('get') - ->with('/path', array('param1' => 'param1value'), array('header1' => 'header1value')) - ->will($this->returnValue($response)); - - $client = $this->getClientMock(); - $client->setHttpClient($httpClient); - - $api = $this->getAbstractApiObject($client); - $this->assertEquals('value', $api->get('/path', array('param1' => 'param1value'), array('header1' => 'header1value'))); - } - - /** - * @test - */ - public function shouldPassPOSTRequestToClient() - { - $response = $this->getResponse('value'); - - $httpClient = $this->getHttpMock(); - $httpClient - ->expects($this->any()) - ->method('post') - ->with('/path', array('param1' => 'param1value'), array('header1' => 'header1value')) - ->will($this->returnValue($response)); - - $client = $this->getClientMock(); - $client->setHttpClient($httpClient); - - $api = $this->getAbstractApiObject($client); - $this->assertEquals('value', $api->post('/path', array('param1' => 'param1value'), array('header1' => 'header1value'))); - } - - /** - * @test - */ - public function shouldPassPUTRequestToClient() - { - $response = $this->getResponse('value'); - - $httpClient = $this->getHttpMock(); - $httpClient - ->expects($this->any()) - ->method('put') - ->with('/path', array('param1' => 'param1value'), array('header1' => 'header1value')) - ->will($this->returnValue($response)); - - $client = $this->getClientMock(); - $client->setHttpClient($httpClient); - - $api = $this->getAbstractApiObject($client); - $this->assertEquals('value', $api->put('/path', array('param1' => 'param1value'), array('header1' => 'header1value'))); - } - - /** - * @test - */ - public function shouldPassDELETERequestToClient() - { - $response = $this->getResponse('value'); - - $httpClient = $this->getHttpMock(); - $httpClient - ->expects($this->any()) - ->method('delete') - ->with('/path', array('param1' => 'param1value'), array('header1' => 'header1value')) - ->will($this->returnValue($response)); - - $client = $this->getClientMock(); - $client->setHttpClient($httpClient); - - $api = $this->getAbstractApiObject($client); - $this->assertEquals('value', $api->delete('/path', array('param1' => 'param1value'), array('header1' => 'header1value'))); - } - - /** - * @test - */ - public function shouldPassPATCHRequestToClient() - { - $response = $this->getResponse('value'); - - $httpClient = $this->getHttpMock(); - $httpClient - ->expects($this->any()) - ->method('patch') - ->with('/path', array('param1' => 'param1value'), array('header1' => 'header1value')) - ->will($this->returnValue($response)); - - $client = $this->getClientMock(); - $client->setHttpClient($httpClient); - - $api = $this->getAbstractApiObject($client); - $this->assertEquals('value', $api->patch('/path', array('param1' => 'param1value'), array('header1' => 'header1value'))); - } - - /** - * @param mixed $value - * @return Response - */ - protected function getResponse($value) - { - $response = new Response(); - $response->setContent($value); - - return $response; - } - - /** - * @param Client $client - * @return AbstractApiTestInstance - */ - protected function getAbstractApiObject(Client $client) - { - return new AbstractApiTestInstance($client); - } -} - -class AbstractApiTestInstance extends AbstractApi -{ - /** - * {@inheritDoc} - */ - public function get($path, array $parameters = array(), $requestHeaders = array()) - { - return parent::get($path, $parameters, $requestHeaders); - } - - /** - * {@inheritDoc} - */ - public function post($path, array $parameters = array(), $requestHeaders = array()) - { - return parent::post($path, $parameters, $requestHeaders); - } - - /** - * {@inheritDoc} - */ - public function patch($path, array $parameters = array(), $requestHeaders = array()) - { - return parent::patch($path, $parameters, $requestHeaders); - } - - /** - * {@inheritDoc} - */ - public function put($path, array $parameters = array(), $requestHeaders = array()) - { - return parent::put($path, $parameters, $requestHeaders); - } - - /** - * {@inheritDoc} - */ - public function delete($path, array $parameters = array(), $requestHeaders = array()) - { - return parent::delete($path, $parameters, $requestHeaders); - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ApiTestCase.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ApiTestCase.php deleted file mode 100644 index a695d97cb8007b5ef05014099192368a099403bc..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ApiTestCase.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -abstract class ApiTestCase extends TestCase -{ - abstract protected function getApiClass(); - - /** - * @param array $methods - * @return \PHPUnit_Framework_MockObject_MockObject|mixed - */ - protected function getApiMock($methods = array()) - { - $client = $this->getClientMock(); - - $methods = array_merge(array('get', 'post', 'postRaw', 'patch', 'delete', 'put', 'head'), $methods); - - return $this->getMockBuilder($this->getApiClass()) - ->setMethods($methods) - ->setConstructorArgs(array($client)) - ->getMock() - ; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/GroupsTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/GroupsTest.php deleted file mode 100644 index b84baffdaeac65042fbb3cab795db0d925ba22e2..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/GroupsTest.php +++ /dev/null @@ -1,247 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; - -class GroupsTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllGroups() - { - $expectedArray = array( - array('id' => 1, 'name' => 'A group'), - array('id' => 2, 'name' => 'Another group'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups', array('page' => 1, 'per_page' => 10)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1, 10)); - } - - /** - * @test - */ - public function shouldNotNeedPaginationWhenGettingGroups() - { - $expectedArray = array( - array('id' => 1, 'name' => 'A group'), - array('id' => 2, 'name' => 'Another group'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldSearchGroups() - { - $expectedArray = array( - array('id' => 1, 'name' => 'A group'), - array('id' => 2, 'name' => 'Another group'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups?search=some%20group', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('some group')); - } - - /** - * @test - */ - public function shouldSearchGroupsWithPagination() - { - $expectedArray = array( - array('id' => 1, 'name' => 'A group'), - array('id' => 2, 'name' => 'Another group'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups?search=group', array('page' => 2, 'per_page' => 5)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('group', 2, 5)); - } - - /** - * @test - */ - public function shouldShowGroup() - { - $expectedArray = array('id' => 1, 'name' => 'A group'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups/1') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1)); - } - - /** - * @test - */ - public function shouldCreateGroup() - { - $expectedArray = array('id' => 1, 'name' => 'A new group'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => null)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('A new group', 'a-new-group')); - } - - /** - * @test - */ - public function shouldCreateGroupWithDescription() - { - $expectedArray = array('id' => 1, 'name' => 'A new group'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => 'Description')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('A new group', 'a-new-group', 'Description')); - } - - /** - * @test - */ - public function shouldTransferProjectToGroup() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('groups/1/projects/2') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->transfer(1, 2)); - } - - /** - * @test - */ - public function shouldGetMembers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt'), - array('id' => 2, 'name' => 'Bob') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('groups/1/members') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->members(1)); - } - - /** - * @test - */ - public function shouldAddMember() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('groups/1/members', array('user_id' => 2, 'access_level' => 3)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addMember(1, 2, 3)); - } - - /** - * @test - */ - public function shouldSaveMember() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('groups/1/members/2', array('access_level' => 4)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->saveMember(1, 2, 4)); - } - - /** - * @test - */ - public function shouldRemoveMember() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('groups/1/members/2') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeMember(1, 2)); - } - - /** - * @test - */ - public function shouldRemoveGroup() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('groups/1') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->remove(1)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Groups'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/IssuesTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/IssuesTest.php deleted file mode 100644 index 86ffb977145075433ab00b6bb32d2e6f6da51609..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/IssuesTest.php +++ /dev/null @@ -1,194 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; - -class IssuesTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllIssues() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An issue'), - array('id' => 2, 'title' => 'Another issue'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('issues', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldGetProjectIssuesWithPagination() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An issue'), - array('id' => 2, 'title' => 'Another issue'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/issues', array('page' => 2, 'per_page' => 5)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1, 2, 5)); - } - - /** - * @test - */ - public function shouldGetProjectIssuesWithParams() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An issue'), - array('id' => 2, 'title' => 'Another issue'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/issues', array('page' => 2, 'per_page' => 5, 'order_by' => 'created_at', 'sort' => 'desc', 'labels' => 'foo,bar', 'state' => 'open')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1, 2, 5, array('order_by' => 'created_at', 'sort' => 'desc', 'labels' => 'foo,bar', 'state' => 'open'))); - } - - /** - * @test - */ - public function shouldShowIssue() - { - $expectedArray = array('id' => 2, 'title' => 'Another issue'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/issues/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1, 2)); - } - - /** - * @test - */ - public function shouldCreateIssue() - { - $expectedArray = array('id' => 3, 'title' => 'A new issue'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/issues', array('title' => 'A new issue', 'labels' => 'foo,bar')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create(1, array('title' => 'A new issue', 'labels' => 'foo,bar'))); - } - - /** - * @test - */ - public function shouldUpdateIssue() - { - $expectedArray = array('id' => 2, 'title' => 'A renamed issue'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/issues/2', array('title' => 'A renamed issue', 'labels' => 'foo')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(1, 2, array('title' => 'A renamed issue', 'labels' => 'foo'))); - } - - /** - * @test - */ - public function shouldGetIssueComments() - { - $expectedArray = array( - array('id' => 1, 'body' => 'A comment'), - array('id' => 2, 'body' => 'Another comment') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/issues/2/notes') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->showComments(1, 2)); - } - - /** - * @test - */ - public function shouldGetIssueComment() - { - $expectedArray = array('id' => 3, 'body' => 'A new comment'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/issues/2/notes/3') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->showComment(1, 2, 3)); - } - - /** - * @test - */ - public function shouldCreateComment() - { - $expectedArray = array('id' => 3, 'body' => 'A new comment'); - - $api = $this->getApiMock(); - $api->expects($this->exactly(2)) - ->method('post') - ->with('projects/1/issues/2/notes', array('body' => 'A new comment')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addComment(1, 2, array('body' => 'A new comment'))); - $this->assertEquals($expectedArray, $api->addComment(1, 2, 'A new comment')); - } - - /** - * @test - */ - public function shouldUpdateComment() - { - $expectedArray = array('id' => 3, 'body' => 'An edited comment'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/issues/2/notes/3', array('body' => 'An edited comment')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->updateComment(1, 2, 3, 'An edited comment')); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Issues'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MergeRequestsTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MergeRequestsTest.php deleted file mode 100644 index 92114fcc05bc58c49e2abf8c1e3f7e9211e4f6a8..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MergeRequestsTest.php +++ /dev/null @@ -1,331 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; -use Gitlab\Api\MergeRequests; - -class MergeRequestsTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetMergeRequestListWithDefaultParams() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/merge_requests', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE, 'state' => MergeRequests::STATE_ALL, 'order_by' => MergeRequests::ORDER_BY, 'sort' => MergeRequests::SORT)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->getList(1)); - } - - /** - * @test - */ - public function shouldGetAll() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_ALL, 1, AbstractApi::PER_PAGE, MergeRequests::ORDER_BY, MergeRequests::SORT) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1)); - } - - /** - * @test - */ - public function shouldGetAllWithParams() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_ALL, 2, 5, 'title', 'desc') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1, 2, 5, 'title', 'desc')); - } - - /** - * @test - */ - public function shouldGetMerged() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_MERGED, 1, AbstractApi::PER_PAGE, MergeRequests::ORDER_BY, MergeRequests::SORT) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->merged(1)); - } - - /** - * @test - */ - public function shouldGetMergedWithParams() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_MERGED, 3, 15, 'updated_at', 'asc') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->merged(1, 3, 15, 'updated_at', 'asc')); - } - - /** - * @test - */ - public function shouldGetOpened() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_OPENED, 1, AbstractApi::PER_PAGE, MergeRequests::ORDER_BY, MergeRequests::SORT) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->opened(1)); - } - - /** - * @test - */ - public function shouldGetOpenedWithParams() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_OPENED, 2, 4, 'title', 'desc') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->opened(1, 2, 4, 'title', 'desc')); - } - - /** - * @test - */ - public function shouldGetClosed() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_CLOSED, 1, AbstractApi::PER_PAGE, MergeRequests::ORDER_BY, MergeRequests::SORT) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->closed(1)); - } - - /** - * @test - */ - public function shouldGetClosedWithParams() - { - $expectedArray = $this->getMultipleMergeRequestsData(); - - $api = $this->getApiMock(array('getList')); - $api->expects($this->once()) - ->method('getList') - ->with(1, MergeRequests::STATE_CLOSED, 2, 4, 'title', 'desc') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->closed(1, 2, 4, 'title', 'desc')); - } - - /** - * @test - */ - public function shouldShowMergeRequest() - { - $expectedArray = array('id' => 2, 'name' => 'A merge request'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/merge_request/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1, 2)); - } - - /** - * @test - */ - public function shouldCreateMergeRequestWithoutOptionalParams() - { - $expectedArray = array('id' => 3, 'title' => 'Merge Request'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/merge_requests', array( - 'title' => 'Merge Request', - 'target_branch' => 'master', - 'source_branch' => 'develop', - 'description' => null, - 'assignee_id' => null, - 'target_project_id' => null - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create(1, 'develop', 'master', 'Merge Request')); - } - - /** - * @test - */ - public function shouldCreateMergeRequestWithOptionalParams() - { - $expectedArray = array('id' => 3, 'title' => 'Merge Request'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/merge_requests', array( - 'title' => 'Merge Request', - 'target_branch' => 'master', - 'source_branch' => 'develop', - 'description' => 'Some changes', - 'assignee_id' => 6, - 'target_project_id' => 20 - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create(1, 'develop', 'master', 'Merge Request', 6, 20, 'Some changes')); - } - - /** - * @test - */ - public function shouldUpdateMergeRequest() - { - $expectedArray = array('id' => 2, 'title' => 'Updated title'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/merge_request/2', array('title' => 'Updated title', 'description' => 'No so many changes now', 'state_event' => 'close')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(1, 2, array( - 'title' => 'Updated title', - 'description' => 'No so many changes now', - 'state_event' => 'close' - ))); - } - - /** - * @test - */ - public function shouldMergeMergeRequest() - { - $expectedArray = array('id' => 2, 'title' => 'Updated title'); - - $api = $this->getApiMock(); - $api->expects($this->exactly(2)) - ->method('put') - ->with('projects/1/merge_request/2/merge', array('merge_commit_message' => 'Accepted')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->merge(1, 2, 'Accepted')); - $this->assertEquals($expectedArray, $api->merge(1, 2, array('merge_commit_message' => 'Accepted'))); - } - - /** - * @test - */ - public function shouldGetMergeRequestComments() - { - $expectedArray = array( - array('id' => 1, 'note' => 'A comment'), - array('id' => 2, 'note' => 'Another comment') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/merge_request/2/comments') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->showComments(1, 2)); - } - - /** - * @test - */ - public function shouldAddMergeRequestComment() - { - $expectedArray = array('id' => 2, 'title' => 'A comment'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/merge_request/2/comments', array('note' => 'A comment')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addComment(1, 2, 'A comment')); - } - - /** - * @test - */ - public function shouldGetMergeRequestChanges() - { - $expectedArray = array('id' => 1, 'title' => 'A merge request'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/merge_request/2/changes') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->changes(1, 2)); - } - - protected function getMultipleMergeRequestsData() - { - return array( - array('id' => 1, 'title' => 'A merge request'), - array('id' => 2, 'title' => 'Another merge request') - ); - } - - protected function getApiClass() - { - return 'Gitlab\Api\MergeRequests'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MilestonesTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MilestonesTest.php deleted file mode 100644 index e22c2370ff9dfbc49db5087284329da980253438..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/MilestonesTest.php +++ /dev/null @@ -1,100 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -class MilestonesTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllMilestones() - { - $expectedArray = array( - array('id' => 1, 'title' => 'A milestone'), - array('id' => 2, 'title' => 'Another milestone'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/milestones') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1)); - } - - /** - * @test - */ - public function shouldShowMilestone() - { - $expectedArray = array('id' => 1, 'name' => 'A milestone'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/milestones/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1, 2)); - } - - /** - * @test - */ - public function shouldCreateMilestone() - { - $expectedArray = array('id' => 3, 'title' => 'A new milestone'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/milestones', array('description' => 'Some text', 'title' => 'A new milestone')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create(1, array('description' => 'Some text', 'title' => 'A new milestone'))); - } - - /** - * @test - */ - public function shouldUpdateMilestone() - { - $expectedArray = array('id' => 3, 'title' => 'Updated milestone'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/milestones/3', array('title' => 'Updated milestone', 'due_date' => '2015-04-01', 'state_event' => 'close')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(1, 3, array('title' => 'Updated milestone', 'due_date' => '2015-04-01', 'state_event' => 'close'))); - } - - /** - * @test - */ - public function shouldGetMilestonesIssues() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An issue'), - array('id' => 2, 'title' => 'Another issue'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/milestones/3/issues') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->issues(1, 3)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Milestones'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectNamespacesTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectNamespacesTest.php deleted file mode 100644 index 1feb5ff1f4146d0b9e020a2ec4f601364aebf5ce..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectNamespacesTest.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; - -class ProjectNamespacesTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllNamespaces() - { - $expectedArray = array( - array('id' => 1, 'name' => 'bespokes'), - array('id' => 2, 'name' => 'internal') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('namespaces', array('page' => 1, 'per_page' => 10)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1, 10)); - } - - /** - * @test - */ - public function shouldNotNeedPaginationWhenGettingNamespaces() - { - $expectedArray = array( - array('id' => 1, 'name' => 'bespokes'), - array('id' => 2, 'name' => 'internal') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('namespaces', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - /** - * @test - */ - public function shouldSearchNamespaces() - { - $expectedArray = array( - array('id' => 1, 'name' => 'bespokes'), - array('id' => 2, 'name' => 'internal') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('namespaces', array('search' => 'term', 'page' => 1, 'per_page' => 10)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('term', 1, 10)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\ProjectNamespaces'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectsTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectsTest.php deleted file mode 100644 index fdcdf5141d3b137981b4659ae6bd6f106e9df06f..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/ProjectsTest.php +++ /dev/null @@ -1,691 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; -use Gitlab\Api\Projects; - -class ProjectsTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllProjects() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getMultipleProjectsRequestMock('projects/all', $expectedArray); - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldGetAllProjectsSortedByName() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getMultipleProjectsRequestMock('projects/all', $expectedArray, 1, 5, 'name', 'asc'); - - $this->assertEquals($expectedArray, $api->all(1, 5, 'name')); - } - - /** - * @test - */ - public function shouldNotNeedPaginationWhenGettingProjects() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/all', array('page' => 1, 'per_page' => AbstractApi::PER_PAGE, 'order_by' => Projects::ORDER_BY, 'sort' => Projects::SORT)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldGetAccessibleProjects() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getMultipleProjectsRequestMock('projects', $expectedArray, 2, 7); - - $this->assertEquals($expectedArray, $api->accessible(2, 7)); - } - - /** - * @test - */ - public function shouldGetOwnedProjects() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getMultipleProjectsRequestMock('projects/owned', $expectedArray, 3, 50); - - $this->assertEquals($expectedArray, $api->owned(3, 50)); - } - - /** - * @test - */ - public function shouldSearchProjects() - { - $expectedArray = $this->getMultipleProjectsData(); - - $api = $this->getMultipleProjectsRequestMock('projects/search/a%20project', $expectedArray); - $this->assertEquals($expectedArray, $api->search('a project')); - - $api = $this->getMultipleProjectsRequestMock('projects/search/a%2Eproject', $expectedArray); - $this->assertEquals($expectedArray, $api->search('a.project')); - - $api = $this->getMultipleProjectsRequestMock('projects/search/a%2Fproject', $expectedArray); - $this->assertEquals($expectedArray, $api->search('a/project')); - } - - /** - * @test - */ - public function shouldShowProject() - { - $expectedArray = array('id' => 1, 'name' => 'Project Name'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1)); - } - - /** - * @test - */ - public function shouldCreateProject() - { - $expectedArray = array('id' => 1, 'name' => 'Project Name'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects', array('name' => 'Project Name', 'issues_enabled' => true)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('Project Name', array( - 'issues_enabled' => true - ))); - } - - /** - * @test - */ - public function shouldUpdateProject() - { - $expectedArray = array('id' => 1, 'name' => 'Updated Name'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1', array('name' => 'Updated Name', 'issues_enabled' => true)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(1, array( - 'name' => 'Updated Name', - 'issues_enabled' => true - ))); - } - - /** - * @test - */ - public function shouldCreateProjectForUser() - { - $expectedArray = array('id' => 1, 'name' => 'Project Name'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/user/1', array('name' => 'Project Name', 'issues_enabled' => true)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createForUser(1, 'Project Name', array( - 'issues_enabled' => true - ))); - } - - /** - * @test - */ - public function shouldRemoveProject() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->remove(1)); - } - - /** - * @test - */ - public function shouldGetMembers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt'), - array('id' => 2, 'name' => 'Bob') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/members') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->members(1)); - } - - /** - * @test - */ - public function shouldGetMembersWithQuery() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/members', array('query' => 'at')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->members(1, 'at')); - } - - /** - * @test - */ - public function shouldGetMember() - { - $expectedArray = array('id' => 2, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/members/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->member(1, 2)); - } - - /** - * @test - */ - public function shouldAddMember() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/members', array('user_id' => 2, 'access_level' => 3)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addMember(1, 2, 3)); - } - - /** - * @test - */ - public function shouldSaveMember() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/members/2', array('access_level' => 4)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->saveMember(1, 2, 4)); - } - - /** - * @test - */ - public function shouldRemoveMember() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/members/2') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeMember(1, 2)); - } - - /** - * @test - */ - public function shouldGetHooks() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Test hook'), - array('id' => 2, 'name' => 'Another hook'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/hooks') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->hooks(1)); - } - - /** - * @test - */ - public function shouldGetHook() - { - $expectedArray = array('id' => 2, 'name' => 'Another hook'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/hooks/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->hook(1, 2)); - } - - /** - * @test - */ - public function shouldAddHook() - { - $expectedArray = array('id' => 3, 'name' => 'A new hook', 'url' => 'http://www.example.com'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/hooks', array('url' => 'http://www.example.com', 'push_events' => true, 'issues_events' => true, 'merge_requests_events' => true)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addHook(1, 'http://www.example.com', array('push_events' => true, 'issues_events' => true, 'merge_requests_events' => true))); - } - - /** - * @test - */ - public function shouldAddHookWithOnlyUrl() - { - $expectedArray = array('id' => 3, 'name' => 'A new hook', 'url' => 'http://www.example.com'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/hooks', array('url' => 'http://www.example.com', 'push_events' => true)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addHook(1, 'http://www.example.com')); - } - - /** - * @test - */ - public function shouldAddHookWithoutPushEvents() - { - $expectedArray = array('id' => 3, 'name' => 'A new hook', 'url' => 'http://www.example.com'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/hooks', array('url' => 'http://www.example.com', 'push_events' => false)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addHook(1, 'http://www.example.com', array('push_events' => false))); - } - - /** - * @test - */ - public function shouldUpdateHook() - { - $expectedArray = array('id' => 3, 'name' => 'A new hook', 'url' => 'http://www.example.com'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/hooks/3', array('url' => 'http://www.example-test.com', 'push_events' => false)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->updateHook(1, 3, array('url' => 'http://www.example-test.com', 'push_events' => false))); - } - - /** - * @test - */ - public function shouldRemoveHook() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/hooks/2') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeHook(1, 2)); - } - - /** - * @test - */ - public function shouldGetKeys() - { - $expectedArray = array( - array('id' => 1, 'title' => 'test-key'), - array('id' => 2, 'title' => 'another-key') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/keys') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->keys(1)); - } - - /** - * @test - */ - public function shouldGetKey() - { - $expectedArray = array('id' => 2, 'title' => 'another-key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/keys/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->key(1, 2)); - } - - /** - * @test - */ - public function shouldAddKey() - { - $expectedArray = array('id' => 3, 'title' => 'new-key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/keys', array('title' => 'new-key', 'key' => '...')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addKey(1, 'new-key', '...')); - } - - /** - * @test - */ - public function shouldRemoveKey() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/keys/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeKey(1, 3)); - } - - /** - * @test - */ - public function shouldGetEvents() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An event'), - array('id' => 2, 'title' => 'Another event') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/events', array( - 'page' => 1, - 'per_page' => AbstractApi::PER_PAGE - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->events(1)); - } - - /** - * @test - */ - public function shouldGetEventsWithPagination() - { - $expectedArray = array( - array('id' => 1, 'title' => 'An event'), - array('id' => 2, 'title' => 'Another event') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/events', array( - 'page' => 2, - 'per_page' => 15 - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->events(1, 2, 15)); - } - - /** - * @test - */ - public function shouldGetLabels() - { - $expectedArray = array( - array('name' => 'bug', 'color' => '#000000'), - array('name' => 'feature', 'color' => '#ff0000') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/labels') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->labels(1)); - } - - /** - * @test - */ - public function shouldAddLabel() - { - $expectedArray = array('name' => 'bug', 'color' => '#000000'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/labels', array('name' => 'wont-fix', 'color' => '#ffffff')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->addLabel(1, array('name' => 'wont-fix', 'color' => '#ffffff'))); - } - - /** - * @test - */ - public function shouldUpdateLabel() - { - $expectedArray = array('name' => 'bug', 'color' => '#00ffff'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/labels', array('name' => 'bug', 'new_name' => 'big-bug', 'color' => '#00ffff')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->updateLabel(1, array('name' => 'bug', 'new_name' => 'big-bug', 'color' => '#00ffff'))); - } - - /** - * @test - */ - public function shouldRemoveLabel() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/labels', array('name' => 'bug')) - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeLabel(1, 'bug')); - } - - /** - * @test - */ - public function shouldCreateForkRelation() - { - $expectedArray = array('project_id' => 1, 'forked_id' => 2); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/fork/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createForkRelation(1, 2)); - } - - /** - * @test - */ - public function shouldRemoveForkRelation() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/2/fork') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeForkRelation(2)); - } - - /** - * @test - */ - public function shouldSetService() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/services/hipchat', array('param' => 'value')) - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->setService(1, 'hipchat', array('param' => 'value'))); - } - - /** - * @test - */ - public function shouldRemoveService() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/services/hipchat') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeService(1, 'hipchat')); - } - - protected function getMultipleProjectsRequestMock($path, $expectedArray = array(), $page = 1, $per_page = 20, $order_by = 'created_at', $sort = 'asc') - { - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with($path, array('page' => $page, 'per_page' => $per_page, 'order_by' => $order_by, 'sort' => $sort)) - ->will($this->returnValue($expectedArray)) - ; - - return $api; - } - - protected function getMultipleProjectsData() - { - return array( - array('id' => 1, 'name' => 'A project'), - array('id' => 2, 'name' => 'Another project') - ); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Projects'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/RepositoriesTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/RepositoriesTest.php deleted file mode 100644 index d3fd61faacea31c743d78f5090ec6b6d9439991f..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/RepositoriesTest.php +++ /dev/null @@ -1,516 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; - -class RepositoriesTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetBranches() - { - $expectedArray = array( - array('name' => 'master'), - array('name' => 'develop') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/branches') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->branches(1)); - } - - /** - * @test - */ - public function shouldGetBranch() - { - $expectedArray = array('name' => 'master'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/branches/master') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->branch(1, 'master')); - } - - /** - * @test - */ - public function shouldCreateBranch() - { - $expectedArray = array('name' => 'feature'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/branches', array('branch_name' => 'feature', 'ref' => 'master')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createBranch(1, 'feature', 'master')); - } - - /** - * @test - */ - public function shouldDeleteBranch() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/repository/branches/master') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->deleteBranch(1, 'master')); - } - - /** - * @test - */ - public function shouldProtectBranch() - { - $expectedArray = array('name' => 'master'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/repository/branches/master/protect') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->protectBranch(1, 'master')); - } - - /** - * @test - */ - public function shouldUnprotectBranch() - { - $expectedArray = array('name' => 'master'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/repository/branches/master/unprotect') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->unprotectBranch(1, 'master')); - } - - /** - * @test - */ - public function shouldGetTags() - { - $expectedArray = array( - array('name' => '1.0'), - array('name' => '1.1') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/tags') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->tags(1)); - } - - /** - * @test - */ - public function shouldCreateTag() - { - $expectedArray = array('name' => '1.0'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/tags', array( - 'tag_name' => '1.0', - 'ref' => 'abcd1234', - 'message' => '1.0 release' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createTag(1, '1.0', 'abcd1234', '1.0 release')); - } - - /** - * @test - */ - public function shouldGetCommits() - { - $expectedArray = array( - array('id' => 'abcd1234', 'title' => 'A commit'), - array('id' => 'efgh5678', 'title' => 'Another commit') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits', array('page' => 0, 'per_page' => AbstractApi::PER_PAGE, 'ref_name' => null)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->commits(1)); - } - - /** - * @test - */ - public function shouldGetCommitsWithParams() - { - $expectedArray = array( - array('id' => 'abcd1234', 'title' => 'A commit'), - array('id' => 'efgh5678', 'title' => 'Another commit') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits', array('page' => 2, 'per_page' => 25, 'ref_name' => 'master')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->commits(1, 2, 25, 'master')); - } - - /** - * @test - */ - public function shouldGetCommit() - { - $expectedArray = array('id' => 'abcd1234', 'title' => 'A commit'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits/abcd1234') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->commit(1, 'abcd1234')); - } - - /** - * @test - */ - public function shouldGetCommitComments() - { - $expectedArray = array( - array('note' => 'A commit message'), - array('note' => 'Another commit message') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits/abcd1234/comments') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->commitComments(1, 'abcd1234')); - } - - /** - * @test - */ - public function shouldCreateCommitComment() - { - $expectedArray = array('id' => 2, 'title' => 'A new comment'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/commits/abcd1234/comments', array('note' => 'A new comment')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createCommitComment(1, 'abcd1234', 'A new comment')); - } - - /** - * @test - */ - public function shouldCreateCommitCommentWithParams() - { - $expectedArray = array('id' => 2, 'title' => 'A new comment'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/commits/abcd1234/comments', array( - 'note' => 'A new comment', - 'path' => '/some/file.txt', - 'line' => 123, 'line_type' => 'old' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createCommitComment(1, 'abcd1234', 'A new comment', array( - 'path' => '/some/file.txt', - 'line' => 123, - 'line_type' => 'old' - ))); - } - - /** - * @test - */ - public function shouldCompare() - { - $expectedArray = array('commit' => 'object'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/compare?from=master&to=feature') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->compare(1, 'master', 'feature')); - } - - /** - * @test - */ - public function shouldGetDiff() - { - $expectedArray = array( - array('diff' => '--- ...'), - array('diff' => '+++ ...') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits/abcd1234/diff') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->diff(1, 'abcd1234')); - } - - /** - * @test - */ - public function shouldGetTree() - { - $expectedArray = array( - array('name' => 'file1.txt'), - array('name' => 'file2.csv') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/tree') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->tree(1)); - } - - /** - * @test - */ - public function shouldGetTreeWithParams() - { - $expectedArray = array( - array('name' => 'dir/file1.txt'), - array('name' => 'dir/file2.csv') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/tree', array('path' => 'dir/', 'ref_name' => 'master')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->tree(1, array('path' => 'dir/', 'ref_name' => 'master'))); - } - - /** - * @test - */ - public function shouldGetBlob() - { - $expectedString = 'something in a file'; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/commits/abcd1234/blob', array('filepath' => 'dir/file1.txt')) - ->will($this->returnValue($expectedString)) - ; - - $this->assertEquals($expectedString, $api->blob(1, 'abcd1234', 'dir/file1.txt')); - } - - /** - * @test - */ - public function shouldGetFile() - { - $expectedArray = array('file_name' => 'file1.txt', 'file_path' => 'dir/file1.txt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/files', array('file_path' => 'dir/file1.txt', 'ref' => 'abcd1234')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->getFile(1, 'dir/file1.txt', 'abcd1234')); - } - - /** - * @test - */ - public function shouldCreateFile() - { - $expectedArray = array('file_name' => 'file1.txt', 'file_path' => 'dir/file1.txt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/files', array( - 'file_path' => 'dir/file1.txt', - 'branch_name' => 'master', - 'encoding' => null, - 'content' => 'some contents', - 'commit_message' => 'Added new file' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createFile(1, 'dir/file1.txt', 'some contents', 'master', 'Added new file')); - } - - /** - * @test - */ - public function shouldCreateFileWithEncoding() - { - $expectedArray = array('file_name' => 'file1.txt', 'file_path' => 'dir/file1.txt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/repository/files', array( - 'file_path' => 'dir/file1.txt', - 'branch_name' => 'master', - 'encoding' => 'text', - 'content' => 'some contents', - 'commit_message' => 'Added new file' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createFile(1, 'dir/file1.txt', 'some contents', 'master', 'Added new file', 'text')); - } - - /** - * @test - */ - public function shouldUpdateFile() - { - $expectedArray = array('file_name' => 'file1.txt', 'file_path' => 'dir/file1.txt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/repository/files', array( - 'file_path' => 'dir/file1.txt', - 'branch_name' => 'master', - 'encoding' => null, - 'content' => 'some new contents', - 'commit_message' => 'Updated new file' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->updateFile(1, 'dir/file1.txt', 'some new contents', 'master', 'Updated new file')); - } - - /** - * @test - */ - public function shouldUpdateFileWithEncoding() - { - $expectedArray = array('file_name' => 'file1.txt', 'file_path' => 'dir/file1.txt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/repository/files', array( - 'file_path' => 'dir/file1.txt', - 'branch_name' => 'master', - 'encoding' => 'base64', - 'content' => 'some new contents', - 'commit_message' => 'Updated file' - )) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->updateFile(1, 'dir/file1.txt', 'some new contents', 'master', 'Updated file', 'base64')); - } - - /** - * @test - */ - public function shouldDeleteFile() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/repository/files', array('file_path' => 'dir/file1.txt', 'branch_name' => 'master', 'commit_message' => 'Deleted file')) - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->deleteFile(1, 'dir/file1.txt', 'master', 'Deleted file')); - } - - /** - * @test - */ - public function shouldGetContributors() - { - $expectedArray = array( - array('name' => 'Matt'), - array('name' => 'Bob') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/repository/contributors') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->contributors(1)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Repositories'; - } -} \ No newline at end of file diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SnippetsTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SnippetsTest.php deleted file mode 100644 index 694aac5959ddecfade4f6b1bedf6d32580003517..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SnippetsTest.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -class SnippetsTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllSnippets() - { - $expectedArray = array( - array('id' => 1, 'title' => 'A snippet'), - array('id' => 2, 'title' => 'Another snippet'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/snippets') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(1)); - } - - /** - * @test - */ - public function shouldShowSnippet() - { - $expectedArray = array('id' => 2, 'title' => 'Another snippet'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/snippets/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1, 2)); - } - - /** - * @test - */ - public function shouldCreateSnippet() - { - $expectedArray = array('id' => 3, 'title' => 'A new snippet'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('projects/1/snippets', array('title' => 'A new snippet', 'code' => 'A file', 'file_name' => 'file.txt')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create(1, 'A new snippet', 'file.txt', 'A file')); - } - - /** - * @test - */ - public function shouldUpdateSnippet() - { - $expectedArray = array('id' => 3, 'title' => 'Updated snippet'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('projects/1/snippets/3', array('title' => 'Updated snippet', 'code' => 'New content', 'file_name' => 'new_file.txt')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(1, 3, array('file_name' => 'new_file.txt', 'code' => 'New content', 'title' => 'Updated snippet'))); - } - - /** - * @test - */ - public function shouldShowContent() - { - $expectedString = 'New content'; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('projects/1/snippets/3/raw') - ->will($this->returnValue($expectedString)) - ; - - $this->assertEquals($expectedString, $api->content(1, 3)); - } - - /** - * @test - */ - public function shouldRemoveSnippet() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('projects/1/snippets/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->remove(1, 3)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Snippets'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SystemHooksTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SystemHooksTest.php deleted file mode 100644 index 3bf16bce6bcd948fad1f0d3c280fc4a4a478e7cb..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/SystemHooksTest.php +++ /dev/null @@ -1,80 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -class SystemHooksTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllHooks() - { - $expectedArray = array( - array('id' => 1, 'url' => 'http://www.example.com'), - array('id' => 2, 'url' => 'http://www.example.org'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('hooks') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldCreateHook() - { - $expectedArray = array('id' => 3, 'url' => 'http://www.example.net'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('hooks', array('url' => 'http://www.example.net')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('http://www.example.net')); - } - - /** - * @test - */ - public function shouldTestHook() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('hooks/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->test(3)); - } - - /** - * @test - */ - public function shouldRemoveHook() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('hooks/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->remove(3)); - } - - protected function getApiClass() - { - return 'Gitlab\Api\SystemHooks'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/TestCase.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/TestCase.php deleted file mode 100644 index cba51e5e26a9bf8cdc1554ae094450706f3eef9b..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/TestCase.php +++ /dev/null @@ -1,38 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Buzz\Client\Curl; - -use Gitlab\Client; -use Gitlab\HttpClient\HttpClientInterface; - -abstract class TestCase extends \PHPUnit_Framework_TestCase -{ - /** - * @return Client - */ - protected function getClientMock() - { - return new Client($this->getHttpMock()); - } - - /** - * @return \PHPUnit_Framework_MockObject_MockObject|HttpClientInterface - */ - protected function getHttpMock() - { - return $this->getMock('Gitlab\HttpClient\HttpClient', array(), array(null, array(), $this->getHttpClientMock())); - } - - /** - * @return \PHPUnit_Framework_MockObject_MockObject|Curl - */ - protected function getHttpClientMock() - { - $httpClient = $this->getMock('Buzz\Client\Curl', array('send')); - $httpClient - ->expects($this->any()) - ->method('send'); - - return $httpClient; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/UsersTest.php b/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/UsersTest.php deleted file mode 100644 index cc1d262ab5d8dffa69a698b7fc9a6d12a7490328..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/Gitlab/Tests/Api/UsersTest.php +++ /dev/null @@ -1,424 +0,0 @@ -<?php namespace Gitlab\Tests\Api; - -use Gitlab\Api\AbstractApi; - -class UsersTest extends ApiTestCase -{ - /** - * @test - */ - public function shouldGetAllUsers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt'), - array('id' => 2, 'name' => 'John'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('active' => null, 'page' => 1, 'per_page' => 10)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(null, 1, 10)); - } - - /** - * @test - */ - public function shouldGetActiveUsers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt'), - array('id' => 2, 'name' => 'John'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('active' => true, 'page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all(true)); - } - - /** - * @test - */ - public function shouldNotNeedPaginationWhenGettingUsers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt'), - array('id' => 2, 'name' => 'John'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('active' => null, 'page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->all()); - } - - /** - * @test - */ - public function shouldSearchUsers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('search' => 'ma', 'active' => null, 'page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('ma')); - } - - /** - * @test - */ - public function shouldSearchActiveUsers() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('search' => 'ma', 'active' => true, 'page' => 1, 'per_page' => AbstractApi::PER_PAGE)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('ma', true)); - } - - /** - * @test - */ - public function shouldSearchActiveUsersWithPagination() - { - $expectedArray = array( - array('id' => 1, 'name' => 'Matt') - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users', array('search' => 'ma', 'active' => true, 'page' => 2, 'per_page' => 5)) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->search('ma', true, 2, 5)); - } - - /** - * @test - */ - public function shouldShowUser() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users/1') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->show(1)); - } - - /** - * @test - */ - public function shouldCreateUser() - { - $expectedArray = array('id' => 3, 'name' => 'Billy'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('users', array('email' => 'billy@example.com', 'password' => 'password')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('billy@example.com', 'password')); - } - - /** - * @test - */ - public function shouldCreateUserWithAdditionalInfo() - { - $expectedArray = array('id' => 3, 'name' => 'Billy'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('users', array('email' => 'billy@example.com', 'password' => 'password', 'name' => 'Billy', 'bio' => 'A person')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->create('billy@example.com', 'password', array('name' => 'Billy', 'bio' => 'A person'))); - } - - /** - * @test - */ - public function shouldUpdateUser() - { - $expectedArray = array('id' => 3, 'name' => 'Billy Bob'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('users/3', array('name' => 'Billy Bob')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->update(3, array('name' => 'Billy Bob'))); - } - - /** - * @test - */ - public function shouldRemoveUser() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('users/1') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->remove(1)); - } - - /** - * @test - */ - public function shouldBlockUser() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('users/1/block') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->block(1)); - } - - /** - * @test - */ - public function shouldUnblockUser() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('put') - ->with('users/1/unblock') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->unblock(1)); - } - - /** - * @test - */ - public function shouldShowCurrentUser() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('user') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->me()); - } - - /** - * @test - */ - public function shouldGetCurrentUserKeys() - { - $expectedArray = array( - array('id' => 1, 'title' => 'A key'), - array('id' => 2, 'name' => 'Another key'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('user/keys') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->keys(1)); - } - - /** - * @test - */ - public function shouldGetCurrentUserKey() - { - $expectedArray = array('id' => 1, 'title' => 'A key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('user/keys/1') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->key(1)); - } - - /** - * @test - */ - public function shouldCreateKeyForCurrentUser() - { - $expectedArray = array('id' => 3, 'title' => 'A new key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('user/keys', array('title' => 'A new key', 'key' => '...')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createKey('A new key', '...')); - } - - /** - * @test - */ - public function shouldDeleteKeyForCurrentUser() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('user/keys/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeKey(3)); - } - - /** - * @test - */ - public function shouldGetUserKeys() - { - $expectedArray = array( - array('id' => 1, 'title' => 'A key'), - array('id' => 2, 'name' => 'Another key'), - ); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users/1/keys') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->userKeys(1)); - } - - /** - * @test - */ - public function shouldGetUserKey() - { - $expectedArray = array('id' => 2, 'title' => 'Another key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('get') - ->with('users/1/keys/2') - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->userKey(1, 2)); - } - - /** - * @test - */ - public function shouldCreateKeyForUser() - { - $expectedArray = array('id' => 3, 'title' => 'A new key'); - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('post') - ->with('users/1/keys', array('title' => 'A new key', 'key' => '...')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->createKeyForUser(1, 'A new key', '...')); - } - - /** - * @test - */ - public function shouldDeleteKeyForUser() - { - $expectedBool = true; - - $api = $this->getApiMock(); - $api->expects($this->once()) - ->method('delete') - ->with('users/1/keys/3') - ->will($this->returnValue($expectedBool)) - ; - - $this->assertEquals($expectedBool, $api->removeUserKey(1, 3)); - } - - /** - * @test - */ - public function shouldAttemptLogin() - { - $expectedArray = array('id' => 1, 'name' => 'Matt'); - - $api = $this->getApiMock(); - $api->expects($this->exactly(2)) - ->method('post') - ->with('session', array('login' => 'matt', 'password' => 'password', 'email' => 'matt')) - ->will($this->returnValue($expectedArray)) - ; - - $this->assertEquals($expectedArray, $api->session('matt', 'password')); - $this->assertEquals($expectedArray, $api->login('matt', 'password')); - } - - protected function getApiClass() - { - return 'Gitlab\Api\Users'; - } -} diff --git a/vendor/m4tthumphrey/php-gitlab-api/test/bootstrap.php b/vendor/m4tthumphrey/php-gitlab-api/test/bootstrap.php deleted file mode 100644 index 83bc8b088a4fee7016d39ea78c45258cde578119..0000000000000000000000000000000000000000 --- a/vendor/m4tthumphrey/php-gitlab-api/test/bootstrap.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -function includeIfExists($file) -{ - if (file_exists($file)) { - return include $file; - } -} - -if ((!$loader = includeIfExists(__DIR__.'/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__.'/../../../.composer/autoload.php'))) { - die('You must set up the project dependencies, run the following commands:'.PHP_EOL. - 'curl -s http://getcomposer.org/installer | php'.PHP_EOL. - 'php composer.phar install'.PHP_EOL); -} - -$loader->add('Gitlab\Tests', __DIR__); - -return $loader; \ No newline at end of file