Skip to content

Add phpstan configuration file #1837

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
includes:
- ../vendor/macopedia/phpstan-magento1/extension.neon
parameters:
magentoRootPath: %currentWorkingDirectory%
paths:
#lets start small with just few modules
- %currentWorkingDirectory%/app/code/core/Mage/Admin
# - %currentWorkingDirectory%/app/code/core/Mage/Adminhtml
# - %currentWorkingDirectory%/app/code/core/Mage/AdminNotification
# - %currentWorkingDirectory%/app/code/core/Mage/Api
# - %currentWorkingDirectory%/app/code/core/Mage/Api2
# - %currentWorkingDirectory%/app/code/core/Mage/Authorizenet
# - %currentWorkingDirectory%/app/code/core/Mage/Backup
# - %currentWorkingDirectory%/app/code/core/Mage/Bundle
# - %currentWorkingDirectory%/app/code/core/Mage/Captcha
# - %currentWorkingDirectory%/app/code/core/Mage/Catalog
# - %currentWorkingDirectory%/app/code/core/Mage/CatalogIndex
# - %currentWorkingDirectory%/app/code/core/Mage/CatalogInventory
# - %currentWorkingDirectory%/app/code/core/Mage/CatalogRule
# - %currentWorkingDirectory%/app/code/core/Mage/CatalogSearch
# - %currentWorkingDirectory%/app/code/core/Mage/Centinel
# - %currentWorkingDirectory%/app/code/core/Mage/Checkout
- %currentWorkingDirectory%/app/code/core/Mage/Cms
# - %currentWorkingDirectory%/app/code/core/Mage/ConfigurableSwatches
# - %currentWorkingDirectory%/app/code/core/Mage/Contacts
# - %currentWorkingDirectory%/app/code/core/Mage/Core
# - %currentWorkingDirectory%/app/code/core/Mage/Cron
# - %currentWorkingDirectory%/app/code/core/Mage/CurrencySymbol
# - %currentWorkingDirectory%/app/code/core/Mage/Customer
# - %currentWorkingDirectory%/app/code/core/Mage/Dataflow
# - %currentWorkingDirectory%/app/code/core/Mage/Directory
# - %currentWorkingDirectory%/app/code/core/Mage/Downloadable
# - %currentWorkingDirectory%/app/code/core/Mage/Eav
# - %currentWorkingDirectory%/app/code/core/Mage/GiftMessage
# - %currentWorkingDirectory%/app/code/core/Mage/GoogleAnalytics
# - %currentWorkingDirectory%/app/code/core/Mage/GoogleCheckout
# - %currentWorkingDirectory%/app/code/core/Mage/ImportExport
# - %currentWorkingDirectory%/app/code/core/Mage/Index
# - %currentWorkingDirectory%/app/code/core/Mage/Install
- %currentWorkingDirectory%/app/code/core/Mage/Log
# - %currentWorkingDirectory%/app/code/core/Mage/Media
# - %currentWorkingDirectory%/app/code/core/Mage/Newsletter
# - %currentWorkingDirectory%/app/code/core/Mage/Oauth
# - %currentWorkingDirectory%/app/code/core/Mage/Page
# - %currentWorkingDirectory%/app/code/core/Mage/PageCache
# - %currentWorkingDirectory%/app/code/core/Mage/Paygate
# - %currentWorkingDirectory%/app/code/core/Mage/Payment
# - %currentWorkingDirectory%/app/code/core/Mage/Paypal
# - %currentWorkingDirectory%/app/code/core/Mage/PaypalUk
# - %currentWorkingDirectory%/app/code/core/Mage/Persistent
# - %currentWorkingDirectory%/app/code/core/Mage/Poll
# - %currentWorkingDirectory%/app/code/core/Mage/ProductAlert
# - %currentWorkingDirectory%/app/code/core/Mage/Rating
# - %currentWorkingDirectory%/app/code/core/Mage/Reports
# - %currentWorkingDirectory%/app/code/core/Mage/Review
# - %currentWorkingDirectory%/app/code/core/Mage/Rss
# - %currentWorkingDirectory%/app/code/core/Mage/Rule
# - %currentWorkingDirectory%/app/code/core/Mage/Sales
# - %currentWorkingDirectory%/app/code/core/Mage/SalesRule
# - %currentWorkingDirectory%/app/code/core/Mage/Sendfriend
# - %currentWorkingDirectory%/app/code/core/Mage/Shipping
# - %currentWorkingDirectory%/app/code/core/Mage/Sitemap
# - %currentWorkingDirectory%/app/code/core/Mage/Tag
# - %currentWorkingDirectory%/app/code/core/Mage/Tax
# - %currentWorkingDirectory%/app/code/core/Mage/Uploader
# - %currentWorkingDirectory%/app/code/core/Mage/Usa
# - %currentWorkingDirectory%/app/code/core/Mage/Weee
# - %currentWorkingDirectory%/app/code/core/Mage/Widget
# - %currentWorkingDirectory%/app/code/core/Mage/Wishlist
excludePaths:
#incompatible interfaces
- */app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php
- */app/code/core/Mage/Admin/Model/Acl/Assert/Time.php

- */app/code/core/Mage/Admin/Model/Config.php
- */app/code/core/Mage/Admin/Model/Roles.php
- */app/code/core/Mage/Admin/Model/User.php
# due to errors (variable passed to a factory):
- */app/code/core/Mage/Cms/Helper/Page.php
- */app/code/core/Mage/Cms/Helper/Data.php
level: 0
# universalObjectCratesClasses:
# - Varien_Object
4 changes: 2 additions & 2 deletions app/code/core/Mage/Admin/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Mage_Admin_Model_Observer
* Handler for controller_action_predispatch event
*
* @param Varien_Event_Observer $observer
* @return boolean
* @return void
*/
public function actionPreDispatchAdmin($observer)
{
Expand Down Expand Up @@ -106,7 +106,7 @@ public function actionPreDispatchAdmin($observer)
->setActionName('login')
->setDispatched(false);
}
return false;
return;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,8 @@
"email": "[email protected]",
"role": "Maintainer"
}
]
],
"require-dev": {
"macopedia/phpstan-magento1": "^1.0"
}
}