107 Commits

Author SHA1 Message Date
X
2db798ce04 Fix ArrayHelper::index function documentation 2025-03-20 18:42:28 +08:00
f94017ce4c Fix #20306: Add new yii\helpers\ArrayHelper::flatten() method 2025-01-06 17:53:58 +03:00
e4d5d73490 Fix #20268: Minor optimisation in \yii\helpers\BaseArrayHelper::map 2024-10-27 13:37:09 +03:00
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
e916e9d564 Fix #19914: Fixed ArrayHelper::keyExists() and ::remove() functions when the key is a float and the value is null 2023-08-18 15:31:09 +04:00
b61b9ac253 Fix #19589: Fix Error reporting in to the BaseArrayHelper::getValue() 2022-09-25 23:48:05 +04:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
c409264484 Fix BaseArrayHelper::htmlDecode() (#19386)
* Fix BaseArrayHelper::htmlDecode()

Add missed second argument on recursive calling.

* Fix BaseArrayHelper::htmlDecode()

`htmlspecialchars_decode()` flags must be same to `htmlspecialchars()` in `BaseArrayHelper::htmlEncode()`

* Update ArrayHelperTest.php

* Update ArrayHelperTest.php

* Update ArrayHelperTest.php

* Update CHANGELOG.md

* test workflow fix
2022-05-22 10:20:04 +02:00
bf058f4d23 Simple optimization and PHPDoc type fixes in yii\helpers\BaseArrayHelper (#19387) 2022-05-16 23:14:43 +04:00
a173488711 Optimize BaseArrayHelper::isIndexed() (#19363) 2022-04-24 10:46:36 +02:00
0f004db99b Fixed issue when trying to check if a multidimensional array is dirty… (#19272)
* Fixed issue when trying to check if a multidimensional array is dirty attribute or not

* fixed issue in logic and added test

* Updated test to only support PHP 7 and above

* Code refactoring

* Updated Test Cases

* Update framework/helpers/BaseArrayHelper.php

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

* Added to CHANGELOG.md

* Update CHANGELOG.md

Co-authored-by: Maher Al Ghoul <maher.gh@opensooq.com>
Co-authored-by: Bizley <pawel@positive.codes>
Co-authored-by: Maher Al Ghoul <maher@rufoof.com>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Maher Al Ghoul <Maher.AlGhoul@opensooq.com>
2022-04-18 13:41:20 +02: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
0041f034fd [doc] Update PHP doc links (#18957)
* Replace https://secure.php.net with https://www.php.net

* Replace http://www.php.net with https://www.php.net
2021-10-19 14:50:26 +02:00
e3028c524d Fix #18899: Replace usages of strpos with strncmp and remove redundant usage of array_merge and array_values 2021-09-28 11:06:46 +03:00
59eb9a3395 Fixed ArrayHelper::toArray for DateTime (#18880)
* Fixed ArrayHelper::toArray() for DateTime object

* Updated README.md for #18880 (Fixed ArrayHelper::toArray() for DateTime object)

Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
2021-09-14 15:30:10 +02:00
71791d790d Fix #18505: Fixed ArrayHelper::get() for ArrayAccess objects with explicitly defined properties
Co-authored-by: Bizley <pawel@positive.codes>
2021-02-04 15:30:56 +03:00
59358f4e5b Fix #18501: Fix type in ArrayHelper::getColumn() phpdoc 2021-02-02 01:10:55 +03:00
02c77da812 Fix #18395: Fix regression in yii\helpers\BaseArrayHelper::filter() (allowing filtering arrays with numeric keys) 2020-12-22 22:35:51 +03:00
bfc0698b36 Fix #18086: Fix accessing public properties of ArrayAccess via ArrayHelper::getValue() 2020-07-05 18:27:17 +03:00
35fb9c6248 Fix #18026: Fix ArrayHelper::getValue() did not work with ArrayAccess objects 2020-05-18 15:18:09 +03:00
b794d76056 Fix #17829: yii\helpers\ArrayHelper::filter now correctly filters data when passing a filter with more than 2 levels 2020-01-29 01:03:31 +03:00
8fb5b35cc5 Closes #17372. Fix documentation for the ArrayHelper::multisort() (#17375) 2019-06-18 14:17:16 +03:00
bdb7c64910 Update to https protocol for php.net links (#17168) [skip ci]
* Updated php.net link for some MemCache properties [skip ci]

* Changed protocol to https for links to php.net in comments

* Changed protocol to https for links to php.net in code

* Changed www.php.net (http) to secure.php.net (https) in comments

* Changed www.php.net (http) to secure.php.net (https) in code

* Changed protocol to https for links to php.net in UPGRADE.md

* Changed protocol to https for links to pecl.php.net in comments

* Changed us.php.net to secure.php.net (https) in comments

* Changed protocol to https for links to php.net in docs

* Changed www.php.net (http) to secure.php.net (https) in docs

* Changed protocol to https for links to pecl.php.net in docs

* Changed ru/jp.php.net to secure.php.net (https) in docs

Don't sure about russian guide: is this links meant to be for guide on russian, or not?
2019-02-28 13:09:27 +03:00
383953d9b7 Update BaseArrayHelper.php (#1) (#16894) 2018-11-18 10:16:52 +02:00
b070b5f733 Improve annotations for yii\helpers\BaseArrayHelper::getColumn()(#16795) (#16802) [skip ci] 2018-10-20 00:10:48 +03:00
c286f00060 Fixes #16666: Fixed yii\helpers\ArrayHelper::merge 2018-08-28 12:31:43 +03:00
1a74b3d4f8 [minor] SCA with Php Inspections (EA Ultimate) (#15871)
* Php Inspections (EA Ultimate): use type casting where applicable

* Php Inspections (EA Ultimate): use constants where applicable

* Php Inspections (EA Ultimate): CS

* Php Inspections (EA Ultimate): address some of one-time used variables

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): revert a constant usage

* Php Inspections (EA Ultimate): revert sequential assignments

* Php Inspections (EA Ultimate): build is green again

* Php Inspections (EA Ultimate): revert array_merge tweaks

* Php Inspections (EA Ultimate): revert BC-incompatible one-time used variable tweak

* Update description [skip ci]

* Php Inspections (EA Ultimate): CS
2018-03-12 01:37:19 +03:00
f10cb6aeee SCA with Php Inspections (EA Ultimate) 2018-02-27 19:13:22 +01: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
38f66e9c6d IsIndexed() @return wrong description fixed (#15538) [skip ci] 2018-01-22 15:44:54 +03:00
d2423cd6ca Fixes #15301: Fixed ArrayHelper::filter() to work properly with 0 in values 2017-12-08 16:34:29 +03:00
2d672b6722 release version 2.0.13 2017-11-03 01:09:29 +03:00
93bbf5b39d Fixes #15015: Added StringHelper::floatToString() to savely cast float values independent of the locale, also fixes some places in the framework that use it now 2017-10-27 11:41:45 +03:00
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
59002a9e1e Fixes #6644: Added yii\helpers\ArrayHelper::setValue() 2017-07-16 00:25:44 +03:00
6e223e6db2 Fixes #14423: Fixed ArrayHelper::merge behavior with null values for integer-keyed elements 2017-07-13 10:36:59 +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
e62ea0136c Fixed phpdoc broken links to PHP manual pages [skip ci] 2017-04-11 00:43:38 +03:00
ed82ba4ee2 Revert "fix ArrayHelper::getValue() to throw exception on invalid input"
This reverts commit e963b2af6486dd79c26a460148c63efb580f53fc because of BC breaking reported in #13248.

To know more about the reasons of commit revertinvg, visit https://github.com/yiisoft/yii2/issues/13248
2016-12-20 12:39:25 +02:00
e963b2af64 fix ArrayHelper::getValue() to throw exception on invalid input
fixes #12927
2016-12-16 01:49:37 +01:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
940f7c7cd4 PHPDocs updated. Closes #12927 2016-11-05 22:11:09 +02:00
6b73cfccbb Fixes #12881: Added removeValue method to yii\helpers\BaseArrayHelper (nilsburg) 2016-11-04 18:21:56 +03:00
e8c16a09fa Fixed some typos (#12847) 2016-10-26 14:02:38 +03:00
11fe407ad0 release version 2.0.10 2016-10-20 14:02:50 +02:00
5ef5005e49 Updated PHPDocs, fixes #12545 2016-09-15 19:51:49 +03:00
993f2aef28 Fixes #11275: Added possibility of unset or force replace former value in ArrayHelper::merge() 2016-08-03 22:49:49 +03:00