diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..1d375f2e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +language: php + +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - 7.1 + - 7.2 + - 7.3 + +# to support hhvm +dist: trusty + +# faster builds on new travis setup not using sudo +sudo: false + +# cache vendor dirs +cache: + directories: + - $HOME/.composer/cache + +env: + matrix: + - COMPOSER_OPTIONS="--prefer-lowest --prefer-stable" + - COMPOSER_OPTIONS="" + +install: +- travis_retry composer self-update && composer --version +- export PATH="$HOME/.composer/vendor/bin:$PATH" +- travis_retry composer install --prefer-dist --no-interaction + +before_script: +- | + if [ $TRAVIS_PHP_VERSION = '5.6' ]; then + PHPUNIT_FLAGS="--coverage --coverage-xml" + fi + +script: +- sh ./phpcs.sh +#- php ./vendor/bin/codecept run unit -d $PHPUNIT_FLAGS + +#after_success: +#- php ./vendor/bin/coveralls -v --exclude-no-stmt -c .coveralls.yml diff --git a/README.md b/README.md index 8f4a9ce8..6a2d1a7e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Build Status](https://travis-ci.org/albertborsos/yii2-ddd.svg?branch=master)](https://travis-ci.org/albertborsos/yii2-ddd) + DDD Classes for Yii 2.0 ======================= Classes for a Domain-Driven Design inspired workflow with Yii 2.0 Framework @@ -97,8 +99,8 @@ class CreateAppService extends AbstractService $model->load($this->getForm()->attributes, ''); if ($model->save()) { - $this->assignLanguages($model->getId(), $this->getForm()->languages); - $this->setId($model->getId()); + $this->assignLanguages($model->id, $this->getForm()->languages); + $this->setId($model->id); return true; } diff --git a/composer.json b/composer.json index 69a4edf3..c2c73c23 100644 --- a/composer.json +++ b/composer.json @@ -27,5 +27,11 @@ "albertborsos\\ddd\\tests\\": "tests/", "albertborsos\\ddd\\tests\\support\\base\\": "tests/_support/base/" } - } + }, + "repositories": [ + { + "type": "composer", + "url": "https://asset-packagist.org" + } + ] } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index e7fddf79..00000000 --- a/composer.lock +++ /dev/null @@ -1,3455 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "content-hash": "94112cb9efe18e1cec522d264df64b3c", - "packages": [ - { - "name": "albertborsos/yii2-theme-helper", - "version": "0.2.0", - "source": { - "type": "git", - "url": "https://github.com/albertborsos/yii2-theme-helper.git", - "reference": "ba0fb87dd1dc40cb2accb6ad77e7cd485d6e546a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/albertborsos/yii2-theme-helper/zipball/ba0fb87dd1dc40cb2accb6ad77e7cd485d6e546a", - "reference": "ba0fb87dd1dc40cb2accb6ad77e7cd485d6e546a", - "shasum": "" - }, - "require": { - "rmrevin/yii2-fontawesome": "~2.17", - "yiisoft/yii2": "~2.0.0", - "yiisoft/yii2-bootstrap": "~2.0.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "albertborsos\\themehelper\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Abert Borsos", - "email": "hello@borsosalbert.hu" - } - ], - "description": "Helper classes for themes", - "keywords": [ - "extension", - "yii2" - ], - "time": "2018-02-02T16:29:04+00:00" - }, - { - "name": "bower-asset/bootstrap", - "version": "v3.3.7", - "source": { - "type": "git", - "url": "https://github.com/twbs/bootstrap.git", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", - "shasum": "" - }, - "require": { - "bower-asset/jquery": ">=1.9.1,<4.0" - }, - "type": "bower-asset-library", - "extra": { - "bower-asset-main": [ - "less/bootstrap.less", - "dist/js/bootstrap.js" - ], - "bower-asset-ignore": [ - "/.*", - "_config.yml", - "CNAME", - "composer.json", - "CONTRIBUTING.md", - "docs", - "js/tests", - "test-infra" - ] - }, - "license": [ - "MIT" - ], - "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", - "keywords": [ - "css", - "framework", - "front-end", - "js", - "less", - "mobile-first", - "responsive", - "web" - ], - "time": "2016-07-25T15:51:55+00:00" - }, - { - "name": "bower-asset/inputmask", - "version": "3.3.11", - "source": { - "type": "git", - "url": "https://github.com/RobinHerbots/Inputmask.git", - "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5e670ad62f50c738388d4dcec78d2888505ad77b", - "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b", - "shasum": "" - }, - "require": { - "bower-asset/jquery": ">=1.7" - }, - "type": "bower-asset-library", - "extra": { - "bower-asset-main": [ - "./dist/inputmask/inputmask.js", - "./dist/inputmask/inputmask.extensions.js", - "./dist/inputmask/inputmask.date.extensions.js", - "./dist/inputmask/inputmask.numeric.extensions.js", - "./dist/inputmask/inputmask.phone.extensions.js", - "./dist/inputmask/jquery.inputmask.js", - "./dist/inputmask/global/document.js", - "./dist/inputmask/global/window.js", - "./dist/inputmask/phone-codes/phone.js", - "./dist/inputmask/phone-codes/phone-be.js", - "./dist/inputmask/phone-codes/phone-nl.js", - "./dist/inputmask/phone-codes/phone-ru.js", - "./dist/inputmask/phone-codes/phone-uk.js", - "./dist/inputmask/dependencyLibs/inputmask.dependencyLib.jqlite.js", - "./dist/inputmask/dependencyLibs/inputmask.dependencyLib.jquery.js", - "./dist/inputmask/dependencyLibs/inputmask.dependencyLib.js", - "./dist/inputmask/bindings/inputmask.binding.js" - ], - "bower-asset-ignore": [ - "**/*", - "!dist/*", - "!dist/inputmask/*", - "!dist/min/*", - "!dist/min/inputmask/*" - ] - }, - "license": [ - "http://opensource.org/licenses/mit-license.php" - ], - "description": "Inputmask is a javascript library which creates an input mask. Inputmask can run against vanilla javascript, jQuery and jqlite.", - "keywords": [ - "form", - "input", - "inputmask", - "jquery", - "mask", - "plugins" - ], - "time": "2017-11-21T11:46:23+00:00" - }, - { - "name": "bower-asset/jquery", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/jquery/jquery-dist.git", - "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/77d2a51d0520d2ee44173afdf4e40a9201f5964e", - "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e", - "shasum": "" - }, - "type": "bower-asset-library", - "extra": { - "bower-asset-main": "dist/jquery.js", - "bower-asset-ignore": [ - "package.json" - ] - }, - "license": [ - "MIT" - ], - "keywords": [ - "browser", - "javascript", - "jquery", - "library" - ], - "time": "2017-03-20T19:02:00+00:00" - }, - { - "name": "bower-asset/punycode", - "version": "v1.3.2", - "source": { - "type": "git", - "url": "https://github.com/bestiejs/punycode.js.git", - "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", - "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", - "shasum": "" - }, - "type": "bower-asset-library", - "extra": { - "bower-asset-main": "punycode.js", - "bower-asset-ignore": [ - "coverage", - "tests", - ".*", - "component.json", - "Gruntfile.js", - "node_modules", - "package.json" - ] - }, - "time": "2014-10-22T12:02:42+00:00" - }, - { - "name": "bower-asset/yii2-pjax", - "version": "2.0.7.1", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/jquery-pjax.git", - "reference": "aef7b953107264f00234902a3880eb50dafc48be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", - "reference": "aef7b953107264f00234902a3880eb50dafc48be", - "shasum": "" - }, - "require": { - "bower-asset/jquery": ">=1.8" - }, - "type": "bower-asset-library", - "extra": { - "bower-asset-main": "./jquery.pjax.js", - "bower-asset-ignore": [ - ".travis.yml", - "Gemfile", - "Gemfile.lock", - "CONTRIBUTING.md", - "vendor/", - "script/", - "test/" - ] - }, - "license": [ - "MIT" - ], - "time": "2017-10-12T10:11:14+00:00" - }, - { - "name": "cebe/markdown", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/cebe/markdown.git", - "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cebe/markdown/zipball/25b28bae8a6f185b5030673af77b32e1163d5c6e", - "reference": "25b28bae8a6f185b5030673af77b32e1163d5c6e", - "shasum": "" - }, - "require": { - "lib-pcre": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "cebe/indent": "*", - "facebook/xhprof": "*@dev", - "phpunit/phpunit": "4.1.*" - }, - "bin": [ - "bin/markdown" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "cebe\\markdown\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Carsten Brandt", - "email": "mail@cebe.cc", - "homepage": "http://cebe.cc/", - "role": "Creator" - } - ], - "description": "A super fast, highly extensible markdown parser for PHP", - "homepage": "https://github.com/cebe/markdown#readme", - "keywords": [ - "extensible", - "fast", - "gfm", - "markdown", - "markdown-extra" - ], - "time": "2017-07-16T21:13:23+00:00" - }, - { - "name": "ezyang/htmlpurifier", - "version": "v4.10.0", - "source": { - "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "d85d39da4576a6934b72480be6978fb10c860021" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021", - "reference": "d85d39da4576a6934b72480be6978fb10c860021", - "shasum": "" - }, - "require": { - "php": ">=5.2" - }, - "require-dev": { - "simpletest/simpletest": "^1.1" - }, - "type": "library", - "autoload": { - "psr-0": { - "HTMLPurifier": "library/" - }, - "files": [ - "library/HTMLPurifier.composer.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL" - ], - "authors": [ - { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" - } - ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", - "keywords": [ - "html" - ], - "time": "2018-02-23T01:58:20+00:00" - }, - { - "name": "fortawesome/font-awesome", - "version": "v4.7.0", - "source": { - "type": "git", - "url": "https://github.com/FortAwesome/Font-Awesome.git", - "reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FortAwesome/Font-Awesome/zipball/a8386aae19e200ddb0f6845b5feeee5eb7013687", - "reference": "a8386aae19e200ddb0f6845b5feeee5eb7013687", - "shasum": "" - }, - "require-dev": { - "jekyll": "1.0.2", - "lessc": "1.4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.6.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "OFL-1.1", - "MIT" - ], - "authors": [ - { - "name": "Dave Gandy", - "email": "dave@fontawesome.io", - "homepage": "http://twitter.com/davegandy", - "role": "Developer" - } - ], - "description": "The iconic font and CSS framework", - "homepage": "http://fontawesome.io/", - "keywords": [ - "FontAwesome", - "awesome", - "bootstrap", - "font", - "icon" - ], - "time": "2016-10-24T15:52:54+00:00" - }, - { - "name": "rmrevin/yii2-fontawesome", - "version": "2.17.1", - "source": { - "type": "git", - "url": "https://github.com/rmrevin/yii2-fontawesome.git", - "reference": "65ce306da864f4d558348aeba040ed7876878090" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rmrevin/yii2-fontawesome/zipball/65ce306da864f4d558348aeba040ed7876878090", - "reference": "65ce306da864f4d558348aeba040ed7876878090", - "shasum": "" - }, - "require": { - "fortawesome/font-awesome": "~4.7", - "php": ">=5.4.0", - "yiisoft/yii2": "2.0.*" - }, - "type": "yii2-extension", - "extra": { - "asset-installer-paths": { - "npm-asset-library": "vendor/npm", - "bower-asset-library": "vendor/bower" - } - }, - "autoload": { - "psr-4": { - "rmrevin\\yii\\fontawesome\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Revin Roman", - "email": "roman@rmrevin.com", - "homepage": "https://rmrevin.com/" - } - ], - "description": "Asset Bundle for Yii2 with Font Awesome", - "keywords": [ - "asset", - "awesome", - "bundle", - "font", - "yii" - ], - "time": "2017-01-11T14:05:47+00:00" - }, - { - "name": "yiisoft/yii2", - "version": "2.0.14.1", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/yii2-framework.git", - "reference": "d99969394c66dc3606134af092b8ec561ea5d7c6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-framework/zipball/d99969394c66dc3606134af092b8ec561ea5d7c6", - "reference": "d99969394c66dc3606134af092b8ec561ea5d7c6", - "shasum": "" - }, - "require": { - "bower-asset/inputmask": "~3.2.2 | ~3.3.5", - "bower-asset/jquery": "3.2.*@stable | 3.1.*@stable | 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable", - "bower-asset/punycode": "1.3.*", - "bower-asset/yii2-pjax": "~2.0.1", - "cebe/markdown": "~1.0.0 | ~1.1.0", - "ext-ctype": "*", - "ext-mbstring": "*", - "ezyang/htmlpurifier": "~4.6", - "lib-pcre": "*", - "php": ">=5.4.0", - "yiisoft/yii2-composer": "~2.0.4" - }, - "bin": [ - "yii" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "yii\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Qiang Xue", - "email": "qiang.xue@gmail.com", - "homepage": "http://www.yiiframework.com/", - "role": "Founder and project lead" - }, - { - "name": "Alexander Makarov", - "email": "sam@rmcreative.ru", - "homepage": "http://rmcreative.ru/", - "role": "Core framework development" - }, - { - "name": "Maurizio Domba", - "homepage": "http://mdomba.info/", - "role": "Core framework development" - }, - { - "name": "Carsten Brandt", - "email": "mail@cebe.cc", - "homepage": "http://cebe.cc/", - "role": "Core framework development" - }, - { - "name": "Timur Ruziev", - "email": "resurtm@gmail.com", - "homepage": "http://resurtm.com/", - "role": "Core framework development" - }, - { - "name": "Paul Klimov", - "email": "klimov.paul@gmail.com", - "role": "Core framework development" - }, - { - "name": "Dmitry Naumenko", - "email": "d.naumenko.a@gmail.com", - "role": "Core framework development" - }, - { - "name": "Boudewijn Vahrmeijer", - "email": "info@dynasource.eu", - "homepage": "http://dynasource.eu", - "role": "Core framework development" - } - ], - "description": "Yii PHP Framework Version 2", - "homepage": "http://www.yiiframework.com/", - "keywords": [ - "framework", - "yii2" - ], - "time": "2018-02-24T20:23:06+00:00" - }, - { - "name": "yiisoft/yii2-bootstrap", - "version": "2.0.8", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/yii2-bootstrap.git", - "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/3f49c47924bb9fa5363c3fc7b073d954168cf438", - "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438", - "shasum": "" - }, - "require": { - "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", - "yiisoft/yii2": "~2.0.6" - }, - "type": "yii2-extension", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "yii\\bootstrap\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Paul Klimov", - "email": "klimov.paul@gmail.com" - }, - { - "name": "Alexander Makarov", - "email": "sam@rmcreative.ru", - "homepage": "http://rmcreative.ru/" - }, - { - "name": "Antonio Ramirez", - "email": "amigo.cobos@gmail.com" - }, - { - "name": "Qiang Xue", - "email": "qiang.xue@gmail.com", - "homepage": "http://www.yiiframework.com/" - } - ], - "description": "The Twitter Bootstrap extension for the Yii framework", - "keywords": [ - "bootstrap", - "yii2" - ], - "time": "2018-02-16T10:41:52+00:00" - }, - { - "name": "yiisoft/yii2-composer", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/yiisoft/yii2-composer.git", - "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", - "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0" - }, - "require-dev": { - "composer/composer": "^1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "yii\\composer\\Plugin", - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "yii\\composer\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Qiang Xue", - "email": "qiang.xue@gmail.com" - } - ], - "description": "The composer plugin for Yii extension installer", - "keywords": [ - "composer", - "extension installer", - "yii2" - ], - "time": "2016-12-20T13:26:02+00:00" - } - ], - "packages-dev": [ - { - "name": "behat/gherkin", - "version": "v4.5.1", - "source": { - "type": "git", - "url": "https://github.com/Behat/Gherkin.git", - "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", - "reference": "74ac03d52c5e23ad8abd5c5cce4ab0e8dc1b530a", - "shasum": "" - }, - "require": { - "php": ">=5.3.1" - }, - "require-dev": { - "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3", - "symfony/yaml": "~2.3|~3" - }, - "suggest": { - "symfony/yaml": "If you want to parse features, represented in YAML files" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.4-dev" - } - }, - "autoload": { - "psr-0": { - "Behat\\Gherkin": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Gherkin DSL parser for PHP 5.3", - "homepage": "http://behat.org/", - "keywords": [ - "BDD", - "Behat", - "Cucumber", - "DSL", - "gherkin", - "parser" - ], - "time": "2017-08-30T11:04:43+00:00" - }, - { - "name": "codeception/codeception", - "version": "2.4.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Codeception.git", - "reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/c50789a9a62cc0eefc0252e88a5f04f8c47b55f4", - "reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4", - "shasum": "" - }, - "require": { - "behat/gherkin": "^4.4.0", - "codeception/phpunit-wrapper": "^6.0|^7.0", - "codeception/stub": "^1.0", - "ext-json": "*", - "ext-mbstring": "*", - "facebook/webdriver": ">=1.1.3 <2.0", - "guzzlehttp/guzzle": ">=4.1.4 <7.0", - "guzzlehttp/psr7": "~1.0", - "php": ">=5.4.0 <8.0", - "symfony/browser-kit": ">=2.7 <5.0", - "symfony/console": ">=2.7 <5.0", - "symfony/css-selector": ">=2.7 <5.0", - "symfony/dom-crawler": ">=2.7 <5.0", - "symfony/event-dispatcher": ">=2.7 <5.0", - "symfony/finder": ">=2.7 <5.0", - "symfony/yaml": ">=2.7 <5.0" - }, - "require-dev": { - "codeception/specify": "~0.3", - "facebook/graph-sdk": "~5.3", - "flow/jsonpath": "~0.2", - "monolog/monolog": "~1.8", - "pda/pheanstalk": "~3.0", - "php-amqplib/php-amqplib": "~2.4", - "predis/predis": "^1.0", - "squizlabs/php_codesniffer": "~2.0", - "symfony/process": ">=2.7 <5.0", - "vlucas/phpdotenv": "^2.4.0" - }, - "suggest": { - "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", - "codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests", - "codeception/specify": "BDD-style code blocks", - "codeception/verify": "BDD-style assertions", - "flow/jsonpath": "For using JSONPath in REST module", - "league/factory-muffin": "For DataFactory module", - "league/factory-muffin-faker": "For Faker support in DataFactory module", - "phpseclib/phpseclib": "for SFTP option in FTP Module", - "stecman/symfony-console-completion": "For BASH autocompletion", - "symfony/phpunit-bridge": "For phpunit-bridge support" - }, - "bin": [ - "codecept" - ], - "type": "library", - "extra": { - "branch-alias": [] - }, - "autoload": { - "psr-4": { - "Codeception\\": "src\\Codeception", - "Codeception\\Extension\\": "ext" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert@mail.ua", - "homepage": "http://codegyre.com" - } - ], - "description": "BDD-style testing framework", - "homepage": "http://codeception.com/", - "keywords": [ - "BDD", - "TDD", - "acceptance testing", - "functional testing", - "unit testing" - ], - "time": "2018-02-27T00:09:12+00:00" - }, - { - "name": "codeception/mockery-module", - "version": "0.2.3", - "source": { - "type": "git", - "url": "https://github.com/Codeception/MockeryModule.git", - "reference": "d01f9d0c52cf4fa87c789c65191027a0d434bd3d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/MockeryModule/zipball/d01f9d0c52cf4fa87c789c65191027a0d434bd3d", - "reference": "d01f9d0c52cf4fa87c789c65191027a0d434bd3d", - "shasum": "" - }, - "require": { - "codeception/codeception": "^2.0", - "mockery/mockery": "^0.8|^0.9|^1.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert.php@mailican.com" - }, - { - "name": "Jáchym Toušek", - "email": "enumag@gmail.com" - } - ], - "description": "Mockery Module for Codeception", - "time": "2017-10-10T16:22:46+00:00" - }, - { - "name": "codeception/phpunit-wrapper", - "version": "6.0.5", - "source": { - "type": "git", - "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "44e2100c300413a6b40cf8874ad402695010f443" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/44e2100c300413a6b40cf8874ad402695010f443", - "reference": "44e2100c300413a6b40cf8874ad402695010f443", - "shasum": "" - }, - "require": { - "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0", - "sebastian/comparator": ">1.1 <3.0", - "sebastian/diff": ">=1.4 <4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\PHPUnit\\": "src\\" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Davert", - "email": "davert.php@resend.cc" - } - ], - "description": "PHPUnit classes used by Codeception", - "time": "2018-02-19T13:24:40+00:00" - }, - { - "name": "codeception/specify", - "version": "0.4.6", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Specify.git", - "reference": "21b586f503ca444aa519dd9cafb32f113a05f286" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Specify/zipball/21b586f503ca444aa519dd9cafb32f113a05f286", - "reference": "21b586f503ca444aa519dd9cafb32f113a05f286", - "shasum": "" - }, - "require": { - "myclabs/deep-copy": "~1.1", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "psr-0": { - "Codeception\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert.php@mailican.com" - } - ], - "description": "BDD code blocks for PHPUnit and Codeception", - "time": "2016-10-21T09:42:00+00:00" - }, - { - "name": "codeception/stub", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Stub.git", - "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99", - "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99", - "shasum": "" - }, - "require": { - "phpunit/phpunit-mock-objects": ">2.3 <7.0" - }, - "require-dev": { - "phpunit/phpunit": ">=4.8 <8.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Codeception\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", - "time": "2018-02-18T13:56:56+00:00" - }, - { - "name": "codeception/verify", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/Codeception/Verify.git", - "reference": "8a17273017e23a866df3fa2ad2b4182b7ce354f0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Codeception/Verify/zipball/8a17273017e23a866df3fa2ad2b4182b7ce354f0", - "reference": "8a17273017e23a866df3fa2ad2b4182b7ce354f0", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "autoload": { - "files": [ - "src/Codeception/function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Bodnarchuk", - "email": "davert.php@mailican.com" - } - ], - "description": "BDD assertion library for PHPUnit", - "time": "2017-07-12T16:50:18+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "facebook/webdriver", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "86b5ca2f67173c9d34340845dd690149c886a605" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/86b5ca2f67173c9d34340845dd690149c886a605", - "reference": "86b5ca2f67173c9d34340845dd690149c886a605", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "ext-zip": "*", - "php": "^5.6 || ~7.0", - "symfony/process": "^2.8 || ^3.1 || ^4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "guzzle/guzzle": "^3.4.1", - "php-coveralls/php-coveralls": "^1.0.2", - "php-mock/php-mock-phpunit": "^1.1", - "phpunit/phpunit": "^5.7", - "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", - "squizlabs/php_codesniffer": "^2.6", - "symfony/var-dumper": "^3.3 || ^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-community": "1.5-dev" - } - }, - "autoload": { - "psr-4": { - "Facebook\\WebDriver\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "A PHP client for Selenium WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", - "keywords": [ - "facebook", - "php", - "selenium", - "webdriver" - ], - "time": "2017-11-15T11:08:09+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.2-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2017-06-22T18:50:49+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20T10:07:11+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20T17:10:46+00:00" - }, - { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", - "shasum": "" - }, - "require": { - "php": "^5.3|^7.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" - }, - "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "hamcrest" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "description": "This is the PHP port of Hamcrest Matchers", - "keywords": [ - "test" - ], - "time": "2016-01-20T08:20:44+00:00" - }, - { - "name": "mito/yii2-coding-standards", - "version": "2.0.0-beta16", - "source": { - "type": "git", - "url": "https://github.com/hellowearemito/yii2-coding-standards.git", - "reference": "41f1fcc48c34722a0cb82b3259e279e580019421" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/hellowearemito/yii2-coding-standards/zipball/41f1fcc48c34722a0cb82b3259e279e580019421", - "reference": "41f1fcc48c34722a0cb82b3259e279e580019421", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "squizlabs/php_codesniffer": "~2.7" - }, - "require-dev": { - "phpunit/phpunit": "^5.3", - "satooshi/php-coveralls": "^1.0" - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Qiang Xue", - "email": "qiang.xue@gmail.com", - "homepage": "http://www.yiiframework.com/", - "role": "Founder and project lead" - }, - { - "name": "Alexander Makarov", - "email": "sam@rmcreative.ru", - "homepage": "http://rmcreative.ru/", - "role": "Core framework development" - }, - { - "name": "Maurizio Domba", - "homepage": "http://mdomba.info/", - "role": "Core framework development" - }, - { - "name": "Carsten Brandt", - "email": "mail@cebe.cc", - "homepage": "http://cebe.cc/", - "role": "Core framework development" - }, - { - "name": "Timur Ruziev", - "email": "resurtm@gmail.com", - "homepage": "http://resurtm.com/", - "role": "Core framework development" - }, - { - "name": "Paul Klimov", - "email": "klimov.paul@gmail.com", - "role": "Core framework development" - }, - { - "name": "Nikola Kovacs", - "email": "nikola.kovacs@gmail.com" - } - ], - "description": "Mito Yii 2 coding standards", - "homepage": "https://mito.hu/", - "keywords": [ - "codesniffer", - "framework", - "yii" - ], - "time": "2017-11-20T15:57:26+00:00" - }, - { - "name": "mockery/mockery", - "version": "1.0", - "source": { - "type": "git", - "url": "https://github.com/mockery/mockery.git", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/1bac8c362b12f522fdd1f1fa3556284c91affa38", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38", - "shasum": "" - }, - "require": { - "hamcrest/hamcrest-php": "~2.0", - "lib-pcre": ">=7.0", - "php": ">=5.6.0" - }, - "require-dev": { - "phpunit/phpunit": "~5.7|~6.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "Mockery": "library/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Pádraic Brady", - "email": "padraic.brady@gmail.com", - "homepage": "http://blog.astrumfutura.com" - }, - { - "name": "Dave Marshall", - "email": "dave.marshall@atstsolutions.co.uk", - "homepage": "http://davedevelopment.co.uk" - } - ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/mockery/mockery", - "keywords": [ - "BDD", - "TDD", - "library", - "mock", - "mock objects", - "mockery", - "stub", - "test", - "test double", - "testing" - ], - "time": "2017-10-06T16:20:43+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - }, - "files": [ - "src/DeepCopy/deep_copy.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "time": "2017-10-19T19:58:43+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-10T14:09:06+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "1.7.5", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7.x-dev" - } - }, - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "time": "2018-02-19T10:16:54+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.12", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "time": "2017-12-04T08:55:13+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.27", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "time": "2018-02-01T05:50:59+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "psr/log", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "time": "2016-10-10T12:19:37+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "time": "2017-03-04T06:30:41+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "2.9.1", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/dcbed1074f8244661eecddfc2a675430d8d33f62", - "reference": "dcbed1074f8244661eecddfc2a675430d8d33f62", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "bin": [ - "scripts/phpcs", - "scripts/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, - "autoload": { - "classmap": [ - "CodeSniffer.php", - "CodeSniffer/CLI.php", - "CodeSniffer/Exception.php", - "CodeSniffer/File.php", - "CodeSniffer/Fixer.php", - "CodeSniffer/Report.php", - "CodeSniffer/Reporting.php", - "CodeSniffer/Sniff.php", - "CodeSniffer/Tokens.php", - "CodeSniffer/Reports/", - "CodeSniffer/Tokenizers/", - "CodeSniffer/DocGenerators/", - "CodeSniffer/Standards/AbstractPatternSniff.php", - "CodeSniffer/Standards/AbstractScopeSniff.php", - "CodeSniffer/Standards/AbstractVariableSniff.php", - "CodeSniffer/Standards/IncorrectPatternException.php", - "CodeSniffer/Standards/Generic/Sniffs/", - "CodeSniffer/Standards/MySource/Sniffs/", - "CodeSniffer/Standards/PEAR/Sniffs/", - "CodeSniffer/Standards/PSR1/Sniffs/", - "CodeSniffer/Standards/PSR2/Sniffs/", - "CodeSniffer/Standards/Squiz/Sniffs/", - "CodeSniffer/Standards/Zend/Sniffs/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2017-05-22T02:43:20+00:00" - }, - { - "name": "symfony/browser-kit", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/browser-kit.git", - "reference": "490f27762705c8489bd042fe3e9377a191dba9b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/490f27762705c8489bd042fe3e9377a191dba9b4", - "reference": "490f27762705c8489bd042fe3e9377a191dba9b4", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0|~4.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0", - "symfony/process": "~2.8|~3.0|~4.0" - }, - "suggest": { - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\BrowserKit\\": "" - }, - "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 BrowserKit Component", - "homepage": "https://symfony.com", - "time": "2018-01-03T07:37:34+00:00" - }, - { - "name": "symfony/console", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/067339e9b8ec30d5f19f5950208893ff026b94f7", - "reference": "067339e9b8ec30d5f19f5950208893ff026b94f7", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0|~4.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/dependency-injection": "<3.4", - "symfony/process": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.3|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/event-dispatcher": "~2.8|~3.0|~4.0", - "symfony/lock": "~3.4|~4.0", - "symfony/process": "~3.3|~4.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2018-02-26T15:46:28+00:00" - }, - { - "name": "symfony/css-selector", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/544655f1fc078a9cd839fdda2b7b1e64627c826a", - "reference": "544655f1fc078a9cd839fdda2b7b1e64627c826a", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\CssSelector\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony CssSelector Component", - "homepage": "https://symfony.com", - "time": "2018-02-03T14:55:07+00:00" - }, - { - "name": "symfony/debug", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/debug.git", - "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/9b1071f86e79e1999b3d3675d2e0e7684268b9bc", - "reference": "9b1071f86e79e1999b3d3675d2e0e7684268b9bc", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" - }, - "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" - }, - "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Debug\\": "" - }, - "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 Debug Component", - "homepage": "https://symfony.com", - "time": "2018-02-28T21:49:22+00:00" - }, - { - "name": "symfony/dom-crawler", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/dom-crawler.git", - "reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2bb5d3101cc01f4fe580e536daf4f1959bc2d24d", - "reference": "2bb5d3101cc01f4fe580e536daf4f1959bc2d24d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/css-selector": "~2.8|~3.0|~4.0" - }, - "suggest": { - "symfony/css-selector": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\DomCrawler\\": "" - }, - "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 DomCrawler Component", - "homepage": "https://symfony.com", - "time": "2018-02-22T10:48:49+00:00" - }, - { - "name": "symfony/event-dispatcher", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "58990682ac3fdc1f563b7e705452921372aad11d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/58990682ac3fdc1f563b7e705452921372aad11d", - "reference": "58990682ac3fdc1f563b7e705452921372aad11d", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/dependency-injection": "<3.3" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - }, - "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 EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2018-02-14T10:03:57+00:00" - }, - { - "name": "symfony/finder", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a479817ce0a9e4adfd7d39c6407c95d97c254625", - "reference": "a479817ce0a9e4adfd7d39c6407c95d97c254625", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-03-05T18:28:11+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-30T19:27:44+00:00" - }, - { - "name": "symfony/process", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/cc4aea21f619116aaf1c58016a944e4821c8e8af", - "reference": "cc4aea21f619116aaf1c58016a944e4821c8e8af", - "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-02-12T17:55:00+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/6af42631dcf89e9c616242c900d6c52bd53bd1bb", - "reference": "6af42631dcf89e9c616242c900d6c52bd53bd1bb", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.4-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "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 Yaml Component", - "homepage": "https://symfony.com", - "time": "2018-02-16T09:50:28+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "time": "2018-01-29T19:49:41+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "mito/yii2-coding-standards": 10 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/phpcs.sh b/phpcs.sh new file mode 100644 index 00000000..ea8c84f4 --- /dev/null +++ b/phpcs.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +php ./vendor/bin/phpcs --standard=vendor/mito/yii2-coding-standards/Application src/interfaces && php ./vendor/bin/phpcs --standard=vendor/mito/yii2-coding-standards/Application src/models +SRC=$? +php ./vendor/bin/phpcs --standard=vendor/mito/yii2-coding-standards/Application -s --exclude=PSR1.Files.SideEffects,PSR1.Classes.ClassDeclaration --extensions=php tests +TESTS=$? + +if [ $SRC -ne 0 ] || [ $TESTS -ne 0 ]; then + exit 1 +fi diff --git a/src/gii/generators/crud/Generator.php b/src/gii/generators/crud/Generator.php index c7cec00f..27b0cbb9 100644 --- a/src/gii/generators/crud/Generator.php +++ b/src/gii/generators/crud/Generator.php @@ -31,14 +31,8 @@ * @author Qiang Xue * @since 2.0 */ -class Generator extends \yii\gii\Generator +class Generator extends \yii\gii\generators\crud\Generator { - public $modelClass; - public $controllerClass; - public $viewPath; - public $baseControllerClass = 'yii\web\Controller'; - public $indexWidgetType = 'grid'; - public $searchModelClass = ''; public $generateTests = false; public $testPath = '@app/tests'; @@ -46,25 +40,7 @@ class Generator extends \yii\gii\Generator * @var boolean whether to wrap the `GridView` or `ListView` widget with the `yii\widgets\Pjax` widget * @since 2.0.5 */ - public $enablePjax = false; - - - /** - * @inheritdoc - */ - public function getName() - { - return 'CRUD Generator'; - } - - /** - * @inheritdoc - */ - public function getDescription() - { - return 'This generator generates a controller and views that implement CRUD (Create, Read, Update, Delete) - operations for the specified data model.'; - } + public $enablePjax = true; /** * @inheritdoc @@ -72,78 +48,18 @@ public function getDescription() public function rules() { return array_merge(parent::rules(), [ - [['controllerClass', 'modelClass', 'searchModelClass', 'baseControllerClass'], 'filter', 'filter' => 'trim'], - [['modelClass', 'controllerClass', 'baseControllerClass', 'indexWidgetType', 'testPath'], 'required'], - [['searchModelClass'], 'compare', 'compareAttribute' => 'modelClass', 'operator' => '!==', 'message' => 'Search Model Class must not be equal to Model Class.'], - [['modelClass', 'controllerClass', 'baseControllerClass', 'searchModelClass'], 'match', 'pattern' => '/^[\w\\\\]*$/', 'message' => 'Only word characters and backslashes are allowed.'], - [['modelClass'], 'validateClass', 'params' => ['extends' => BaseActiveRecord::class]], - [['baseControllerClass'], 'validateClass', 'params' => ['extends' => Controller::class]], - [['controllerClass'], 'match', 'pattern' => '/Controller$/', 'message' => 'Controller class name must be suffixed with "Controller".'], - [['controllerClass'], 'match', 'pattern' => '/(^|\\\\)[A-Z][^\\\\]+Controller$/', 'message' => 'Controller class name must start with an uppercase letter.'], - [['controllerClass', 'searchModelClass'], 'validateNewClass'], - [['indexWidgetType'], 'in', 'range' => ['grid', 'list']], - [['modelClass'], 'validateModelClass'], - [['enableI18N', 'enablePjax'], 'boolean'], [['generateTests'], 'boolean'], - [['messageCategory'], 'validateMessageCategory', 'skipOnEmpty' => false], - ['viewPath', 'safe'], ['testPath', 'safe'], ]); } - public function validateClass($attribute, $params) - { - if (parent::validateClass($attribute, $params)) { - $parts = StringHelper::explode($this->modelClass, '\\'); - $resourceKey = array_search('resources', $parts); - if ($resourceKey === false) { - $this->addError($attribute, 'Missing `resources` part in model namespace!'); - } - // unset `business` - $businessKey = array_search('business', $parts); - if ($businessKey === false) { - $this->addError($attribute, 'Missing `business` part in model namespace!'); - } - return true; - } - - return false; - } - - /** - * An inline validator that checks if the attribute value refers to a valid namespaced class name. - * The validator will check if the directory containing the new class file exist or not. - * @param string $attribute the attribute being validated - * @param array $params the validation options - * @throws \yii\base\Exception - */ - public function validateNewClass($attribute, $params) - { - $class = ltrim($this->$attribute, '\\'); - if (($pos = strrpos($class, '\\')) !== false) { - $ns = substr($class, 0, $pos); - $path = Yii::getAlias('@' . str_replace('\\', '/', $ns), false); - if ($path && !is_dir($path)) { - FileHelper::createDirectory($path); - } - } - parent::validateNewClass($attribute, $params); - } - /** * @inheritdoc */ public function attributeLabels() { return array_merge(parent::attributeLabels(), [ - 'modelClass' => 'Model Class', - 'controllerClass' => 'Controller Class', - 'viewPath' => 'View Path', 'testPath' => 'Test Path', - 'baseControllerClass' => 'Base Controller Class', - 'indexWidgetType' => 'Widget Used in Index Page', - 'searchModelClass' => 'Search Model Class', - 'enablePjax' => 'Enable Pjax', 'generateTests' => 'Generate test files', ]); } @@ -154,56 +70,17 @@ public function attributeLabels() public function hints() { return array_merge(parent::hints(), [ - 'modelClass' => 'This is the ActiveRecord class associated with the table that CRUD will be built upon. - You should provide a fully qualified class name, e.g., app\models\Post.', - 'controllerClass' => 'This is the name of the controller class to be generated. You should - provide a fully qualified namespaced class (e.g. app\controllers\PostController), - and class name should be in CamelCase with an uppercase first letter. Make sure the class - is using the same namespace as specified by your application\'s controllerNamespace property.', - 'viewPath' => 'Specify the directory for storing the view scripts for the controller. You may use path alias here, e.g., - /var/www/basic/controllers/views/post, @app/views/post. If not set, it will default - to @app/views/ControllerID', 'testPath' => 'Specify the directory for storing the test scripts for the controller. You may use path alias here, e.g., @app/tests/codeception.', - 'baseControllerClass' => 'This is the class that the new CRUD controller class will extend from. - You should provide a fully qualified class name, e.g., yii\web\Controller.', - 'indexWidgetType' => 'This is the widget type to be used in the index page to display list of the models. - You may choose either GridView or ListView', - 'searchModelClass' => 'This is the name of the search model class to be generated. You should provide a fully - qualified namespaced class name, e.g., app\models\PostSearch.', - 'enablePjax' => 'This indicates whether the generator should wrap the GridView or ListView - widget on the index page with yii\widgets\Pjax widget. Set this to true if you want to get - sorting, filtering and pagination without page refreshing.', ]); } - /** - * @inheritdoc - */ - public function requiredTemplates() - { - return ['controller.php']; - } - /** * @inheritdoc */ public function stickyAttributes() { - return array_merge(parent::stickyAttributes(), ['baseControllerClass', 'indexWidgetType', 'testPath']); - } - - /** - * Checks if model class is valid - */ - public function validateModelClass() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - $pk = $class::primaryKey(); - if (empty($pk)) { - $this->addError('modelClass', "The table associated with $class must have primary key(s)."); - } + return array_merge(parent::stickyAttributes(), ['testPath']); } /** @@ -301,360 +178,6 @@ public function getControllerID() return Inflector::camel2id($class); } - /** - * @return string the controller view path - */ - public function getViewPath() - { - if (empty($this->viewPath)) { - return Yii::getAlias('@app/views/' . $this->getControllerID()); - } else { - return Yii::getAlias($this->viewPath); - } - } - - public function getNameAttribute() - { - foreach ($this->getColumnNames() as $name) { - if (!strcasecmp($name, 'name') || !strcasecmp($name, 'title')) { - return $name; - } - } - /* @var $class \yii\db\ActiveRecord */ - $class = $this->modelClass; - $pk = $class::primaryKey(); - - return $pk[0]; - } - - /** - * Generates code for active field - * @param string $attribute - * @return string - */ - public function generateActiveField($attribute) - { - $tableSchema = $this->getTableSchema(); - if ($tableSchema === false || !isset($tableSchema->columns[$attribute])) { - if (preg_match('/^(password|pass|passwd|passcode)$/i', $attribute)) { - return "\$form->field(\$model, '$attribute')->passwordInput()"; - } else { - return "\$form->field(\$model, '$attribute')"; - } - } - $column = $tableSchema->columns[$attribute]; - if ($column->phpType === 'boolean') { - return "\$form->field(\$model, '$attribute')->checkbox()"; - } elseif ($column->type === 'text') { - return "\$form->field(\$model, '$attribute')->textarea(['rows' => 6])"; - } else { - if (preg_match('/^(password|pass|passwd|passcode)$/i', $column->name)) { - $input = 'passwordInput'; - } else { - $input = 'textInput'; - } - if (is_array($column->enumValues) && count($column->enumValues) > 0) { - $dropDownOptions = []; - foreach ($column->enumValues as $enumValue) { - $dropDownOptions[$enumValue] = Inflector::humanize($enumValue); - } - return "\$form->field(\$model, '$attribute')->dropDownList(" - . preg_replace("/\n\s*/", ' ', VarDumper::export($dropDownOptions)).", ['prompt' => ''])"; - } elseif ($column->phpType !== 'string' || $column->size === null) { - return "\$form->field(\$model, '$attribute')->$input()"; - } else { - return "\$form->field(\$model, '$attribute')->$input(['maxlength' => true])"; - } - } - } - - /** - * Generates code for active search field - * @param string $attribute - * @return string - */ - public function generateActiveSearchField($attribute) - { - $tableSchema = $this->getTableSchema(); - $placeholder = $this->enableI18N ? "Yii::t('" . $this->messageCategory . "', '" . Inflector::camel2words($attribute) . "')" : false; - $textInput = $placeholder ? "->textInput(['placeholder' => $placeholder])" : null; - if ($tableSchema === false) { - return "\$form->field(\$model, '$attribute')" . $textInput; - } - $column = $tableSchema->columns[$attribute]; - if ($column->phpType === 'boolean') { - return "\$form->field(\$model, '$attribute')->checkbox()"; - } else { - return "\$form->field(\$model, '$attribute')" . $textInput; - } - } - - /** - * Generates column format - * @param \yii\db\ColumnSchema $column - * @return string - */ - public function generateColumnFormat($column) - { - if ($column->phpType === 'boolean') { - return 'boolean'; - } elseif ($column->type === 'text') { - return 'ntext'; - } elseif (stripos($column->name, 'time') !== false && $column->phpType === 'integer') { - return 'datetime'; - } elseif (stripos($column->name, 'email') !== false) { - return 'email'; - } elseif (stripos($column->name, 'url') !== false) { - return 'url'; - } else { - return 'text'; - } - } - - /** - * Generates validation rules for the search model. - * @return array the generated validation rules - */ - public function generateSearchRules() - { - if (($table = $this->getTableSchema()) === false) { - return ["[['" . implode("', '", $this->getColumnNames()) . "'], 'safe']"]; - } - $types = []; - foreach ($table->columns as $column) { - switch ($column->type) { - case Schema::TYPE_SMALLINT: - case Schema::TYPE_INTEGER: - case Schema::TYPE_BIGINT: - $types['integer'][] = $column->name; - break; - case Schema::TYPE_BOOLEAN: - $types['boolean'][] = $column->name; - break; - case Schema::TYPE_FLOAT: - case Schema::TYPE_DOUBLE: - case Schema::TYPE_DECIMAL: - case Schema::TYPE_MONEY: - $types['number'][] = $column->name; - break; - case Schema::TYPE_DATE: - case Schema::TYPE_TIME: - case Schema::TYPE_DATETIME: - case Schema::TYPE_TIMESTAMP: - default: - $types['safe'][] = $column->name; - break; - } - } - - $rules = []; - foreach ($types as $type => $columns) { - $rules[] = "[['" . implode("', '", $columns) . "'], '$type']"; - } - - return $rules; - } - - /** - * @return array searchable attributes - */ - public function getSearchAttributes() - { - return $this->getColumnNames(); - } - - /** - * Generates the attribute labels for the search model. - * @return array the generated attribute labels (name => label) - */ - public function generateSearchLabels() - { - /* @var $model \yii\base\Model */ - $model = new $this->modelClass(); - $attributeLabels = $model->attributeLabels(); - $labels = []; - foreach ($this->getColumnNames() as $name) { - if (isset($attributeLabels[$name])) { - $labels[$name] = $attributeLabels[$name]; - } else { - if (!strcasecmp($name, 'id')) { - $labels[$name] = 'ID'; - } else { - $label = Inflector::camel2words($name); - if (!empty($label) && substr_compare($label, ' id', -3, 3, true) === 0) { - $label = substr($label, 0, -3) . ' ID'; - } - $labels[$name] = $label; - } - } - } - - return $labels; - } - - /** - * Generates search conditions - * @return array - */ - public function generateSearchConditions() - { - $columns = []; - if (($table = $this->getTableSchema()) === false) { - $class = $this->modelClass; - /* @var $model \yii\base\Model */ - $model = new $class(); - foreach ($model->attributes() as $attribute) { - $columns[$attribute] = 'unknown'; - } - } else { - foreach ($table->columns as $column) { - $columns[$column->name] = $column->type; - } - } - - $likeConditions = []; - $hashConditions = []; - foreach ($columns as $column => $type) { - switch ($type) { - case Schema::TYPE_SMALLINT: - case Schema::TYPE_INTEGER: - case Schema::TYPE_BIGINT: - case Schema::TYPE_BOOLEAN: - case Schema::TYPE_FLOAT: - case Schema::TYPE_DOUBLE: - case Schema::TYPE_DECIMAL: - case Schema::TYPE_MONEY: - case Schema::TYPE_DATE: - case Schema::TYPE_TIME: - case Schema::TYPE_DATETIME: - case Schema::TYPE_TIMESTAMP: - $hashConditions[] = "'{$column}' => \$this->{$column},"; - break; - default: - $likeConditions[] = "->andFilterWhere(['like', '{$column}', \$this->{$column}])"; - break; - } - } - - $conditions = []; - if (!empty($hashConditions)) { - $conditions[] = "\$query->andFilterWhere([\n" - . str_repeat(' ', 12) . implode("\n" . str_repeat(' ', 12), $hashConditions) - . "\n" . str_repeat(' ', 8) . "]);\n"; - } - if (!empty($likeConditions)) { - $conditions[] = "\$query" . implode("\n" . str_repeat(' ', 12), $likeConditions) . ";\n"; - } - - return $conditions; - } - - /** - * Generates URL parameters - * @return string - */ - public function generateUrlParams() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - $pks = $class::primaryKey(); - if (count($pks) === 1) { - if (is_subclass_of($class, 'yii\mongodb\ActiveRecord')) { - return "'id' => (string)\$model->{$pks[0]}"; - } else { - return "'id' => \$model->{$pks[0]}"; - } - } else { - $params = []; - foreach ($pks as $pk) { - if (is_subclass_of($class, 'yii\mongodb\ActiveRecord')) { - $params[] = "'$pk' => (string)\$model->$pk"; - } else { - $params[] = "'$pk' => \$model->$pk"; - } - } - - return implode(', ', $params); - } - } - - /** - * Generates action parameters - * @return string - */ - public function generateActionParams() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - $pks = $class::primaryKey(); - if (count($pks) === 1) { - return '$id'; - } else { - return '$' . implode(', $', $pks); - } - } - - /** - * Generates parameter tags for phpdoc - * @return array parameter tags for phpdoc - */ - public function generateActionParamComments() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - $pks = $class::primaryKey(); - if (($table = $this->getTableSchema()) === false) { - $params = []; - foreach ($pks as $pk) { - $params[] = '@param ' . (substr(strtolower($pk), -2) == 'id' ? 'integer' : 'string') . ' $' . $pk; - } - - return $params; - } - if (count($pks) === 1) { - return ['@param ' . $table->columns[$pks[0]]->phpType . ' $id']; - } else { - $params = []; - foreach ($pks as $pk) { - $params[] = '@param ' . $table->columns[$pk]->phpType . ' $' . $pk; - } - - return $params; - } - } - - /** - * Returns table schema for current model class or false if it is not an active record - * @return boolean|\yii\db\TableSchema - */ - public function getTableSchema() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - if (is_subclass_of($class, 'yii\db\ActiveRecord')) { - return $class::getTableSchema(); - } else { - return false; - } - } - - /** - * @return array model column names - */ - public function getColumnNames() - { - /* @var $class ActiveRecord */ - $class = $this->modelClass; - if (is_subclass_of($class, 'yii\db\ActiveRecord')) { - return $class::getTableSchema()->getColumnNames(); - } else { - /* @var $model \yii\base\Model */ - $model = new $class(); - - return $model->attributes(); - } - } - public function getCreateServiceClass($namespaceOnly = false) { $parts = StringHelper::explode($this->modelClass, '\\'); diff --git a/src/gii/generators/crud/default/domains/create.service.php b/src/gii/generators/crud/default/domains/create.service.php index e63300f6..8ec19658 100644 --- a/src/gii/generators/crud/default/domains/create.service.php +++ b/src/gii/generators/crud/default/domains/create.service.php @@ -25,7 +25,7 @@ public function execute() $model->load($this->getForm()->attributes, ''); if ($model->save()) { - $this->setId($model->getId()); + $this->setId($model->id); return true; } diff --git a/src/gii/generators/crud/default/domains/delete.service.php b/src/gii/generators/crud/default/domains/delete.service.php index 87870195..33ca620e 100644 --- a/src/gii/generators/crud/default/domains/delete.service.php +++ b/src/gii/generators/crud/default/domains/delete.service.php @@ -35,7 +35,7 @@ public function execute() throw new Exception('modelClass) ?> cannot be removed!'); } $transaction->commit(); - $this->setId($this->getModel()->getId()); + $this->setId($this->getModel()->id); return true; } catch (Exception $e) { $transaction->rollBack(); diff --git a/src/gii/generators/crud/default/domains/toggle-status.service.php b/src/gii/generators/crud/default/domains/toggle-status.service.php index ff492b6d..f46c35d8 100644 --- a/src/gii/generators/crud/default/domains/toggle-status.service.php +++ b/src/gii/generators/crud/default/domains/toggle-status.service.php @@ -30,7 +30,7 @@ public function execute() $model->load($form->attributes, ''); if ($model->save()) { - $this->setId($model->getId()); + $this->setId($model->id); return true; } diff --git a/src/gii/generators/crud/default/domains/update.service.php b/src/gii/generators/crud/default/domains/update.service.php index d0d05a4f..c3b8b3be 100644 --- a/src/gii/generators/crud/default/domains/update.service.php +++ b/src/gii/generators/crud/default/domains/update.service.php @@ -25,7 +25,7 @@ public function execute() $model->load($this->getForm()->attributes, ''); if ($model->save()) { - $this->setId($model->getId()); + $this->setId($model->id); return true; } diff --git a/src/gii/generators/crud/form.php b/src/gii/generators/crud/form.php index 2176f235..ccbd7426 100644 --- a/src/gii/generators/crud/form.php +++ b/src/gii/generators/crud/form.php @@ -3,17 +3,11 @@ /* @var $form yii\widgets\ActiveForm */ /* @var $generator yii\gii\generators\crud\Generator */ -echo $form->field($generator, 'modelClass'); -echo $form->field($generator, 'searchModelClass'); -echo $form->field($generator, 'controllerClass'); -echo $form->field($generator, 'viewPath'); -echo $form->field($generator, 'baseControllerClass'); -echo $form->field($generator, 'indexWidgetType')->dropDownList([ - 'grid' => 'GridView', - 'list' => 'ListView', +echo $this->render('@vendor/yiisoft/yii2-gii/src/generators/crud/form.php', [ + 'form' => $form, + 'generator' => $generator, ]); -echo $form->field($generator, 'enableI18N')->checkbox(); -echo $form->field($generator, 'enablePjax')->checkbox(); +echo \yii\helpers\Html::tag('hr'); echo $form->field($generator, 'generateTests')->checkbox(); echo $form->field($generator, 'testPath'); -echo $form->field($generator, 'messageCategory'); +echo \yii\helpers\Html::tag('hr'); diff --git a/src/gii/generators/model/Generator.php b/src/gii/generators/model/Generator.php index 4f057e24..14d9c23a 100644 --- a/src/gii/generators/model/Generator.php +++ b/src/gii/generators/model/Generator.php @@ -24,182 +24,14 @@ * @author Qiang Xue * @since 2.0 */ -class Generator extends \yii\gii\Generator +class Generator extends \yii\gii\generators\model\Generator { - const RELATIONS_NONE = 'none'; - const RELATIONS_ALL = 'all'; - const RELATIONS_ALL_INVERSE = 'all-inverse'; - - public $db = 'db'; public $ns = 'app\modules\moduleName\domains\domainName\activerecords'; - public $tableName; - public $modelClass; - public $baseClass = 'yii\db\ActiveRecord'; - public $generateRelations = self::RELATIONS_ALL; - public $generateLabelsFromComments = false; - public $useTablePrefix = false; - public $useSchemaName = true; - public $generateQuery = false; - public $queryNs = 'app\models'; - public $queryClass; - public $queryBaseClass = 'yii\db\ActiveQuery'; - + public $generateRelations = self::RELATIONS_ALL_INVERSE; - /** - * @inheritdoc - */ - public function getName() - { - return 'Model Generator'; - } - - /** - * @inheritdoc - */ - public function getDescription() - { - return 'This generator generates an ActiveRecord class for the specified database table.'; - } - - /** - * @inheritdoc - */ - public function rules() + public function formView() { - return array_merge(parent::rules(), [ - [['db', 'ns', 'tableName', 'modelClass', 'baseClass', 'queryNs', 'queryClass', 'queryBaseClass'], 'filter', 'filter' => 'trim'], - [['ns'], 'filter', 'filter' => function ($value) { - return trim($value, '\\'); - }], - [['queryNs'], 'filter', 'filter' => function ($value) { - return trim(str_replace('activerecords', 'activequeries', $value), '\\'); - }], - [['db', 'ns', 'tableName', 'baseClass', 'queryNs', 'queryBaseClass'], 'required'], - [['db', 'modelClass', 'queryClass'], 'match', 'pattern' => '/^\w+$/', 'message' => 'Only word characters are allowed.'], - [['ns', 'baseClass', 'queryNs', 'queryBaseClass'], 'match', 'pattern' => '/^[\w\\\\]+$/', 'message' => 'Only word characters and backslashes are allowed.'], - [['tableName'], 'match', 'pattern' => '/^([\w ]+\.)?([\w\* ]+)$/', 'message' => 'Only word characters, and optionally spaces, an asterisk and/or a dot are allowed.'], - [['db'], 'validateDb'], - [['ns', 'queryNs'], 'validateNamespace'], - [['tableName'], 'validateTableName'], - [['modelClass'], 'validateModelClass', 'skipOnEmpty' => false], - [['baseClass'], 'validateClass', 'params' => ['extends' => ActiveRecord::class]], - [['queryBaseClass'], 'validateClass', 'params' => ['extends' => ActiveQuery::class]], - [['generateRelations'], 'in', 'range' => [self::RELATIONS_NONE, self::RELATIONS_ALL, self::RELATIONS_ALL_INVERSE]], - [['generateLabelsFromComments', 'useTablePrefix', 'useSchemaName', 'generateQuery'], 'boolean'], - [['enableI18N'], 'boolean'], - [['messageCategory'], 'validateMessageCategory', 'skipOnEmpty' => false], - ]); - } - - /** - * @inheritdoc - */ - public function attributeLabels() - { - return array_merge(parent::attributeLabels(), [ - 'ns' => 'Namespace', - 'db' => 'Database Connection ID', - 'tableName' => 'Table Name', - 'modelClass' => 'Model Class', - 'baseClass' => 'Base Class', - 'generateRelations' => 'Generate Relations', - 'generateLabelsFromComments' => 'Generate Labels from DB Comments', - 'generateQuery' => 'Generate ActiveQuery', - 'queryNs' => 'ActiveQuery Namespace', - 'queryClass' => 'ActiveQuery Class', - 'queryBaseClass' => 'ActiveQuery Base Class', - 'useSchemaName' => 'Use Schema Name', - ]); - } - - /** - * @inheritdoc - */ - public function hints() - { - return array_merge(parent::hints(), [ - 'ns' => 'This is the namespace of the ActiveRecord class to be generated, e.g., app\models', - 'db' => 'This is the ID of the DB application component.', - 'tableName' => 'This is the name of the DB table that the new ActiveRecord class is associated with, e.g. post. - The table name may consist of the DB schema part if needed, e.g. public.post. - The table name may end with asterisk to match multiple table names, e.g. tbl_* - will match tables who name starts with tbl_. In this case, multiple ActiveRecord classes - will be generated, one for each matching table name; and the class names will be generated from - the matching characters. For example, table tbl_post will generate Post - class.', - 'modelClass' => 'This is the name of the ActiveRecord class to be generated. The class name should not contain - the namespace part as it is specified in "Namespace". You do not need to specify the class name - if "Table Name" ends with asterisk, in which case multiple ActiveRecord classes will be generated.', - 'baseClass' => 'This is the base class of the new ActiveRecord class. It should be a fully qualified namespaced class name.', - 'generateRelations' => 'This indicates whether the generator should generate relations based on - foreign key constraints it detects in the database. Note that if your database contains too many tables, - you may want to uncheck this option to accelerate the code generation process.', - 'generateLabelsFromComments' => 'This indicates whether the generator should generate attribute labels - by using the comments of the corresponding DB columns.', - 'useTablePrefix' => 'This indicates whether the table name returned by the generated ActiveRecord class - should consider the tablePrefix setting of the DB connection. For example, if the - table name is tbl_post and tablePrefix=tbl_, the ActiveRecord class - will return the table name as {{%post}}.', - 'useSchemaName' => 'This indicates whether to include the schema name in the ActiveRecord class - when it\'s auto generated. Only non default schema would be used.', - 'generateQuery' => 'This indicates whether to generate ActiveQuery for the ActiveRecord class.', - 'queryNs' => 'This is the namespace of the ActiveQuery class to be generated, e.g., app\models', - 'queryClass' => 'This is the name of the ActiveQuery class to be generated. The class name should not contain - the namespace part as it is specified in "ActiveQuery Namespace". You do not need to specify the class name - if "Table Name" ends with asterisk, in which case multiple ActiveQuery classes will be generated.', - 'queryBaseClass' => 'This is the base class of the new ActiveQuery class. It should be a fully qualified namespaced class name.', - ]); - } - - /** - * @inheritdoc - */ - public function autoCompleteData() - { - $db = $this->getDbConnection(); - if ($db !== null) { - return [ - 'tableName' => function () use ($db) { - return $db->getSchema()->getTableNames(); - }, - ]; - } else { - return []; - } - } - - /** - * @inheritdoc - */ - public function requiredTemplates() - { - // @todo make 'query.php' to be required before 2.1 release - return ['model.php'/*, 'query.php'*/]; - } - - /** - * @inheritdoc - */ - public function stickyAttributes() - { - return array_merge(parent::stickyAttributes(), ['ns', 'db', 'baseClass', 'generateRelations', 'generateLabelsFromComments', 'queryNs', 'queryBaseClass']); - } - - /** - * Returns the `tablePrefix` property of the DB connection as specified - * - * @return string - * @since 2.0.5 - * @see getDbConnection - */ - public function getTablePrefix() - { - $db = $this->getDbConnection(); - if ($db !== null) { - return $db->tablePrefix; - } else { - return ''; - } + return Yii::getAlias('@vendor/yiisoft/yii2-gii/src/generators/model/form.php'); } /** @@ -250,616 +82,9 @@ public function generate() } /** - * Generates the attribute labels for the specified table. - * @param \yii\db\TableSchema $table the table schema - * @return array the generated attribute labels (name => label) - */ - public function generateLabels($table) - { - $labels = []; - foreach ($table->columns as $column) { - if ($this->generateLabelsFromComments && !empty($column->comment)) { - $labels[$column->name] = $column->comment; - } elseif (!strcasecmp($column->name, 'id')) { - $labels[$column->name] = 'ID'; - } else { - $label = Inflector::camel2words($column->name); - if (!empty($label) && substr_compare($label, ' id', -3, 3, true) === 0) { - $label = substr($label, 0, -3) . ' ID'; - } - $labels[$column->name] = $label; - } - } - - return $labels; - } - - /** - * Generates validation rules for the specified table. - * @param \yii\db\TableSchema $table the table schema - * @return array the generated validation rules - */ - public function generateRules($table) - { - $types = []; - $lengths = []; - foreach ($table->columns as $column) { - if ($column->autoIncrement) { - continue; - } - if (!$column->allowNull && $column->defaultValue === null) { - $types['required'][] = $column->name; - } - switch ($column->type) { - case Schema::TYPE_SMALLINT: - case Schema::TYPE_INTEGER: - case Schema::TYPE_BIGINT: - $types['integer'][] = $column->name; - break; - case Schema::TYPE_BOOLEAN: - $types['boolean'][] = $column->name; - break; - case Schema::TYPE_FLOAT: - case 'double': // Schema::TYPE_DOUBLE, which is available since Yii 2.0.3 - case Schema::TYPE_DECIMAL: - case Schema::TYPE_MONEY: - $types['number'][] = $column->name; - break; - case Schema::TYPE_DATE: - case Schema::TYPE_TIME: - case Schema::TYPE_DATETIME: - case Schema::TYPE_TIMESTAMP: - $types['safe'][] = $column->name; - break; - default: // strings - if ($column->size > 0) { - $lengths[$column->size][] = $column->name; - } else { - $types['string'][] = $column->name; - } - } - } - $rules = []; - foreach ($types as $type => $columns) { - $rules[] = "[['" . implode("', '", $columns) . "'], '$type']"; - } - foreach ($lengths as $length => $columns) { - $rules[] = "[['" . implode("', '", $columns) . "'], 'string', 'max' => $length]"; - } - - $db = $this->getDbConnection(); - - // Unique indexes rules - try { - $uniqueIndexes = $db->getSchema()->findUniqueIndexes($table); - foreach ($uniqueIndexes as $uniqueColumns) { - // Avoid validating auto incremental columns - if (!$this->isColumnAutoIncremental($table, $uniqueColumns)) { - $attributesCount = count($uniqueColumns); - - if ($attributesCount === 1) { - $rules[] = "[['" . $uniqueColumns[0] . "'], 'unique']"; - } elseif ($attributesCount > 1) { - $labels = array_intersect_key($this->generateLabels($table), array_flip($uniqueColumns)); - $lastLabel = array_pop($labels); - $columnsList = implode("', '", $uniqueColumns); - $rules[] = "[['$columnsList'], 'unique', 'targetAttribute' => ['$columnsList'], 'message' => 'The combination of " . implode(', ', $labels) . " and $lastLabel has already been taken.']"; - } - } - } - } catch (NotSupportedException $e) { - // doesn't support unique indexes information...do nothing - } - - // Exist rules for foreign keys - foreach ($table->foreignKeys as $refs) { - $refTable = $refs[0]; - $refTableSchema = $db->getTableSchema($refTable); - if ($refTableSchema === null) { - // Foreign key could point to non-existing table: https://github.com/yiisoft/yii2-gii/issues/34 - continue; - } - $refClassName = $this->generateClassName($refTable); - unset($refs[0]); - $attributes = implode("', '", array_keys($refs)); - $targetAttributes = []; - foreach ($refs as $key => $value) { - $targetAttributes[] = "'$key' => '$value'"; - } - $targetAttributes = implode(', ', $targetAttributes); - $rules[] = "[['$attributes'], 'exist', 'skipOnError' => true, 'targetClass' => $refClassName::class, 'targetAttribute' => [$targetAttributes]]"; - } - - return $rules; - } - - /** - * Generates relations using a junction table by adding an extra viaTable(). - * @param \yii\db\TableSchema the table being checked - * @param array $fks obtained from the checkJunctionTable() method - * @param array $relations - * @return array modified $relations - */ - private function generateManyManyRelations($table, $fks, $relations) - { - $db = $this->getDbConnection(); - - foreach ($fks as $pair) { - list($firstKey, $secondKey) = $pair; - $table0 = $firstKey[0]; - $table1 = $secondKey[0]; - unset($firstKey[0], $secondKey[0]); - $className0 = $this->generateClassName($table0); - $className1 = $this->generateClassName($table1); - $table0Schema = $db->getTableSchema($table0); - $table1Schema = $db->getTableSchema($table1); - - $link = $this->generateRelationLink(array_flip($secondKey)); - $viaLink = $this->generateRelationLink($firstKey); - $relationName = $this->generateRelationName($relations, $table0Schema, key($secondKey), true); - $relations[$table0Schema->fullName][$relationName] = [ - "return \$this->hasMany($className1::class, $link)->viaTable('" - . $this->generateTableName($table->name) . "', $viaLink);", - $className1, - true, - ]; - - $link = $this->generateRelationLink(array_flip($firstKey)); - $viaLink = $this->generateRelationLink($secondKey); - $relationName = $this->generateRelationName($relations, $table1Schema, key($firstKey), true); - $relations[$table1Schema->fullName][$relationName] = [ - "return \$this->hasMany($className0::class, $link)->viaTable('" - . $this->generateTableName($table->name) . "', $viaLink);", - $className0, - true, - ]; - } - - return $relations; - } - - /** - * @return string[] all db schema names or an array with a single empty string - * @throws NotSupportedException - * @since 2.0.5 - */ - protected function getSchemaNames() - { - $db = $this->getDbConnection(); - $schema = $db->getSchema(); - if ($schema->hasMethod('getSchemaNames')) { // keep BC to Yii versions < 2.0.4 - try { - $schemaNames = $schema->getSchemaNames(); - } catch (NotSupportedException $e) { - // schema names are not supported by schema - } - } - if (!isset($schemaNames)) { - if (($pos = strpos($this->tableName, '.')) !== false) { - $schemaNames = [substr($this->tableName, 0, $pos)]; - } else { - $schemaNames = ['']; - } - } - return $schemaNames; - } - - /** - * @return array the generated relation declarations - */ - protected function generateRelations() - { - if ($this->generateRelations === self::RELATIONS_NONE) { - return []; - } - - $db = $this->getDbConnection(); - - $relations = []; - foreach ($this->getSchemaNames() as $schemaName) { - foreach ($db->getSchema()->getTableSchemas($schemaName) as $table) { - $className = $this->generateClassName($table->fullName); - foreach ($table->foreignKeys as $refs) { - $refTable = $refs[0]; - $refTableSchema = $db->getTableSchema($refTable); - if ($refTableSchema === null) { - // Foreign key could point to non-existing table: https://github.com/yiisoft/yii2-gii/issues/34 - continue; - } - unset($refs[0]); - $fks = array_keys($refs); - $refClassName = $this->generateClassName($refTable); - - // Add relation for this table - $link = $this->generateRelationLink(array_flip($refs)); - $relationName = $this->generateRelationName($relations, $table, $fks[0], false); - $relations[$table->fullName][$relationName] = [ - "return \$this->hasOne($refClassName::class, $link);", - $refClassName, - false, - ]; - - // Add relation for the referenced table - $hasMany = $this->isHasManyRelation($table, $fks); - $link = $this->generateRelationLink($refs); - $relationName = $this->generateRelationName($relations, $refTableSchema, $className, $hasMany); - $relations[$refTableSchema->fullName][$relationName] = [ - "return \$this->" . ($hasMany ? 'hasMany' : 'hasOne') . "($className::class, $link);", - $className, - $hasMany, - ]; - } - - if (($junctionFks = $this->checkJunctionTable($table)) === false) { - continue; - } - - $relations = $this->generateManyManyRelations($table, $junctionFks, $relations); - } - } - - if ($this->generateRelations === self::RELATIONS_ALL_INVERSE) { - return $this->addInverseRelations($relations); - } - - return $relations; - } - - /** - * Adds inverse relations - * - * @param array $relations relation declarations - * @return array relation declarations extended with inverse relation names - * @since 2.0.5 - */ - protected function addInverseRelations($relations) - { - $relationNames = []; - foreach ($this->getSchemaNames() as $schemaName) { - foreach ($this->getDbConnection()->getSchema()->getTableSchemas($schemaName) as $table) { - $className = $this->generateClassName($table->fullName); - foreach ($table->foreignKeys as $refs) { - $refTable = $refs[0]; - $refTableSchema = $this->getDbConnection()->getTableSchema($refTable); - unset($refs[0]); - $fks = array_keys($refs); - - $leftRelationName = $this->generateRelationName($relationNames, $table, $fks[0], false); - $relationNames[$table->fullName][$leftRelationName] = true; - $hasMany = $this->isHasManyRelation($table, $fks); - $rightRelationName = $this->generateRelationName( - $relationNames, - $refTableSchema, - $className, - $hasMany - ); - $relationNames[$refTableSchema->fullName][$rightRelationName] = true; - - $relations[$table->fullName][$leftRelationName][0] = - rtrim($relations[$table->fullName][$leftRelationName][0], ';') - . "->inverseOf('".lcfirst($rightRelationName)."');"; - $relations[$refTableSchema->fullName][$rightRelationName][0] = - rtrim($relations[$refTableSchema->fullName][$rightRelationName][0], ';') - . "->inverseOf('".lcfirst($leftRelationName)."');"; - } - } - } - return $relations; - } - - /** - * Determines if relation is of has many type - * - * @param TableSchema $table - * @param array $fks - * @return boolean - * @since 2.0.5 - */ - protected function isHasManyRelation($table, $fks) - { - $uniqueKeys = [$table->primaryKey]; - try { - $uniqueKeys = array_merge($uniqueKeys, $this->getDbConnection()->getSchema()->findUniqueIndexes($table)); - } catch (NotSupportedException $e) { - // ignore - } - foreach ($uniqueKeys as $uniqueKey) { - if (count(array_diff(array_merge($uniqueKey, $fks), array_intersect($uniqueKey, $fks))) === 0) { - return false; - } - } - return true; - } - - /** - * Generates the link parameter to be used in generating the relation declaration. - * @param array $refs reference constraint - * @return string the generated link parameter. - */ - protected function generateRelationLink($refs) - { - $pairs = []; - foreach ($refs as $a => $b) { - $pairs[] = "'$a' => '$b'"; - } - - return '[' . implode(', ', $pairs) . ']'; - } - - /** - * Checks if the given table is a junction table, that is it has at least one pair of unique foreign keys. - * @param \yii\db\TableSchema the table being checked - * @return array|boolean all unique foreign key pairs if the table is a junction table, - * or false if the table is not a junction table. - */ - protected function checkJunctionTable($table) - { - if (count($table->foreignKeys) < 2) { - return false; - } - $uniqueKeys = [$table->primaryKey]; - try { - $uniqueKeys = array_merge($uniqueKeys, $this->getDbConnection()->getSchema()->findUniqueIndexes($table)); - } catch (NotSupportedException $e) { - // ignore - } - $result = []; - // find all foreign key pairs that have all columns in an unique constraint - $foreignKeys = array_values($table->foreignKeys); - for ($i = 0; $i < count($foreignKeys); $i++) { - $firstColumns = $foreignKeys[$i]; - unset($firstColumns[0]); - - for ($j = $i + 1; $j < count($foreignKeys); $j++) { - $secondColumns = $foreignKeys[$j]; - unset($secondColumns[0]); - - $fks = array_merge(array_keys($firstColumns), array_keys($secondColumns)); - foreach ($uniqueKeys as $uniqueKey) { - if (count(array_diff(array_merge($uniqueKey, $fks), array_intersect($uniqueKey, $fks))) === 0) { - // save the foreign key pair - $result[] = [$foreignKeys[$i], $foreignKeys[$j]]; - break; - } - } - } - } - return empty($result) ? false : $result; - } - - /** - * Generate a relation name for the specified table and a base name. - * @param array $relations the relations being generated currently. - * @param \yii\db\TableSchema $table the table schema - * @param string $key a base name that the relation name may be generated from - * @param boolean $multiple whether this is a has-many relation - * @return string the relation name - */ - protected function generateRelationName($relations, $table, $key, $multiple) - { - if (!empty($key) && substr_compare($key, 'id', -2, 2, true) === 0 && strcasecmp($key, 'id')) { - $key = rtrim(substr($key, 0, -2), '_'); - } - if ($multiple) { - $key = Inflector::pluralize($key); - } - $name = $rawName = Inflector::id2camel($key, '_'); - $i = 0; - while (isset($table->columns[lcfirst($name)])) { - $name = $rawName . ($i++); - } - while (isset($relations[$table->fullName][$name])) { - $name = $rawName . ($i++); - } - - return $name; - } - - /** - * Validates the [[db]] attribute. - */ - public function validateDb() - { - if (!Yii::$app->has($this->db)) { - $this->addError('db', 'There is no application component named "db".'); - } elseif (!Yii::$app->get($this->db) instanceof Connection) { - $this->addError('db', 'The "db" application component must be a DB connection instance.'); - } - } - - /** - * Validates the namespace. - * - * @param string $attribute Namespace variable. - */ - public function validateNamespace($attribute) - { - $value = $this->$attribute; - $value = ltrim($value, '\\'); - $path = Yii::getAlias('@' . str_replace('\\', '/', $value), false); - if ($path === false) { - $this->addError($attribute, 'Namespace must be associated with an existing directory.'); - } - } - - /** - * Validates the [[modelClass]] attribute. - */ - public function validateModelClass() - { - if ($this->isReservedKeyword($this->modelClass)) { - $this->addError('modelClass', 'Class name cannot be a reserved PHP keyword.'); - } - if ((empty($this->tableName) || substr_compare($this->tableName, '*', -1, 1)) && $this->modelClass == '') { - $this->addError('modelClass', 'Model Class cannot be blank if table name does not end with asterisk.'); - } - } - - /** - * Validates the [[tableName]] attribute. - */ - public function validateTableName() - { - if (strpos($this->tableName, '*') !== false && substr_compare($this->tableName, '*', -1, 1)) { - $this->addError('tableName', 'Asterisk is only allowed as the last character.'); - - return; - } - $tables = $this->getTableNames(); - if (empty($tables)) { - $this->addError('tableName', "Table '{$this->tableName}' does not exist."); - } else { - foreach ($tables as $table) { - $class = $this->generateClassName($table); - if ($this->isReservedKeyword($class)) { - $this->addError('tableName', "Table '$table' will generate a class which is a reserved PHP keyword."); - break; - } - } - } - } - - protected $tableNames; - protected $classNames; - - /** - * @return array the table names that match the pattern specified by [[tableName]]. - */ - protected function getTableNames() - { - if ($this->tableNames !== null) { - return $this->tableNames; - } - $db = $this->getDbConnection(); - if ($db === null) { - return []; - } - $tableNames = []; - if (strpos($this->tableName, '*') !== false) { - if (($pos = strrpos($this->tableName, '.')) !== false) { - $schema = substr($this->tableName, 0, $pos); - $pattern = '/^' . str_replace('*', '\w+', substr($this->tableName, $pos + 1)) . '$/'; - } else { - $schema = ''; - $pattern = '/^' . str_replace('*', '\w+', $this->tableName) . '$/'; - } - - foreach ($db->schema->getTableNames($schema) as $table) { - if (preg_match($pattern, $table)) { - $tableNames[] = $schema === '' ? $table : ($schema . '.' . $table); - } - } - } elseif (($table = $db->getTableSchema($this->tableName, true)) !== null) { - $tableNames[] = $this->tableName; - $this->classNames[$this->tableName] = $this->modelClass; - } - - return $this->tableNames = $tableNames; - } - - /** - * Generates the table name by considering table prefix. - * If [[useTablePrefix]] is false, the table name will be returned without change. - * @param string $tableName the table name (which may contain schema prefix) - * @return string the generated table name - */ - public function generateTableName($tableName) - { - if (!$this->useTablePrefix) { - return $tableName; - } - - $db = $this->getDbConnection(); - if (preg_match("/^{$db->tablePrefix}(.*?)$/", $tableName, $matches)) { - $tableName = '{{%' . $matches[1] . '}}'; - } elseif (preg_match("/^(.*?){$db->tablePrefix}$/", $tableName, $matches)) { - $tableName = '{{' . $matches[1] . '%}}'; - } - return $tableName; - } - - /** - * Generates a class name from the specified table name. - * @param string $tableName the table name (which may contain schema prefix) - * @param boolean $useSchemaName should schema name be included in the class name, if present - * @return string the generated class name - */ - protected function generateClassName($tableName, $useSchemaName = null) - { - if (isset($this->classNames[$tableName])) { - return $this->classNames[$tableName]; - } - - $schemaName = ''; - $fullTableName = $tableName; - if (($pos = strrpos($tableName, '.')) !== false) { - if (($useSchemaName === null && $this->useSchemaName) || $useSchemaName) { - $schemaName = substr($tableName, 0, $pos) . '_'; - } - $tableName = substr($tableName, $pos + 1); - } - - $db = $this->getDbConnection(); - $patterns = []; - $patterns[] = "/^{$db->tablePrefix}(.*?)$/"; - $patterns[] = "/^(.*?){$db->tablePrefix}$/"; - if (strpos($this->tableName, '*') !== false) { - $pattern = $this->tableName; - if (($pos = strrpos($pattern, '.')) !== false) { - $pattern = substr($pattern, $pos + 1); - } - $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/'; - } - $className = $tableName; - foreach ($patterns as $pattern) { - if (preg_match($pattern, $tableName, $matches)) { - $className = $matches[1]; - break; - } - } - - return $this->classNames[$fullTableName] = Inflector::id2camel($schemaName.$className, '_'); - } - - /** - * Generates a query class name from the specified model class name. - * @param string $modelClassName model class name - * @return string generated class name - */ - protected function generateQueryClassName($modelClassName) - { - $queryClassName = $this->queryClass; - if (empty($queryClassName) || strpos($this->tableName, '*') !== false) { - $queryClassName = $modelClassName . 'Query'; - } - return $queryClassName; - } - - /** - * @return Connection the DB connection as specified by [[db]]. - */ - protected function getDbConnection() - { - return Yii::$app->get($this->db, false); - } - - /** - * Checks if any of the specified columns is auto incremental. - * @param \yii\db\TableSchema $table the table schema - * @param array $columns columns to check for autoIncrement property - * @return boolean whether any of the specified columns is auto incremental. + * @param bool $namespaceOnly + * @return string */ - protected function isColumnAutoIncremental($table, $columns) - { - foreach ($columns as $column) { - if (isset($table->columns[$column]) && $table->columns[$column]->autoIncrement) { - return true; - } - } - - return false; - } - public function getBusinessClass($namespaceOnly = false) { $parts = StringHelper::explode($this->ns, '\\'); diff --git a/src/gii/generators/model/form.php b/src/gii/generators/model/form.php deleted file mode 100644 index 0c717761..00000000 --- a/src/gii/generators/model/form.php +++ /dev/null @@ -1,27 +0,0 @@ -field($generator, 'tableName')->textInput(['table_prefix' => $generator->getTablePrefix()]); -echo $form->field($generator, 'modelClass'); -echo $form->field($generator, 'ns'); -echo $form->field($generator, 'baseClass'); -echo $form->field($generator, 'db'); -echo $form->field($generator, 'useTablePrefix')->checkbox(); -echo $form->field($generator, 'generateRelations')->dropDownList([ - Generator::RELATIONS_NONE => 'No relations', - Generator::RELATIONS_ALL => 'All relations', - Generator::RELATIONS_ALL_INVERSE => 'All relations with inverse', -]); -echo $form->field($generator, 'generateLabelsFromComments')->checkbox(); -echo $form->field($generator, 'generateQuery')->checkbox(); -echo $form->field($generator, 'queryNs'); -echo $form->field($generator, 'queryClass'); -echo $form->field($generator, 'queryBaseClass'); -echo $form->field($generator, 'enableI18N')->checkbox(); -echo $form->field($generator, 'messageCategory'); -echo $form->field($generator, 'useSchemaName')->checkbox();