50 Commits

Author SHA1 Message Date
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
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
1271bc419f Fix #19041: Fix PHP 8.1 issues 2022-01-14 13:52:01 +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
4cb2dfef1a Add more tests for helpers (#18675) 2021-05-25 10:28:57 +03: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
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
f2d32fab77 Fix #18046: Add test for current ArrayHelper::merge() behavior (#18054) 2020-05-20 18:41:40 +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
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
d2423cd6ca Fixes #15301: Fixed ArrayHelper::filter() to work properly with 0 in values 2017-12-08 16:34:29 +03:00
2992b9b09d Refactored tests with PHPUnit assert methods (#15260) 2017-11-30 22:10:31 +03:00
64d8af61a6 Fixes for PHP 7.2 compatibility (#14959) 2017-10-19 01:54:40 +03:00
431c1b01a7 added test case for merging empty arrays
issue #14617
2017-09-01 10:58:45 +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
b99e955627 Fix CS (#14665)
* Run php-cs-fixer.

* Enable phpdoc_types rule.
2017-08-18 12:10:42 +02:00
69673c0c94 Rename Object -> BaseObject for PHP 7.2 compatibility
issue #7936
2017-07-19 10:51:46 +02: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
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
21a7a68e45 Add test coverage of yii\helpers\BaseArrayHelper (#14205) 2017-05-25 14:12:13 +05:00
d786b78f25 Helper independent (#14050)
* Made sure most helpers are independent of Yii::$app

* Made sure most validators are independent of Yii::$app
2017-04-26 09:49:44 +02:00
c4857176ac added test for ArrayHelper::multisort() with closure key
related to #13248
2016-12-20 14:14:01 +01: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
6b73cfccbb Fixes #12881: Added removeValue method to yii\helpers\BaseArrayHelper (nilsburg) 2016-11-04 18:21:56 +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
30bb9bd7c8 Fixes #11462: Added support of filtering rules to yii\log\Target::$logVar, added \yii\helpers\BaseArrayHelper::filter() method 2016-07-03 01:56:05 +03:00
b45e5fbaf2 Unit test for #11549 2016-06-19 15:22:12 +03:00
239d7814eb Fixes #11739: Fixed ArrayHelper::index() losing precision for float keys 2016-06-19 15:00:46 +03:00
b211e6bf69 added failing test for #11686
test BaseArrayHelper::isIn() in strict mode
2016-06-09 13:08:26 +02:00
c6d04644d3 passing properties to recursive call if properties of top object are not specified
fixes #7717
close #10960
2016-04-28 02:34:10 +02:00
976b9fe357 Updated ArrayHelperTest to test exceptions of ArrayHelper::isIn() and ::isSubset() 2016-03-10 16:39:21 +02:00
b641cb7dea Updated ArrayHelperTest::testIsTraversable() 2016-02-25 12:02:48 +02:00
16a6af5fa8 Add helper function for checking if an object is an array-like object.
Added support for traversable objects in `BaseHtml` and `ArrayHelper`
2016-02-24 23:49:05 +02:00
d66659e329 ArrayHelperTest - groupBy tests moved to a separate method 2016-02-24 23:08:59 +02:00
ef8b0a2be0 parameter dimensions in ArrayHelper::index 2016-02-15 17:47:44 +10:00
0f30b0843b added test for SORT_DESC
for #8348 and #10607
2016-02-07 20:50:25 +01:00
78de315794 Fixed processing nested objects multisort in BaseArrayHelper
fixes #8348
close #10607
2016-02-07 20:20:32 +01:00
ed23b97baf #10574 - Fix for BaseArrayHelper to work with invalid characters in proper way 2016-01-16 09:37:36 +03:00
f6dcb290ed reverted c00b97a/#9915, this is expected behavior
When accessing non-existing properties it is expected behavior to throw an error.
This is the case in all other places.

It is also not reliably possible to determine whether a property exists beforehand.
it is not sufficient to call `property_exists()` as it may be available via `__get()`.

Instead of `property_exists()` or `isset()` it should call `$object->canGetProperty()` but this is not
guaranteed to be implemented and therefor doing such a check will not work in 2.0.x.

calling isset() may break code that works through __get() but has not implemented __isset() properly.

We may discuss this for 2.1 again but I am in favor of keeping it as is.
2016-01-15 16:19:24 +01:00
d1812d2081 fixed arrayhelper test, renamed test methods according to FW change 2015-11-22 17:07:48 +01:00
22d9997281 Implemented support of traversable objects in RangeValidator::ranges, added ArrayHelper::in() and ArrayHelper::subset() 2015-11-18 16:41:56 +02:00
c00b97a12c Fixes #9915: yii\helpers\ArrayHelper::getValue() was erroring instead of returning null for non-existing object properties 2015-10-14 12:56:59 +03:00
8caaba0168 Allow specification of the $key as an array at yii\helpers\ArrayHelper::getValue() 2015-04-20 15:52:32 +03:00
6949992246 Simplified tests directory structure a bit 2015-04-16 12:10:01 +03:00