-
Notifications
You must be signed in to change notification settings - Fork 1
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
Incompatible with latest Nette #3
Comments
I opened a PR (#4) that fixes the failures but there are still several deprecations:
I can fix those as well (probably by updating Codeception). And I can switch CI to GitHub actions if you want. |
@MartkCz Any opinion on this? |
I'm not using this package anymore. I'll merge your pr and release a new version. Feel free to update the dependency. |
Thanks. Will probably want to fix the warnings as well before then. Are you okay with breaking the API (as below) or do you want a deprecation first? commit 12e2b2ee321dbf6f3c92800332901b6c8dcd8616
Author: Jan Tojnar <[email protected]>
Date: Thu Feb 29 19:39:00 2024 +0100
FormResponse: Fix deprecation
nette/forms 3.2.0 deprecated the boolean argument, let’s drop it:
https://github.com/nette/forms/commit/0a812bd6e70aba54c6e563aef4d77bd4388607ae
Also let’s use the `Array` constant introduced in nette/forms 3.1.12:
https://github.com/nette/forms/commit/0be7b3d5971113515e9020cf53453e74f02a46a1
diff --git a/src/Components/Responses/FormResponse.php b/src/Components/Responses/FormResponse.php
index f806422..35c0746 100644
--- a/src/Components/Responses/FormResponse.php
+++ b/src/Components/Responses/FormResponse.php
@@ -3,7 +3,7 @@
namespace WebChemistry\Testing\Components\Responses;
use Nette\Application\UI\Form;
-use Nette\Utils\ArrayHash;
+use Nette\Forms\Container;
/**
* @property-read Form $form
@@ -44,11 +44,11 @@ class FormResponse extends BaseResponse {
}
/**
- * @param bool $asArray
- * @return array|ArrayHash
+ * Returns the values submitted by the form.
+ * @param Control[]|null $controls
*/
- public function getValues(bool $asArray = true) {
- return $this->getForm()->getValues($asArray);
+ public function getValues(string|object|null $returnType = null, ?array $controls = null): object|array {
+ return $this->getForm()->getValues($returnType, $controls);
}
/**
@@ -56,7 +56,7 @@ class FormResponse extends BaseResponse {
* @return mixed
*/
public function getValue(string $path) {
- $values = $this->getValues(true);
+ $values = $this->getValues(Container::Array);
foreach (explode('.', $path) as $item) {
$values = $values[$item];
}
diff --git a/composer.json b/composer.json
index f7fb241..14dc64e 100644
--- a/composer.json
+++ b/composer.json
@@ -5,7 +5,7 @@
"require-dev": {
"codeception/codeception": "~4.1",
"nette/application": "^3.2",
- "nette/forms": "^3.0",
+ "nette/forms": "^3.1.12",
"latte/latte": "^2.9",
"codeception/module-asserts": "^1.3"
}, |
Is it ready for release? |
One more thing #7 |
Looks like we actually used a different default than a9776b4#diff-619c18463d859978e51257d25f93c4fbf7117d95a0067d5b2a2e1c144362d565R50 Will want something like the following: --- a/src/Components/Responses/FormResponse.php
+++ b/src/Components/Responses/FormResponse.php
@@ -47,7 +47,7 @@ class FormResponse extends BaseResponse {
* Returns the values submitted by the form.
* @param Control[]|null $controls
*/
- public function getValues(string|object|null $returnType = null, ?array $controls = null): object|array {
+ public function getValues(string|object $returnType = Container::Array, ?array $controls = null): object|array {
return $this->getForm()->getValues($returnType, $controls);
}
|
I give you rights, I get lost in it :) this will be faster |
Thanks. Will try to finish it up and then then make a release? |
Yes, major version, please. |
nette/application 3.2.0 changed order of arguments in nette/application@bb8f93c. That one is trivial to fix but there are other issues as well.
Is this project still maintained? Would you accept pull requests to fix it?
The text was updated successfully, but these errors were encountered: