themehybrid / hybrid-core

Official repository for the Hybrid Core WordPress development framework.
GNU General Public License v2.0
689 stars 144 forks source link

5.0: `Hybrid\View\View::display()` has an unused variable `$data` #165

Closed lkraav closed 5 years ago

lkraav commented 5 years ago

https://github.com/justintadlock/hybrid-core/blob/5.0.0/src/View/View.php#L184

Advanced IDEs flag this automatically.

justintadlock commented 5 years ago

While it's not used in the method, this variable is assigned so that it's available to templates. Not sure if there's another way around that.

lkraav commented 5 years ago

Oh, you mean it's in the scope for the include() statement and the goal is to provide both $data and standalone extracted variables?

justintadlock commented 5 years ago

Yes. The original plan was not to extract, but that was added as an extra feature.

lkraav commented 5 years ago

I think in the case of PlatesView, I can still remove $data here, because it won't be in scope with another engine's render call.