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

Add template files to phpstan checks #4245

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Oct 3, 2024

Description (*)

Check template files with phpstan.

  • started with +16k errors
  • made some regex replacements
  • baseline 11k errors

Yeah, 11k baseline is not nice, but that will be reduced during days. (help welcome to add doc blocks to template files!)

Related Pull Requests

  1. See Add template files to checks #2847

@github-actions github-actions bot added environment Component: PayPal Relates to Mage_Paypal Component: Catalog Relates to Mage_Catalog Template : admin Relates to admin template Component: Cms Relates to Mage_Cms Component: Reports Relates to Mage_Reports Component: CatalogInventory Relates to Mage_CatalogInventory Component: Checkout Relates to Mage_Checkout Component: Sales Relates to Mage_Sales Component: Usa Relates to Mage_Usa Component: Customer Relates to Mage_Customer Component: Eav Relates to Mage_Eav Template : rwd Relates to rwd template Template : base Relates to base template Component: Adminhtml Relates to Mage_Adminhtml Component: ProductAlert Relates to Mage_ProductAlert Component: Page Relates to Mage_Page Component: Api PageRelates to Mage_Api Component: Captcha Relates to Mage_Captcha Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: Wishlist Relates to Mage_Wishlist Component: Widget Relates to Mage_Widget Component: Tax Relates to Mage_Tax Component: Shipping Relates to Mage_Shipping labels Oct 3, 2024
ADDISON74
ADDISON74 previously approved these changes Oct 5, 2024
# Conflicts:
#	.phpstan.dist.baseline.neon
ADDISON74
ADDISON74 previously approved these changes Oct 14, 2024
@@ -9,13 +9,14 @@
* @category design
* @package default_default
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2018-2022 The OpenMage Contributors (https://www.openmage.org)
* @copyright Copyright (c) 2018-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php
/**
* @see Mage_Bundle_Block_Adminhtml_Sales_Order_Items_Renderer
Copy link
Contributor

Choose a reason for hiding this comment

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

Possible to remove line 18?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see annotation is in lot of files and its used for phpdocumentor. I'd keep.

Copy link
Contributor

Choose a reason for hiding this comment

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

How about consistency? The see annotation is also not in a lot of files. For consistency, is it better to remove?

@ADDISON74
Copy link
Contributor

There is an error in a template file reported recently:

Ignored error pattern #^Variable $this might not be defined.$# in path /home/runner/work/magento-lts/magento-lts/app/design/adminhtml/default/default/template/customer/tab/view.phtml was not matched in reported errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Adminhtml Relates to Mage_Adminhtml Component: Api PageRelates to Mage_Api Component: Api2 Relates to Mage_Api2 Component: Authorizenet Relates to Mage_Authorizenet Component: Bundle Relates to Mage_Bundle Component: Captcha Relates to Mage_Captcha Component: Catalog Relates to Mage_Catalog Component: CatalogInventory Relates to Mage_CatalogInventory Component: CatalogSearch Relates to Mage_CatalogSearch Component: Checkout Relates to Mage_Checkout Component: Cms Relates to Mage_Cms Component: CurrencySymbol Relates to Mage_CurrencySymbol Component: Customer Relates to Mage_Customer Component: Directory Relates to Mage_Directory Component: Downloadable Relates to Mage_Downloadable Component: Media Relates to Mage_Media Component: Newsletter Relates to Mage_Newsletter Component: Oauth Relates to Mage_Oauth Component: Page Relates to Mage_Page Component: Payment Relates to Mage_Payment Component: PayPal Relates to Mage_Paypal Component: Persistant Relates to Mage_Persistant Component: ProductAlert Relates to Mage_ProductAlert Component: Reports Relates to Mage_Reports Component: Sales Relates to Mage_Sales Component: Sendfriend Relates to Mage_Sendfriend Component: Shipping Relates to Mage_Shipping Component: Tax Relates to Mage_Tax Component: Usa Relates to Mage_Usa Component: Widget Relates to Mage_Widget Component: Wishlist Relates to Mage_Wishlist environment phpstan Template : admin Relates to admin template Template : base Relates to base template Template : install Relates to install template Template : rwd Relates to rwd template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants