77 Commits

Author SHA1 Message Date
61f1bd7af9 Fix @var annotations (#20517) 2025-09-08 13:07:30 +03:00
53256fdd24 Fix #20513: Fix code examples in PHPDoc 2025-09-06 00:22:56 +03:00
8b50a4942a Fix @var tags syntax in framework folder (#20392) 2025-06-03 19:57:08 +03:00
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
a292af13bf [PHP 8.4] Fixes for implicit nullability deprecation (#20133)
Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations.
Related to #20128.

See:
 - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types)
 - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated)

Co-authored-by: Wilmer Arambula <terabytesoftw@gmail.com>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
2024-03-26 11:27:58 +03:00
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
7d8507dea8 Fix eager loading of nested one-to-many relations (#19585)
* Update ActiveRelationTrait.php

fix #19507

* update structure-applications.md wiki links (#19597)

* update structure-models.md wiki links (#19598)

* Update structure-views.md wiki links (#19600)

* update structure-filters.md links (#19601)

* Added nested via relations

* Added nested via relations eager loading test

* Update framework/db/ActiveRelationTrait.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/data/ar/Customer.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/data/ar/Customer.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Update tests/framework/db/ActiveRecordTest.php

Co-authored-by: Bizley <pawel@positive.codes>

* Fix #19507: Fix eager loading of nested relations

Co-authored-by: Ihor Sychevskyi <arhell333@gmail.com>
Co-authored-by: Bizley <pawel@positive.codes>
2022-10-04 15:55:53 +06:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
adadbefe88 Fix #19469: Fix a virtual relation not working because of new isset checks in \yii\db\ActiveRelationTrait 2022-07-15 23:52:39 +03:00
c5c792cb07 Update ActiveRelationTrait.php (#19453)
* Update ActiveRelationTrait.php

* Update ActiveRelationTrait.php

* Update framework/db/ActiveRelationTrait.php

Co-authored-by: Bizley <pawel@positive.codes>

Co-authored-by: Bizley <pawel@positive.codes>
2022-06-24 09:02:04 +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
67ea4cf968 Fix #19148: Fix undefined array key errors in yii\db\ActiveRelationTrait 2022-01-19 01:47:07 +03:00
1e41533789 (Docs) Normalized existing "virtual" / "magic" methods' descriptions, add missing ones (#19066) 2021-12-08 12:27:28 +03:00
14a28ab4f4 docs improvment (#18935) 2021-10-05 10:13:33 +02:00
82be8b61cf Replacing deprecated ::className() with ::class (#18671) 2021-05-22 23:14:54 +03:00
112effc631 Fix #18435: Fix ensuring Active Record relation links' keys to be strings 2020-12-18 19:12:33 +03:00
ff0fd9a9ea Fix #16492: Fix eager loading Active Record relations when relation key is a subject to a type-casting behavior 2020-12-15 22:56:24 +03:00
bdc29982fa Fix @method signatures in ActiveRelationTrait (#18369) 2020-11-06 20:13:19 +03:00
cb67d07b85 Fix #17974: Fix ActiveRelationTrait compatibility with PHP 7.4 2020-04-19 23:25:02 +03:00
2da6773b68 Fixes #17089: Fixed caching of related records when via() using with callable 2019-02-13 23:22:07 +03:00
4333b90186 Fixes #15482: AR::find()->with() missing data when using string identifiers for relations 2019-01-14 18:50:56 -05:00
698e45ac1e Fixed code style 2019-01-02 18:24:16 +02:00
d02fb4e3dd Reduce the Cyclomatic Complexity level 2019-01-01 13:01:12 +03:00
a7771acd8d Add ArrayExpression support in related tables 2019-01-01 02:39:55 +03:00
87af257892 Fixes #5341: HasMany via two relations 2018-09-09 23:45:32 +03:00
84c55b468a [minor] SCA (#16464)
* Php Inspections (EA Ultimate): new findings

* Php Inspections (EA Ultimate): dealing with older PHP versions compatibility
2018-07-01 01:04:48 +03:00
6dd2aec011 [minor]: SCA (#16269)
* Php Inspections (EA Ultimate): minor code tweaks

* Php Inspections (EA Ultimate): code style

* Php Inspections (EA Ultimate): code style

* Php Inspections (EA Ultimate): code style
2018-05-14 12:00:01 +03:00
e6f5c46cdc Fixes #15633: Deprecate some things going away/changing in 2.1
- Deprecated `yii\base\BaseObject::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading
- Deprecated XCache and Zend data cache support as caching backends
- Deprecated `yii\BaseYii::powered()` method
- Added `yii\base\InvalidArgumentException` and deprecated `yii\base\InvalidParamException`
- Added `yii\BaseYii::debug()` and deprecated `yii\BaseYii::trace()`
2018-02-11 01:48:29 +03:00
1e0157f0ac Fixes #7316: Documentation for ActiveRelationTrait::inverseOf() [skip ci] (#14892) 2017-10-07 18:59:53 +02:00
d68789a195 Fixes #13779, fixes #5786
- #13779: Fixed `yii\db\ActiveRecord::joinWith()` unable to use relation defined via attached behavior.
- #5786: Allowed to use custom constructors in ActiveRecord-based classes.
2017-08-29 15:13:28 +03:00
8ff3756d55 remove loop over an array with one element
small optimization, fixes #12061
2017-08-22 13:03:01 +02: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
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
c19b2f7dc8 release version 2.0.11 2017-02-01 17:46:29 +01:00
5609e918de Fixed some malformed @var tags (#13468) [skip ci] 2017-01-30 11:42:52 +03:00
c17766181f Added QueryInterface::emulateExecution()
Added `QueryInterface::emulateExecution()`, which allows preventing of
the actual query execution.
This allows to cancel `DataProvider` preventing search query execution
in case search model is invalid:

``` php
public function search($params)
    {
        $query = Item::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            $query->where('0=1');
            $query->emulateExecution(); // No SQL execution will be done
            return $dataProvider;
        }
```

This also fix unecessary query in case of `via()` usage. See #12390.

fixes #12390
fixes #6373
close #12708
2016-12-02 13:28:51 +01:00
3a6fbad561 phpDoc: Fix example for ActiveRelationTrait::via() (#13008) [skip ci] 2016-11-15 13:30:04 +03:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
217d50e4ff improved PHPdoc and @since annotations 2016-07-11 12:58:43 +02:00
0f640c7138 Make sure inverseOf relations are also populated during dynamic relational queries
Refs #6347
2016-07-04 15:07:37 +02:00
52e23e0317 fix issue with composite key in combination with join
fixes #10201
fixes #9047
close #9895
2016-04-22 16:39:06 +02:00
762b9207ea Avoid some calls to new $this->modelClass in ActiveQuery
this fixes some cases of the problem described in #8639 and is fully BC.
Fixing other places may need BC breaks.
2016-02-23 13:24:01 +01:00
1b3770fd21 Use === instead of == where possible 2015-10-10 01:04:35 +03:00
67658cf57d Replaced static with $this in phpdoc since current IDEs are finally able to handle it correctly 2015-05-31 13:39:30 +03:00
582b7606ac Fixed yii\db\ActiveRelationTrait::populateRelation() fails when link refers to array string convertable object attribute 2015-05-08 11:17:35 +03:00
4503cae876 code style fix 2015-04-24 13:47:44 +03:00
c0fc4596e2 Fixed yii\db\ActiveRelationTrait::populateRelation() fails when link refers to string convertable object attribute, like \MongoId 2015-04-24 13:42:47 +03:00
6481d13494 Optimized checks order in conditions 2015-02-08 17:56:36 +03:00