82 Commits

Author SHA1 Message Date
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
a87c02c712 Fix more types (#19333)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect

* Null types for Validator

* Several more null types

* One more

* Make AccessRule::$allow always a boolean

It doesn't have any special null handling, so it's safe to default to false

* Validator::$skipOnEmpty is always a boolean

* Catch all throwable from Widget::widget()

* Don't limit $previous args to \Exception

The actual \Exception allows $previous to be any throwable in PHP 7+

* Add Throwable catch block to Instance::get()

* Throwable cleanup

Comment changes only.

- Document \Throwable instead of \Exception wherever appropriate
- Removed redundant exception/error classes when \Throwable is referenced

* Yii::setlogger() accepts null

* ArrayHelper::removeValue() can remove any type of value

* Change default $allow value to false
2022-04-03 11:20:21 +02:00
4628b91e73 Fix types (#19332)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect
2022-03-30 18:40:10 +02:00
fa6f0ef658 Fix variable references in phpdoc (#19006) 2021-11-10 13:26:55 +03:00
480ae53f6d Fix migration command example in BaseMigrateController (#18978) 2021-10-27 10:08:09 +03:00
f7c81fb044 Fix BaseMigrateController::$migrationPath phpdoc (#18924) 2021-10-01 23:35:54 +03:00
7966fe47e6 Scrutinizer fixes (#18685)
* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/filters/AccessRule.php?selectedLabels%5B0%5D=2&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/helpers/BaseFileHelper.php?selectedLabels%5B0%5D=2&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/base/Application.php?selectedLabels%5B0%5D=7&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/base/Module.php?selectedLabels%5B0%5D=7&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/web/MultipartFormDataParser.php?selectedLabels%5B0%5D=7&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/web/Session.php?selectedLabels%5B0%5D=7&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/base/Controller.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/console/controllers/MigrateController.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* Added vardocs, and small refactor

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/db/conditions/InConditionBuilder.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/db/Connection.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/db/mssql/QueryBuilder.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/log/Logger.php?selectedLabels%5B0%5D=6&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/console/controllers/BaseMigrateController.php?selectedLabels%5B0%5D=18&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* Adding space between type

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/console/controllers/CacheController.php?selectedLabels%5B0%5D=18&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/console/controllers/FixtureController.php?selectedLabels%5B0%5D=18&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* https://scrutinizer-ci.com/g/yiisoft/yii2/issues/master/files/framework/console/controllers/MigrateController.php?selectedLabels%5B0%5D=18&selectedSeverities%5B0%5D=10&selectedSeverities%5B1%5D=5&orderField=path&order=asc&honorSelectedPaths=0

* Update framework/console/controllers/CacheController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/CacheController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

* Update framework/console/controllers/FixtureController.php

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
2021-05-31 21:07:36 +03:00
31ca0fcb6f Fix #18676: Added method yii\helpers\BaseFileHelper::changeOwnership() and properties newFileMode/newFileOwnership in yii\console\controllers\BaseMigrateController
Co-authored-by: Bizley <pawel@positive.codes>
2021-05-30 19:26:15 +03:00
6cba80d887 Fix #18339: Fix migrate controller actions to return exit codes
Co-authored-by: Bizley <pawel@positive.codes>
2020-12-09 16:48:39 +03:00
e478c23bd4 Fix #17985: Convert migrationNamespaces to array if needed
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
2020-07-01 00:52:52 +03:00
e6c4640c98 Fix #17979: Improve migrate/fresh command description 2020-04-18 11:53:18 +03:00
67ff6f814b Fix #17771: migrate/fresh was not returning exit code 2020-01-09 15:31:54 +03:00
e50a07c30c Fix #17437: Fixed generating namespaced migrations 2019-07-23 17:28:43 +03:00
65f6b59b35 @inheritdoc notation changed 2018-01-23 13:11:24 +02:00
185209957e Fixes #15270: Resolved potential race conditions when writing generated php-files 2017-12-02 18:24:56 +03:00
2d672b6722 release version 2.0.13 2017-11-03 01:09:29 +03:00
e311001ef5 #14543: Adjusted implementation of migration name length limit 2017-10-27 00:20:37 +03:00
614fb52c45 Fixes #14543: Throw exception when trying to create migration longer than 255 symbols 2017-10-23 23:21:44 +03:00
ab8c54f12a Fixes #14864: Ability to use dependencies in constructor of migrations 2017-09-23 01:24:18 +02:00
97923ac783 ensure backwards compatibiliy with migration without $compact
See https://github.com/yiisoft/yii2/pull/14474#discussion_r135237472
2017-09-01 11:07:52 +02:00
9588c8f5a4 Fixes #13853: Added yii\db\Migration::$compact as well as yii\console\controllers\BaseMigrateController::$compact to allow making the migration console output more compact 2017-08-25 13:30:28 +03:00
264831cf21 BaseMigrateController::refreshDatabase() renamed to truncateDatabase() 2017-08-24 13:08:46 +03:00
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
58792cdac5 Fixes #14664: Add migrate/fresh command to truncate database and apply migrations again 2017-08-20 01:00:41 +03:00
2f9f15bf92 Fixes #14188: Add constants and function for sysexits(3) to ConsoleHelper 2017-07-15 23:26:15 +03:00
0070b97837 allow migrate/mark to mark the history base (#14428)
fixes #7890
2017-07-12 11:48:03 +02:00
a50d9d8e3e Enable include rule in php-cs-fixer (#14418) 2017-07-10 13:19:57 +03:00
fe8a0a6a2e Enable no_useless_else rule in php-cs-fixer (#14420) 2017-07-10 11:26:21 +03:00
ba0ab403b5 Added php-cs-fixer coding standards validation to Travis CI (#14100)
* php-cs-fixer: PSR2 rule.

* php-cs-fixer: PSR2 rule - fix views.

* Travis setup refactoring.

* Add php-cs-fixer to travis cs tests.

* Fix tests on hhvm-3.12

* improve travis config

* composer update

* revert composer update

* improve travis config

* Fix CS.

* Extract config to separate classes.

* Extract config to separate classes.

* Add file header.

* Force short array syntax.

* binary_operator_spaces fixer

* Fix broken tests

* cast_spaces fixer

* concat_space fixer

* dir_constant fixer

* ereg_to_preg fixer

* function_typehint_space fixer

* hash_to_slash_comment fixer

* is_null fixer

* linebreak_after_opening_tag fixer

* lowercase_cast fixer

* magic_constant_casing fixer

* modernize_types_casting fixer

* native_function_casing fixer

* new_with_braces fixer

* no_alias_functions fixer

* no_blank_lines_after_class_opening fixer

* no_blank_lines_after_phpdoc fixer

* no_empty_comment fixer

* no_empty_phpdoc fixer

* no_empty_statement fixer

* no_extra_consecutive_blank_lines fixer

* no_leading_import_slash fixer

* no_leading_namespace_whitespace fixer

* no_mixed_echo_print fixer

* no_multiline_whitespace_around_double_arrow fixer

* no_multiline_whitespace_before_semicolons fixer

* no_php4_constructor fixer

* no_short_bool_cast fixer

* no_singleline_whitespace_before_semicolons fixer

* no_spaces_around_offset fixer

* no_trailing_comma_in_list_call fixer

* no_trailing_comma_in_singleline_array fixer

* no_unneeded_control_parentheses fixer

* no_unused_imports fixer

* no_useless_return fixer

* no_whitespace_before_comma_in_array fixer

* no_whitespace_in_blank_line fixer

* not_operator_with_successor_space fixer

* object_operator_without_whitespace fixer

* ordered_imports fixer

* php_unit_construct fixer

* php_unit_dedicate_assert fixer

* php_unit_fqcn_annotation fixer

* phpdoc_indent fixer

* phpdoc_no_access fixer

* phpdoc_no_empty_return fixer

* phpdoc_no_package fixer

* phpdoc_no_useless_inheritdoc fixer

* Fix broken tests

* phpdoc_return_self_reference fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_to_comment fixer

* phpdoc_trim fixer

* phpdoc_var_without_name fixer

* psr4 fixer

* self_accessor fixer

* short_scalar_cast fixer

* single_blank_line_before_namespace fixer

* single_quote fixer

* standardize_not_equals fixer

* ternary_operator_spaces fixer

* trailing_comma_in_multiline_array fixer

* trim_array_spaces fixer

* protected_to_private fixer

* unary_operator_spaces fixer

* whitespace_after_comma_in_array fixer

* `parent::setRules()` -> `$this->setRules()`

* blank_line_after_opening_tag fixer

* Update finder config.

* Revert changes for YiiRequirementChecker.

* Fix array formatting.

* Add missing import.

* Fix CS for new code merged from master.

* Fix some indentation issues.
2017-06-12 12:25:45 +03:00
fdc91f351b Improved base migration controller documentation [skip ci] (#14253) 2017-06-09 11:36:03 +03:00
844eacba26 Update BaseMigrateController.php
make sure console arguments are recognized as array.
2017-06-05 11:31:38 +02:00
6ec6f8d76c moved include file logic to separate method 2017-06-02 13:35:45 +02:00
5288577221 make migrationPath accept an array 2017-06-02 13:35:45 +02:00
deb1def9d3 added alias syntax support
fixes #13356
fixes #13359
2017-06-02 13:34:34 +02:00
cb9462b224 Added support for specifying aliases for migrationNamespaces
This is used to specify pathes to migrations that do not have
namespaces.

While not directly supported by the migration command provideded by the
framework, these migrations exist in a lot of extensions because custom implementations
of migration controllers out of the framework were using this approach
to load multiple migrations from multiple paths.

Even the framework itself currently ships non-namespaced migrations:

- 17a1d91e4a/framework/rbac/migrations/m140506_102106_rbac_init.php
- 17a1d91e4a/framework/caching/migrations/m150909_153426_cache_init.php
- 17a1d91e4a/framework/log/migrations/m141106_185632_log_init.php

This change allows existing applications to adopt the new namespace-based approach
while keeping existing migrations. While it would be possible to add
namespaces to migrations in the application itself, it is not easily possible
to add namespaces to migrations that come from external sources like
extensions.
2017-06-02 13:34:34 +02:00
4b9e48b8dc improved docs: link term "path alias" to the guide 2017-06-02 10:45:20 +02:00
862a5dd6b7 Added support for field yii\console\controllers\BaseMigrateController::$migrationNamespaces setup from CLI 2017-01-16 16:48:44 +02:00
25a7ed60e7 Docs about namespaced migrations fixed 2017-01-10 14:22:50 +02:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
11fe407ad0 release version 2.0.10 2016-10-20 14:02:50 +02:00
19a896a299 Improve phpdoc and error in BaseMigrateController (#12573) [skip ci] 2016-09-20 22:44:00 +02:00
239cdcdf8a Regex fix 2016-09-16 11:58:41 +03:00
0450b2002a Added missing @since 2016-09-13 11:26:50 +03:00
7acd3b6400 Fixed namespace path resolve on Windows at BaseMigrateController 2016-09-13 11:25:48 +03:00
8aa0e85a07 Add migration namespace support (#12511)
namespace support added to `BaseMigrateController`
2016-09-12 14:01:04 +03:00
a2123d8bb9 Fixed typo in BaseMigrateController.php (#12033) 2016-07-28 16:34:48 +03:00
731769241b release version 2.0.8 2016-04-28 16:50:20 +02:00