diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..1c7a731 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,37 @@ +# PHP CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-php/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/php:cli + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mysql:9.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "composer.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: composer install -n --prefer-dist + + - save_cache: + paths: + - ./vendor + key: v1-dependencies-{{ checksum "composer.json" }} + + # run tests! + - run: vendor/bin/phpunit ./Tests \ No newline at end of file diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..04e7f5c --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,21 @@ +--- +engines: + duplication: + enabled: true + config: + languages: + - php + fixme: + enabled: true + phpmd: + enabled: true +ratings: + paths: + - "**.inc" + - "**.js" + - "**.jsx" + - "**.module" + - "**.php" + - "**.py" + - "**.rb" +exclude_paths: ["Tests/"] diff --git a/README.md b/README.md index 63b3f54..fe9396b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +[![CircleCI build badge](https://circleci.com/gh/trms/carousel-api-php.svg?style=shield&circle-token=:circle-token)](https://circleci.com/gh/trms/carousel-api-php.svg?style=shield&circle-token=:circle-token) +[![License](https://poser.pugx.org/trms/carousel/license)](https://packagist.org/packages/trms/carousel) +[![Total Downloads](https://poser.pugx.org/trms/carousel/downloads)](https://packagist.org/packages/trms/carousel) +[![Latest Stable Version](https://poser.pugx.org/trms/carousel/version)](https://packagist.org/packages/trms/carousel) +[![Code Climate](https://img.shields.io/codeclimate/github/trms/carousel-api-php.svg)]() + # PHP Package for the Carousel API This package is designed to be a fluent interface for Tightrope Media Systems' Carousel API. For more information on TRMS and the Carousel software please visit [www.trms.com](https://www.trms.com). diff --git a/composer.json b/composer.json index 3ced0f4..7f0a461 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "trms/carousel", "description": "A PHP package to access Tightrope Media Systems' Carousel Software API", + "license": "MIT", "require": { "nesbot/carbon": "^1.22", "guzzlehttp/guzzle": "~6.0", diff --git a/composer.lock b/composer.lock index 82cc2d2..9c1832b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "e8a2a8e801899545e7e07f84a2d8bfaf", + "content-hash": "0824f3bae76d46d65f22b4470d222066", "packages": [ { "name": "guzzlehttp/guzzle", @@ -328,16 +328,16 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.4.0", + "version": "v1.5.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937" + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/f29dca382a6485c3cbe6379f0c61230167681937", - "reference": "f29dca382a6485c3cbe6379f0c61230167681937", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7c8fae0ac1d216eb54349e6a8baa57d515fe8803", + "reference": "7c8fae0ac1d216eb54349e6a8baa57d515fe8803", "shasum": "" }, "require": { @@ -349,7 +349,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -383,24 +383,24 @@ "portable", "shim" ], - "time": "2017-06-09T14:24:12+00:00" + "time": "2017-06-14T15:44:48+00:00" }, { "name": "symfony/translation", - "version": "v3.3.4", + "version": "v3.3.9", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3" + "reference": "add53753d978f635492dfe8cd6953f6a7361ef90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3", - "reference": "35dd5fb003c90e8bd4d8cabdf94bf9c96d06fdc3", + "url": "https://api.github.com/repos/symfony/translation/zipball/add53753d978f635492dfe8cd6953f6a7361ef90", + "reference": "add53753d978f635492dfe8cd6953f6a7361ef90", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -448,24 +448,24 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-06-24T16:45:30+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "symfony/var-dumper", - "version": "v3.3.4", + "version": "v3.3.9", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "9ee920bba1d2ce877496dcafca7cbffff4dbe08a" + "reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9ee920bba1d2ce877496dcafca7cbffff4dbe08a", - "reference": "9ee920bba1d2ce877496dcafca7cbffff4dbe08a", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89fcb5a73e0ede2be2512234c4e40457bb22b35f", + "reference": "89fcb5a73e0ede2be2512234c4e40457bb22b35f", "shasum": "" }, "require": { - "php": ">=5.5.9", + "php": "^5.5.9|>=7.0.8", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { @@ -516,28 +516,28 @@ "debug", "dump" ], - "time": "2017-07-05T13:02:37+00:00" + "time": "2017-08-27T14:52:21+00:00" }, { "name": "tightenco/collect", - "version": "v5.4.27", + "version": "v5.5.9", "source": { "type": "git", "url": "https://github.com/tightenco/collect.git", - "reference": "16a16f2214f2ef251e6cbd3efd47b422bace5f58" + "reference": "e277d1983234706604115e86ea06998329c30c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tightenco/collect/zipball/16a16f2214f2ef251e6cbd3efd47b422bace5f58", - "reference": "16a16f2214f2ef251e6cbd3efd47b422bace5f58", + "url": "https://api.github.com/repos/tightenco/collect/zipball/e277d1983234706604115e86ea06998329c30c6e", + "reference": "e277d1983234706604115e86ea06998329c30c6e", "shasum": "" }, "require": { - "php": ">=5.6.4" + "php": ">=7.0" }, "require-dev": { - "mockery/mockery": "^0.9.7", - "phpunit/phpunit": "^5.7" + "mockery/mockery": "~1.0", + "phpunit/phpunit": "~6.0" }, "type": "library", "autoload": { @@ -563,7 +563,7 @@ "collection", "laravel" ], - "time": "2017-06-15T20:17:56+00:00" + "time": "2017-09-20T17:15:11+00:00" } ], "packages-dev": [ @@ -775,16 +775,16 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -825,26 +825,26 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/2d3d238c433cf69caeb4842e97a3223a116f94b2", + "reference": "2d3d238c433cf69caeb4842e97a3223a116f94b2", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { @@ -870,24 +870,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-08-30T18:51:59+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -917,26 +917,26 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "v1.7.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", + "reference": "c9b8c6088acd19d769d4cc0ffa60a9fe34344bd6", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, @@ -947,7 +947,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -980,7 +980,7 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-09-04T11:05:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1184,29 +1184,29 @@ }, { "name": "phpunit/php-token-stream", - "version": "1.4.11", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7" + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e03f8f67534427a787e21a385a67ec3ca6978ea7", - "reference": "e03f8f67534427a787e21a385a67ec3ca6978ea7", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", + "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.3.3" + "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "^6.2.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -1229,7 +1229,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-02-27T10:12:30+00:00" + "time": "2017-08-20T05:47:52+00:00" }, { "name": "phpunit/phpunit", @@ -1887,20 +1887,20 @@ }, { "name": "symfony/yaml", - "version": "v3.3.4", + "version": "v3.3.9", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8" + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/1f93a8d19b8241617f5074a123e282575b821df8", - "reference": "1f93a8d19b8241617f5074a123e282575b821df8", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1d8c2a99c80862bdc3af94c1781bf70f86bccac0", + "reference": "1d8c2a99c80862bdc3af94c1781bf70f86bccac0", "shasum": "" }, "require": { - "php": ">=5.5.9" + "php": "^5.5.9|>=7.0.8" }, "require-dev": { "symfony/console": "~2.8|~3.0" @@ -1938,7 +1938,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-06-15T12:58:50+00:00" + "time": "2017-07-29T21:54:42+00:00" }, { "name": "webmozart/assert", diff --git a/src/Server/API.php b/src/Server/API.php index a011526..bb662b6 100644 --- a/src/Server/API.php +++ b/src/Server/API.php @@ -11,7 +11,7 @@ use TRMS\Carousel\Exceptions\CarouselAPIException; use TRMS\Carousel\Requests\ModelRequest; -use TRMS\Carousel\Requests\ApiRequest; +use TRMS\Carousel\Requests\APIRequest; use TRMS\Carousel\Requests\FileUploadRequest; class API