Skip to content
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

[zend-controller] fixes "Creation of dynamic property ::$ajaxable is deprecated" on PHP 8.2+ when using ContextSwitch helper #196

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

marcing
Copy link
Contributor

@marcing marcing commented Mar 12, 2024

followup to #170 - unfinished fix for dynamic contexts in Zend_Controller_Action

fixes "Creation of dynamic property ::$ajaxable is deprecated" on PHP 8.2+ when using ContextSwitch helper

@marcing marcing marked this pull request as ready for review March 12, 2024 19:07
@marcing marcing requested a review from falkenhawk March 12, 2024 19:07
@falkenhawk falkenhawk changed the title [zend-controller] fixes "Creation of dynamic property ::$ajaxable is deprecated" [zend-controller] fixes "Creation of dynamic property ::$ajaxable is deprecated" on PHP 8.2+ when using ContextSwitch helper Mar 13, 2024
@marcing marcing force-pushed the fix/php8-zend-controller-action-contexts branch from ae765c3 to ea3c37e Compare March 13, 2024 14:36
@@ -159,6 +159,25 @@ public function tearDown()
unset($_SERVER['HTTP_X_REQUESTED_WITH']);
}
}

public function testAddActionContext()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't actually test ajaxContext which would use ajaxable property in action controller, does it?
Also, indentation looks off

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I understand now. The test uses $this->helper, which is instance of Zend_Controller_Action_Helper_AjaxContext over custom Zend_Controller_Action_Helper_AjaxContextTestController without contexts defined, then calls addActionContext to add new context to Zend_Controller_Action_Helper_AjaxContextTestController::$ajaxable.

@marcing marcing force-pushed the fix/php8-zend-controller-action-contexts branch from ea3c37e to ab64d58 Compare March 19, 2024 11:18
…deprecated" on PHP 8.2+ when using ContextSwitch helper
@marcing marcing force-pushed the fix/php8-zend-controller-action-contexts branch from ab64d58 to 704fb68 Compare March 19, 2024 11:22
Copy link
Member

@falkenhawk falkenhawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 💚

@falkenhawk falkenhawk merged commit ee72a88 into master Mar 19, 2024
13 checks passed
@falkenhawk falkenhawk deleted the fix/php8-zend-controller-action-contexts branch April 18, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants