-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate \Cake\Form\Form\errors(); #12601
Conversation
Afaik the consensus was to focus on the actual functional splitting, and keeping the aliases of existing ones simple, so errors() instead of getErrors() - for the sake of changing it only this would introduce hundreds of more deprecations in the code, wouldnt it? Also refs #10930 (which should be closed at this point now IMO). And there are still actual important things to be done: #9978 |
@@ -244,6 +244,24 @@ public function validate(array $data) | |||
* @return array Last set validation errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deprecated
tag needs to be addded in docblock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.7.0?
Yeah this change can be deemed unnecessary but consistency/intuitiveness in API is also important. Since we have |
Yes, I wondered why there was not some shared interface. |
👍 Me and three of my colleagues including @TekkCraft prefer this consistency. |
I got problems with CI. deprecated since 3.7.0? |
You need to add your changes on top of |
tests/TestCase/ORM/EntityTest.php
Outdated
$this->assertSame($entity, $entity->errors('foo', 'bar')); | ||
$this->assertEquals(['bar'], $entity->errors('foo')); | ||
$this->assertEmpty($entity->getErrors()); | ||
$this->assertSame($entity, $entity->getErrors('foo', 'bar')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a setter call $entity->setErrors('foo', 'bar')
, that's what's causing tests to fail.
8bdb229
to
a7c196a
Compare
tests/TestCase/Form/FormTest.php
Outdated
@@ -150,6 +150,18 @@ public function testValidateDeprected() | |||
* @return void | |||
*/ | |||
public function testErrors() | |||
{ | |||
$this->deprecated(function () { | |||
$this->testGetErrors(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you no need to wrap this method with deprecated
when it does not use/have deprecated methods
Looks like the appveyor error is unrelated. Edit: anything else? |
The |
Ref #12596