From a43fb56d5c01a4774a254148cb93d776fb67c2a2 Mon Sep 17 00:00:00 2001 From: Cyrill Schumacher Date: Thu, 31 Jan 2013 21:55:10 +0100 Subject: [PATCH 1/3] Replaced is_null() with === null according to http://framework.zend.com/issues/browse/ZF-5413 --- app/Mage.php | 6 +- .../Mage/AdminNotification/Helper/Data.php | 6 +- .../Mage/AdminNotification/Model/Feed.php | 2 +- .../Mage/AdminNotification/Model/Survey.php | 2 +- .../Block/Catalog/Category/Abstract.php | 4 +- .../Block/Catalog/Category/Tab/General.php | 2 +- .../Block/Catalog/Category/Tab/Product.php | 2 +- .../Adminhtml/Block/Catalog/Category/Tree.php | 4 +- .../Catalog/Product/Attribute/Set/Main.php | 2 +- .../Composite/Fieldset/Configurable.php | 2 +- .../Product/Composite/Fieldset/Grouped.php | 2 +- .../Product/Composite/Fieldset/Options.php | 2 +- .../Product/Edit/Tab/Attributes/Create.php | 2 +- .../Product/Edit/Tab/Options/Option.php | 16 +-- .../Block/Catalog/Product/Edit/Tabs.php | 2 +- .../Catalog/Product/Helper/Form/BaseImage.php | 2 +- .../Product/Helper/Form/Msrp/Enabled.php | 2 +- .../Product/Helper/Form/Msrp/Price.php | 2 +- .../Tab/Newsletter/Grid/Filter/Status.php | 2 +- .../Block/Customer/Form/Element/File.php | 2 +- .../Sales/Order/Address/Form/Renderer/Vat.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Bar.php | 2 +- .../Mage/Adminhtml/Block/Media/Uploader.php | 2 +- .../Adminhtml/Block/Newsletter/Subscriber.php | 2 +- .../Subscriber/Grid/Filter/Website.php | 2 +- .../Adminhtml/Block/Notification/Window.php | 4 +- .../Adminhtml/Block/Report/Grid/Abstract.php | 6 +- .../Adminhtml/Block/Report/Grid/Shopcart.php | 2 +- .../Sales/Grid/Column/Renderer/Date.php | 2 +- .../Mage/Adminhtml/Block/Review/Edit/Form.php | 2 +- .../Block/Review/Grid/Renderer/Type.php | 2 +- .../Adminhtml/Block/Sales/Items/Abstract.php | 10 +- .../Adminhtml/Block/Sales/Order/Abstract.php | 2 +- .../Adminhtml/Block/Sales/Order/Create.php | 4 +- .../Block/Sales/Order/Create/Comment.php | 2 +- .../Block/Sales/Order/Create/Form.php | 2 +- .../Sales/Order/Create/Form/Abstract.php | 2 +- .../Block/Sales/Order/Create/Form/Address.php | 4 +- .../Sales/Order/Create/Giftmessage/Form.php | 2 +- .../Block/Sales/Order/Create/Items/Grid.php | 2 +- .../Sales/Order/Create/Sidebar/Abstract.php | 2 +- .../Block/Sales/Order/Create/Sidebar/Cart.php | 2 +- .../Sales/Order/Create/Sidebar/Compared.php | 2 +- .../Sales/Order/Create/Sidebar/Pcompared.php | 2 +- .../Sales/Order/Create/Sidebar/Pviewed.php | 2 +- .../Sales/Order/Create/Sidebar/Wishlist.php | 2 +- .../Block/Sales/Order/Create/Totals.php | 2 +- .../Sales/Order/Creditmemo/Create/Items.php | 2 +- .../Block/Sales/Order/View/Giftmessage.php | 4 +- .../Adminhtml/Block/Sales/Order/View/Info.php | 2 +- .../Block/Shipping/Carrier/Tablerate/Grid.php | 2 +- .../Email/Template/Grid/Filter/Type.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rate/Title.php | 4 +- .../Urlrewrite/Catalog/Category/Tree.php | 2 +- .../Adminhtml/Block/Urlrewrite/Edit/Form.php | 4 +- .../Adminhtml/Controller/Report/Abstract.php | 2 +- .../Catalog/Product/Edit/Action/Attribute.php | 4 +- .../Adminhtml/Helper/Dashboard/Abstract.php | 2 +- .../Mage/Adminhtml/Model/Giftmessage/Save.php | 2 +- .../Adminhtml/Model/Sales/Order/Create.php | 12 +- .../Mage/Adminhtml/Model/Session/Quote.php | 8 +- .../Catalog/Product/AttributeController.php | 2 +- .../Catalog/Product/SetController.php | 2 +- .../Report/StatisticsController.php | 2 +- .../Sales/Order/CreateController.php | 2 +- .../Authorizenet/Block/Directpost/Iframe.php | 2 +- app/code/core/Mage/Backend/Block/Menu.php | 2 +- .../Mage/Backend/Block/System/Config/Form.php | 6 +- .../core/Mage/Backend/Block/Widget/Grid.php | 2 +- .../Mage/Backend/Block/Widget/Grid/Column.php | 8 +- .../Block/Widget/Grid/Column/Filter/Price.php | 4 +- .../Widget/Grid/Column/Filter/Select.php | 2 +- .../Block/Widget/Grid/Column/Filter/Store.php | 2 +- .../Block/Widget/Grid/Column/Filter/Theme.php | 2 +- .../Widget/Grid/Column/Renderer/Checkbox.php | 2 +- .../Widget/Grid/Column/Renderer/Date.php | 2 +- .../Widget/Grid/Column/Renderer/Datetime.php | 2 +- .../Widget/Grid/Column/Renderer/Radio.php | 2 +- .../Widget/Grid/Column/Renderer/Store.php | 4 +- .../Widget/Grid/Column/Renderer/Text.php | 4 +- .../Backend/Block/Widget/Grid/Container.php | 4 +- .../Mage/Backend/Block/Widget/Grid/Export.php | 2 +- .../Backend/Block/Widget/Grid/Extended.php | 2 +- .../core/Mage/Backend/Block/Widget/Tabs.php | 6 +- .../Backend/Controller/ActionAbstract.php | 2 +- app/code/core/Mage/Backend/Helper/Data.php | 2 +- app/code/core/Mage/Backend/Model/Auth.php | 2 +- .../core/Mage/Backend/Model/Auth/Session.php | 4 +- app/code/core/Mage/Backend/Model/Config.php | 6 +- .../Model/Config/Backend/Admin/Observer.php | 2 +- .../Model/Config/Source/Email/Identity.php | 2 +- app/code/core/Mage/Backend/Model/Menu.php | 2 +- .../Model/Menu/Builder/CommandAbstract.php | 4 +- .../Mage/Backend/Model/Menu/Config/Menu.php | 2 +- .../Backend/Model/Menu/Item/Validator.php | 2 +- app/code/core/Mage/Backend/Model/Url.php | 2 +- app/code/core/Mage/Backup/Model/Backup.php | 4 +- .../Product/View/Type/Bundle/Option.php | 4 +- .../Product/Attribute/Source/Price/View.php | 2 +- .../core/Mage/Bundle/Model/Product/Price.php | 14 +- .../Model/Resource/Option/Collection.php | 2 +- .../Bundle/Model/Resource/Price/Index.php | 4 +- .../core/Mage/Catalog/Block/Layer/View.php | 2 +- .../core/Mage/Catalog/Block/Navigation.php | 2 +- .../Mage/Catalog/Block/Product/Abstract.php | 6 +- .../Catalog/Block/Product/Compare/List.php | 4 +- .../core/Mage/Catalog/Block/Product/List.php | 2 +- .../Catalog/Block/Product/List/Promotion.php | 2 +- .../Catalog/Block/Product/List/Random.php | 2 +- .../Catalog/Block/Product/List/Toolbar.php | 2 +- .../Catalog/Block/Product/List/Upsell.php | 2 +- .../core/Mage/Catalog/Block/Product/Price.php | 2 +- .../Catalog/Block/Product/View/Abstract.php | 2 +- .../Catalog/Block/Product/View/Additional.php | 2 +- .../Catalog/Block/Product/View/Options.php | 2 +- .../Block/Product/View/Options/Type/Date.php | 2 +- .../core/Mage/Catalog/Helper/Category.php | 2 +- .../Mage/Catalog/Helper/Flat/Abstract.php | 2 +- app/code/core/Mage/Catalog/Helper/Product.php | 6 +- .../core/Mage/Catalog/Helper/Product/Flat.php | 2 +- app/code/core/Mage/Catalog/Model/Category.php | 8 +- .../Category/Attribute/Source/Sortby.php | 2 +- app/code/core/Mage/Catalog/Model/Config.php | 6 +- app/code/core/Mage/Catalog/Model/Layer.php | 4 +- .../Catalog/Model/Layer/Filter/Abstract.php | 10 +- .../Catalog/Model/Layer/Filter/Attribute.php | 2 +- .../Catalog/Model/Layer/Filter/Decimal.php | 8 +- .../Mage/Catalog/Model/Layer/Filter/Price.php | 10 +- .../Model/Layer/Filter/Price/Algorithm.php | 4 +- .../core/Mage/Catalog/Model/Layer/State.php | 2 +- app/code/core/Mage/Catalog/Model/Product.php | 4 +- .../Attribute/Backend/Groupprice/Abstract.php | 2 +- .../Model/Product/Attribute/Backend/Media.php | 2 +- .../Catalog/Model/Product/Flat/Indexer.php | 16 +-- .../core/Mage/Catalog/Model/Product/Image.php | 4 +- .../core/Mage/Catalog/Model/Product/Link.php | 2 +- .../Mage/Catalog/Model/Product/Option.php | 2 +- .../Catalog/Model/Product/Option/Value.php | 2 +- .../core/Mage/Catalog/Model/Product/Type.php | 6 +- .../Model/Product/Type/Configurable.php | 4 +- .../Product/Type/Configurable/Attribute.php | 4 +- .../Model/Product/Type/Configurable/Price.php | 2 +- .../Model/Product/Type/Grouped/Price.php | 2 +- .../Mage/Catalog/Model/Product/Type/Price.php | 12 +- .../core/Mage/Catalog/Model/Product/Url.php | 2 +- .../Model/Resource/Category/Collection.php | 2 +- .../Catalog/Model/Resource/Category/Flat.php | 8 +- .../Resource/Category/Flat/Collection.php | 2 +- .../Resource/Category/Indexer/Product.php | 2 +- .../Catalog/Model/Resource/Category/Tree.php | 6 +- .../Model/Resource/Collection/Abstract.php | 2 +- .../Model/Resource/Layer/Filter/Price.php | 2 +- .../Mage/Catalog/Model/Resource/Product.php | 4 +- .../Model/Resource/Product/Collection.php | 22 ++-- .../Product/Compare/Item/Collection.php | 2 +- .../Model/Resource/Product/Indexer/Eav.php | 2 +- .../Resource/Product/Indexer/Eav/Decimal.php | 2 +- .../Resource/Product/Indexer/Eav/Source.php | 4 +- .../Model/Resource/Product/Indexer/Price.php | 2 +- .../Product/Indexer/Price/Default.php | 2 +- app/code/core/Mage/Catalog/Model/Url.php | 10 +- .../Adminhtml/Form/Field/Customergroup.php | 2 +- .../Mage/CatalogInventory/Model/Observer.php | 16 +-- .../Model/Resource/Indexer/Stock.php | 2 +- .../Model/Resource/Indexer/Stock/Default.php | 2 +- .../CatalogInventory/Model/Stock/Item.php | 4 +- .../CatalogInventory/Model/Stock/Status.php | 8 +- app/code/core/Mage/CatalogRule/Model/Rule.php | 4 +- .../CatalogSearch/Block/Advanced/Form.php | 6 +- .../core/Mage/CatalogSearch/Block/Result.php | 2 +- .../Mage/CatalogSearch/Model/Advanced.php | 4 +- .../CatalogSearch/Model/Indexer/Fulltext.php | 2 +- .../core/Mage/CatalogSearch/Model/Query.php | 4 +- .../CatalogSearch/Model/Resource/Fulltext.php | 4 +- .../core/Mage/Centinel/Model/State/Jcb.php | 2 +- .../Mage/Centinel/Model/State/Mastercard.php | 2 +- .../core/Mage/Centinel/Model/State/Visa.php | 2 +- app/code/core/Mage/Checkout/Block/Cart.php | 2 +- .../Mage/Checkout/Block/Cart/Abstract.php | 2 +- .../Mage/Checkout/Block/Cart/Crosssell.php | 4 +- .../Checkout/Block/Cart/Item/Renderer.php | 2 +- .../core/Mage/Checkout/Block/Cart/Sidebar.php | 2 +- .../core/Mage/Checkout/Block/Cart/Totals.php | 4 +- .../Block/Multishipping/Address/Select.php | 18 +-- .../Block/Multishipping/Addresses.php | 2 +- .../Checkout/Block/Multishipping/Billing.php | 2 +- .../Checkout/Block/Multishipping/Overview.php | 2 +- .../Checkout/Block/Multishipping/Shipping.php | 2 +- .../Mage/Checkout/Block/Onepage/Abstract.php | 2 +- .../Mage/Checkout/Block/Onepage/Billing.php | 2 +- .../Mage/Checkout/Block/Onepage/Shipping.php | 2 +- app/code/core/Mage/Checkout/Helper/Data.php | 2 +- app/code/core/Mage/Checkout/Model/Cart.php | 6 +- app/code/core/Mage/Checkout/Model/Session.php | 6 +- .../Mage/Checkout/Model/Type/Abstract.php | 8 +- .../controllers/OnepageController.php | 2 +- app/code/core/Mage/Cms/Model/Page.php | 2 +- .../core/Mage/Cms/Model/Resource/Block.php | 2 +- .../core/Mage/Cms/Model/Resource/Page.php | 2 +- app/code/core/Mage/Core/Block/Abstract.php | 8 +- app/code/core/Mage/Core/Block/Template.php | 4 +- .../core/Mage/Core/Block/Template/Zend.php | 2 +- .../Mage/Core/Controller/Request/Http.php | 4 +- .../Mage/Core/Controller/Varien/Action.php | 2 +- .../Mage/Core/Controller/Varien/Front.php | 2 +- .../Core/Controller/Varien/Router/Base.php | 4 +- app/code/core/Mage/Core/Helper/Data.php | 6 +- .../core/Mage/Core/Helper/File/Storage.php | 2 +- .../Core/Helper/File/Storage/Database.php | 4 +- app/code/core/Mage/Core/Helper/Http.php | 2 +- app/code/core/Mage/Core/Helper/Js.php | 2 +- app/code/core/Mage/Core/Helper/String.php | 2 +- app/code/core/Mage/Core/Helper/Url.php | 2 +- app/code/core/Mage/Core/Model/Abstract.php | 2 +- app/code/core/Mage/Core/Model/App.php | 8 +- app/code/core/Mage/Core/Model/App/Area.php | 2 +- .../core/Mage/Core/Model/App/Emulation.php | 2 +- app/code/core/Mage/Core/Model/Cache.php | 2 +- app/code/core/Mage/Core/Model/Config.php | 4 +- app/code/core/Mage/Core/Model/Cookie.php | 22 ++-- app/code/core/Mage/Core/Model/Date.php | 8 +- app/code/core/Mage/Core/Model/Design.php | 2 +- .../core/Mage/Core/Model/Design/Package.php | 2 +- .../core/Mage/Core/Model/Email/Template.php | 2 +- .../core/Mage/Core/Model/File/Storage.php | 2 +- .../Mage/Core/Model/File/Storage/Database.php | 2 +- .../Mage/Core/Model/File/Storage/File.php | 2 +- .../core/Mage/Core/Model/File/Uploader.php | 2 +- app/code/core/Mage/Core/Model/Flag.php | 4 +- app/code/core/Mage/Core/Model/Locale.php | 4 +- .../Mage/Core/Model/Resource/Db/Abstract.php | 10 +- .../core/Mage/Core/Model/Resource/Design.php | 6 +- .../Core/Model/Resource/Design/Collection.php | 2 +- .../Core/Model/Resource/Email/Template.php | 2 +- .../Core/Model/Resource/File/Storage/File.php | 2 +- .../Core/Model/Resource/Helper/Mysql4.php | 2 +- .../Mage/Core/Model/Resource/Resource.php | 6 +- .../core/Mage/Core/Model/Resource/Setup.php | 2 +- .../Core/Model/Resource/Setup/Migration.php | 2 +- .../Mage/Core/Model/Resource/Translate.php | 4 +- .../Core/Model/Resource/Translate/String.php | 8 +- .../core/Mage/Core/Model/Session/Abstract.php | 2 +- .../Core/Model/Source/Urlrewrite/Options.php | 2 +- .../Core/Model/Source/Urlrewrite/Types.php | 2 +- app/code/core/Mage/Core/Model/Store.php | 30 ++--- app/code/core/Mage/Core/Model/Store/Group.php | 14 +- .../core/Mage/Core/Model/System/Store.php | 2 +- .../core/Mage/Core/Model/Theme/Service.php | 4 +- app/code/core/Mage/Core/Model/Translate.php | 10 +- .../core/Mage/Core/Model/Translate/Inline.php | 4 +- app/code/core/Mage/Core/Model/Url.php | 8 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 6 +- app/code/core/Mage/Core/Model/Website.php | 22 ++-- .../Mage/Customer/Block/Account/Dashboard.php | 2 +- .../Block/Account/Dashboard/Newsletter.php | 2 +- .../core/Mage/Customer/Block/Address/Book.php | 2 +- .../Block/Address/Renderer/Default.php | 2 +- .../core/Mage/Customer/Block/Form/Login.php | 2 +- .../Mage/Customer/Block/Form/Register.php | 6 +- .../core/Mage/Customer/Helper/Address.php | 2 +- app/code/core/Mage/Customer/Helper/Data.php | 2 +- app/code/core/Mage/Customer/Model/Address.php | 2 +- .../Mage/Customer/Model/Address/Abstract.php | 2 +- .../Mage/Customer/Model/Address/Config.php | 2 +- .../core/Mage/Customer/Model/Customer.php | 2 +- .../Customer/Attribute/Backend/Billing.php | 6 +- .../Customer/Attribute/Backend/Shipping.php | 8 +- .../core/Mage/Directory/Block/Currency.php | 4 +- app/code/core/Mage/Directory/Block/Data.php | 8 +- app/code/core/Mage/Directory/Helper/Data.php | 2 +- .../core/Mage/Directory/Model/Currency.php | 2 +- app/code/core/Mage/Directory/Model/Region.php | 2 +- .../Product/Edit/Tab/Downloadable/Links.php | 4 +- .../Product/Edit/Tab/Downloadable/Samples.php | 2 +- .../Mage/Downloadable/Helper/Download.php | 2 +- .../Mage/Downloadable/Model/Product/Price.php | 2 +- .../Mage/Downloadable/Model/Product/Type.php | 4 +- .../Attribute/Edit/Options/Abstract.php | 4 +- app/code/core/Mage/Eav/Model/Attribute.php | 4 +- .../Eav/Model/Attribute/Data/Abstract.php | 4 +- .../core/Mage/Eav/Model/Entity/Abstract.php | 2 +- .../Entity/Attribute/Backend/Datetime.php | 2 +- .../Entity/Attribute/Backend/Time/Created.php | 2 +- .../Model/Entity/Attribute/Source/Boolean.php | 2 +- app/code/core/Mage/Eav/Model/Form.php | 16 +-- .../Eav/Model/Resource/Entity/Attribute.php | 2 +- .../Entity/Attribute/Option/Collection.php | 2 +- .../Resource/Form/Fieldset/Collection.php | 4 +- .../Mage/Eav/Model/Resource/Form/Type.php | 2 +- .../Mage/GiftMessage/Block/Message/Inline.php | 2 +- .../core/Mage/GiftMessage/Helper/Message.php | 2 +- .../core/Mage/GoogleOptimizer/Block/Code.php | 2 +- .../core/Mage/GoogleOptimizer/Model/Code.php | 6 +- .../Model/Attribute/Default.php | 6 +- .../Attribute/SalePriceEffectiveDate.php | 4 +- .../core/Mage/GoogleShopping/Model/Config.php | 2 +- .../core/Mage/GoogleShopping/Model/Item.php | 4 +- .../core/Mage/GoogleShopping/Model/Type.php | 2 +- .../Model/Import/Entity/Product.php | 6 +- .../Import/Entity/Product/Type/Grouped.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 2 +- app/code/core/Mage/Index/Model/Process.php | 2 +- .../core/Mage/Index/Model/Resource/Event.php | 2 +- app/code/core/Mage/Install/Block/Admin.php | 2 +- app/code/core/Mage/Install/Block/Config.php | 2 +- app/code/core/Mage/Install/Block/Db/Main.php | 2 +- app/code/core/Mage/Install/Block/Db/Type.php | 2 +- app/code/core/Mage/Install/Block/End.php | 2 +- app/code/core/Mage/Install/Block/Locale.php | 4 +- .../core/Mage/Install/Model/Installer.php | 4 +- .../Mage/Install/Model/Installer/Abstract.php | 2 +- .../Mage/Install/Model/Installer/Console.php | 2 +- .../Mage/Log/Model/Resource/Aggregation.php | 6 +- .../core/Mage/Log/Model/Visitor/Online.php | 2 +- app/code/core/Mage/Media/Model/File/Image.php | 2 +- app/code/core/Mage/Media/Model/Image.php | 4 +- .../core/Mage/Newsletter/Model/Problem.php | 4 +- app/code/core/Mage/Newsletter/Model/Queue.php | 8 +- .../Newsletter/Model/Resource/Template.php | 2 +- .../core/Mage/Newsletter/Model/Subscriber.php | 4 +- app/code/core/Mage/Oauth/Model/Server.php | 2 +- .../core/Mage/Page/Block/Html/Breadcrumbs.php | 2 +- .../core/Mage/Page/Block/Html/Topmenu.php | 2 +- app/code/core/Mage/Page/Block/Switch.php | 2 +- .../core/Mage/Page/Block/Template/Links.php | 4 +- .../core/Mage/Paygate/Model/Authorizenet.php | 6 +- .../Mage/Payment/Block/Form/Banktransfer.php | 2 +- .../Payment/Block/Form/Cashondelivery.php | 2 +- app/code/core/Mage/Payment/Block/Form/Cc.php | 6 +- .../core/Mage/Payment/Block/Info/Checkmo.php | 4 +- .../Mage/Payment/Block/Info/Instructions.php | 2 +- .../Model/Billing/AgreementAbstract.php | 4 +- app/code/core/Mage/Payment/Model/Info.php | 2 +- .../core/Mage/Payment/Model/Method/Cc.php | 2 +- .../Paypal/Block/Express/Review/Billing.php | 2 +- .../Paypal/Block/Express/Review/Shipping.php | 2 +- .../Mage/Paypal/Model/Express/Checkout.php | 4 +- app/code/core/Mage/Paypal/Model/Hostedpro.php | 2 +- .../core/Mage/Paypal/Model/Payflowpro.php | 2 +- .../core/Mage/Persistent/Helper/Session.php | 6 +- .../Persistent/Model/Persistent/Config.php | 2 +- .../core/Mage/Persistent/Model/Session.php | 4 +- app/code/core/Mage/Poll/Model/Poll.php | 4 +- .../ProductAlert/Block/Email/Abstract.php | 2 +- .../Mage/ProductAlert/Block/Product/View.php | 2 +- .../core/Mage/ProductAlert/Model/Email.php | 6 +- .../core/Mage/ProductAlert/Model/Observer.php | 2 +- .../ProductAlert/Model/Resource/Price.php | 4 +- .../Model/Resource/Price/Collection.php | 2 +- .../ProductAlert/Model/Resource/Stock.php | 4 +- .../Model/Resource/Stock/Collection.php | 2 +- .../Mage/Reports/Block/Adminhtml/Grid.php | 2 +- .../Mage/Reports/Block/Product/Abstract.php | 6 +- app/code/core/Mage/Reports/Model/Event.php | 2 +- .../Mage/Reports/Model/Event/Observer.php | 2 +- .../Model/Resource/Order/Collection.php | 2 +- .../Model/Resource/Report/Abstract.php | 2 +- .../Resource/Report/Collection/Abstract.php | 4 +- .../core/Mage/Review/Helper/Action/Pager.php | 2 +- .../Resource/Review/Product/Collection.php | 4 +- app/code/core/Mage/Rss/Block/Wishlist.php | 4 +- .../Mage/Rss/controllers/IndexController.php | 4 +- app/code/core/Mage/Rule/Model/Abstract.php | 4 +- .../Mage/Rule/Model/Condition/Abstract.php | 6 +- .../Mage/Rule/Model/Condition/Combine.php | 2 +- .../Rule/Model/Condition/Product/Abstract.php | 2 +- .../Sales/Block/Billing/Agreement/View.php | 4 +- .../Mage/Sales/Block/Billing/Agreements.php | 2 +- .../core/Mage/Sales/Block/Items/Abstract.php | 2 +- .../core/Mage/Sales/Block/Order/Comments.php | 2 +- .../Mage/Sales/Block/Widget/Guest/Form.php | 2 +- app/code/core/Mage/Sales/Model/Order.php | 22 ++-- .../Mage/Sales/Model/Order/Creditmemo.php | 12 +- .../Sales/Model/Order/Creditmemo/Item.php | 2 +- .../core/Mage/Sales/Model/Order/Invoice.php | 12 +- .../Mage/Sales/Model/Order/Invoice/Item.php | 2 +- app/code/core/Mage/Sales/Model/Order/Item.php | 10 +- .../core/Mage/Sales/Model/Order/Payment.php | 4 +- .../Sales/Model/Order/Payment/Transaction.php | 2 +- .../Mage/Sales/Model/Order/Pdf/Abstract.php | 2 +- .../Sales/Model/Order/Pdf/Items/Abstract.php | 10 +- .../core/Mage/Sales/Model/Order/Shipment.php | 2 +- .../Mage/Sales/Model/Order/Shipment/Item.php | 2 +- .../Mage/Sales/Model/Order/Status/History.php | 2 +- .../Method/Billing/AgreementAbstract.php | 2 +- app/code/core/Mage/Sales/Model/Quote.php | 24 ++-- .../core/Mage/Sales/Model/Quote/Address.php | 4 +- app/code/core/Mage/Sales/Model/Quote/Item.php | 2 +- .../Mage/Sales/Model/Quote/Item/Abstract.php | 8 +- .../Order/Attribute/Backend/Billing.php | 2 +- .../Order/Attribute/Backend/Shipping.php | 2 +- .../Sales/Model/Resource/Order/Collection.php | 2 +- .../Resource/Report/Collection/Abstract.php | 2 +- .../Model/Resource/Rule/Collection.php | 2 +- .../Model/Resource/Catalog/Product.php | 2 +- .../Tag/Block/Adminhtml/Edit/Accordion.php | 2 +- .../Tag/Block/Adminhtml/Edit/Assigned.php | 2 +- .../core/Mage/Tag/Block/Customer/View.php | 4 +- app/code/core/Mage/Tag/Block/Product/List.php | 2 +- .../core/Mage/Tag/Block/Product/Result.php | 2 +- app/code/core/Mage/Tag/Model/Tag.php | 2 +- app/code/core/Mage/Tag/Model/Tag/Relation.php | 4 +- app/code/core/Mage/Tax/Helper/Data.php | 6 +- app/code/core/Mage/Tax/Model/Calculation.php | 6 +- .../core/Mage/Tax/Model/Calculation/Rate.php | 6 +- .../core/Mage/Tax/Model/Calculation/Rule.php | 2 +- .../Mage/Tax/Model/Class/Source/Product.php | 2 +- app/code/core/Mage/Tax/Model/Observer.php | 2 +- .../Mage/Tax/Model/Resource/Calculation.php | 2 +- .../Tax/Model/Sales/Total/Quote/Subtotal.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Fedex.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Ups.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Usps.php | 2 +- .../controllers/Adminhtml/UserController.php | 2 +- .../Controller/Dispatcher/Soap/Handler.php | 2 +- .../core/Mage/Webapi/Controller/Front.php | 4 +- .../Request/Rest/Interpreter/Xml.php | 2 +- app/code/core/Mage/Webapi/Helper/Data.php | 2 +- .../Webapi/Model/Authorization/Config.php | 2 +- .../Model/Config/Reader/TypeProcessor.php | 2 +- .../Mage/Weee/Block/Renderer/Weee/Tax.php | 2 +- app/code/core/Mage/Weee/Helper/Data.php | 2 +- app/code/core/Mage/Weee/Model/Tax.php | 2 +- .../Mage/Widget/Model/Widget/Instance.php | 2 +- .../core/Mage/Wishlist/Block/Abstract.php | 2 +- .../Mage/Wishlist/Block/Customer/Sharing.php | 2 +- .../Mage/Wishlist/Block/Customer/Sidebar.php | 2 +- .../Mage/Wishlist/Block/Share/Wishlist.php | 2 +- app/code/core/Mage/Wishlist/Helper/Data.php | 4 +- app/code/core/Mage/Wishlist/Model/Item.php | 6 +- .../Model/Resource/Item/Collection.php | 2 +- .../core/Mage/Wishlist/Model/Wishlist.php | 6 +- .../Wishlist/controllers/IndexController.php | 2 +- .../Mage/Core/Block/AbstractTest.php | 2 +- .../Varien/Db/Adapter/Pdo/MysqlTest.php | 2 +- .../Import/Entity/CustomerCompositeTest.php | 4 +- downloader/Maged/Controller.php | 10 +- downloader/Maged/Model/Connect.php | 4 +- downloader/lib/Mage/Backup/Snapshot.php | 2 +- .../lib/Mage/Connect/Channel/Generator.php | 2 +- downloader/lib/Mage/Connect/Channel/VO.php | 2 +- downloader/lib/Mage/Connect/Command.php | 4 +- downloader/lib/Mage/Connect/Package.php | 8 +- .../lib/Mage/Connect/Package/Reader.php | 2 +- .../lib/Mage/Connect/Package/Target.php | 8 +- .../lib/Mage/Connect/Package/Writer.php | 8 +- downloader/lib/Mage/Connect/Packager.php | 4 +- downloader/lib/Mage/Connect/Rest.php | 4 +- downloader/lib/Mage/HTTP/Client/Curl.php | 4 +- downloader/lib/Mage/HTTP/Client/Socket.php | 4 +- lib/Mage/Backup/Snapshot.php | 2 +- lib/Mage/Connect/Channel/Generator.php | 2 +- lib/Mage/Connect/Channel/VO.php | 14 +- lib/Mage/Connect/Command.php | 24 ++-- lib/Mage/Connect/Package.php | 8 +- lib/Mage/Connect/Package/Reader.php | 2 +- lib/Mage/Connect/Package/Target.php | 8 +- lib/Mage/Connect/Package/Writer.php | 8 +- lib/Mage/Connect/Packager.php | 4 +- lib/Mage/Connect/Rest.php | 20 +-- lib/Mage/HTTP/Client/Curl.php | 10 +- lib/Mage/HTTP/Client/Socket.php | 120 +++++++++--------- lib/Magento/Acl/Config/Reader.php | 2 +- lib/Magento/Config/XmlAbstract.php | 4 +- lib/Magento/Di/Zend.php | 2 +- lib/Magento/Filesystem/Adapter/Zlib.php | 2 +- lib/Magento/Validator/ValidatorAbstract.php | 2 +- lib/PEAR/HTTP/Request.php | 4 +- lib/PEAR/Net/Socket.php | 4 +- lib/PEAR/Net/URL.php | 2 +- lib/PEAR/PEAR.php | 6 +- lib/PEAR/PEAR/PEAR.php | 6 +- lib/PEAR/SOAP/Base.php | 4 +- lib/PEAR/XML/Serializer.php | 112 ++++++++-------- lib/Varien/Convert/Container/Abstract.php | 6 +- lib/Varien/Data/Collection.php | 2 +- lib/Varien/Data/Collection/Db.php | 10 +- lib/Varien/Data/Form/Element/Abstract.php | 2 +- lib/Varien/Data/Form/Element/Hidden.php | 2 +- lib/Varien/Data/Form/Element/Radios.php | 2 +- lib/Varien/Data/Form/Filter/Date.php | 2 +- lib/Varien/Data/Tree/Db.php | 4 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 8 +- lib/Varien/Db/Ddl/Table.php | 2 +- lib/Varien/Debug.php | 4 +- lib/Varien/Http/Adapter/Curl.php | 2 +- lib/Varien/Io/Ftp.php | 4 +- lib/Varien/Io/Sftp.php | 2 +- lib/Varien/Object.php | 8 +- lib/Varien/Object/Cache.php | 2 +- lib/Varien/Pear/Frontend.php | 2 +- lib/Varien/Pear/Package.php | 2 +- lib/Varien/Simplexml/Config.php | 8 +- lib/Varien/Simplexml/Element.php | 12 +- lib/googlecheckout/googlerequest.php | 2 +- pub/errors/processor.php | 2 +- 496 files changed, 1062 insertions(+), 1062 deletions(-) diff --git a/app/Mage.php b/app/Mage.php index 6629187adfc32..a34e8cf23dd63 100644 --- a/app/Mage.php +++ b/app/Mage.php @@ -298,7 +298,7 @@ public static function objects($key = null) if (!self::$_objects) { self::$_objects = new Varien_Object_Cache; } - if (is_null($key)) { + if ($key === null) { return self::$_objects; } else { return self::$_objects->load($key); @@ -730,7 +730,7 @@ public static function isInstalled() */ public static function log($message, $level = null, $file = 'system.log', $forceLog = false) { - $level = is_null($level) ? Zend_Log::DEBUG : $level; + $level = $level === null ? Zend_Log::DEBUG : $level; if (empty($file) || $file == 'system.log') { $file = 'system.log'; $key = Mage_Core_Model_Logger::LOGGER_SYSTEM; @@ -865,7 +865,7 @@ public static function getScriptSystemUrl($folder, $exitIfNot = false) } } - if (is_null($baseUrl)) { + if ($baseUrl === null) { $errorMessage = "Unable detect system directory: $folder"; if ($exitIfNot) { // exit because of infinity loop diff --git a/app/code/core/Mage/AdminNotification/Helper/Data.php b/app/code/core/Mage/AdminNotification/Helper/Data.php index 1f8a8f1273f8f..91c045f84a7b1 100644 --- a/app/code/core/Mage/AdminNotification/Helper/Data.php +++ b/app/code/core/Mage/AdminNotification/Helper/Data.php @@ -71,7 +71,7 @@ class Mage_AdminNotification_Helper_Data extends Mage_Core_Helper_Abstract */ public function getLatestNotice() { - if (is_null($this->_latestNotice)) { + if ($this->_latestNotice === null) { $this->_latestNotice = Mage::getModel('Mage_AdminNotification_Model_Inbox')->loadLatestNotice(); } return $this->_latestNotice; @@ -85,7 +85,7 @@ public function getLatestNotice() */ public function getUnreadNoticeCount($severity) { - if (is_null($this->_unreadNoticeCounts)) { + if ($this->_unreadNoticeCounts === null) { $this->_unreadNoticeCounts = Mage::getModel('Mage_AdminNotification_Model_Inbox')->getNoticeStatus(); } return isset($this->_unreadNoticeCounts[$severity]) ? $this->_unreadNoticeCounts[$severity] : 0; @@ -99,7 +99,7 @@ public function getUnreadNoticeCount($severity) */ public function getPopupObjectUrl($withExt = false) { - if (is_null($this->_popupUrl)) { + if ($this->_popupUrl === null) { $sheme = Mage::app()->getFrontController()->getRequest()->isSecure() ? 'https://' : 'http://'; diff --git a/app/code/core/Mage/AdminNotification/Model/Feed.php b/app/code/core/Mage/AdminNotification/Model/Feed.php index 309bcb51a2365..c7034c7a4514c 100644 --- a/app/code/core/Mage/AdminNotification/Model/Feed.php +++ b/app/code/core/Mage/AdminNotification/Model/Feed.php @@ -60,7 +60,7 @@ protected function _construct() */ public function getFeedUrl() { - if (is_null($this->_feedUrl)) { + if ($this->_feedUrl === null) { $this->_feedUrl = (Mage::getStoreConfigFlag(self::XML_USE_HTTPS_PATH) ? 'https://' : 'http://') . Mage::getStoreConfig(self::XML_FEED_URL_PATH); } diff --git a/app/code/core/Mage/AdminNotification/Model/Survey.php b/app/code/core/Mage/AdminNotification/Model/Survey.php index bde1aa4015216..397b9fe298ffe 100644 --- a/app/code/core/Mage/AdminNotification/Model/Survey.php +++ b/app/code/core/Mage/AdminNotification/Model/Survey.php @@ -107,7 +107,7 @@ public static function isSurveyViewed() public static function saveSurveyViewed($viewed) { $flagData = self::_getFlagModel()->getFlagData(); - if (is_null($flagData)) { + if ($flagData === null) { $flagData = array(); } $flagData = array_merge($flagData, array('survey_viewed' => (bool)$viewed)); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index d7b4fece7b712..e6a2f20f13aa1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -85,7 +85,7 @@ public function getRoot($parentNodeCategory=null, $recursionLevel=3) return $this->getNode($parentNodeCategory, $recursionLevel); } $root = Mage::registry('root'); - if (is_null($root)) { + if ($root === null) { $storeId = (int) $this->getRequest()->getParam('store'); if ($storeId) { @@ -191,7 +191,7 @@ public function getEditUrl() public function getRootIds() { $ids = $this->getData('root_ids'); - if (is_null($ids)) { + if ($ids === null) { $ids = array(); foreach (Mage::app()->getGroups() as $store) { $ids[] = $store->getRootCategoryId(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php index 889033ea90d89..048c8d3e49a5e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/General.php @@ -116,7 +116,7 @@ protected function _getAdditionalElementTypes() protected function _getParentCategoryOptions($node=null, &$options=array()) { - if (is_null($node)) { + if ($node === null) { $node = $this->getRoot(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php index 27752ae7c34da..47db9146d07d0 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/Product.php @@ -151,7 +151,7 @@ public function getGridUrl() protected function _getSelectedProducts() { $products = $this->getRequest()->getPost('selected_products'); - if (is_null($products)) { + if ($products === null) { $products = $this->getCategory()->getProductsPosition(); return array_keys($products); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 78ad8b75d2d06..3395df1d5f63f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php @@ -90,7 +90,7 @@ public function getCategoryCollection() { $storeId = $this->getRequest()->getParam('store', $this->_getDefaultStoreId()); $collection = $this->getData('category_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = Mage::getModel('Mage_Catalog_Model_Category')->getCollection(); /* @var $collection Mage_Catalog_Model_Resource_Category_Collection */ @@ -187,7 +187,7 @@ public function getLoadTreeUrl($expanded=null) { $params = array('_current'=>true, 'id'=>null,'store'=>null); if ( - (is_null($expanded) && Mage::getSingleton('Mage_Backend_Model_Auth_Session')->getIsTreeWasExpanded()) + ($expanded === null && Mage::getSingleton('Mage_Backend_Model_Auth_Session')->getIsTreeWasExpanded()) || $expanded == true) { $params['expand_all'] = true; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php index 51012516f14ed..4e03a9731aba4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Set/Main.php @@ -362,7 +362,7 @@ protected function _getSetId() public function getIsCurrentSetDefault() { $isDefault = $this->getData('is_current_set_default'); - if (is_null($isDefault)) { + if ($isDefault === null) { $defaultSetId = Mage::getModel('Mage_Eav_Model_Entity_Type') ->load(Mage::registry('entityType')) ->getDefaultAttributeSetId(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php index 35a92925f24e8..879fc3be2d24e 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Configurable.php @@ -44,7 +44,7 @@ public function getProduct() $this->setData('product', Mage::registry('product')); } $product = $this->getData('product'); - if (is_null($product->getTypeInstance()->getStoreFilter($product))) { + if ($product->getTypeInstance()->getStoreFilter($product) === null) { $product->getTypeInstance()->setStoreFilter(Mage::app()->getStore($product->getStoreId()), $product); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php index efccb90624af1..3194e2e87c118 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Grouped.php @@ -61,7 +61,7 @@ public function getProduct() $this->setData('product', Mage::registry('product')); } $product = $this->getData('product'); - if (is_null($product->getTypeInstance()->getStoreFilter($product))) { + if ( $product->getTypeInstance()->getStoreFilter($product) === null) { $product->getTypeInstance()->setStoreFilter(Mage::app()->getStore($product->getStoreId()), $product); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php index 4656bb03f77fd..40ddc253199fd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Composite/Fieldset/Options.php @@ -60,7 +60,7 @@ public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) $renderer = $this->getOptionRender( $this->getGroupOfOption($option->getType()) ); - if (is_null($renderer['renderer'])) { + if ($renderer['renderer'] === null) { $renderer['renderer'] = $this->getLayout()->createBlock($renderer['block']) ->setTemplate($renderer['template']) ->setSkipJsReloadPrice(1); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php index 1b873fe6f2c04..262e95ee603bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes/Create.php @@ -47,7 +47,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes_Create extends Ma */ public function getConfig() { - if (is_null($this->_config)) { + if ($this->_config === null) { $this->_config = new Varien_Object(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php index 586e53d870c71..2c4ae8a8af72b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Options/Option.php @@ -237,8 +237,8 @@ public function getOptionValues() if ($this->getProduct()->getStoreId() != '0') { $value['checkboxScopeTitle'] = $this->getCheckboxScopeHtml($option->getOptionId(), 'title', - is_null($option->getStoreTitle())); - $value['scopeTitleDisabled'] = is_null($option->getStoreTitle())?'disabled':null; + $option->getStoreTitle() === null); + $value['scopeTitleDisabled'] = $option->getStoreTitle() === null?'disabled':null; } if ($option->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT) { @@ -263,15 +263,15 @@ public function getOptionValues() if ($this->getProduct()->getStoreId() != '0') { $value['optionValues'][$i]['checkboxScopeTitle'] = $this->getCheckboxScopeHtml( - $_value->getOptionId(), 'title', is_null($_value->getStoreTitle()), + $_value->getOptionId(), 'title', $_value->getStoreTitle() === null, $_value->getOptionTypeId()); - $value['optionValues'][$i]['scopeTitleDisabled'] = is_null($_value->getStoreTitle()) + $value['optionValues'][$i]['scopeTitleDisabled'] = $_value->getStoreTitle() === null ? 'disabled' : null; if ($scope == Mage_Core_Model_Store::PRICE_SCOPE_WEBSITE) { $value['optionValues'][$i]['checkboxScopePrice'] = $this->getCheckboxScopeHtml( - $_value->getOptionId(), 'price', is_null($_value->getstorePrice()), + $_value->getOptionId(), 'price', $_value->getstorePrice() === null, $_value->getOptionTypeId()); - $value['optionValues'][$i]['scopePriceDisabled'] = is_null($_value->getStorePrice()) + $value['optionValues'][$i]['scopePriceDisabled'] = $_value->getStorePrice() === null ? 'disabled' : null; } } @@ -289,8 +289,8 @@ public function getOptionValues() if ($this->getProduct()->getStoreId() != '0' && $scope == Mage_Core_Model_Store::PRICE_SCOPE_WEBSITE) { $value['checkboxScopePrice'] = $this->getCheckboxScopeHtml($option->getOptionId(), - 'price', is_null($option->getStorePrice())); - $value['scopePriceDisabled'] = is_null($option->getStorePrice())?'disabled':null; + 'price', $option->getStorePrice() === null); + $value['scopePriceDisabled'] = $option->getStorePrice() === null?'disabled':null; } } $values[] = new Varien_Object($value); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php index 2cdb49d5c1a24..d2f08d756accb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php @@ -182,7 +182,7 @@ public function getProduct() */ public function getAttributeTabBlock() { - if (is_null(Mage::helper('Mage_Adminhtml_Helper_Catalog')->getAttributeTabBlock())) { + if (Mage::helper('Mage_Adminhtml_Helper_Catalog')->getAttributeTabBlock() === null) { return $this->_attributeTabBlock; } return Mage::helper('Mage_Adminhtml_Helper_Catalog')->getAttributeTabBlock(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php index 04859509b5aec..663c122509811 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/BaseImage.php @@ -88,7 +88,7 @@ public function __construct(array $attributes = array()) public function getDefaultHtml() { $html = $this->getData('default_html'); - if (is_null($html)) { + if ($html === null) { $html = ($this->getNoSpan() === true) ? '' : '' . "\n"; $html .= $this->getLabelHtml(); $html .= $this->getElementHtml(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php index 9b53991f22376..a45233af8f128 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Enabled.php @@ -40,7 +40,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Msrp_Enabled extends Vari */ public function getElementHtml() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { $this->setValue(Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type_Enabled::MSRP_ENABLE_USE_CONFIG); } return parent::getElementHtml(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php index b8aa0952c71d3..fdca4ddb3a4bb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Msrp/Price.php @@ -40,7 +40,7 @@ class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Msrp_Price extends Varien */ public function getElementHtml() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { $this->setValue(Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type_Price::TYPE_USE_CONFIG); } return parent::getElementHtml(); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php index 566476f4c03cf..fc071ae6b6993 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Newsletter/Grid/Filter/Status.php @@ -61,7 +61,7 @@ protected function _getOptions() public function getCondition() { - if(is_null($this->getValue())) { + if($this->getValue() === null) { return null; } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php index e837701b64d83..8bccd2bd581e2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Form/Element/File.php @@ -202,7 +202,7 @@ public function getEscapedValue($index = null) return false; } $value = $this->getValue(); - if (is_array($value) && is_null($index)) { + if (is_array($value) && $index === null) { $index = 'value'; } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php index 3510ecbe1a480..e010ceb699576 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Sales/Order/Address/Form/Renderer/Vat.php @@ -50,7 +50,7 @@ class Mage_Adminhtml_Block_Customer_Sales_Order_Address_Form_Renderer_Vat */ public function getValidateButton() { - if (is_null($this->_validateButton)) { + if ($this->_validateButton === null) { /** @var $form Varien_Data_Form */ $form = $this->_element->getForm(); diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php index 24fa987116814..f7e5fa1d434ff 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Bar.php @@ -93,7 +93,7 @@ public function setCurrency($currency) */ public function getCurrency() { - if (is_null($this->_currentCurrencyCode)) { + if ($this->_currentCurrencyCode === null) { if ($this->getRequest()->getParam('store')) { $this->_currentCurrencyCode = Mage::app()->getStore($this->getRequest()->getParam('store'))->getBaseCurrency(); } else if ($this->getRequest()->getParam('website')){ diff --git a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php index e4f37691d89fe..d62733541018c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php +++ b/app/code/core/Mage/Adminhtml/Block/Media/Uploader.php @@ -103,7 +103,7 @@ public function getConfigJson() */ public function getConfig() { - if(is_null($this->_config)) { + if($this->_config === null) { $this->_config = new Varien_Object(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php index 2b05f371e8c50..b82c160732d89 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber.php @@ -64,7 +64,7 @@ protected function _beforeToHtml() */ public function getQueueCollection() { - if(is_null($this->_queueCollection)) { + if($this->_queueCollection === null) { /** @var $this->_queueCollection Mage_Newsletter_Model_Resource_Queue_Collection */ $this->_queueCollection = Mage::getResourceSingleton('Mage_Newsletter_Model_Resource_Queue_Collection') ->addTemplateInfo() diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php index c9d80f9b9ca85..0f67742c4c814 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Subscriber/Grid/Filter/Website.php @@ -45,7 +45,7 @@ protected function _getOptions() public function getCollection() { - if(is_null($this->_websiteCollection)) { + if($this->_websiteCollection === null) { $this->_websiteCollection = Mage::getResourceModel('Mage_Core_Model_Resource_Website_Collection') ->load(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php index 700469a165a62..58685e2110410 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php @@ -105,7 +105,7 @@ public function canShow() return false; } - if (is_null($this->_available)) { + if ($this->_available === null) { $this->_available = $this->isShow(); } return $this->_available; @@ -139,7 +139,7 @@ public function getLastNotice() */ public function getSeverityIconsUrl() { - if (is_null($this->_severityIconsUrl)) { + if ($this->_severityIconsUrl === null) { $this->_severityIconsUrl = (Mage::app()->getFrontController()->getRequest()->isSecure() ? 'https://' : 'http://') . sprintf(Mage::getStoreConfig(self::XML_SEVERITY_ICONS_URL_PATH), Mage::getVersion(), diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php index 17315394545b7..d93e502e74c37 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php @@ -51,7 +51,7 @@ public function getResourceCollectionName() public function getCollection() { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $this->setCollection(Mage::getModel('Mage_Reports_Model_Grouped_Collection')); } return $this->_collection; @@ -59,7 +59,7 @@ public function getCollection() protected function _getAggregatedColumns() { - if (is_null($this->_aggregatedColumns)) { + if ($this->_aggregatedColumns === null) { foreach ($this->getColumns() as $column) { if (!is_array($this->_aggregatedColumns)) { $this->_aggregatedColumns = array(); @@ -255,7 +255,7 @@ public function setStoreIds($storeIds) public function getCurrentCurrencyCode() { - if (is_null($this->_currentCurrencyCode)) { + if ($this->_currentCurrencyCode === null) { $this->_currentCurrencyCode = (count($this->_storeIds) > 0) ? Mage::app()->getStore(array_shift($this->_storeIds))->getBaseCurrencyCode() : Mage::app()->getStore()->getBaseCurrencyCode(); diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php index 34636da741e3a..36938a8a27c2f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Shopcart.php @@ -62,7 +62,7 @@ public function setStoreIds($storeIds) */ public function getCurrentCurrencyCode() { - if (is_null($this->_currentCurrencyCode)) { + if ($this->_currentCurrencyCode === null) { reset($this->_storeIds); $this->_currentCurrencyCode = (count($this->_storeIds) > 0) ? Mage::app()->getStore(current($this->_storeIds))->getBaseCurrencyCode() diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php index 151e3192b1233..e0200c0addf70 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php @@ -44,7 +44,7 @@ protected function _getFormat() { $format = $this->getColumn()->getFormat(); if (!$format) { - if (is_null(self::$_format)) { + if (self::$_format === null) { try { $localeCode = Mage::app()->getLocale()->getLocaleCode(); $localeData = new Zend_Locale_Data; diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php index 07eabf3ee4bd7..ea02ac28ac9cf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php @@ -58,7 +58,7 @@ protected function _prepareForm() if ($customer->getId()) { $customerText = Mage::helper('Mage_Review_Helper_Data')->__('%2$s %3$s (%4$s)', $this->getUrl('*/customer/edit', array('id' => $customer->getId(), 'active_tab'=>'review')), $this->escapeHtml($customer->getFirstname()), $this->escapeHtml($customer->getLastname()), $this->escapeHtml($customer->getEmail())); } else { - if (is_null($review->getCustomerId())) { + if ($review->getCustomerId() === null) { $customerText = Mage::helper('Mage_Review_Helper_Data')->__('Guest'); } elseif ($review->getCustomerId() == 0) { $customerText = Mage::helper('Mage_Review_Helper_Data')->__('Administrator'); diff --git a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php index 4f6889e57b10f..3c5260b5996c6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php @@ -37,7 +37,7 @@ class Mage_Adminhtml_Block_Review_Grid_Renderer_Type extends Mage_Adminhtml_Bloc public function render(Varien_Object $row) { - if (is_null($row->getCustomerId())) { + if ($row->getCustomerId() === null) { if ($row->getStoreId() == Mage_Core_Model_App::ADMIN_STORE_ID) { return Mage::helper('Mage_Review_Helper_Data')->__('Administrator'); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php index 67d9c3f8e2c7a..24bcd90271e8b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php @@ -122,7 +122,7 @@ public function getItemRenderer($type) if (!isset($this->_itemRenders[$type])) { $type = 'default'; } - if (is_null($this->_itemRenders[$type]['renderer'])) { + if ($this->_itemRenders[$type]['renderer'] === null) { $this->_itemRenders[$type]['renderer'] = $this->getLayout() ->createBlock($this->_itemRenders[$type]['block']) ->setTemplate($this->_itemRenders[$type]['template']); @@ -148,7 +148,7 @@ public function getColumnRenderer($column, $compositePart='') if (!isset($this->_columnRenders[$column])) { return false; } - if (is_null($this->_columnRenders[$column]['renderer'])) { + if ($this->_columnRenders[$column]['renderer'] === null) { $this->_columnRenders[$column]['renderer'] = $this->getLayout() ->createBlock($this->_columnRenders[$column]['block']) ->setTemplate($this->_columnRenders[$column]['template']) @@ -269,7 +269,7 @@ public function getOrder() public function getPriceDataObject() { $obj = $this->getData('price_data_object'); - if (is_null($obj)) { + if ($obj === null) { return $this->getOrder(); } return $obj; @@ -577,7 +577,7 @@ public function canParentReturnToStock($item = null) */ public function canShipPartially($order = null) { - if (is_null($order) || !$order instanceof Mage_Sales_Model_Order) { + if ($order === null || !$order instanceof Mage_Sales_Model_Order) { $order = Mage::registry('current_shipment')->getOrder(); } $value = $order->getCanShipPartially(); @@ -595,7 +595,7 @@ public function canShipPartially($order = null) */ public function canShipPartiallyItem($order = null) { - if (is_null($order) || !$order instanceof Mage_Sales_Model_Order) { + if ($order === null || !$order instanceof Mage_Sales_Model_Order) { $order = Mage::registry('current_shipment')->getOrder(); } $value = $order->getCanShipPartiallyItem(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php index 76effba883e9d..6c07b8883815a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Abstract.php @@ -55,7 +55,7 @@ public function getOrder() public function getPriceDataObject() { $obj = $this->getData('price_data_object'); - if (is_null($obj)) { + if ($obj === null) { return $this->getOrder(); } return $obj; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index 2381423e830ba..4ce38ebad1cc1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -51,7 +51,7 @@ protected function _construct() $this->_updateButton('save', 'label', Mage::helper('Mage_Sales_Helper_Data')->__('Submit Order')); $this->_updateButton('save', 'onclick', "order.submit()"); $this->_updateButton('save', 'id', 'submit_order_top_button'); - if (is_null($customerId) || !$storeId) { + if ($customerId === null || !$storeId) { $this->_updateButton('save', 'style', 'display:none'); } @@ -60,7 +60,7 @@ protected function _construct() $this->_updateButton('reset', 'id', 'reset_order_top_button'); - if (is_null($customerId)) { + if ($customerId === null) { $this->_updateButton('reset', 'style', 'display:none'); } else { $this->_updateButton('back', 'style', 'display:none'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php index 9ef2a129f30d2..56f5e0f206376 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Comment.php @@ -51,7 +51,7 @@ public function getCommentNote() public function getNoteNotify() { $notify = $this->getQuote()->getCustomerNoteNotify(); - if (is_null($notify) || $notify) { + if ($notify === null || $notify) { return true; } return false; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php index 0900b41fa8f04..a359b2a8c0f03 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php @@ -61,7 +61,7 @@ public function getSaveUrl() public function getCustomerSelectorDisplay() { $customerId = $this->getCustomerId(); - if (is_null($customerId)) { + if ($customerId === null) { return 'block'; } return 'none'; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php index 18d9f5b542bce..509bdfcb2fbfd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Abstract.php @@ -81,7 +81,7 @@ protected function _prepareLayout() */ public function getForm() { - if (is_null($this->_form)) { + if ($this->_form === null) { $this->_form = new Varien_Data_Form(); $this->_prepareForm(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php index ddec3cb6bf17a..a118588cc85f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form/Address.php @@ -58,7 +58,7 @@ public function getAddressCollection() */ protected function _getAddressForm() { - if (is_null($this->_addressForm)) { + if ($this->_addressForm === null) { $this->_addressForm = Mage::getModel('Mage_Customer_Model_Form') ->setFormCode('adminhtml_customer_address') ->setStore($this->getStore()); @@ -166,7 +166,7 @@ protected function _prepareForm() } } } - if (is_null($this->_form->getElement('country_id')->getValue())) { + if ( $this->_form->getElement('country_id')->getValue() === null) { $this->_form->getElement('country_id')->setValue( Mage::helper('Mage_Core_Helper_Data')->getDefaultCountry($this->getStore()) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php index 12d82e5cba5b4..5cf0908f34586 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Giftmessage/Form.php @@ -258,7 +258,7 @@ protected function _initMessage() */ public function getMessage() { - if(is_null($this->_giftMessage)) { + if($this->_giftMessage === null) { $this->_initMessage(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index c8eb58a505e6a..9613f92050531 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -106,7 +106,7 @@ public function getItemOrigPrice($item) public function isGiftMessagesAvailable($item=null) { - if(is_null($item)) { + if($item === null) { return $this->helper('Mage_GiftMessage_Helper_Message')->getIsMessagesAvailable( 'items', $this->getQuote(), $this->getStore() ); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php index f67770c8b504a..c5e112fd77f90 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Abstract.php @@ -116,7 +116,7 @@ public function getProductId($item) public function getItemCount() { $count = $this->getData('item_count'); - if (is_null($count)) { + if ($count === null) { $count = count($this->getItems()); $this->setData('item_count', $count); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php index 55e679877d3c6..f686f6d14ea15 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Cart.php @@ -61,7 +61,7 @@ public function getHeaderText() public function getItemCollection() { $collection = $this->getData('item_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = $this->getCreateOrderModel()->getCustomerCart()->getAllVisibleItems(); $this->setData('item_collection', $collection); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php index 1cc7bef90da40..a17d3d16e4437 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Compared.php @@ -55,7 +55,7 @@ public function getHeaderText() public function getItemCollection() { $collection = $this->getData('item_collection'); - if (is_null($collection)) { + if ($collection === null) { if ($collection = $this->getCreateOrderModel()->getCustomerCompareList()) { $collection = $collection->getItemCollection() ->useProductItem(true) diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php index 640b62836e50d..3e9d65deda8b4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pcompared.php @@ -54,7 +54,7 @@ public function getHeaderText() public function getItemCollection() { $productCollection = $this->getData('item_collection'); - if (is_null($productCollection)) { + if ($productCollection === null) { // get products to skip $skipProducts = array(); if ($collection = $this->getCreateOrderModel()->getCustomerCompareList()) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php index 2b148ef5bb386..8f04926e93fa7 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Pviewed.php @@ -54,7 +54,7 @@ public function getHeaderText() public function getItemCollection() { $productCollection = $this->getData('item_collection'); - if (is_null($productCollection)) { + if ($productCollection === null) { $stores = array(); $website = Mage::app()->getStore($this->getStoreId())->getWebsite(); foreach ($website->getStores() as $store) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php index 9354e30bbffe0..31c3cde6cc27c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Sidebar/Wishlist.php @@ -61,7 +61,7 @@ public function getHeaderText() public function getItemCollection() { $collection = $this->getData('item_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = $this->getCreateOrderModel()->getCustomerWishlist(true); if ($collection) { $collection = $collection->getItemCollection()->load(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php index 8b54e13f5f271..76cbbf279db60 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Totals.php @@ -83,7 +83,7 @@ public function renderTotal($total, $area = null, $colspan = 1) return $this->_getTotalRenderer($total->getCode()) ->setTotal($total) ->setColspan($colspan) - ->setRenderingArea(is_null($area) ? -1 : $area) + ->setRenderingArea($area === null ? -1 : $area) ->toHtml(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php index 6f57b4662e61c..d4aee8344443d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Creditmemo/Create/Items.php @@ -170,7 +170,7 @@ public function canReturnToStock() */ public function canReturnItemsToStock() { - if (is_null($this->_canReturnToStock)) { + if ($this->_canReturnToStock === null) { if ($this->_canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT)) { $canReturnToStock = false; foreach ($this->getCreditmemo()->getAllItems() as $item) { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php index 51da81704770d..0ebe4675b21b8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Giftmessage.php @@ -113,7 +113,7 @@ public function setEntity(Varien_Object $entity) */ public function getEntity() { - if(is_null($this->_entity)) { + if($this->_entity === null) { $this->setEntity(Mage::getModel('Mage_GiftMessage_Model_Message')->getEntityModelByType('order')); $this->getEntity()->load($this->getRequest()->getParam('entity')); } @@ -227,7 +227,7 @@ protected function _initMessage() */ public function getMessage() { - if(is_null($this->_giftMessage)) { + if($this->_giftMessage === null) { $this->_initMessage(); } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php index b1dd21a6215c2..e233a773127e9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Info.php @@ -54,7 +54,7 @@ public function getOrderStoreName() { if ($this->getOrder()) { $storeId = $this->getOrder()->getStoreId(); - if (is_null($storeId)) { + if ($storeId === null) { $deleted = Mage::helper('Mage_Adminhtml_Helper_Data')->__(' [deleted]'); return nl2br($this->getOrder()->getStoreName()) . $deleted; } diff --git a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php index 14dfb5787c146..115459a99373d 100644 --- a/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php @@ -79,7 +79,7 @@ public function setWebsiteId($websiteId) */ public function getWebsiteId() { - if (is_null($this->_websiteId)) { + if ($this->_websiteId === null) { $this->_websiteId = Mage::app()->getWebsite()->getId(); } return $this->_websiteId; diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php index b5c1cc44693af..069bc69b0e69b 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Grid/Filter/Type.php @@ -54,7 +54,7 @@ protected function _getOptions() public function getCondition() { - if(is_null($this->getValue())) { + if($this->getValue() === null) { return null; } diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php index 0ffd86a4e7c38..4b686b1717b00 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Title.php @@ -38,7 +38,7 @@ class Mage_Adminhtml_Block_Tax_Rate_Title extends Mage_Core_Block_Template public function getTitles() { - if (is_null($this->_titles)) { + if ($this->_titles === null) { $this->_titles = array(); $titles = Mage::getSingleton('Mage_Tax_Model_Calculation_Rate')->getTitles(); foreach ($titles as $title) { @@ -56,7 +56,7 @@ public function getTitles() public function getStores() { $stores = $this->getData('stores'); - if (is_null($stores)) { + if ($stores === null) { $stores = Mage::getModel('Mage_Core_Model_Store') ->getResourceCollection() ->setLoadDefault(false) diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php index e4563e0fd775a..39f0b822484bf 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php @@ -89,7 +89,7 @@ public function getTreeArray($parentId = null, $asJson = false, $recursionLevel public function getCategoryCollection() { $collection = $this->_getData('category_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = Mage::getModel('Mage_Catalog_Model_Category')->getCollection() ->addAttributeToSelect(array('name', 'is_active')) ->setLoadProductCount(true); diff --git a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php index e37bd02ae6feb..08e84d27409c4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -238,7 +238,7 @@ protected function _formPostInit($form) */ protected function _getSessionData() { - if (is_null($this->_sessionData)) { + if ($this->_sessionData === null) { $this->_sessionData = Mage::getModel('Mage_Adminhtml_Model_Session')->getData('urlrewrite_data', true); } return $this->_sessionData; @@ -264,7 +264,7 @@ protected function _getModel() */ protected function _getAllStores() { - if (is_null($this->_allStores)) { + if ($this->_allStores === null) { $this->_allStores = Mage::getSingleton('Mage_Core_Model_System_Store')->getStoreValuesForForm(); } diff --git a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php index 088bdaff24910..4cda21d14b812 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Controller/Report/Abstract.php @@ -48,7 +48,7 @@ abstract class Mage_Adminhtml_Controller_Report_Abstract extends Mage_Adminhtml_ */ protected function _getSession() { - if (is_null($this->_adminSession)) { + if ($this->_adminSession === null) { $this->_adminSession = Mage::getSingleton('Mage_Backend_Model_Auth_Session'); } return $this->_adminSession; diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php index 9ceab88e19698..117ae2c984eb6 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php @@ -63,7 +63,7 @@ class Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute extends Mage_B */ public function getProducts() { - if (is_null($this->_products)) { + if ($this->_products === null) { $productsIds = $this->getProductIds(); if (!is_array($productsIds)) { @@ -121,7 +121,7 @@ public function getProductsSetIds() */ public function getAttributes() { - if (is_null($this->_attributes)) { + if ($this->_attributes === null) { $this->_attributes = Mage::getSingleton('Mage_Eav_Model_Config') ->getEntityType(Mage_Catalog_Model_Product::ENTITY) ->getAttributeCollection() diff --git a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php index f107968438aed..f2e571dd6b405 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php @@ -50,7 +50,7 @@ abstract class Mage_Adminhtml_Helper_Dashboard_Abstract extends Mage_Core_Helper public function getCollection() { - if(is_null($this->_collection)) { + if($this->_collection === null) { $this->_initCollection(); } return $this->_collection; diff --git a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php index b4f0cdfb977d1..f669f46541810 100644 --- a/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php +++ b/app/code/core/Mage/Adminhtml/Model/Giftmessage/Save.php @@ -138,7 +138,7 @@ protected function _saveOne($entityId, $giftmessage) { */ protected function _deleteOne($entityModel, $giftmessageModel=null) { - if(is_null($giftmessageModel)) { + if($giftmessageModel === null) { $giftmessageModel = Mage::getModel('Mage_GiftMessage_Model_Message') ->load($entityModel->getGiftMessageId()); } diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index 1c8af3fb19363..7a502e248826b 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -544,7 +544,7 @@ public function moveQuoteItem($item, $moveTo, $qty) break; case 'cart': $cart = $this->getCustomerCart(); - if ($cart && is_null($item->getOptionByCode('additional_options'))) { + if ($cart && $item->getOptionByCode('additional_options') === null) { //options and info buy request $product = Mage::getModel('Mage_Catalog_Model_Product') ->setStoreId($this->getQuote()->getStoreId()) @@ -1025,7 +1025,7 @@ public function getShippingAddress() */ protected function _getCustomerForm() { - if (is_null($this->_customerForm)) { + if ($this->_customerForm === null) { $this->_customerForm = Mage::getModel('Mage_Customer_Model_Form') ->setFormCode('adminhtml_checkout') ->ignoreInvisible(false); @@ -1040,7 +1040,7 @@ protected function _getCustomerForm() */ protected function _getCustomerAddressForm() { - if (is_null($this->_customerAddressForm)) { + if ($this->_customerAddressForm === null) { $this->_customerAddressForm = Mage::getModel('Mage_Customer_Model_Form') ->setFormCode('adminhtml_customer_address') ->ignoreInvisible(false); @@ -1400,11 +1400,11 @@ public function _prepareCustomer() } } - if (is_null($customer->getDefaultBilling()) && $customerBillingAddress) { + if ($customer->getDefaultBilling() === null && $customerBillingAddress) { $customerBillingAddress->setIsDefaultBilling(true); } - if (is_null($customer->getDefaultShipping())) { + if ($customer->getDefaultShipping() === null) { if ($this->getShippingAddress()->getSameAsBilling() && $customerBillingAddress) { $customerBillingAddress->setIsDefaultShipping(true); } elseif ($customerShippingAddress) { @@ -1553,7 +1553,7 @@ public function createOrder() protected function _validate() { $customerId = $this->getSession()->getCustomerId(); - if (is_null($customerId)) { + if ($customerId === null) { Mage::throwException(Mage::helper('Mage_Adminhtml_Helper_Data')->__('Please select a customer.')); } diff --git a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php index 32c68ff71384d..62daf0fa56426 100644 --- a/app/code/core/Mage/Adminhtml/Model/Session/Quote.php +++ b/app/code/core/Mage/Adminhtml/Model/Session/Quote.php @@ -78,7 +78,7 @@ public function __construct() */ public function getQuote() { - if (is_null($this->_quote)) { + if ($this->_quote === null) { $this->_quote = Mage::getModel('Mage_Sales_Model_Quote'); if ($this->getStoreId() && $this->getQuoteId()) { $this->_quote->setStoreId($this->getStoreId()) @@ -118,7 +118,7 @@ public function setCustomer(Mage_Customer_Model_Customer $customer) */ public function getCustomer($forceReload=false, $useSetStore=false) { - if (is_null($this->_customer) || $forceReload) { + if ($this->_customer === null || $forceReload) { $this->_customer = Mage::getModel('Mage_Customer_Model_Customer'); if ($useSetStore && $this->getStore()->getId()) { $this->_customer->setStore($this->getStore()); @@ -137,7 +137,7 @@ public function getCustomer($forceReload=false, $useSetStore=false) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->_store = Mage::app()->getStore($this->getStoreId()); if ($currencyId = $this->getCurrencyId()) { $this->_store->setCurrentCurrencyCode($currencyId); @@ -153,7 +153,7 @@ public function getStore() */ public function getOrder() { - if (is_null($this->_order)) { + if ($this->_order === null) { $this->_order = Mage::getModel('Mage_Sales_Model_Order'); if ($this->getOrderId()) { $this->_order->load($this->getOrderId()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php index 72790cf7d52c3..23e00fe265339 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php @@ -298,7 +298,7 @@ public function saveAction() $data['is_filterable_in_search'] = 0; } - if (is_null($model->getIsUserDefined()) || $model->getIsUserDefined() != 0) { + if ($model->getIsUserDefined() === null || $model->getIsUserDefined() != 0) { $data['backend_type'] = $model->getBackendTypeByInput($data['frontend_input']); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php index f4836e6593e08..2875e4517d90a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php @@ -240,7 +240,7 @@ protected function _isAllowed() */ protected function _getEntityTypeId() { - if (is_null(Mage::registry('entityType'))) { + if (Mage::registry('entityType') === null) { $this->_setTypeId(); } return Mage::registry('entityType'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php index ed3bb87adfb1c..f6b55586d9f62 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Report/StatisticsController.php @@ -191,7 +191,7 @@ protected function _isAllowed() */ protected function _getSession() { - if (is_null($this->_adminSession)) { + if ($this->_adminSession === null) { $this->_adminSession = Mage::getSingleton('Mage_Backend_Model_Auth_Session'); } return $this->_adminSession; diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php index 1cc55967e407a..39aecc9129dc4 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php @@ -165,7 +165,7 @@ protected function _processActionData($action = null) if (!$this->_getOrderCreateModel()->getQuote()->isVirtual()) { $syncFlag = $this->getRequest()->getPost('shipping_as_billing'); $shippingMethod = $this->_getOrderCreateModel()->getShippingAddress()->getShippingMethod(); - if (is_null($syncFlag) + if ($syncFlag === null && $this->_getOrderCreateModel()->getShippingAddress()->getSameAsBilling() && empty($shippingMethod) ) { diff --git a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php index 380bb49696da0..3a7e59f4d26f0 100644 --- a/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/core/Mage/Authorizenet/Block/Directpost/Iframe.php @@ -43,7 +43,7 @@ class Mage_Authorizenet_Block_Directpost_Iframe extends Mage_Core_Block_Template protected function _prepareLayout() { $params = Mage::registry('authorizenet_directpost_form_params'); - if (is_null($params)) { + if ($params === null) { $params = array(); } $this->setParams($params); diff --git a/app/code/core/Mage/Backend/Block/Menu.php b/app/code/core/Mage/Backend/Block/Menu.php index ff9043ba04eef..a6c43dbfb851d 100644 --- a/app/code/core/Mage/Backend/Block/Menu.php +++ b/app/code/core/Mage/Backend/Block/Menu.php @@ -304,7 +304,7 @@ public function renderMenu($menu, $level = 0) */ public function getActiveItemModel() { - if (is_null($this->_activeItemModel)) { + if ($this->_activeItemModel === null) { $this->_activeItemModel = $this->getMenuModel()->get($this->getActive()); if (false == ($this->_activeItemModel instanceof Mage_Backend_Model_Menu_Item)) { $this->_activeItemModel = false; diff --git a/app/code/core/Mage/Backend/Block/System/Config/Form.php b/app/code/core/Mage/Backend/Block/System/Config/Form.php index 9248b2bde7451..c50739d92c950 100644 --- a/app/code/core/Mage/Backend/Block/System/Config/Form.php +++ b/app/code/core/Mage/Backend/Block/System/Config/Form.php @@ -554,7 +554,7 @@ public function canUseWebsiteValue($fieldValue) public function getScope() { $scope = $this->getData('scope'); - if (is_null($scope)) { + if ($scope === null) { if ($this->getStoreCode()) { $scope = self::SCOPE_STORES; } elseif ($this->getWebsiteCode()) { @@ -595,7 +595,7 @@ public function getScopeLabel(Mage_Backend_Model_Config_Structure_Element_Field public function getScopeCode() { $scopeCode = $this->getData('scope_code'); - if (is_null($scopeCode)) { + if ($scopeCode === null) { if ($this->getStoreCode()) { $scopeCode = $this->getStoreCode(); } elseif ($this->getWebsiteCode()) { @@ -617,7 +617,7 @@ public function getScopeCode() public function getScopeId() { $scopeId = $this->getData('scope_id'); - if (is_null($scopeId)) { + if ($scopeId === null) { if ($this->getStoreCode()) { $scopeId = Mage::app()->getStore($this->getStoreCode())->getId(); } elseif ($this->getWebsiteCode()) { diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid.php b/app/code/core/Mage/Backend/Block/Widget/Grid.php index 90d7204f466b8..2e99124a5fbe5 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid.php @@ -309,7 +309,7 @@ protected function _prepareCollection() $dir = $this->getParam($this->getVarNameDir(), $this->_defaultDir); $filter = $this->getParam($this->getVarNameFilter(), null); - if (is_null($filter)) { + if ($filter === null) { $filter = $this->_defaultFilter; } diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php index 7c45a2c456f26..6060fedd2dc09 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php @@ -184,7 +184,7 @@ public function getHeaderHtml() */ public function getCssClass() { - if (is_null($this->_cssClass)) { + if ($this->_cssClass === null) { if ($this->getAlign()) { $this->_cssClass .= 'a-'.$this->getAlign(); } @@ -402,7 +402,7 @@ protected function _getRendererByType() */ public function getRenderer() { - if (is_null($this->_renderer)) { + if ($this->_renderer === null) { $rendererClass = $this->getData('renderer'); if (empty($rendererClass)) { $rendererClass = $this->_getRendererByType(); @@ -457,9 +457,9 @@ protected function _getFilterByType() */ public function getFilter() { - if (is_null($this->_filter)) { + if ($this->_filter === null) { $filterClass = $this->getData('filter'); - if (false === (bool) $filterClass && false === is_null($filterClass)) { + if (false === (bool) $filterClass && false === $filterClass === null) { return false; } if (!$filterClass) { diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php index 33661750dfec0..9f4cd41aef4f6 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php @@ -83,7 +83,7 @@ public function getCurrencyAffect() protected function _getCurrencyModel() { - if (is_null($this->_currencyModel)) { + if ($this->_currencyModel === null) { $this->_currencyModel = Mage::getModel('Mage_Directory_Model_Currency'); } @@ -109,7 +109,7 @@ protected function _getCurrencySelectHtml() protected function _getCurrencyList() { - if (is_null($this->_currencyList)) { + if ($this->_currencyList === null) { $this->_currencyList = $this->_getCurrencyModel()->getConfigAllowCurrencies(); } return $this->_currencyList; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php index f80ef49dab69e..e476b22234b1f 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php @@ -92,7 +92,7 @@ public function getHtml() public function getCondition() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { return null; } return array('eq' => $this->getValue()); diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Store.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Store.php index 8b1bde5c3a98e..c470d34150f0a 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Store.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Store.php @@ -107,7 +107,7 @@ public function getHtml() */ public function getCondition() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { return null; } if ($this->getValue() == '_deleted_') { diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php index 63416d0f9f12c..0114d64d0b48f 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php @@ -112,7 +112,7 @@ protected function _drawOptions($options) */ public function getCondition() { - if (is_null($this->getValue())) { + if ($this->getValue() === null) { return null; } $value = $this->getValue(); diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php index e5f3ef2129db7..4e1ad81ce5e89 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -44,7 +44,7 @@ class Mage_Backend_Block_Widget_Grid_Column_Renderer_Checkbox */ public function getValues() { - if (is_null($this->_values)) { + if ($this->_values === null) { $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : array(); } return $this->_values; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Date.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Date.php index 519ad68cde22a..f029c6740c7e6 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Date.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Date.php @@ -50,7 +50,7 @@ protected function _getFormat() { $format = $this->getColumn()->getFormat(); if (!$format) { - if (is_null(self::$_format)) { + if (self::$_format === null) { try { self::$_format = Mage::app()->getLocale()->getDateFormat( Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php index 9f0feea3e7a79..31114e52f6357 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Datetime.php @@ -49,7 +49,7 @@ protected function _getFormat() { $format = $this->getColumn()->getFormat(); if (!$format) { - if (is_null(self::$_format)) { + if (self::$_format === null) { try { self::$_format = Mage::app()->getLocale()->getDateTimeFormat( Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Radio.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Radio.php index f0f3372a35799..a66cfeba60a0a 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Radio.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Radio.php @@ -44,7 +44,7 @@ class Mage_Backend_Block_Widget_Grid_Column_Renderer_Radio */ public function getValues() { - if (is_null($this->_values)) { + if ($this->_values === null) { $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : array(); } return $this->_values; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Store.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Store.php index d61ef3839338e..10e4e7e09af49 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Store.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Store.php @@ -85,7 +85,7 @@ public function render(Varien_Object $row) $skipEmptyStoresLabel = $this->_getShowEmptyStoresLabelFlag(); $origStores = $row->getData($this->getColumn()->getIndex()); - if (is_null($origStores) && $row->getStoreName()) { + if ($origStores === null && $row->getStoreName()) { $scopes = array(); foreach (explode("\n", $row->getStoreName()) as $k => $label) { $scopes[] = str_repeat(' ', $k * 3) . $label; @@ -134,7 +134,7 @@ public function renderExport(Varien_Object $row) $skipAllStoresLabel = $this->_getShowAllStoresLabelFlag(); $origStores = $row->getData($this->getColumn()->getIndex()); - if (is_null($origStores) && $row->getStoreName()) { + if ($origStores === null && $row->getStoreName()) { $scopes = array(); foreach (explode("\n", $row->getStoreName()) as $k => $label) { $scopes[] = str_repeat(' ', $k * 3) . $label; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Text.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Text.php index ddf3dce0023c6..6be5ab269c743 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Text.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Text.php @@ -52,10 +52,10 @@ public function _getValue(Varien_Object $row) { $format = ( $this->getColumn()->getFormat() ) ? $this->getColumn()->getFormat() : null; $defaultValue = $this->getColumn()->getDefault(); - if (is_null($format)) { + if ($format === null) { // If no format and it column not filtered specified return data as is. $data = parent::_getValue($row); - $string = is_null($data) ? $defaultValue : $data; + $string = $data === null ? $defaultValue : $data; return $this->escapeHtml($string); } elseif (preg_match_all($this->_variablePattern, $format, $matches)) { // Parsing of format string diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php index cf07f7932c7cc..7d886dc64fe50 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Container.php @@ -44,10 +44,10 @@ class Mage_Backend_Block_Widget_Grid_Container extends Mage_Backend_Block_Widget protected function _construct() { - if (is_null($this->_addButtonLabel)) { + if ($this->_addButtonLabel === null) { $this->_addButtonLabel = $this->__('Add New'); } - if (is_null($this->_backButtonLabel)) { + if ($this->_backButtonLabel === null) { $this->_backButtonLabel = $this->__('Back'); } diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php index 94ea3b58f16cd..66441b63d613d 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Export.php @@ -242,7 +242,7 @@ public function _exportIterateCollection($callback, array $args) $originalCollection->setPageSize($this->getExportPageSize()); $originalCollection->setCurPage($page); $originalCollection->load(); - if (is_null($count)) { + if ($count === null) { $count = $originalCollection->getSize(); $lPage = $originalCollection->getLastPageNumber(); } diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php index 7fec3edcac081..e6ea51888123b 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Extended.php @@ -928,7 +928,7 @@ public function _exportIterateCollection($callback, array $args) $collection->setPageSize($this->_exportPageSize); $collection->setCurPage($page); $collection->load(); - if (is_null($count)) { + if ($count === null) { $count = $collection->getSize(); $lPage = $collection->getLastPageNumber(); } diff --git a/app/code/core/Mage/Backend/Block/Widget/Tabs.php b/app/code/core/Mage/Backend/Block/Widget/Tabs.php index 651e5073749e6..a3ab3d35203a0 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Tabs.php +++ b/app/code/core/Mage/Backend/Block/Widget/Tabs.php @@ -114,7 +114,7 @@ public function addTab($tabId, $tab) throw new Exception(Mage::helper('Mage_Backend_Helper_Data')->__('Wrong tab configuration.')); } - if (is_null($this->_tabs[$tabId]->getUrl())) { + if ($this->_tabs[$tabId]->getUrl() === null) { $this->_tabs[$tabId]->setUrl('#'); } @@ -125,7 +125,7 @@ public function addTab($tabId, $tab) $this->_tabs[$tabId]->setId($tabId); $this->_tabs[$tabId]->setTabId($tabId); - if (is_null($this->_activeTab)) { + if ($this->_activeTab === null) { $this->_activeTab = $tabId; } if (true === $this->_tabs[$tabId]->getActive()) { @@ -177,7 +177,7 @@ public function setActiveTab($tabId) if (isset($this->_tabs[$tabId]) && $this->canShowTab($this->_tabs[$tabId]) && !$this->getTabIsHidden($this->_tabs[$tabId])) { $this->_activeTab = $tabId; - if (!(is_null($this->_activeTab)) && ($tabId !== $this->_activeTab)) { + if (!($this->_activeTab === null) && ($tabId !== $this->_activeTab)) { foreach ($this->_tabs as $id => $tab) { $tab->setActive($id === $tabId); } diff --git a/app/code/core/Mage/Backend/Controller/ActionAbstract.php b/app/code/core/Mage/Backend/Controller/ActionAbstract.php index c052f7eef6b0f..b61484dde128f 100644 --- a/app/code/core/Mage/Backend/Controller/ActionAbstract.php +++ b/app/code/core/Mage/Backend/Controller/ActionAbstract.php @@ -208,7 +208,7 @@ public function preDispatch() if ($this->_isUrlChecked()) { $this->setFlag('', self::FLAG_IS_URLS_CHECKED, true); } - if (is_null(Mage::getSingleton('Mage_Backend_Model_Session')->getLocale())) { + if (Mage::getSingleton('Mage_Backend_Model_Session')->getLocale() === null) { Mage::getSingleton('Mage_Backend_Model_Session')->setLocale(Mage::app()->getLocale()->getLocaleCode()); } diff --git a/app/code/core/Mage/Backend/Helper/Data.php b/app/code/core/Mage/Backend/Helper/Data.php index e7ceb57f646bd..83d37cd63e1aa 100644 --- a/app/code/core/Mage/Backend/Helper/Data.php +++ b/app/code/core/Mage/Backend/Helper/Data.php @@ -59,7 +59,7 @@ public function getPageHelpUrl() public function setPageHelpUrl($url=null) { - if (is_null($url)) { + if ($url === null) { $request = Mage::app()->getRequest(); $frontModule = $request->getControllerModule(); if (!$frontModule) { diff --git a/app/code/core/Mage/Backend/Model/Auth.php b/app/code/core/Mage/Backend/Model/Auth.php index b2d5f309a018f..58e1087976ad6 100644 --- a/app/code/core/Mage/Backend/Model/Auth.php +++ b/app/code/core/Mage/Backend/Model/Auth.php @@ -194,7 +194,7 @@ public function isLoggedIn() */ public static function throwException($msg = null, $code = null) { - if (is_null($msg)) { + if ($msg === null) { $msg = Mage::helper('Mage_Backend_Helper_Data')->__('Authentication error occurred.'); } throw new Mage_Backend_Model_Auth_Exception($msg, $code); diff --git a/app/code/core/Mage/Backend/Model/Auth/Session.php b/app/code/core/Mage/Backend/Model/Auth/Session.php index 3500e2bdc6d50..3b104496c920c 100644 --- a/app/code/core/Mage/Backend/Model/Auth/Session.php +++ b/app/code/core/Mage/Backend/Model/Auth/Session.php @@ -98,7 +98,7 @@ public function init($namespace, $sessionName = null) */ public function refreshAcl($user = null) { - if (is_null($user)) { + if ($user === null) { $user = $this->getUser(); } if (!$user) { @@ -174,7 +174,7 @@ public function isLoggedIn() */ public function isFirstPageAfterLogin() { - if (is_null($this->_isFirstAfterLogin)) { + if ($this->_isFirstAfterLogin === null) { $this->_isFirstAfterLogin = $this->getData('is_first_visit', true); } return $this->_isFirstAfterLogin; diff --git a/app/code/core/Mage/Backend/Model/Config.php b/app/code/core/Mage/Backend/Model/Config.php index 45cd4cc57714e..746300756fed6 100644 --- a/app/code/core/Mage/Backend/Model/Config.php +++ b/app/code/core/Mage/Backend/Model/Config.php @@ -335,13 +335,13 @@ public function extendConfig($path, $full = true, $oldConfig = array()) */ protected function _validate() { - if (is_null($this->getSection())) { + if ($this->getSection() === null) { $this->setSection(''); } - if (is_null($this->getWebsite())) { + if ($this->getWebsite() === null) { $this->setWebsite(''); } - if (is_null($this->getStore())) { + if ($this->getStore() === null) { $this->setStore(''); } } diff --git a/app/code/core/Mage/Backend/Model/Config/Backend/Admin/Observer.php b/app/code/core/Mage/Backend/Model/Config/Backend/Admin/Observer.php index f16a6be1f2d34..8653b5a6f5717 100644 --- a/app/code/core/Mage/Backend/Model/Config/Backend/Admin/Observer.php +++ b/app/code/core/Mage/Backend/Model/Config/Backend/Admin/Observer.php @@ -33,7 +33,7 @@ class Mage_Backend_Model_Config_Backend_Admin_Observer */ public function afterCustomUrlChanged() { - if (is_null(Mage::registry('custom_admin_path_redirect'))) { + if (Mage::registry('custom_admin_path_redirect') === null) { return; } diff --git a/app/code/core/Mage/Backend/Model/Config/Source/Email/Identity.php b/app/code/core/Mage/Backend/Model/Config/Source/Email/Identity.php index 2c3501fac43b3..1b1b7356fe6b6 100644 --- a/app/code/core/Mage/Backend/Model/Config/Source/Email/Identity.php +++ b/app/code/core/Mage/Backend/Model/Config/Source/Email/Identity.php @@ -56,7 +56,7 @@ public function __construct(Mage_Backend_Model_Config_Structure $configStructure */ public function toOptionArray() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array(); /** @var $section Mage_Backend_Model_Config_Structure_Element_Section */ $section = $this->_configStructure->getElement('trans_email'); diff --git a/app/code/core/Mage/Backend/Model/Menu.php b/app/code/core/Mage/Backend/Model/Menu.php index b37cf07afef2b..b45877b2588ba 100644 --- a/app/code/core/Mage/Backend/Model/Menu.php +++ b/app/code/core/Mage/Backend/Model/Menu.php @@ -205,7 +205,7 @@ public function getFirstAvailable() if ($item->isAllowed() && !$item->isDisabled()) { if ($item->hasChildren()) { $result = $item->getChildren()->getFirstAvailable(); - if (false == is_null($result)) { + if (false == $result === null) { break; } } else { diff --git a/app/code/core/Mage/Backend/Model/Menu/Builder/CommandAbstract.php b/app/code/core/Mage/Backend/Model/Menu/Builder/CommandAbstract.php index 9255157d7455a..320c6f15a4858 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Builder/CommandAbstract.php +++ b/app/code/core/Mage/Backend/Model/Menu/Builder/CommandAbstract.php @@ -57,7 +57,7 @@ abstract class Mage_Backend_Model_Menu_Builder_CommandAbstract public function __construct(array $data = array()) { foreach ($this->_requiredParams as $param) { - if (!isset($data[$param]) || is_null($data[$param])) { + if (!isset($data[$param]) || $data[$param] === null) { throw new InvalidArgumentException("Missing required param " . $param); } } @@ -83,7 +83,7 @@ public function getId() */ public function chain(Mage_Backend_Model_Menu_Builder_CommandAbstract $command) { - if (is_null($this->_next)) { + if ($this->_next === null) { $this->_next = $command; } else { $this->_next->chain($command); diff --git a/app/code/core/Mage/Backend/Model/Menu/Config/Menu.php b/app/code/core/Mage/Backend/Model/Menu/Config/Menu.php index 81b4113983ee5..b8ce1b30c1193 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Config/Menu.php +++ b/app/code/core/Mage/Backend/Model/Menu/Config/Menu.php @@ -103,7 +103,7 @@ public function getMergedConfig() */ protected function _getDomConfigModel() { - if (is_null($this->_domConfig)) { + if ($this->_domConfig === null) { $this->_domConfig = new Mage_Backend_Model_Menu_Config_Menu_Dom( $this->_getInitialXml(), $this->_getIdAttributes() diff --git a/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php b/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php index 592f3adf0a81f..de5c4386b0740 100644 --- a/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php +++ b/app/code/core/Mage/Backend/Model/Menu/Item/Validator.php @@ -119,7 +119,7 @@ public function validate($data) */ public function validateParam($param, $value) { - if (in_array($param, $this->_required) && is_null($value)) { + if (in_array($param, $this->_required) && $value === null) { throw new InvalidArgumentException('Param ' . $param . ' is required'); } diff --git a/app/code/core/Mage/Backend/Model/Url.php b/app/code/core/Mage/Backend/Model/Url.php index 35847e446e649..90d781466b31a 100644 --- a/app/code/core/Mage/Backend/Model/Url.php +++ b/app/code/core/Mage/Backend/Model/Url.php @@ -302,7 +302,7 @@ public function findFirstAvailableMenu() */ protected function _getMenu() { - if (is_null($this->_menu)) { + if ($this->_menu === null) { $this->_menu = $this->_menuConfig->getMenu(); } return $this->_menu; diff --git a/app/code/core/Mage/Backup/Model/Backup.php b/app/code/core/Mage/Backup/Model/Backup.php index 406fb15ae6128..c4c87a0924d3e 100644 --- a/app/code/core/Mage/Backup/Model/Backup.php +++ b/app/code/core/Mage/Backup/Model/Backup.php @@ -217,7 +217,7 @@ public function deleteFile() */ public function open($write = false) { - if (is_null($this->getPath())) { + if ($this->getPath() === null) { Mage::exception('Mage_Backup', $this->_helper->__('Backup file path was not specified.')); } @@ -253,7 +253,7 @@ public function open($write = false) */ protected function _getStream() { - if (is_null($this->_stream)) { + if ($this->_stream === null) { Mage::exception('Mage_Backup', $this->_helper->__('Backup file handler was unspecified.')); } return $this->_stream; diff --git a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php index 85b25f3303569..ab64dfdf35886 100644 --- a/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php +++ b/app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php @@ -55,7 +55,7 @@ class Mage_Bundle_Block_Catalog_Product_View_Type_Bundle_Option extends Mage_Bun */ protected function _showSingle() { - if (is_null($this->_showSingle)) { + if ($this->_showSingle === null) { $_option = $this->getOption(); $_selections = $_option->getSelections(); @@ -105,7 +105,7 @@ protected function _getDefaultValues() */ protected function _getSelectedOptions() { - if (is_null($this->_selectedOptions)) { + if ($this->_selectedOptions === null) { $this->_selectedOptions = array(); $option = $this->getOption(); diff --git a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php index e20e4fcc71b0c..b51ae7fa2d350 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php +++ b/app/code/core/Mage/Bundle/Model/Product/Attribute/Source/Price/View.php @@ -41,7 +41,7 @@ class Mage_Bundle_Model_Product_Attribute_Source_Price_View extends Mage_Eav_Mod */ public function getAllOptions() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array( array( 'label' => Mage::helper('Mage_Bundle_Helper_Data')->__('As Low as'), diff --git a/app/code/core/Mage/Bundle/Model/Product/Price.php b/app/code/core/Mage/Bundle/Model/Product/Price.php index fc46d9307f600..b53ece2a6636d 100644 --- a/app/code/core/Mage/Bundle/Model/Product/Price.php +++ b/app/code/core/Mage/Bundle/Model/Product/Price.php @@ -111,7 +111,7 @@ public function getTotalBundleItemsPrice($product, $qty = null) */ public function getFinalPrice($qty = null, $product) { - if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { + if ($qty === null && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } @@ -373,7 +373,7 @@ public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qt public function getSelectionFinalTotalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty, $multiplyQty = true, $takeTierPrice = true) { - if (is_null($selectionQty)) { + if ($selectionQty === null) { $selectionQty = $selectionProduct->getSelectionQty(); } @@ -435,7 +435,7 @@ public function getGroupPrice($product) { $groupPrices = $product->getData('group_price'); - if (is_null($groupPrices)) { + if ($groupPrices === null) { $attribute = $product->getResource()->getAttribute('group_price'); if ($attribute) { $attribute->getBackend()->afterLoad($product); @@ -443,7 +443,7 @@ public function getGroupPrice($product) } } - if (is_null($groupPrices) || !is_array($groupPrices)) { + if ($groupPrices === null || !is_array($groupPrices)) { return null; } @@ -471,7 +471,7 @@ public function getGroupPrice($product) */ protected function _applyTierPrice($product, $qty, $finalPrice) { - if (is_null($qty)) { + if ($qty === null) { return $finalPrice; } @@ -497,14 +497,14 @@ public function getTierPrice($qty=null, $product) $allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL; $prices = $product->getData('tier_price'); - if (is_null($prices)) { + if ($prices === null) { if ($attribute = $product->getResource()->getAttribute('tier_price')) { $attribute->getBackend()->afterLoad($product); $prices = $product->getData('tier_price'); } } - if (is_null($prices) || !is_array($prices)) { + if ($prices === null || !is_array($prices)) { if (!is_null($qty)) { return $product->getPrice(); } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php index 6888a785e387a..41f895e04a934 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Option/Collection.php @@ -197,7 +197,7 @@ public function resetAllIds() */ public function getAllIds() { - if (is_null($this->_itemIds)) { + if ($this->_itemIds === null) { $this->_itemIds = parent::getAllIds(); } return $this->_itemIds; diff --git a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php index ea544da3ac9a6..e08dee1744ac6 100755 --- a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php @@ -86,7 +86,7 @@ protected function _getAttribute($attributeCode) */ protected function _getWebsites() { - if (is_null($this->_websites)) { + if ($this->_websites === null) { $this->_websites = Mage::app()->getWebsites(false); } return $this->_websites; @@ -99,7 +99,7 @@ protected function _getWebsites() */ protected function _getCustomerGroups() { - if (is_null($this->_customerGroups)) { + if ($this->_customerGroups === null) { $this->_customerGroups = array(); foreach (Mage::getModel('Mage_Customer_Model_Group')->getCollection() as $group) { $this->_customerGroups[$group->getId()] = $group; diff --git a/app/code/core/Mage/Catalog/Block/Layer/View.php b/app/code/core/Mage/Catalog/Block/Layer/View.php index f33efc0aa60eb..8e8d9f321e2e8 100644 --- a/app/code/core/Mage/Catalog/Block/Layer/View.php +++ b/app/code/core/Mage/Catalog/Block/Layer/View.php @@ -147,7 +147,7 @@ public function getLayer() protected function _getFilterableAttributes() { $attributes = $this->getData('_filterable_attributes'); - if (is_null($attributes)) { + if ($attributes === null) { $attributes = $this->getLayer()->getFilterableAttributes(); $this->setData('_filterable_attributes', $attributes); } diff --git a/app/code/core/Mage/Catalog/Block/Navigation.php b/app/code/core/Mage/Catalog/Block/Navigation.php index 4174baea9b950..1f3f3459c7e23 100644 --- a/app/code/core/Mage/Catalog/Block/Navigation.php +++ b/app/code/core/Mage/Catalog/Block/Navigation.php @@ -152,7 +152,7 @@ public function isCategoryActive($category) protected function _getCategoryInstance() { - if (is_null($this->_categoryInstance)) { + if ($this->_categoryInstance === null) { $this->_categoryInstance = Mage::getModel('Mage_Catalog_Model_Category'); } return $this->_categoryInstance; diff --git a/app/code/core/Mage/Catalog/Block/Product/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/Abstract.php index 7eb9b6e5b069d..e223c65d9c20a 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/Abstract.php @@ -328,7 +328,7 @@ public function getTierPriceTemplate() */ public function getTierPriceHtml($product = null) { - if (is_null($product)) { + if ($product === null) { $product = $this->getProduct(); } return $this->_getPriceBlock($product->getTypeId()) @@ -346,7 +346,7 @@ public function getTierPriceHtml($product = null) */ public function getTierPrices($product = null) { - if (is_null($product)) { + if ($product === null) { $product = $this->getProduct(); } $prices = $product->getFormatedTierPrice(); @@ -429,7 +429,7 @@ protected function _addProductAttributesAndPrices(Mage_Catalog_Model_Resource_Pr */ public function getImageLabel($product=null, $mediaAttributeCode='image') { - if (is_null($product)) { + if ($product === null) { $product = $this->getProduct(); } diff --git a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php index 28fe03342d6b4..4d7af0e521fb5 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Compare/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/Compare/List.php @@ -108,7 +108,7 @@ protected function _prepareLayout() */ public function getItems() { - if (is_null($this->_items)) { + if ($this->_items === null) { Mage::helper('Mage_Catalog_Helper_Product_Compare')->setAllowUsedFlat(false); $this->_items = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Compare_Item_Collection') @@ -141,7 +141,7 @@ public function getItems() */ public function getAttributes() { - if (is_null($this->_attributes)) { + if ($this->_attributes === null) { $this->_attributes = $this->getItems()->getComparableAttributes(); } diff --git a/app/code/core/Mage/Catalog/Block/Product/List.php b/app/code/core/Mage/Catalog/Block/Product/List.php index 899946ef0a68d..5529e3d3188ff 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List.php +++ b/app/code/core/Mage/Catalog/Block/Product/List.php @@ -55,7 +55,7 @@ class Mage_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_Abstrac */ protected function _getProductCollection() { - if (is_null($this->_productCollection)) { + if ($this->_productCollection === null) { $layer = $this->getLayer(); /* @var $layer Mage_Catalog_Model_Layer */ if ($this->getShowRootCategory()) { diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php index b0854d44a1deb..7df51fada6cea 100755 --- a/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Promotion.php @@ -27,7 +27,7 @@ class Mage_Catalog_Block_Product_List_Promotion extends Mage_Catalog_Block_Produ { protected function _getProductCollection() { - if (is_null($this->_productCollection)) { + if ($this->_productCollection === null) { $collection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection'); Mage::getModel('Mage_Catalog_Model_Layer')->prepareProductCollection($collection); // your custom filter diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Random.php b/app/code/core/Mage/Catalog/Block/Product/List/Random.php index 743db0bde1cf0..b251dc2d407aa 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Random.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Random.php @@ -36,7 +36,7 @@ class Mage_Catalog_Block_Product_List_Random extends Mage_Catalog_Block_Product_ { protected function _getProductCollection() { - if (is_null($this->_productCollection)) { + if ($this->_productCollection === null) { $collection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Collection'); Mage::getModel('Mage_Catalog_Model_Layer')->prepareProductCollection($collection); $collection->getSelect()->order('rand()'); diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php index a997a9a57d43d..1857bb06493ba 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php @@ -477,7 +477,7 @@ public function isOrderCurrent($order) */ public function getOrderUrl($order, $direction) { - if (is_null($order)) { + if ($order === null) { $order = $this->getCurrentOrder() ? $this->getCurrentOrder() : $this->_availableOrder[0]; } return $this->getPagerUrl(array( diff --git a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php index 0d0ae5de83e25..6cb1634467946 100644 --- a/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php +++ b/app/code/core/Mage/Catalog/Block/Product/List/Upsell.php @@ -105,7 +105,7 @@ public function getItemCollection() public function getItems() { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = $this->getItemCollection()->getItems(); } return $this->_items; diff --git a/app/code/core/Mage/Catalog/Block/Product/Price.php b/app/code/core/Mage/Catalog/Block/Product/Price.php index fa27c361c87c5..400d53a01f4c8 100644 --- a/app/code/core/Mage/Catalog/Block/Product/Price.php +++ b/app/code/core/Mage/Catalog/Block/Product/Price.php @@ -74,7 +74,7 @@ public function getIdSuffix() */ public function getTierPrices($product = null) { - if (is_null($product)) { + if ($product === null) { $product = $this->getProduct(); } $prices = $product->getFormatedTierPrice(); diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php index 35d75846401ee..84ab5ebb72a14 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Abstract.php @@ -41,7 +41,7 @@ abstract class Mage_Catalog_Block_Product_View_Abstract extends Mage_Catalog_Blo public function getProduct() { $product = parent::getProduct(); - if (is_null($product->getTypeInstance()->getStoreFilter($product))) { + if ($product->getTypeInstance()->getStoreFilter($product) === null) { $product->getTypeInstance()->setStoreFilter(Mage::app()->getStore(), $product); } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php index 4262372e7ef95..a2b4bccb23385 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Additional.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Additional.php @@ -42,7 +42,7 @@ class Mage_Catalog_Block_Product_View_Additional extends Mage_Core_Block_Templat public function getChildHtmlList() { - if (is_null($this->_list)) { + if ($this->_list === null) { $this->_list = array(); $layout = $this->getLayout(); foreach ($this->getChildNames() as $name) { diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options.php b/app/code/core/Mage/Catalog/Block/Product/View/Options.php index 9fbd4a060bde7..09510532d793d 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options.php @@ -192,7 +192,7 @@ public function getOptionHtml(Mage_Catalog_Model_Product_Option $option) $renderer = $this->getOptionRender( $this->getGroupOfOption($option->getType()) ); - if (is_null($renderer['renderer'])) { + if ($renderer['renderer'] === null) { $renderer['renderer'] = $this->getLayout()->createBlock($renderer['block']) ->setTemplate($renderer['template']); } diff --git a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php index e119aee19a1bf..b0583c7403bf7 100644 --- a/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Date.php @@ -201,7 +201,7 @@ protected function _getHtmlSelect($name, $value = null) } $select->setExtraParams($extraParams); - if (is_null($value)) { + if ($value === null) { $value = $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId() . '/' . $name); } if (!is_null($value)) { diff --git a/app/code/core/Mage/Catalog/Helper/Category.php b/app/code/core/Mage/Catalog/Helper/Category.php index 978fe54df4d64..9bb2c3df853ec 100644 --- a/app/code/core/Mage/Catalog/Helper/Category.php +++ b/app/code/core/Mage/Catalog/Helper/Category.php @@ -135,7 +135,7 @@ public function canShow($category) */ public function getCategoryUrlSuffix($storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } diff --git a/app/code/core/Mage/Catalog/Helper/Flat/Abstract.php b/app/code/core/Mage/Catalog/Helper/Flat/Abstract.php index aff5a9ee6f688..0a9a10e213c5b 100644 --- a/app/code/core/Mage/Catalog/Helper/Flat/Abstract.php +++ b/app/code/core/Mage/Catalog/Helper/Flat/Abstract.php @@ -81,7 +81,7 @@ public function isAvailable() */ public function getProcess() { - if (is_null($this->_process)) { + if ($this->_process === null) { $this->_process = Mage::getModel('Mage_Index_Model_Process') ->load($this->_indexerCode, 'indexer_code'); } diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 625a9383a156a..922c381f6a127 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -154,7 +154,7 @@ public function getEmailToFriendUrl($product) public function getStatuses() { - if(is_null($this->_statuses)) { + if($this->_statuses === null) { $this->_statuses = array();//Mage::getModel('Mage_Catalog_Model_Product_Status')->getResourceCollection()->load(); } @@ -190,7 +190,7 @@ public function canShow($product, $where = 'catalog') */ public function getProductUrlSuffix($storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } @@ -233,7 +233,7 @@ public function getAttributeInputTypes($inputType = null) ) ); - if (is_null($inputType)) { + if ($inputType === null) { return $inputTypes; } else if (isset($inputTypes[$inputType])) { return $inputTypes[$inputType]; diff --git a/app/code/core/Mage/Catalog/Helper/Product/Flat.php b/app/code/core/Mage/Catalog/Helper/Product/Flat.php index 43ebb6e84fcf3..c211e4bc38e01 100644 --- a/app/code/core/Mage/Catalog/Helper/Product/Flat.php +++ b/app/code/core/Mage/Catalog/Helper/Product/Flat.php @@ -82,7 +82,7 @@ class Mage_Catalog_Helper_Product_Flat extends Mage_Catalog_Helper_Flat_Abstract */ public function getFlag() { - if (is_null($this->_flagObject)) { + if ($this->_flagObject === null) { $this->_flagObject = Mage::getSingleton('Mage_Catalog_Model_Product_Flat_Flag') ->loadSelf(); } diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 1f4a8b9b7eb90..e92c8296f0889 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -169,7 +169,7 @@ public function getTreeModel() */ public function getTreeModelInstance() { - if (is_null($this->_treeModel)) { + if ($this->_treeModel === null) { $this->_treeModel = Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Category_Tree'); } return $this->_treeModel; @@ -316,7 +316,7 @@ public function getProductsPosition() } $array = $this->getData('products_position'); - if (is_null($array)) { + if ($array === null) { $array = $this->getResource()->getProductsPosition($this); $this->setData('products_position', $array); } @@ -404,7 +404,7 @@ public function setStoreId($storeId) public function getUrl() { $url = $this->_getData('url'); - if (is_null($url)) { + if ($url === null) { Magento_Profiler::start('REWRITE: '.__METHOD__, array('group' => 'REWRITE', 'method' => __METHOD__)); if ($this->hasData('request_path') && $this->getRequestPath() != '') { @@ -668,7 +668,7 @@ public function checkId($id) public function getPathIds() { $ids = $this->getData('path_ids'); - if (is_null($ids)) { + if ($ids === null) { $ids = explode('/', $this->getPath()); $this->setData('path_ids', $ids); } diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php index 829532ad8b1cc..417b5393b3cae 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Source/Sortby.php @@ -51,7 +51,7 @@ protected function _getCatalogConfig() { */ public function getAllOptions() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array(array( 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Best Value'), 'value' => 'position' diff --git a/app/code/core/Mage/Catalog/Model/Config.php b/app/code/core/Mage/Catalog/Model/Config.php index 4e6989b12f3b6..8340d720209fa 100644 --- a/app/code/core/Mage/Catalog/Model/Config.php +++ b/app/code/core/Mage/Catalog/Model/Config.php @@ -251,7 +251,7 @@ public function getSourceOptionId($source, $value) */ public function getProductAttributes() { - if (is_null($this->_productAttributes)) { + if ($this->_productAttributes === null) { $this->_productAttributes = array_keys($this->getAttributesUsedInProductListing()); } return $this->_productAttributes; @@ -286,7 +286,7 @@ protected function _getResource() * @return array */ public function getAttributesUsedInProductListing() { - if (is_null($this->_usedInProductListing)) { + if ($this->_usedInProductListing === null) { $this->_usedInProductListing = array(); $entityType = Mage_Catalog_Model_Product::ENTITY; $attributesData = $this->_getResource() @@ -309,7 +309,7 @@ public function getAttributesUsedInProductListing() { * @return array */ public function getAttributesUsedForSortBy() { - if (is_null($this->_usedForSortBy)) { + if ($this->_usedForSortBy === null) { $this->_usedForSortBy = array(); $entityType = Mage_Catalog_Model_Product::ENTITY; $attributesData = $this->_getResource() diff --git a/app/code/core/Mage/Catalog/Model/Layer.php b/app/code/core/Mage/Catalog/Model/Layer.php index 95b881c959a39..e7faa5fce71c8 100644 --- a/app/code/core/Mage/Catalog/Model/Layer.php +++ b/app/code/core/Mage/Catalog/Model/Layer.php @@ -147,7 +147,7 @@ public function apply() public function getCurrentCategory() { $category = $this->getData('current_category'); - if (is_null($category)) { + if ($category === null) { if ($category = Mage::registry('current_category')) { $this->setData('current_category', $category); } @@ -254,7 +254,7 @@ protected function _prepareAttributeCollection($collection) public function getState() { $state = $this->getData('state'); - if (is_null($state)) { + if ($state === null) { Magento_Profiler::start(__METHOD__); $state = Mage::getModel('Mage_Catalog_Model_Layer_State'); $this->setData('state', $state); diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php index c347fff1bab78..0e320a748d57e 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Abstract.php @@ -116,7 +116,7 @@ public function getItemsCount() */ public function getItems() { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_initItems(); } return $this->_items; @@ -170,7 +170,7 @@ protected function _initItems() public function getLayer() { $layer = $this->_getData('layer'); - if (is_null($layer)) { + if ($layer === null) { $layer = Mage::getSingleton('Mage_Catalog_Model_Layer'); $this->setData('layer', $layer); } @@ -235,7 +235,7 @@ public function setAttributeModel($attribute) public function getAttributeModel() { $attribute = $this->getData('attribute_model'); - if (is_null($attribute)) { + if ($attribute === null) { Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('The attribute model is not defined')); } return $attribute; @@ -259,7 +259,7 @@ public function getName() public function getStoreId() { $storeId = $this->_getData('store_id'); - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } return $storeId; @@ -284,7 +284,7 @@ public function setStoreId($storeId) public function getWebsiteId() { $websiteId = $this->_getData('website_id'); - if (is_null($websiteId)) { + if ($websiteId === null) { $websiteId = Mage::app()->getStore()->getWebsiteId(); } return $websiteId; diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php index 4d0c4859dfa2c..6f79a61fa266d 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Attribute.php @@ -59,7 +59,7 @@ public function __construct() */ protected function _getResource() { - if (is_null($this->_resource)) { + if ($this->_resource === null) { $this->_resource = Mage::getResourceModel('Mage_Catalog_Model_Resource_Layer_Filter_Attribute'); } return $this->_resource; diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php index 41e079babefb5..210455c61cd14 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Decimal.php @@ -60,7 +60,7 @@ public function __construct() */ protected function _getResource() { - if (is_null($this->_resource)) { + if ($this->_resource === null) { $this->_resource = Mage::getResourceModel('Mage_Catalog_Model_Resource_Layer_Filter_Decimal'); } return $this->_resource; @@ -139,7 +139,7 @@ protected function _renderItemLabel($range, $value) public function getMaxValue() { $max = $this->getData('max_value'); - if (is_null($max)) { + if ($max === null) { list($min, $max) = $this->_getResource()->getMinMax($this); $this->setData('max_value', $max); $this->setData('min_value', $min); @@ -155,7 +155,7 @@ public function getMaxValue() public function getMinValue() { $min = $this->getData('min_value'); - if (is_null($min)) { + if ($min === null) { list($min, $max) = $this->_getResource()->getMinMax($this); $this->setData('max_value', $max); $this->setData('min_value', $min); @@ -196,7 +196,7 @@ public function getRangeItemCounts($range) { $rangeKey = 'range_item_counts_' . $range; $items = $this->getData($rangeKey); - if (is_null($items)) { + if ($items === null) { $items = $this->_getResource()->getCount($this, $range); $this->setData($rangeKey, $items); } diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php index 3b699d135eb50..6eaeba4195660 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php @@ -83,7 +83,7 @@ public function __construct() */ protected function _getResource() { - if (is_null($this->_resource)) { + if ($this->_resource === null) { $this->_resource = Mage::getResourceModel('Mage_Catalog_Model_Resource_Layer_Filter_Price'); } return $this->_resource; @@ -135,7 +135,7 @@ public function getPriceRange() public function getMaxPriceInt() { $maxPrice = $this->getData('max_price_int'); - if (is_null($maxPrice)) { + if ($maxPrice === null) { $maxPrice = $this->getLayer()->getProductCollection()->getMaxPrice(); $maxPrice = floor($maxPrice); $this->setData('max_price_int', $maxPrice); @@ -154,7 +154,7 @@ public function getRangeItemCounts($range) { $rangeKey = 'range_item_counts_' . $range; $items = $this->getData($rangeKey); - if (is_null($items)) { + if ($items === null) { $items = $this->_getResource()->getCount($this, $range); // checking max number of intervals $i = 0; @@ -422,7 +422,7 @@ protected function _applyToCollection($range, $index) public function getCustomerGroupId() { $customerGroupId = $this->_getData('customer_group_id'); - if (is_null($customerGroupId)) { + if ($customerGroupId === null) { $customerGroupId = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerGroupId(); } return $customerGroupId; @@ -447,7 +447,7 @@ public function setCustomerGroupId($customerGroupId) public function getCurrencyRate() { $rate = $this->_getData('currency_rate'); - if (is_null($rate)) { + if ($rate === null) { $rate = Mage::app()->getStore($this->getStoreId())->getCurrentCurrencyRate(); } if (!$rate) { diff --git a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php index e0b8453300ff9..2687f86cb4710 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php +++ b/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php @@ -537,7 +537,7 @@ public function calculateSeparators() $result = array(); $lastCount = 0; $intervalFirstPrice = $this->_minPrice; - $lastSeparator = is_null($this->_lowerLimit) ? 0 : $this->_lowerLimit; + $lastSeparator = $this->_lowerLimit === null ? 0 : $this->_lowerLimit; for ($i = 1; $i < $this->getIntervalsNumber(); ++$i) { $separator = $this->_findPriceSeparator($i); @@ -600,7 +600,7 @@ public function calculateSeparators() $isEqualPrice = ($intervalFirstPrice == $this->_maxPrice) ? $intervalFirstPrice : false; $result[$this->getIntervalsNumber()] = array( 'from' => $isEqualPrice ? $isEqualPrice : $lastSeparator, - 'to' => $isEqualPrice ? $isEqualPrice : (is_null($this->_upperLimit) ? '' : $this->_upperLimit), + 'to' => $isEqualPrice ? $isEqualPrice : ($this->_upperLimit === null ? '' : $this->_upperLimit), 'count' => $this->_count - $lastCount, ); } diff --git a/app/code/core/Mage/Catalog/Model/Layer/State.php b/app/code/core/Mage/Catalog/Model/Layer/State.php index 12622dce7913b..bc6392d729790 100644 --- a/app/code/core/Mage/Catalog/Model/Layer/State.php +++ b/app/code/core/Mage/Catalog/Model/Layer/State.php @@ -70,7 +70,7 @@ public function setFilters($filters) public function getFilters() { $filters = $this->getData('filters'); - if (is_null($filters)) { + if ($filters === null) { $filters = array(); $this->setData('filters', $filters); } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index a8dfb67ebe7a1..41a3d7ae2f9c5 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -242,7 +242,7 @@ public function getTypeId() */ public function getStatus() { - if (is_null($this->_getData('status'))) { + if ($this->_getData('status') === null) { $this->setData('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED); } return $this->_getData('status'); @@ -320,7 +320,7 @@ public function getCategoryId() public function getCategory() { $category = $this->getData('category'); - if (is_null($category) && $this->getCategoryId()) { + if ($category === null && $this->getCategoryId()) { $category = Mage::getModel('Mage_Catalog_Model_Category')->load($this->getCategoryId()); $this->setCategory($category); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php index fd7f4233900cb..b04bc60903a02 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Groupprice/Abstract.php @@ -57,7 +57,7 @@ abstract protected function _getDuplicateErrorMessage(); */ protected function _getWebsiteCurrencyRates() { - if (is_null($this->_rates)) { + if ($this->_rates === null) { $this->_rates = array(); $baseCurrency = Mage::app()->getBaseCurrencyCode(); foreach (Mage::app()->getWebsites() as $website) { diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index e4c946c177983..bb83b814aa37f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -93,7 +93,7 @@ public function afterLoad($object) foreach ($this->_getResource()->loadGallery($object, $this) as $image) { foreach ($localAttributes as $localAttribute) { - if (is_null($image[$localAttribute])) { + if ($image[$localAttribute] === null) { $image[$localAttribute] = $this->_getDefaultValue($localAttribute, $image); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php index 366d1bbf40b55..a7c37e19becf4 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php @@ -80,7 +80,7 @@ protected function _construct() */ public function rebuild($store = null) { - if (is_null($store)) { + if ($store === null) { $this->_getResource()->prepareFlatTables(); } else { $this->_getResource()->prepareFlatTable($store); @@ -103,7 +103,7 @@ public function rebuild($store = null) */ public function updateAttribute($attributeCode, $store = null, $productIds = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->updateAttribute($attributeCode, $store->getId(), $productIds); } @@ -127,7 +127,7 @@ public function updateAttribute($attributeCode, $store = null, $productIds = nul */ public function prepareDataStorage($store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->prepareDataStorage($store->getId()); } @@ -148,7 +148,7 @@ public function prepareDataStorage($store = null) */ public function updateEventAttributes($store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->updateEventAttributes($store->getId()); } @@ -173,7 +173,7 @@ public function updateEventAttributes($store = null) */ public function updateProductStatus($productId, $status, $store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->updateProductStatus($productId, $status, $store->getId()); } @@ -200,7 +200,7 @@ public function updateProductStatus($productId, $status, $store = null) */ public function updateProduct($productIds, $store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->updateProduct($productIds, $store->getId()); } @@ -231,7 +231,7 @@ public function updateProduct($productIds, $store = null) */ public function saveProduct($productIds, $store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->saveProduct($productIds, $store->getId()); } @@ -262,7 +262,7 @@ public function saveProduct($productIds, $store = null) */ public function removeProduct($productIds, $store = null) { - if (is_null($store)) { + if ($store === null) { foreach (Mage::app()->getStores() as $store) { $this->removeProduct($productIds, $store->getId()); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Image.php b/app/code/core/Mage/Catalog/Model/Product/Image.php index f70b61570e70b..a73f275b91cf2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Image.php @@ -239,7 +239,7 @@ protected function _getMemoryUsage() protected function _getNeedMemoryForFile($file = null) { - $file = is_null($file) ? $this->getBaseFile() : $file; + $file = $file === null ? $this->getBaseFile() : $file; if (!$file) { return 0; } @@ -411,7 +411,7 @@ public function getImageProcessor() */ public function resize() { - if (is_null($this->getWidth()) && is_null($this->getHeight())) { + if ($this->getWidth() === null && $this->getHeight() === null) { return $this; } $this->getImageProcessor()->resize($this->_width, $this->_height); diff --git a/app/code/core/Mage/Catalog/Model/Product/Link.php b/app/code/core/Mage/Catalog/Model/Product/Link.php index 6cba498c4f523..b0efe79dd7a84 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link.php @@ -118,7 +118,7 @@ public function getLinkCollection() public function getAttributes($type=null) { - if (is_null($type)) { + if ($type === null) { $type = $this->getLinkTypeId(); } return $this->_getResource()->getAttributesByType($type); diff --git a/app/code/core/Mage/Catalog/Model/Product/Option.php b/app/code/core/Mage/Catalog/Model/Product/Option.php index d872d384c2881..349011e2bfc66 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option.php @@ -221,7 +221,7 @@ public function setProduct(Mage_Catalog_Model_Product $product = null) */ public function getGroupByType($type = null) { - if (is_null($type)) { + if ($type === null) { $type = $this->getType(); } $optionGroupsToTypes = array( diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php index 4bf0050157d26..89e8687432dfc 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value.php @@ -106,7 +106,7 @@ public function setProduct($product) public function getProduct() { - if (is_null($this->_product)) { + if ($this->_product === null) { $this->_product = $this->getOption()->getProduct(); } return $this->_product; diff --git a/app/code/core/Mage/Catalog/Model/Product/Type.php b/app/code/core/Mage/Catalog/Model/Product/Type.php index a98a8c9f767f7..9c6e45234b00f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type.php @@ -149,7 +149,7 @@ static public function getOptionText($optionId) static public function getTypes() { - if (is_null(self::$_types)) { + if (self::$_types === null) { $productTypes = Mage::getConfig()->getNode('global/catalog/product/type')->asArray(); foreach ($productTypes as $productKey => $productConfig) { $moduleName = 'Mage_Catalog_Helper_Data'; @@ -172,7 +172,7 @@ static public function getTypes() */ static public function getCompositeTypes() { - if (is_null(self::$_compositeTypes)) { + if (self::$_compositeTypes === null) { self::$_compositeTypes = array(); $types = self::getTypes(); foreach ($types as $typeId=>$typeInfo) { @@ -191,7 +191,7 @@ static public function getCompositeTypes() */ public static function getTypesByPriority() { - if (is_null(self::$_typesPriority)) { + if (self::$_typesPriority === null) { self::$_typesPriority = array(); $a = array(); $b = array(); diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php index 0f96e0dbb3e6c..310d2b761b4a9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php @@ -305,8 +305,8 @@ public function getUsedProducts($product, $requiredAttributeIds = null) { Magento_Profiler::start('CONFIGURABLE:'.__METHOD__, array('group' => 'CONFIGURABLE', 'method' => __METHOD__)); if (!$product->hasData($this->_usedProducts)) { - if (is_null($requiredAttributeIds) - and is_null($product->getData($this->_configurableAttributes))) { + if ($requiredAttributeIds === null + && $product->getData($this->_configurableAttributes) === null) { // If used products load before attributes, we will load attributes. $this->getConfigurableAttributes($product); // After attributes loading products loaded too. diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php index a4a4fc3a88829..f67ce00e3a358 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php @@ -64,7 +64,7 @@ protected function _construct() public function addPrice($priceData) { $data = $this->getPrices(); - if (is_null($data)) { + if ($data === null) { $data = array(); } $data[] = $priceData; @@ -81,7 +81,7 @@ public function getLabel() { if ($this->getData('use_default') && $this->getProductAttribute()) { return $this->getProductAttribute()->getStoreLabel(); - } else if (is_null($this->getData('label')) && $this->getProductAttribute()) { + } else if ($this->getData('label') === null && $this->getProductAttribute()) { $this->setData('label', $this->getProductAttribute()->getStoreLabel()); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php index bf5fd2582f613..5ae02b7464c95 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php @@ -42,7 +42,7 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo */ public function getFinalPrice($qty=null, $product) { - if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { + if ($qty === null && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php index 53c64914beb17..fe4ffc6575509 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php @@ -42,7 +42,7 @@ class Mage_Catalog_Model_Product_Type_Grouped_Price extends Mage_Catalog_Model_P */ public function getFinalPrice($qty=null, $product) { - if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { + if ($qty === null && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php index 9139ddb1026c3..6db3aecea0c80 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Price.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Price.php @@ -73,7 +73,7 @@ public function getBasePrice($product, $qty = null) */ public function getFinalPrice($qty = null, $product) { - if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { + if ($qty === null && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } @@ -122,7 +122,7 @@ public function getGroupPrice($product) $groupPrices = $product->getData('group_price'); - if (is_null($groupPrices)) { + if ($groupPrices === null) { $attribute = $product->getResource()->getAttribute('group_price'); if ($attribute) { $attribute->getBackend()->afterLoad($product); @@ -130,7 +130,7 @@ public function getGroupPrice($product) } } - if (is_null($groupPrices) || !is_array($groupPrices)) { + if ($groupPrices === null || !is_array($groupPrices)) { return $product->getPrice(); } @@ -157,7 +157,7 @@ public function getGroupPrice($product) */ protected function _applyTierPrice($product, $qty, $finalPrice) { - if (is_null($qty)) { + if ($qty === null) { return $finalPrice; } @@ -180,7 +180,7 @@ public function getTierPrice($qty = null, $product) $allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL; $prices = $product->getData('tier_price'); - if (is_null($prices)) { + if ($prices === null) { $attribute = $product->getResource()->getAttribute('tier_price'); if ($attribute) { $attribute->getBackend()->afterLoad($product); @@ -188,7 +188,7 @@ public function getTierPrice($qty = null, $product) } } - if (is_null($prices) || !is_array($prices)) { + if ($prices === null || !is_array($prices)) { if (!is_null($qty)) { return $product->getPrice(); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Url.php b/app/code/core/Mage/Catalog/Model/Product/Url.php index 8c8e0701ea387..74f3e3fdb55de 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Url.php +++ b/app/code/core/Mage/Catalog/Model/Product/Url.php @@ -151,7 +151,7 @@ public function getUrlPath($product, $category=null) { $path = $product->getData('url_path'); - if (is_null($category)) { + if ($category === null) { /** @todo get default category */ return $path; } elseif (!$category instanceof Mage_Catalog_Model_Category) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php index 0a5399b474052..82fbe5ea33372 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Collection.php @@ -172,7 +172,7 @@ public function setProductStoreId($storeId) */ public function getProductStoreId() { - if (is_null($this->_productStoreId)) { + if ($this->_productStoreId === null) { $this->_productStoreId = Mage_Catalog_Model_Abstract::DEFAULT_STORE_ID; } return $this->_productStoreId; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 5b1243ee60949..d86b6af005d2a 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -134,7 +134,7 @@ public function setStoreId($storeId) */ public function getStoreId() { - if (is_null($this->_storeId)) { + if ($this->_storeId === null) { return (int)Mage::app()->getStore()->getId(); } return $this->_storeId; @@ -414,7 +414,7 @@ public function getCategories($parent, $recursionLevel = 0, $sorted = false, $as */ public function getNodeById($nodeId, $nodes = null) { - if (is_null($nodes)) { + if ($nodes === null) { $nodes = $this->getNodes($nodeId); } if (isset($nodes[$nodeId])) { @@ -902,7 +902,7 @@ protected function _synchronize($category) */ public function synchronize($category = null, $storeIds = array()) { - if (is_null($category)) { + if ($category === null) { if (empty($storeIds)) { $storeIds = null; } @@ -1398,7 +1398,7 @@ public function getAnchorsAbove(array $filterIds, $storeId = 0) */ public function getStoresRootCategories($storeIds = null) { - if (is_null($this->_storesRootCategories)) { + if ($this->_storesRootCategories === null) { $select = $this->_getWriteAdapter()->select() ->from(array('cs' => $this->getTable('core_store')), array('store_id')) ->join( diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php index 09a1bfc1b22e9..737881d700282 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat/Collection.php @@ -151,7 +151,7 @@ public function setStoreId($storeId) */ public function getStoreId() { - if (is_null($this->_storeId)) { + if ($this->_storeId === null) { return Mage::app()->getStore()->getId(); } return $this->_storeId; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index ed11092b1a6c5..b3adb5d4814e1 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -1028,7 +1028,7 @@ protected function _getEnabledProductsTemporaryTable() */ protected function _getStoresInfo() { - if (is_null($this->_storesInfo)) { + if ($this->_storesInfo === null) { $adapter = $this->_getReadAdapter(); $select = $adapter->select() ->from(array('s' => $this->getTable('core_store')), array('store_id', 'website_id')) diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php index ace02926bd375..baacfb68dfcfe 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Tree.php @@ -132,7 +132,7 @@ public function getStoreId() public function addCollectionData($collection = null, $sorted = false, $exclude = array(), $toLoad = true, $onlyActive = false) { - if (is_null($collection)) { + if ($collection === null) { $collection = $this->getCollection($sorted); } else { $this->setCollection($collection); @@ -267,7 +267,7 @@ protected function _getDisabledIds($collection) protected function _getIsActiveAttributeId() { $resource = Mage::getSingleton('Mage_Core_Model_Resource'); - if (is_null($this->_isActiveAttributeId)) { + if ($this->_isActiveAttributeId === null) { $bind = array( 'entity_type_code' => Mage_Catalog_Model_Category::ENTITY, 'attribute_code' => 'is_active' @@ -341,7 +341,7 @@ protected function _getItemIsActive($id) */ public function getCollection($sorted = false) { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $this->_collection = $this->_getDefaultCollection($sorted); } return $this->_collection; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php index 4f38424c10a44..ecb94bc29c068 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php @@ -76,7 +76,7 @@ public function setStoreId($storeId) */ public function getStoreId() { - if (is_null($this->_storeId)) { + if ($this->_storeId === null) { $this->setStoreId(Mage::app()->getStore()->getId()); } return $this->_storeId; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php index f458d25c0a67c..cacd846f3a318 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Price.php @@ -66,7 +66,7 @@ protected function _getIndexTableAlias() */ protected function _replaceTableAlias($conditionString) { - if (is_null($conditionString)) { + if ($conditionString === null) { return null; } $adapter = $this->_getReadAdapter(); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Product.php index 562bc6802f94e..e49a2194a9bd2 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product.php @@ -391,11 +391,11 @@ public function refreshEnabledIndex($store = null, $product = null) $condition = array(); $indexTable = $this->getTable('catalog_product_enabled_index'); - if (is_null($store) && is_null($product)) { + if ($store === null && $product === null) { Mage::throwException( Mage::helper('Mage_Catalog_Helper_Data')->__('To reindex the enabled product(s), the store or product must be specified') ); - } elseif (is_null($product) || is_array($product)) { + } elseif ($product === null || is_array($product)) { $storeId = $store->getId(); $websiteId = $store->getWebsiteId(); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index 05310d4c8a68e..aee5fe22324b5 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -255,7 +255,7 @@ protected function _preparePriceExpressionParameters($select) */ public function getPriceExpression($select) { - if (is_null($this->_priceExpression)) { + if ($this->_priceExpression === null) { $this->_preparePriceExpressionParameters($select); } return $this->_priceExpression; @@ -269,7 +269,7 @@ public function getPriceExpression($select) */ public function getAdditionalPriceExpression($select) { - if (is_null($this->_additionalPriceExpression)) { + if ($this->_additionalPriceExpression === null) { $this->_preparePriceExpressionParameters($select); } return $this->_additionalPriceExpression; @@ -876,7 +876,7 @@ public function getSelectCountSql() protected function _getSelectCountSql($select = null, $resetLeftJoins = true) { $this->_renderFilters(); - $countSelect = (is_null($select)) ? + $countSelect = ($select === null) ? $this->_getClearSelect() : $this->_buildClearSelect($select); $countSelect->columns('COUNT(DISTINCT e.entity_id)'); @@ -930,7 +930,7 @@ protected function _getClearSelect() */ protected function _buildClearSelect($select = null) { - if (is_null($select)) { + if ($select === null) { $select = clone $this->getSelect(); } $select->reset(Zend_Db_Select::ORDER); @@ -1248,7 +1248,7 @@ public function getAllIdsCache($resetCache = false) $ids = $this->_allIdsCache; } - if (is_null($ids)) { + if ($ids === null) { $ids = $this->getAllIds(); $this->setAllIdsCache($ids); } @@ -1279,10 +1279,10 @@ public function addPriceData($customerGroupId = null, $websiteId = null) { $this->_productLimitationFilters['use_price_index'] = true; - if (!isset($this->_productLimitationFilters['customer_group_id']) && is_null($customerGroupId)) { + if (!isset($this->_productLimitationFilters['customer_group_id']) && $customerGroupId === null) { $customerGroupId = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerGroupId(); } - if (!isset($this->_productLimitationFilters['website_id']) && is_null($websiteId)) { + if (!isset($this->_productLimitationFilters['website_id']) && $websiteId === null) { $websiteId = Mage::app()->getStore($this->getStoreId())->getWebsiteId(); } @@ -2016,7 +2016,7 @@ public function setOrder($attribute, $dir = 'desc') */ public function getMaxPrice() { - if (is_null($this->_maxPrice)) { + if ($this->_maxPrice === null) { $this->_prepareStatisticsData(); } @@ -2030,7 +2030,7 @@ public function getMaxPrice() */ public function getMinPrice() { - if (is_null($this->_minPrice)) { + if ($this->_minPrice === null) { $this->_prepareStatisticsData(); } @@ -2044,7 +2044,7 @@ public function getMinPrice() */ public function getPriceStandardDeviation() { - if (is_null($this->_priceStandardDeviation)) { + if ($this->_priceStandardDeviation === null) { $this->_prepareStatisticsData(); } @@ -2059,7 +2059,7 @@ public function getPriceStandardDeviation() */ public function getPricesCount() { - if (is_null($this->_pricesCount)) { + if ($this->_pricesCount === null) { $this->_prepareStatisticsData(); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 9851d821e38e2..907b466642cf4 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -220,7 +220,7 @@ protected function _getAttributeIdsBySetIds(array $setIds) */ public function getComparableAttributes() { - if (is_null($this->_comparableAttributes)) { + if ($this->_comparableAttributes === null) { $this->_comparableAttributes = array(); $setIds = $this->_getAttributeSetIds(); if ($setIds) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php index 788fb1470a293..233f3c1c8ac9b 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav.php @@ -57,7 +57,7 @@ protected function _construct() */ public function getIndexers() { - if (is_null($this->_types)) { + if ($this->_types === null) { $this->_types = array( 'source' => Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Indexer_Eav_Source'), 'decimal' => Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Indexer_Eav_Decimal'), diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php index 8cc1a8b664659..61891b318fcea 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Decimal.php @@ -56,7 +56,7 @@ protected function _prepareIndex($entityIds = null, $attributeId = null) $write = $this->_getWriteAdapter(); $idxTable = $this->getIdxTable(); // prepare select attributes - if (is_null($attributeId)) { + if ($attributeId === null) { $attrIds = $this->_getIndexableAttributes(); } else { $attrIds = array($attributeId); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php index 256357cbb7b0c..5ed7fc229d230 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Source.php @@ -98,7 +98,7 @@ protected function _prepareSelectIndex($entityIds = null, $attributeId = null) $adapter = $this->_getWriteAdapter(); $idxTable = $this->getIdxTable(); // prepare select attributes - if (is_null($attributeId)) { + if ($attributeId === null) { $attrIds = $this->_getIndexableAttributes(false); } else { $attrIds = array($attributeId); @@ -176,7 +176,7 @@ protected function _prepareMultiselectIndex($entityIds = null, $attributeId = nu $adapter = $this->_getWriteAdapter(); // prepare multiselect attributes - if (is_null($attributeId)) { + if ($attributeId === null) { $attrIds = $this->_getIndexableAttributes(true); } else { $attrIds = array($attributeId); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index 0fe8a2e990cee..3a595ddd5d8e8 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -340,7 +340,7 @@ protected function _getIndexer($productTypeId) */ public function getTypeIndexers() { - if (is_null($this->_indexers)) { + if ($this->_indexers === null) { $this->_indexers = array(); $types = Mage::getSingleton('Mage_Catalog_Model_Product_Type')->getTypesByPriority(); foreach ($types as $typeId => $typeInfo) { diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 8357bfb3105af..af8d37d2da44b 100755 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -79,7 +79,7 @@ public function setTypeId($typeCode) */ public function getTypeId() { - if (is_null($this->_typeId)) { + if ($this->_typeId === null) { Mage::throwException(Mage::helper('Mage_Catalog_Helper_Data')->__('A product type is not defined for the indexer.')); } return $this->_typeId; diff --git a/app/code/core/Mage/Catalog/Model/Url.php b/app/code/core/Mage/Catalog/Model/Url.php index 58d4f9de5ea38..8049dfe8f5a6a 100644 --- a/app/code/core/Mage/Catalog/Model/Url.php +++ b/app/code/core/Mage/Catalog/Model/Url.php @@ -162,7 +162,7 @@ public function getStores($storeId = null) */ public function getResource() { - if (is_null($this->_resourceModel)) { + if ($this->_resourceModel === null) { $this->_resourceModel = Mage::getResourceModel('Mage_Catalog_Model_Resource_Url'); } return $this->_resourceModel; @@ -243,7 +243,7 @@ public function getShouldSaveRewritesHistory($storeId = null) */ public function refreshRewrites($storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { foreach ($this->getStores() as $store) { $this->refreshRewrites($store->getId()); } @@ -439,7 +439,7 @@ protected function _refreshCategoryProductRewrites(Varien_Object $category) */ public function refreshCategoryRewrite($categoryId, $storeId = null, $refreshProducts = true) { - if (is_null($storeId)) { + if ($storeId === null) { foreach ($this->getStores() as $store) { $this->refreshCategoryRewrite($categoryId, $store->getId(), $refreshProducts); } @@ -476,7 +476,7 @@ public function refreshCategoryRewrite($categoryId, $storeId = null, $refreshPro */ public function refreshProductRewrite($productId, $storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { foreach ($this->getStores() as $store) { $this->refreshProductRewrite($productId, $store->getId()); } @@ -586,7 +586,7 @@ public function refreshProductRewrites($storeId) */ public function clearStoreInvalidRewrites($storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { foreach ($this->getStores() as $store) { $this->clearStoreInvalidRewrites($store->getId()); } diff --git a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index cebb8614f6896..9531aafec529b 100644 --- a/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -56,7 +56,7 @@ class Mage_CatalogInventory_Block_Adminhtml_Form_Field_Customergroup extends Mag */ protected function _getCustomerGroups($groupId = null) { - if (is_null($this->_customerGroups)) { + if ($this->_customerGroups === null) { $this->_customerGroups = array(); $collection = Mage::getModel('Mage_Customer_Model_Group')->getCollection(); foreach ($collection as $item) { diff --git a/app/code/core/Mage/CatalogInventory/Model/Observer.php b/app/code/core/Mage/CatalogInventory/Model/Observer.php index c03cac73811ed..08f3a56b46674 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Observer.php +++ b/app/code/core/Mage/CatalogInventory/Model/Observer.php @@ -129,7 +129,7 @@ public function saveInventoryData($observer) { $product = $observer->getEvent()->getProduct(); - if (is_null($product->getStockData())) { + if ($product->getStockData() === null) { if ($product->getIsChangedWebsites() || $product->dataHasChangedFor('status')) { Mage::getSingleton('Mage_CatalogInventory_Model_Stock_Status') ->updateStatus($product->getId()); @@ -194,23 +194,23 @@ protected function _prepareItemForSave($item, $product) ->setProductId($product->getId()) ->setStockId($item->getStockId()); if (!is_null($product->getData('stock_data/min_qty')) - && is_null($product->getData('stock_data/use_config_min_qty'))) { + && $product->getData('stock_data/use_config_min_qty') === null) { $item->setData('use_config_min_qty', false); } if (!is_null($product->getData('stock_data/min_sale_qty')) - && is_null($product->getData('stock_data/use_config_min_sale_qty'))) { + && $product->getData('stock_data/use_config_min_sale_qty') === null) { $item->setData('use_config_min_sale_qty', false); } if (!is_null($product->getData('stock_data/max_sale_qty')) - && is_null($product->getData('stock_data/use_config_max_sale_qty'))) { + && $product->getData('stock_data/use_config_max_sale_qty') === null) { $item->setData('use_config_max_sale_qty', false); } if (!is_null($product->getData('stock_data/backorders')) - && is_null($product->getData('stock_data/use_config_backorders'))) { + && $product->getData('stock_data/use_config_backorders') === null) { $item->setData('use_config_backorders', false); } if (!is_null($product->getData('stock_data/notify_stock_qty')) - && is_null($product->getData('stock_data/use_config_notify_stock_qty'))) { + && $product->getData('stock_data/use_config_notify_stock_qty') === null) { $item->setData('use_config_notify_stock_qty', false); } $originalQty = $product->getData('stock_data/original_inventory_qty'); @@ -218,11 +218,11 @@ protected function _prepareItemForSave($item, $product) $item->setQtyCorrection($item->getQty()-$originalQty); } if (!is_null($product->getData('stock_data/enable_qty_increments')) - && is_null($product->getData('stock_data/use_config_enable_qty_inc'))) { + && $product->getData('stock_data/use_config_enable_qty_inc') === null) { $item->setData('use_config_enable_qty_inc', false); } if (!is_null($product->getData('stock_data/qty_increments')) - && is_null($product->getData('stock_data/use_config_qty_increments'))) { + && $product->getData('stock_data/use_config_qty_increments') === null) { $item->setData('use_config_qty_increments', false); } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php index 1fd28181301bd..4b5ce5a6a9f13 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -264,7 +264,7 @@ public function reindexAll() */ protected function _getTypeIndexers() { - if (is_null($this->_indexers)) { + if ($this->_indexers === null) { $this->_indexers = array(); $types = Mage::getSingleton('Mage_Catalog_Model_Product_Type')->getTypesByPriority(); foreach ($types as $typeId => $typeInfo) { diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php index 0d206413bc2d2..aa00a06001d86 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php @@ -111,7 +111,7 @@ public function setTypeId($typeId) */ public function getTypeId() { - if (is_null($this->_typeId)) { + if ($this->_typeId === null) { Mage::throwException(Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Undefined product type.')); } return $this->_typeId; diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php index b05443cf915e5..216173e755292 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item.php @@ -233,7 +233,7 @@ public function addQty($qty) public function getStoreId() { $storeId = $this->getData('store_id'); - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); $this->setData('store_id', $storeId); } @@ -854,7 +854,7 @@ public function getStockQty() $qty += $childProduct->getStockItem()->getStockQty(); } } - if (is_null($stockQty) || $qty < $stockQty) { + if ($stockQty === null || $qty < $stockQty) { $stockQty = $qty; } } diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php index 45e8c34bd8e7c..00a673c1f532c 100755 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Status.php @@ -80,7 +80,7 @@ protected function _construct() */ public function getProductTypeInstances() { - if (is_null($this->_productTypes)) { + if ($this->_productTypes === null) { $this->_productTypes = array(); $productEmulator = new Varien_Object(); @@ -115,7 +115,7 @@ public function getProductTypeInstance($productType) */ public function getWebsites($websiteId = null) { - if (is_null($this->_websites)) { + if ($this->_websites === null) { $this->_websites = $this->getResource()->getWebsiteStores(); } @@ -204,7 +204,7 @@ public function changeItemStatus(Mage_CatalogInventory_Model_Stock_Item $item) */ public function assignProduct(Mage_Catalog_Model_Product $product, $stockId = 1, $stockStatus = null) { - if (is_null($stockStatus)) { + if ($stockStatus === null) { $websiteId = $product->getStore()->getWebsiteId(); $status = $this->getProductStatus($product->getId(), $websiteId, $stockId); $stockStatus = isset($status[$product->getId()]) ? $status[$product->getId()] : null; @@ -249,7 +249,7 @@ public function rebuild($websiteId = null) */ public function updateStatus($productId, $productType = null, $websiteId = null) { - if (is_null($productType)) { + if ($productType === null) { $productType = $this->getProductType($productId); } diff --git a/app/code/core/Mage/CatalogRule/Model/Rule.php b/app/code/core/Mage/CatalogRule/Model/Rule.php index 6aa6dce822249..f5a027e4719a0 100644 --- a/app/code/core/Mage/CatalogRule/Model/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Rule.php @@ -185,7 +185,7 @@ public function setNow($now) */ public function getMatchingProductIds() { - if (is_null($this->_productIds)) { + if ($this->_productIds === null) { $this->_productIds = array(); $this->setCollectedAttributes(array()); @@ -241,7 +241,7 @@ public function applyToProduct($product, $websiteIds = null) if (is_numeric($product)) { $product = Mage::getModel('Mage_Catalog_Model_Product')->load($product); } - if (is_null($websiteIds)) { + if ($websiteIds === null) { $websiteIds = $this->getWebsiteIds(); } $this->getResource()->applyToProduct($this, $product, $websiteIds); diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index ed7073fd72409..aefdd8ff381ff 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php @@ -110,7 +110,7 @@ public function getAttributeValue($attribute, $part = null) public function getAvailableCurrencies() { $currencies = $this->getData('_currencies'); - if (is_null($currencies)) { + if ($currencies === null) { $currencies = array(); $codes = Mage::app()->getStore()->getAvailableCurrencyCodes(true); if (is_array($codes) && count($codes)) { @@ -250,7 +250,7 @@ public function getAttributeYesNoElement($attribute) protected function _getSelectBlock() { $block = $this->getData('_select_block'); - if (is_null($block)) { + if ($block === null) { $block = $this->getLayout()->createBlock('Mage_Core_Block_Html_Select'); $this->setData('_select_block', $block); } @@ -260,7 +260,7 @@ protected function _getSelectBlock() protected function _getDateBlock() { $block = $this->getData('_date_block'); - if (is_null($block)) { + if ($block === null) { $block = $this->getLayout()->createBlock('Mage_Core_Block_Html_Date'); $this->setData('_date_block', $block); } diff --git a/app/code/core/Mage/CatalogSearch/Block/Result.php b/app/code/core/Mage/CatalogSearch/Block/Result.php index 3802ed9a75b00..0ffee9bc25b4a 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Result.php +++ b/app/code/core/Mage/CatalogSearch/Block/Result.php @@ -168,7 +168,7 @@ public function getProductListHtml() */ protected function _getProductCollection() { - if (is_null($this->_productCollection)) { + if ($this->_productCollection === null) { $this->_productCollection = $this->getListBlock()->getLoadedProductCollection(); } diff --git a/app/code/core/Mage/CatalogSearch/Model/Advanced.php b/app/code/core/Mage/CatalogSearch/Model/Advanced.php index d098b8e6f5c2a..49baae3aa8fc4 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Advanced.php +++ b/app/code/core/Mage/CatalogSearch/Model/Advanced.php @@ -115,7 +115,7 @@ public function getAttributes() { /* @var $attributes Mage_Catalog_Model_Resource_Eav_Resource_Product_Attribute_Collection */ $attributes = $this->getData('attributes'); - if (is_null($attributes)) { + if ($attributes === null) { $product = Mage::getModel('Mage_Catalog_Model_Product'); $attributes = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Attribute_Collection') ->addHasOptionsFilter() @@ -281,7 +281,7 @@ public function getSearchCriterias() */ public function getProductCollection() { - if (is_null($this->_productCollection)) { + if ($this->_productCollection === null) { $collection = $this->_engine->getAdvancedResultCollection(); $this->prepareProductCollection($collection); if (!$collection) { diff --git a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php index 61c5e9f761348..057e46b81eb18 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php @@ -318,7 +318,7 @@ protected function _registerCatalogProductEvent(Mage_Index_Model_Event $event) */ protected function _getSearchableAttributes() { - if (is_null($this->_searchableAttributes)) { + if ($this->_searchableAttributes === null) { /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */ $attributeCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Attribute_Collection'); $attributeCollection->addIsSearchableFilter(); diff --git a/app/code/core/Mage/CatalogSearch/Model/Query.php b/app/code/core/Mage/CatalogSearch/Model/Query.php index d8cbda7cf1a5d..2d3813a9330e7 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Query.php +++ b/app/code/core/Mage/CatalogSearch/Model/Query.php @@ -100,7 +100,7 @@ public function getSearchCollection() public function getResultCollection() { $collection = $this->getData('result_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = $this->getSearchCollection(); $text = $this->getSynonymFor(); @@ -125,7 +125,7 @@ public function getResultCollection() public function getSuggestCollection() { $collection = $this->getData('suggest_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = Mage::getResourceModel('Mage_CatalogSearch_Model_Resource_Query_Collection') ->setStoreId($this->getStoreId()) ->setQueryFilter($this->getQueryText()); diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index a719ba9f734bd..3e5066a2f9309 100755 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -105,7 +105,7 @@ public function getSeparator() */ public function rebuildIndex($storeId = null, $productIds = null) { - if (is_null($storeId)) { + if ($storeId === null) { $storeIds = array_keys(Mage::app()->getStores()); foreach ($storeIds as $storeId) { $this->_rebuildStoreIndex($storeId, $productIds); @@ -387,7 +387,7 @@ public function getEavConfig() */ protected function _getSearchableAttributes($backendType = null) { - if (is_null($this->_searchableAttributes)) { + if ($this->_searchableAttributes === null) { $this->_searchableAttributes = array(); $productAttributeCollection = Mage::getResourceModel('Mage_Catalog_Model_Resource_Product_Attribute_Collection'); diff --git a/app/code/core/Mage/Centinel/Model/State/Jcb.php b/app/code/core/Mage/Centinel/Model/State/Jcb.php index ba66da282b1e6..fdb96bd869f95 100644 --- a/app/code/core/Mage/Centinel/Model/State/Jcb.php +++ b/app/code/core/Mage/Centinel/Model/State/Jcb.php @@ -36,7 +36,7 @@ class Mage_Centinel_Model_State_Jcb extends Mage_Centinel_Model_StateAbstract */ public function isAuthenticateAllowed() { - return $this->_isLookupStrictSuccessful() && is_null($this->getAuthenticateEciFlag()); + return $this->_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; } /** diff --git a/app/code/core/Mage/Centinel/Model/State/Mastercard.php b/app/code/core/Mage/Centinel/Model/State/Mastercard.php index cf30692e2acf0..5b540e0abfc8b 100644 --- a/app/code/core/Mage/Centinel/Model/State/Mastercard.php +++ b/app/code/core/Mage/Centinel/Model/State/Mastercard.php @@ -36,7 +36,7 @@ class Mage_Centinel_Model_State_Mastercard extends Mage_Centinel_Model_StateAbst */ public function isAuthenticateAllowed() { - return $this->_isLookupStrictSuccessful() && is_null($this->getAuthenticateEciFlag()); + return $this->_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; } /** diff --git a/app/code/core/Mage/Centinel/Model/State/Visa.php b/app/code/core/Mage/Centinel/Model/State/Visa.php index 09b37b9e3c618..330befe49a01c 100644 --- a/app/code/core/Mage/Centinel/Model/State/Visa.php +++ b/app/code/core/Mage/Centinel/Model/State/Visa.php @@ -36,7 +36,7 @@ class Mage_Centinel_Model_State_Visa extends Mage_Centinel_Model_StateAbstract */ public function isAuthenticateAllowed() { - return $this->_isLookupStrictSuccessful() && is_null($this->getAuthenticateEciFlag()); + return $this->_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; } /** diff --git a/app/code/core/Mage/Checkout/Block/Cart.php b/app/code/core/Mage/Checkout/Block/Cart.php index ed66b69802ef2..4bd2bd79e324b 100644 --- a/app/code/core/Mage/Checkout/Block/Cart.php +++ b/app/code/core/Mage/Checkout/Block/Cart.php @@ -122,7 +122,7 @@ public function getCheckoutUrl() public function getContinueShoppingUrl() { $url = $this->getData('continue_shopping_url'); - if (is_null($url)) { + if ($url === null) { $url = Mage::getSingleton('Mage_Checkout_Model_Session')->getContinueShoppingUrl(true); if (!$url) { $url = Mage::getUrl(); diff --git a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php index a3328147aebac..f5cc5ead1283a 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Abstract.php @@ -89,7 +89,7 @@ public function getItemRenderer($type) if (!isset($this->_itemRenders[$type])) { $type = 'default'; } - if (is_null($this->_itemRenders[$type]['blockInstance'])) { + if ($this->_itemRenders[$type]['blockInstance'] === null) { $this->_itemRenders[$type]['blockInstance'] = $this->getLayout() ->createBlock($this->_itemRenders[$type]['block']) ->setTemplate($this->_itemRenders[$type]['template']) diff --git a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php index b9b8826bd4578..0824cbee43b6c 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Crosssell.php @@ -48,7 +48,7 @@ class Mage_Checkout_Block_Cart_Crosssell extends Mage_Catalog_Block_Product_Abst public function getItems() { $items = $this->getData('items'); - if (is_null($items)) { + if ($items === null) { $items = array(); $ninProductIds = $this->_getCartProductIds(); if ($ninProductIds) { @@ -106,7 +106,7 @@ public function getItemCount() protected function _getCartProductIds() { $ids = $this->getData('_cart_product_ids'); - if (is_null($ids)) { + if ($ids === null) { $ids = array(); foreach ($this->getQuote()->getAllItems() as $item) { if ($product = $item->getProduct()) { diff --git a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php index e4ddf6d12be03..f51e5c4206aa0 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php @@ -101,7 +101,7 @@ public function overrideProductThumbnail($productThumbnail) */ protected function _getThumbnail() { - if (is_null($this->_productThumbnail)) { + if ($this->_productThumbnail === null) { $product = $this->getProduct(); if ($this->getProduct()->isConfigurable()) { $children = $this->getItem()->getChildren(); diff --git a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php index 99efdb96faf06..0f7b4e50c78ea 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Sidebar.php @@ -57,7 +57,7 @@ protected function _construct() public function getItemCount() { $count = $this->getData('item_count'); - if (is_null($count)) { + if ($count === null) { $count = Mage::getStoreConfig(self::XML_PATH_CHECKOUT_SIDEBAR_COUNT); $this->setData('item_count', $count); } diff --git a/app/code/core/Mage/Checkout/Block/Cart/Totals.php b/app/code/core/Mage/Checkout/Block/Cart/Totals.php index b7fd360c7164a..6d40f5b1f0c64 100644 --- a/app/code/core/Mage/Checkout/Block/Cart/Totals.php +++ b/app/code/core/Mage/Checkout/Block/Cart/Totals.php @@ -32,7 +32,7 @@ class Mage_Checkout_Block_Cart_Totals extends Mage_Checkout_Block_Cart_Abstract public function getTotals() { - if (is_null($this->_totals)) { + if ($this->_totals === null) { return parent::getTotals(); } return $this->_totals; @@ -73,7 +73,7 @@ public function renderTotal($total, $area = null, $colspan = 1) return $this->_getTotalRenderer($code) ->setTotal($total) ->setColspan($colspan) - ->setRenderingArea(is_null($area) ? -1 : $area) + ->setRenderingArea($area === null ? -1 : $area) ->toHtml(); } diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php index a1afff0ea8ab1..108aaef3cabbb 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Address/Select.php @@ -40,47 +40,47 @@ protected function _prepareLayout() } return parent::_prepareLayout(); } - + protected function _getCheckout() { return Mage::getSingleton('Mage_Checkout_Model_Type_Multishipping'); } - + public function getAddressCollection() { $collection = $this->getData('address_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = $this->_getCheckout()->getCustomer()->getAddresses(); $this->setData('address_collection', $collection); } return $collection; } - + public function isAddressDefaultBilling($address) { return $address->getId() == $this->_getCheckout()->getCustomer()->getDefaultBilling(); } - + public function isAddressDefaultShipping($address) { return $address->getId() == $this->_getCheckout()->getCustomer()->getDefaultShipping(); } - + public function getEditAddressUrl($address) { return $this->getUrl('*/*/editAddress', array('id'=>$address->getId())); } - + public function getSetAddressUrl($address) { return $this->getUrl('*/*/setBilling', array('id'=>$address->getId())); } - + public function getAddNewUrl() { return $this->getUrl('*/*/newBilling'); } - + public function getBackUrl() { return $this->getUrl('*/multishipping/billing'); diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php index 9950d848192ea..ec249110d46d2 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Addresses.php @@ -84,7 +84,7 @@ public function getAddressesHtmlSelect($item, $index) public function getAddressOptions() { $options = $this->getData('address_options'); - if (is_null($options)) { + if ($options === null) { $options = array(); foreach ($this->getCustomer()->getAddresses() as $address) { $options[] = array( diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php index 216a3907e427c..308e041cb80c7 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Billing.php @@ -79,7 +79,7 @@ public function getSelectedMethodCode() public function getAddress() { $address = $this->getData('address'); - if (is_null($address)) { + if ($address === null) { $address = Mage::getSingleton('Mage_Checkout_Model_Type_Multishipping')->getQuote()->getBillingAddress(); $this->setData('address', $address); } diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php index 3777788679460..3ef93f194c089 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Overview.php @@ -98,7 +98,7 @@ public function getShippingAddresses() public function getShippingAddressCount() { $count = $this->getData('shipping_address_count'); - if (is_null($count)) { + if ($count === null) { $count = count($this->getShippingAddresses()); $this->setData('shipping_address_count', $count); } diff --git a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php index f228c9c0bf7f7..59f80898121b4 100644 --- a/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Multishipping/Shipping.php @@ -59,7 +59,7 @@ public function getAddresses() public function getAddressCount() { $count = $this->getData('address_count'); - if (is_null($count)) { + if ($count === null) { $count = count($this->getAddresses()); $this->setData('address_count', $count); } diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php index 9e662bb15ae81..8bb09e65220e8 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Abstract.php @@ -148,7 +148,7 @@ public function getAddressesHtmlSelect($type) public function getCountryHtmlSelect($type) { $countryId = $this->getAddress()->getCountryId(); - if (is_null($countryId)) { + if ($countryId === null) { $countryId = Mage::helper('Mage_Core_Helper_Data')->getDefaultCountry(); } $select = $this->getLayout()->createBlock('Mage_Core_Block_Html_Select') diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php index 7207461d80033..8b5924132b986 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Billing.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Billing.php @@ -101,7 +101,7 @@ public function getMethod() */ public function getAddress() { - if (is_null($this->_address)) { + if ($this->_address === null) { if ($this->isCustomerLoggedIn()) { $this->_address = $this->getQuote()->getBillingAddress(); if(!$this->_address->getFirstname()) { diff --git a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php index 8d9ca97106e1e..ea4b4d854cc94 100644 --- a/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php +++ b/app/code/core/Mage/Checkout/Block/Onepage/Shipping.php @@ -68,7 +68,7 @@ public function getMethod() */ public function getAddress() { - if (is_null($this->_address)) { + if ($this->_address === null) { if ($this->isCustomerLoggedIn()) { $this->_address = $this->getQuote()->getShippingAddress(); } else { diff --git a/app/code/core/Mage/Checkout/Helper/Data.php b/app/code/core/Mage/Checkout/Helper/Data.php index 30a31e2c64a3e..91ba0a92eb795 100644 --- a/app/code/core/Mage/Checkout/Helper/Data.php +++ b/app/code/core/Mage/Checkout/Helper/Data.php @@ -68,7 +68,7 @@ public function convertPrice($price, $format=true) public function getRequiredAgreementIds() { - if (is_null($this->_agreements)) { + if ($this->_agreements === null) { if (!Mage::getStoreConfigFlag('checkout/options/enable_agreements')) { $this->_agreements = array(); } else { diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php index 503425cd76dfa..bfd984b362329 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Cart.php @@ -98,7 +98,7 @@ public function getItems() public function getQuoteProductIds() { $products = $this->getData('product_ids'); - if (is_null($products)) { + if ($products === null) { $products = array(); foreach ($this->getQuote()->getAllItems() as $item) { $products[$item->getProductId()] = $item->getProductId(); @@ -165,7 +165,7 @@ public function init() public function addOrderItem($orderItem, $qtyFlag=null) { /* @var $orderItem Mage_Sales_Model_Order_Item */ - if (is_null($orderItem->getParentItem())) { + if ($orderItem->getParentItem() === null) { $product = Mage::getModel('Mage_Catalog_Model_Product') ->setStoreId(Mage::app()->getStore()->getId()) ->load($orderItem->getProductId()); @@ -175,7 +175,7 @@ public function addOrderItem($orderItem, $qtyFlag=null) $info = $orderItem->getProductOptionByCode('info_buyRequest'); $info = new Varien_Object($info); - if (is_null($qtyFlag)) { + if ($qtyFlag === null) { $info->setQty($orderItem->getQtyOrdered()); } else { $info->setQty(1); diff --git a/app/code/core/Mage/Checkout/Model/Session.php b/app/code/core/Mage/Checkout/Model/Session.php index 2c6adbedcc421..cb14d54a48ffc 100644 --- a/app/code/core/Mage/Checkout/Model/Session.php +++ b/app/code/core/Mage/Checkout/Model/Session.php @@ -231,7 +231,7 @@ public function loadCustomerQuote() public function setStepData($step, $data, $value=null) { $steps = $this->getSteps(); - if (is_null($value)) { + if ($value === null) { if (is_array($data)) { $steps[$step] = $data; } @@ -251,13 +251,13 @@ public function setStepData($step, $data, $value=null) public function getStepData($step=null, $data=null) { $steps = $this->getSteps(); - if (is_null($step)) { + if ($step === null) { return $steps; } if (!isset($steps[$step])) { return false; } - if (is_null($data)) { + if ($data === null) { return $steps[$step]; } if (!is_string($data) || !isset($steps[$step][$data])) { diff --git a/app/code/core/Mage/Checkout/Model/Type/Abstract.php b/app/code/core/Mage/Checkout/Model/Type/Abstract.php index b3f32a2ed00bd..f65fa93d8d22d 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Abstract.php +++ b/app/code/core/Mage/Checkout/Model/Type/Abstract.php @@ -41,7 +41,7 @@ abstract class Mage_Checkout_Model_Type_Abstract extends Varien_Object public function getCheckoutSession() { $checkout = $this->getData('checkout_session'); - if (is_null($checkout)) { + if ($checkout === null) { $checkout = Mage::getSingleton('Mage_Checkout_Model_Session'); $this->setData('checkout_session', $checkout); } @@ -76,7 +76,7 @@ public function getQuoteItems() public function getCustomerSession() { $customer = $this->getData('customer_session'); - if (is_null($customer)) { + if ($customer === null) { $customer = Mage::getSingleton('Mage_Customer_Model_Session'); $this->setData('customer_session', $customer); } @@ -101,7 +101,7 @@ public function getCustomer() public function getCustomerDefaultShippingAddress() { $address = $this->getData('customer_default_shipping_address'); - if (is_null($address)) { + if ($address === null) { $address = $this->getCustomer()->getDefaultShippingAddress(); if (!$address) { foreach ($this->getCustomer()->getAddresses() as $address) { @@ -123,7 +123,7 @@ public function getCustomerDefaultShippingAddress() public function getCustomerDefaultBillingAddress() { $address = $this->getData('customer_default_billing_address'); - if (is_null($address)) { + if ($address === null) { $address = $this->getCustomer()->getDefaultBillingAddress(); if (!$address) { foreach ($this->getCustomer()->getAddresses() as $address) { diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 1ddc161497563..5bf535322e47c 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -452,7 +452,7 @@ public function savePaymentAction() */ protected function _getOrder() { - if (is_null($this->_order)) { + if ($this->_order === null) { $this->_order = Mage::getModel('Mage_Sales_Model_Order'); $this->_order->load($this->getOnepage()->getQuote()->getId(), 'quote_id'); if (!$this->_order->getId()) { diff --git a/app/code/core/Mage/Cms/Model/Page.php b/app/code/core/Mage/Cms/Model/Page.php index a42a98b17afc5..b00ddd91fd35a 100644 --- a/app/code/core/Mage/Cms/Model/Page.php +++ b/app/code/core/Mage/Cms/Model/Page.php @@ -107,7 +107,7 @@ protected function _construct() */ public function load($id, $field=null) { - if (is_null($id)) { + if ($id === null) { return $this->noRoutePage(); } return parent::load($id, $field); diff --git a/app/code/core/Mage/Cms/Model/Resource/Block.php b/app/code/core/Mage/Cms/Model/Resource/Block.php index d767cecf404d2..72c2e4bebf29a 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Block.php +++ b/app/code/core/Mage/Cms/Model/Resource/Block.php @@ -130,7 +130,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { - if (!is_numeric($value) && is_null($field)) { + if (!is_numeric($value) && $field === null) { $field = 'identifier'; } diff --git a/app/code/core/Mage/Cms/Model/Resource/Page.php b/app/code/core/Mage/Cms/Model/Resource/Page.php index 60a5ec522f7cd..185877e669a5e 100755 --- a/app/code/core/Mage/Cms/Model/Resource/Page.php +++ b/app/code/core/Mage/Cms/Model/Resource/Page.php @@ -160,7 +160,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { - if (!is_numeric($value) && is_null($field)) { + if (!is_numeric($value) && $field === null) { $field = 'identifier'; } diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index 4b960fbf74cf4..de53c88db8b5e 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -766,7 +766,7 @@ protected function _getNotFoundUrl($route = '', $params = array('_direct' => 'co */ public function getMessagesBlock() { - if (is_null($this->_messagesBlock)) { + if ($this->_messagesBlock === null) { return $this->getLayout()->getMessagesBlock(); } return $this->_messagesBlock; @@ -1034,7 +1034,7 @@ public function getCacheLifetime() */ protected function _loadCache() { - if (is_null($this->getCacheLifetime()) || !$this->_cache->canUse(self::CACHE_GROUP)) { + if ($this->getCacheLifetime() === null || !$this->_cache->canUse(self::CACHE_GROUP)) { return false; } $cacheKey = $this->getCacheKey(); @@ -1057,7 +1057,7 @@ protected function _loadCache() */ protected function _saveCache($data) { - if (is_null($this->getCacheLifetime()) || !$this->_cache->canUse(self::CACHE_GROUP)) { + if ($this->getCacheLifetime() === null || !$this->_cache->canUse(self::CACHE_GROUP)) { return false; } $cacheKey = $this->getCacheKey(); @@ -1079,7 +1079,7 @@ protected function _saveCache($data) */ protected function _getSidPlaceholder($cacheKey = null) { - if (is_null($cacheKey)) { + if ($cacheKey === null) { $cacheKey = $this->getCacheKey(); } diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 3d16eea73032e..46545515ace35 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -248,7 +248,7 @@ public function getDirectOutput() public function getShowTemplateHints() { - if (is_null(self::$_showTemplateHints)) { + if (self::$_showTemplateHints === null) { self::$_showTemplateHints = Mage::getStoreConfig(self::XML_PATH_DEBUG_TEMPLATE_HINTS) && Mage::helper('Mage_Core_Helper_Data')->isDevAllowed(); self::$_showTemplateHintsBlocks = Mage::getStoreConfig(self::XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS) @@ -397,7 +397,7 @@ public function getCacheKeyInfo() */ protected function _getAllowSymlinks() { - if (is_null($this->_allowSymlinks)) { + if ($this->_allowSymlinks === null) { $this->_allowSymlinks = $this->_storeConfig->getConfigFlag(self::XML_PATH_TEMPLATE_ALLOW_SYMLINK); } return $this->_allowSymlinks; diff --git a/app/code/core/Mage/Core/Block/Template/Zend.php b/app/code/core/Mage/Core/Block/Template/Zend.php index 0c005e426c6bc..1c37e8f29ff14 100644 --- a/app/code/core/Mage/Core/Block/Template/Zend.php +++ b/app/code/core/Mage/Core/Block/Template/Zend.php @@ -51,7 +51,7 @@ function _construct() public function assign($key, $value=null) { - if (is_array($key) && is_null($value)) { + if (is_array($key) && $value === null) { foreach ($key as $k=>$v) { $this->assign($k, $v); } diff --git a/app/code/core/Mage/Core/Controller/Request/Http.php b/app/code/core/Mage/Core/Controller/Request/Http.php index 3b67f47263b6c..94370ad943539 100644 --- a/app/code/core/Mage/Core/Controller/Request/Http.php +++ b/app/code/core/Mage/Core/Controller/Request/Http.php @@ -217,7 +217,7 @@ public function isDirectAccessFrontendName($code) */ public function getDirectFrontNames() { - if (is_null($this->_directFrontNames)) { + if ($this->_directFrontNames === null) { $names = Mage::getConfig()->getNode(self::XML_NODE_DIRECT_FRONT_NAMES); if ($names) { $this->_directFrontNames = $names->asArray(); @@ -492,7 +492,7 @@ public function initForward() */ public function getBeforeForwardInfo($name = null) { - if (is_null($name)) { + if ($name === null) { return $this->_beforeForwardInfo; } elseif (isset($this->_beforeForwardInfo[$name])) { return $this->_beforeForwardInfo[$name]; diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 6fa69f84e8beb..8b83a82c92d3c 100755 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -1140,7 +1140,7 @@ protected function _prepareDownloadResponse( ->setHeader('Pragma', 'public', true) ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true) ->setHeader('Content-type', $contentType, true) - ->setHeader('Content-Length', is_null($contentLength) ? strlen($content) : $contentLength, true) + ->setHeader('Content-Length', $contentLength === null ? strlen($content) : $contentLength, true) ->setHeader('Content-Disposition', 'attachment; filename="'.$fileName.'"', true) ->setHeader('Last-Modified', date('r'), true); diff --git a/app/code/core/Mage/Core/Controller/Varien/Front.php b/app/code/core/Mage/Core/Controller/Varien/Front.php index 84394705bdf56..759e33ff43c39 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Front.php +++ b/app/code/core/Mage/Core/Controller/Varien/Front.php @@ -74,7 +74,7 @@ public function setDefault($key, $value=null) public function getDefault($key=null) { - if (is_null($key)) { + if ($key === null) { return $this->_defaults; } elseif (isset($this->_defaults[$key])) { return $this->_defaults[$key]; diff --git a/app/code/core/Mage/Core/Controller/Varien/Router/Base.php b/app/code/core/Mage/Core/Controller/Varien/Router/Base.php index f14298d53d5be..d96cdec283a7f 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Router/Base.php +++ b/app/code/core/Mage/Core/Controller/Varien/Router/Base.php @@ -82,7 +82,7 @@ public function __construct( $this->_areaCode = $areaCode; $this->_baseController = $baseController; - if (is_null($this->_areaCode) || is_null($this->_baseController)) { + if ($this->_areaCode === null || $this->_baseController === null) { throw new InvalidArgumentException("Not enough options to initialize router."); } } @@ -412,7 +412,7 @@ protected function _matchController(Mage_Core_Controller_Request_Http $request, */ if (false == $found) { $controllerInstance = $this->_getNotFoundControllerInstance($currentModuleName, $request); - if (is_null($controllerInstance)) { + if ($controllerInstance === null) { return null; } } diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index f32493c6e69fc..180ba5e8af38a 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -178,7 +178,7 @@ public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMA if (!($date instanceof Zend_Date) && $date && !strtotime($date)) { return ''; } - if (is_null($date)) { + if ($date === null) { $date = Mage::app()->getLocale()->date( Mage::getSingleton('Mage_Core_Model_Date')->gmtTimestamp(), null, @@ -211,7 +211,7 @@ public function formatTime($time = null, $format = Mage_Core_Model_Locale::FORMA return $time; } - if (is_null($time)) { + if ($time === null) { $date = Mage::app()->getLocale()->date(time()); } else if ($time instanceof Zend_Date) { $date = $time; @@ -263,7 +263,7 @@ public function validateKey($key) public function getRandomString($len, $chars = null) { - if (is_null($chars)) { + if ($chars === null) { $chars = self::CHARS_LOWERS . self::CHARS_UPPERS . self::CHARS_DIGITS; } mt_srand(10000000*(double)microtime()); diff --git a/app/code/core/Mage/Core/Helper/File/Storage.php b/app/code/core/Mage/Core/Helper/File/Storage.php index e1fdb8c53b08c..974729119cff7 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage.php +++ b/app/code/core/Mage/Core/Helper/File/Storage.php @@ -56,7 +56,7 @@ class Mage_Core_Helper_File_Storage extends Mage_Core_Helper_Abstract */ public function getCurrentStorageCode() { - if (is_null($this->_currentStorage)) { + if ($this->_currentStorage === null) { $this->_currentStorage = (int) Mage::app() ->getConfig()->getNode(Mage_Core_Model_File_Storage::XML_PATH_STORAGE_MEDIA); } diff --git a/app/code/core/Mage/Core/Helper/File/Storage/Database.php b/app/code/core/Mage/Core/Helper/File/Storage/Database.php index dd88d7651e5bf..2d8e152c07d83 100644 --- a/app/code/core/Mage/Core/Helper/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Helper/File/Storage/Database.php @@ -96,7 +96,7 @@ public function checkDbUsage() */ public function getStorageDatabaseModel() { - if (is_null($this->_databaseModel)) { + if ($this->_databaseModel === null) { $this->_databaseModel = Mage::getModel('Mage_Core_Model_File_Storage_Database'); } @@ -120,7 +120,7 @@ public function getStorageFileModel() */ public function getResourceStorageModel() { - if (is_null($this->_resourceModel)) { + if ($this->_resourceModel === null) { $this->_resourceModel = $this->getStorageDatabaseModel()->getResource(); } return $this->_resourceModel; diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 447171c98eaa4..d8e3ca82cd04c 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -125,7 +125,7 @@ public function getRemoteAddrHeaders() */ public function getRemoteAddr($ipToLong = false) { - if (is_null($this->_remoteAddr)) { + if ($this->_remoteAddr === null) { $headers = $this->getRemoteAddrHeaders(); foreach ($headers as $var) { if ($this->_getRequest()->getServer($var, false)) { diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index 075392f462e99..837a446a91b56 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -134,7 +134,7 @@ protected function _getTranslateData() */ protected function _getXmlConfig() { - if (is_null($this->_config)) { + if ($this->_config === null) { $canUsaCache = Mage::app()->useCache('config'); $cachedXml = Mage::app()->loadCache(self::JAVASCRIPT_TRANSLATE_CONFIG_KEY); if ($canUsaCache && $cachedXml) { diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 5bfcfe46b9ee3..8f9bf5543c3ba 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -92,7 +92,7 @@ public function strlen($string) public function substr($string, $offset, $length = null) { $string = $this->cleanString($string); - if (is_null($length)) { + if ($length === null) { $length = $this->strlen($string) - $offset; } return iconv_substr($string, $offset, $length, self::ICONV_CHARSET); diff --git a/app/code/core/Mage/Core/Helper/Url.php b/app/code/core/Mage/Core/Helper/Url.php index 7a3db68709a45..cb047e855a700 100644 --- a/app/code/core/Mage/Core/Helper/Url.php +++ b/app/code/core/Mage/Core/Helper/Url.php @@ -112,7 +112,7 @@ public function addRequestParam($url, $param) if (is_array($value)) { // $key[]=$value1&$key[]=$value2 ... $arrQueryParams[] = $key . '[]=' . implode('&' . $key . '[]=', $value); - } elseif (is_null($value)) { + } elseif ($value === null) { $arrQueryParams[] = $key; } else { $arrQueryParams[] = $key . '=' . $value; diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index bd635203ebd28..0d6185bd9f4c6 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -199,7 +199,7 @@ public function __wakeup() protected function _setResourceModel($resourceName, $resourceCollectionName = null) { $this->_resourceName = $resourceName; - if (is_null($resourceCollectionName)) { + if ($resourceCollectionName === null) { $resourceCollectionName = $resourceName . '_Collection'; } $this->_resourceCollectionName = $resourceCollectionName; diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index eabc277684393..86f2ee831aee1 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -715,7 +715,7 @@ protected function _initStores() $websiteStores[$store->getWebsiteId()][$store->getId()] = $store; $groupStores[$store->getGroupId()][$store->getId()] = $store; - if (is_null($this->_store) && $store->getId()) { + if ($this->_store === null && $store->getId()) { $this->_store = $store; } } @@ -1052,7 +1052,7 @@ public function getDistroLocaleCode() */ public function getWebsite($id = null) { - if (is_null($id)) { + if ($id === null) { $id = $this->getStore()->getWebsiteId(); } elseif ($id instanceof Mage_Core_Model_Website) { return $id; @@ -1108,7 +1108,7 @@ public function getWebsites($withDefault = false, $codeKey = false) */ public function getGroup($id = null) { - if (is_null($id)) { + if ($id === null) { $id = $this->getStore()->getGroup()->getId(); } elseif ($id instanceof Mage_Core_Model_Store_Group) { return $id; @@ -1587,7 +1587,7 @@ public function getIsCacheLocked() */ public function clearWebsiteCache($id = null) { - if (is_null($id)) { + if ($id === null) { $id = $this->getStore()->getWebsiteId(); } elseif ($id instanceof Mage_Core_Model_Website) { $id = $id->getId(); diff --git a/app/code/core/Mage/Core/Model/App/Area.php b/app/code/core/Mage/Core/Model/App/Area.php index d3fc995d152d9..d510f9418143b 100644 --- a/app/code/core/Mage/Core/Model/App/Area.php +++ b/app/code/core/Mage/Core/Model/App/Area.php @@ -73,7 +73,7 @@ public function __construct($areaCode) */ public function load($part=null) { - if (is_null($part)) { + if ($part === null) { $this->_loadPart(self::PART_CONFIG) ->_loadPart(self::PART_EVENTS) ->_loadPart(self::PART_DESIGN) diff --git a/app/code/core/Mage/Core/Model/App/Emulation.php b/app/code/core/Mage/Core/Model/App/Emulation.php index b1dd0f4178fdd..89f96d335e2d7 100644 --- a/app/code/core/Mage/Core/Model/App/Emulation.php +++ b/app/code/core/Mage/Core/Model/App/Emulation.php @@ -98,7 +98,7 @@ public function stopEnvironmentEmulation(Varien_Object $initialEnvironmentInfo) */ protected function _emulateInlineTranslation($storeId = null, $area = Mage_Core_Model_App_Area::AREA_FRONTEND) { - if (is_null($storeId)) { + if ($storeId === null) { $newTranslateInline = false; } else { if ($area == Mage_Core_Model_App_Area::AREA_ADMIN) { diff --git a/app/code/core/Mage/Core/Model/Cache.php b/app/code/core/Mage/Core/Model/Cache.php index 9104d3f6302e9..f13310d30b682 100644 --- a/app/code/core/Mage/Core/Model/Cache.php +++ b/app/code/core/Mage/Core/Model/Cache.php @@ -593,7 +593,7 @@ public function saveOptions($options) */ public function canUse($typeCode) { - if (is_null($this->_allowedCacheOptions)) { + if ($this->_allowedCacheOptions === null) { $this->_initOptions(); } diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 9ca5a3418cb99..cfcd120bdd12a 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -286,7 +286,7 @@ public function __construct(Magento_ObjectManager $objectManager, $sourceData = */ public function getResourceModel() { - if (is_null($this->_resourceModel)) { + if ($this->_resourceModel === null) { $this->_resourceModel = Mage::getResourceModel('Mage_Core_Model_Resource_Config'); } return $this->_resourceModel; @@ -1681,7 +1681,7 @@ public function getResourceModelClassName($modelClass) */ public function getAreas() { - if (is_null($this->_allowedAreas) ) { + if ($this->_allowedAreas === null ) { $this->_loadAreas(); } diff --git a/app/code/core/Mage/Core/Model/Cookie.php b/app/code/core/Mage/Core/Model/Cookie.php index 1de4732752dda..4a76273c6542a 100644 --- a/app/code/core/Mage/Core/Model/Cookie.php +++ b/app/code/core/Mage/Core/Model/Cookie.php @@ -67,7 +67,7 @@ public function setStore($store) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->_store = Mage::app()->getStore(); } return $this->_store; @@ -169,7 +169,7 @@ public function setLifetime($lifetime) public function getHttponly() { $httponly = Mage::getStoreConfig(self::XML_PATH_COOKIE_HTTPONLY, $this->getStore()); - if (is_null($httponly)) { + if ($httponly === null) { return null; } return (bool)$httponly; @@ -212,7 +212,7 @@ public function set($name, $value, $period = null, $path = null, $domain = null, if ($period === true) { $period = 3600 * 24 * 365; - } elseif (is_null($period)) { + } elseif ($period === null) { $period = $this->getLifetime(); } @@ -222,16 +222,16 @@ public function set($name, $value, $period = null, $path = null, $domain = null, else { $expire = time() + $period; } - if (is_null($path)) { + if ($path === null) { $path = $this->getPath(); } - if (is_null($domain)) { + if ($domain === null) { $domain = $this->getDomain(); } - if (is_null($secure)) { + if ($secure === null) { $secure = $this->isSecure(); } - if (is_null($httponly)) { + if ($httponly === null) { $httponly = $this->getHttponly(); } @@ -292,16 +292,16 @@ public function delete($name, $path = null, $domain = null, $secure = null, $htt return $this; } - if (is_null($path)) { + if ($path === null) { $path = $this->getPath(); } - if (is_null($domain)) { + if ($domain === null) { $domain = $this->getDomain(); } - if (is_null($secure)) { + if ($secure === null) { $secure = $this->isSecure(); } - if (is_null($httponly)) { + if ($httponly === null) { $httponly = $this->getHttponly(); } diff --git a/app/code/core/Mage/Core/Model/Date.php b/app/code/core/Mage/Core/Model/Date.php index ba6b16854c7a9..fbd7cb7852ad8 100644 --- a/app/code/core/Mage/Core/Model/Date.php +++ b/app/code/core/Mage/Core/Model/Date.php @@ -102,7 +102,7 @@ public function calculateOffset($timezone = null) */ public function gmtDate($format = null, $input = null) { - if (is_null($format)) { + if ($format === null) { $format = 'Y-m-d H:i:s'; } @@ -126,7 +126,7 @@ public function gmtDate($format = null, $input = null) */ public function date($format = null, $input = null) { - if (is_null($format)) { + if ($format === null) { $format = 'Y-m-d H:i:s'; } @@ -142,7 +142,7 @@ public function date($format = null, $input = null) */ public function gmtTimestamp($input = null) { - if (is_null($input)) { + if ($input === null) { return gmdate('U'); } else if (is_numeric($input)) { $result = $input; @@ -172,7 +172,7 @@ public function gmtTimestamp($input = null) */ public function timestamp($input = null) { - if (is_null($input)) { + if ($input === null) { $result = $this->gmtTimestamp(); } else if (is_numeric($input)) { $result = $input; diff --git a/app/code/core/Mage/Core/Model/Design.php b/app/code/core/Mage/Core/Model/Design.php index 3eb0c8e947dc5..527f4e47adb07 100644 --- a/app/code/core/Mage/Core/Model/Design.php +++ b/app/code/core/Mage/Core/Model/Design.php @@ -73,7 +73,7 @@ protected function _construct() */ public function loadChange($storeId, $date = null) { - if (is_null($date)) { + if ($date === null) { $date = Varien_Date::formatDate(Mage::app()->getLocale()->storeTimeStamp($storeId), false); } diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 4be237dd86398..5b341f3cce5ff 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -194,7 +194,7 @@ public function setArea($area) */ public function getArea() { - if (is_null($this->_area)) { + if ($this->_area === null) { $this->_area = self::DEFAULT_AREA; } return $this->_area; diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index 8de298bc2ff65..638ef3cca22a7 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -278,7 +278,7 @@ public function loadBaseContents($module, $filename) */ static public function getDefaultTemplates() { - if (is_null(self::$_defaultTemplates)) { + if (self::$_defaultTemplates === null) { self::$_defaultTemplates = Mage::getConfig()->getNode(self::XML_PATH_TEMPLATE_EMAIL)->asArray(); } diff --git a/app/code/core/Mage/Core/Model/File/Storage.php b/app/code/core/Mage/Core/Model/File/Storage.php index 9284a5c66a20e..767208f875d0b 100644 --- a/app/code/core/Mage/Core/Model/File/Storage.php +++ b/app/code/core/Mage/Core/Model/File/Storage.php @@ -98,7 +98,7 @@ public function getSyncFlag() */ public function getStorageModel($storage = null, $params = array()) { - if (is_null($storage)) { + if ($storage === null) { $storage = Mage::helper('Mage_Core_Helper_File_Storage')->getCurrentStorageCode(); } diff --git a/app/code/core/Mage/Core/Model/File/Storage/Database.php b/app/code/core/Mage/Core/Model/File/Storage/Database.php index 2427a3ec11bd7..a2730d084ef92 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/Database.php +++ b/app/code/core/Mage/Core/Model/File/Storage/Database.php @@ -74,7 +74,7 @@ public function __construct($connectionName = null) */ public function getDirectoryModel() { - if (is_null($this->_directoryModel)) { + if ($this->_directoryModel === null) { $arguments = array('connection' => $this->getConnectionName()); $this->_directoryModel = Mage::getModel( 'Mage_Core_Model_File_Storage_Directory_Database', diff --git a/app/code/core/Mage/Core/Model/File/Storage/File.php b/app/code/core/Mage/Core/Model/File/Storage/File.php index df0fdf72f2dc6..831784eff26c3 100644 --- a/app/code/core/Mage/Core/Model/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/File/Storage/File.php @@ -131,7 +131,7 @@ public function collectData($offset = 0, $count = 100, $type = 'files') $offset = ((int) $offset >= 0) ? (int) $offset : 0; $count = ((int) $count >= 1) ? (int) $count : 1; - if (is_null($this->_data)) { + if ($this->_data === null) { $this->_data = $this->getStorageData(); } diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index b75d791d9400b..381ac3dadd326 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -75,7 +75,7 @@ protected function _afterSave($result) */ public function skipDbProcessing($flag = null) { - if (is_null($flag)) { + if ($flag === null) { return $this->_skipDbProcessing; } $this->_skipDbProcessing = (bool)$flag; diff --git a/app/code/core/Mage/Core/Model/Flag.php b/app/code/core/Mage/Core/Model/Flag.php index 751d9635665d7..29228aad0f4c0 100644 --- a/app/code/core/Mage/Core/Model/Flag.php +++ b/app/code/core/Mage/Core/Model/Flag.php @@ -70,7 +70,7 @@ protected function _construct() */ protected function _beforeSave() { - if (is_null($this->_flagCode)) { + if ($this->_flagCode === null) { Mage::throwException(Mage::helper('Mage_Core_Helper_Data')->__('Please define flag code.')); } @@ -112,7 +112,7 @@ public function setFlagData($value) */ public function loadSelf() { - if (is_null($this->_flagCode)) { + if ($this->_flagCode === null) { Mage::throwException(Mage::helper('Mage_Core_Helper_Data')->__('Please define flag code.')); } diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index d0d5e0d9d6c20..e230cc87fa127 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -457,7 +457,7 @@ public function getDateTimeFormat($type) */ public function date($date = null, $part = null, $locale = null, $useTimezone = true) { - if (is_null($locale)) { + if ($locale === null) { $locale = $this->getLocale(); } @@ -584,7 +584,7 @@ public function currency($currency) */ public function getNumber($value) { - if (is_null($value)) { + if ($value === null) { return null; } diff --git a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php index 67d28b81eecd0..885db11179a85 100644 --- a/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php +++ b/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php @@ -178,7 +178,7 @@ protected function _setResource($connections, $tables = null) $this->_resourcePrefix = $connections; } - if (is_null($tables) && is_string($connections)) { + if ($tables === null && is_string($connections)) { $this->_resourceModel = $this->_resourcePrefix; } else if (is_array($tables)) { foreach ($tables as $k => $v) { @@ -201,7 +201,7 @@ protected function _setResource($connections, $tables = null) protected function _setMainTable($mainTable, $idFieldName = null) { $this->_mainTable = $mainTable; - if (is_null($idFieldName)) { + if ($idFieldName === null) { $idFieldName = $mainTable . '_id'; } @@ -327,7 +327,7 @@ public function getReadConnection() */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { - if (is_null($field)) { + if ($field === null) { $field = $this->getIdFieldName(); } @@ -447,7 +447,7 @@ public function delete(Mage_Core_Model_Abstract $object) */ public function addUniqueField($field) { - if (is_null($this->_uniqueFields)) { + if ($this->_uniqueFields === null) { $this->_initUniqueFields(); } if (is_array($this->_uniqueFields) ) { @@ -498,7 +498,7 @@ protected function _initUniqueFields() */ public function getUniqueFields() { - if (is_null($this->_uniqueFields)) { + if ($this->_uniqueFields === null) { $this->_initUniqueFields(); } return $this->_uniqueFields; diff --git a/app/code/core/Mage/Core/Model/Resource/Design.php b/app/code/core/Mage/Core/Model/Resource/Design.php index d68d0597ad04e..b080d24191a94 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design.php +++ b/app/code/core/Mage/Core/Model/Resource/Design.php @@ -128,18 +128,18 @@ protected function _checkIntersection($storeId, $dateFrom, $dateTo, $currentId) $dateConditions[] = 'date_to IS NULL'; } - if (is_null($dateFrom) && !is_null($dateTo)) { + if ($dateFrom === null && !is_null($dateTo)) { $dateConditions[] = 'date_to <= :date_to OR date_from <= :date_to'; } - if (!is_null($dateFrom) && is_null($dateTo)) { + if (!is_null($dateFrom) && $dateTo === null) { $dateConditions[] = 'date_to >= :date_from OR date_from >= :date_from'; } if (!is_null($dateFrom) && !is_null($dateTo)) { $dateConditions[] = 'date_from BETWEEN :date_from AND :date_to'; $dateConditions[] = 'date_to BETWEEN :date_from AND :date_to'; - } elseif (is_null($dateFrom) && is_null($dateTo)) { + } elseif ($dateFrom === null && $dateTo === null) { $dateConditions = array(); } diff --git a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php index 0eec4cf575596..e60acbdaf34a7 100644 --- a/app/code/core/Mage/Core/Model/Resource/Design/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Design/Collection.php @@ -64,7 +64,7 @@ public function joinStore() */ public function addDateFilter($date = null) { - if (is_null($date)) { + if ($date === null) { $date = $this->formatDate(true); } else { $date = $this->formatDate($date); diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Template.php b/app/code/core/Mage/Core/Model/Resource/Email/Template.php index 6335711b667fd..585c06507b435 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Template.php @@ -70,7 +70,7 @@ public function loadByCode($templateCode) */ public function checkCodeUsage(Mage_Core_Model_Email_Template $template) { - if ($template->getTemplateActual() != 0 || is_null($template->getTemplateActual())) { + if ($template->getTemplateActual() != 0 || $template->getTemplateActual() === null) { $select = $this->_getReadAdapter()->select() ->from($this->getMainTable(), 'COUNT(*)') ->where('template_code = :template_code'); diff --git a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php index c5533348d85d0..bf7f05122456e 100644 --- a/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php +++ b/app/code/core/Mage/Core/Model/Resource/File/Storage/File.php @@ -90,7 +90,7 @@ public function __construct( */ public function getMediaBaseDirectory() { - if (is_null($this->_mediaBaseDirectory)) { + if ($this->_mediaBaseDirectory === null) { $this->_mediaBaseDirectory = $this->_dbHelper->getMediaBaseDir(); } diff --git a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php index 7d2fc506a50d8..3718dc2b382f5 100644 --- a/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Core/Model/Resource/Helper/Mysql4.php @@ -296,7 +296,7 @@ public function prepareColumnsList(Varien_Db_Select $select, $groupByCondition = $preparedColumns[strtoupper($col)] = array($correlationName, $col, null); } } else { - $columnKey = is_null($alias) ? $column : $alias; + $columnKey = $alias === null ? $column : $alias; $preparedColumns[strtoupper($columnKey)] = array($correlationName, $column, $alias); } } diff --git a/app/code/core/Mage/Core/Model/Resource/Resource.php b/app/code/core/Mage/Core/Model/Resource/Resource.php index 9c4cf63668d54..f4eea8146cd8a 100644 --- a/app/code/core/Mage/Core/Model/Resource/Resource.php +++ b/app/code/core/Mage/Core/Model/Resource/Resource.php @@ -69,8 +69,8 @@ protected function _construct() */ protected function _loadVersionData($needType) { - if ((($needType == 'db') && is_null(self::$_versions)) - || (($needType == 'data') && is_null(self::$_dataVersions))) { + if ((($needType == 'db') && self::$_versions === null) + || (($needType == 'data') && self::$_dataVersions === null)) { self::$_versions = array(); // Db version column always exists self::$_dataVersions = null; // Data version array will be filled only if Data column exist @@ -81,7 +81,7 @@ protected function _loadVersionData($needType) foreach ($rowset as $row) { self::$_versions[$row['code']] = $row['version']; if (array_key_exists('data_version', $row)) { - if (is_null(self::$_dataVersions)) { + if (self::$_dataVersions === null) { self::$_dataVersions = array(); } self::$_dataVersions[$row['code']] = $row['data_version']; diff --git a/app/code/core/Mage/Core/Model/Resource/Setup.php b/app/code/core/Mage/Core/Model/Resource/Setup.php index 21523516e89f7..17ae9fde300f0 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup.php @@ -746,7 +746,7 @@ public function getTableRow($table, $idField, $id, $field = null, $parentField = $this->_setupCache[$table][$parentId][$id] = $adapter->fetchRow($select, $bind); } - if (is_null($field)) { + if ($field === null) { return $this->_setupCache[$table][$parentId][$id]; } return isset($this->_setupCache[$table][$parentId][$id][$field]) diff --git a/app/code/core/Mage/Core/Model/Resource/Setup/Migration.php b/app/code/core/Mage/Core/Model/Resource/Setup/Migration.php index 5631e6ff62712..221f3f9f40286 100644 --- a/app/code/core/Mage/Core/Model/Resource/Setup/Migration.php +++ b/app/code/core/Mage/Core/Model/Resource/Setup/Migration.php @@ -664,7 +664,7 @@ protected function _pushToMap($entityType, $alias, $className) */ protected function _getAliasesMap() { - if (is_null($this->_aliasesMap)) { + if ($this->_aliasesMap === null) { $this->_aliasesMap = array(); $map = $this->_loadMap($this->_pathToMapFile); diff --git a/app/code/core/Mage/Core/Model/Resource/Translate.php b/app/code/core/Mage/Core/Model/Resource/Translate.php index ed52de131ca38..7ba64273406be 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate.php @@ -56,7 +56,7 @@ public function getTranslationArray($storeId = null, $locale = null) return array(); } - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } @@ -93,7 +93,7 @@ public function getTranslationArrayByStrings(array $strings, $storeId = null) return array(); } - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } diff --git a/app/code/core/Mage/Core/Model/Resource/Translate/String.php b/app/code/core/Mage/Core/Model/Resource/Translate/String.php index 3a00aa01aeff9..5e09432863140 100644 --- a/app/code/core/Mage/Core/Model/Resource/Translate/String.php +++ b/app/code/core/Mage/Core/Model/Resource/Translate/String.php @@ -139,7 +139,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) if (is_array($translations)) { foreach ($translations as $storeId => $translate) { - if (is_null($translate) || $translate=='') { + if ($translate === null || $translate=='') { $where = array( 'store_id = ?' => $storeId, 'string = ?' => $object->getString() @@ -176,7 +176,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) */ public function deleteTranslate($string, $locale = null, $storeId = null) { - if (is_null($locale)) { + if ($locale === null) { $locale = Mage::app()->getLocale()->getLocaleCode(); } @@ -210,11 +210,11 @@ public function saveTranslate($string, $translate, $locale = null, $storeId = nu $write = $this->_getWriteAdapter(); $table = $this->getMainTable(); - if (is_null($locale)) { + if ($locale === null) { $locale = Mage::app()->getLocale()->getLocaleCode(); } - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index 0d174fe5cefde..8eb75a303ef99 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -589,7 +589,7 @@ public function addUniqueMessages($messages) public function setSessionId($id=null) { - if (is_null($id) + if ($id === null && (Mage::app()->getStore()->isAdmin() || Mage::getStoreConfig(self::XML_PATH_USE_FRONTEND_SID))) { $_queryParam = $this->getSessionIdQueryParam(); if (isset($_GET[$_queryParam]) && Mage::getSingleton('Mage_Core_Model_Url')->isOwnOriginUrl()) { diff --git a/app/code/core/Mage/Core/Model/Source/Urlrewrite/Options.php b/app/code/core/Mage/Core/Model/Source/Urlrewrite/Options.php index 810fc6ec267d5..d42715bfe5288 100644 --- a/app/code/core/Mage/Core/Model/Source/Urlrewrite/Options.php +++ b/app/code/core/Mage/Core/Model/Source/Urlrewrite/Options.php @@ -48,7 +48,7 @@ class Mage_Core_Model_Source_Urlrewrite_Options */ public function getAllOptions() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array( '' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('No'), self::TEMPORARY => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Temporary (302)'), diff --git a/app/code/core/Mage/Core/Model/Source/Urlrewrite/Types.php b/app/code/core/Mage/Core/Model/Source/Urlrewrite/Types.php index 7e39ae7805315..3fddeee15830f 100644 --- a/app/code/core/Mage/Core/Model/Source/Urlrewrite/Types.php +++ b/app/code/core/Mage/Core/Model/Source/Urlrewrite/Types.php @@ -48,7 +48,7 @@ class Mage_Core_Model_Source_Urlrewrite_Types */ public function getAllOptions() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array( self::SYSTEM => Mage::helper('Mage_Adminhtml_Helper_Data')->__('System'), self::CUSTOM => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Custom') diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index a5fade2330f8c..5654bd6dbd387 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -278,7 +278,7 @@ protected function _getSession() */ public function load($id, $field=null) { - if (!is_numeric($id) && is_null($field)) { + if (!is_numeric($id) && $field === null) { $this->_getResource()->load($this, $id, 'code'); return $this; } @@ -421,10 +421,10 @@ public function setWebsite(Mage_Core_Model_Website $website) */ public function getWebsite() { - if (is_null($this->getWebsiteId())) { + if ($this->getWebsiteId() === null) { return false; } - if (is_null($this->_website)) { + if ($this->_website === null) { $this->_website = Mage::app()->getWebsite($this->getWebsiteId()); } return $this->_website; @@ -530,11 +530,11 @@ public function getUrl($route = '', $params = array()) */ public function getBaseUrl($type = self::URL_TYPE_LINK, $secure = null) { - $cacheKey = $type . '/' . (is_null($secure) ? 'null' : ($secure ? 'true' : 'false')); + $cacheKey = $type . '/' . ($secure === null ? 'null' : ($secure ? 'true' : 'false')); if (!isset($this->_baseUrlCache[$cacheKey])) { switch ($type) { case self::URL_TYPE_WEB: - $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool)$secure; + $secure = $secure === null ? $this->isCurrentlySecure() : (bool)$secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_url'); break; @@ -552,12 +552,12 @@ public function getBaseUrl($type = self::URL_TYPE_LINK, $secure = null) break; case self::URL_TYPE_JS: - $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool) $secure; + $secure = $secure === null ? $this->isCurrentlySecure() : (bool) $secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_public_url') . 'lib/'; break; case self::URL_TYPE_THEME: - $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool) $secure; + $secure = $secure === null ? $this->isCurrentlySecure() : (bool) $secure; $url = $this->getConfig('web/' . ($secure ? 'secure' : 'unsecure') . '/base_public_url') . 'media/theme/'; break; @@ -625,7 +625,7 @@ protected function _isCustomEntryPoint() */ protected function _updateMediaPathUseRewrites($secure = null, $type = self::URL_TYPE_MEDIA) { - $secure = is_null($secure) ? $this->isCurrentlySecure() : (bool) $secure; + $secure = $secure === null ? $this->isCurrentlySecure() : (bool) $secure; $secureStringFlag = $secure ? 'secure' : 'unsecure'; $url = $this->getConfig('web/' . $secureStringFlag . '/base_' . $type . '_url'); if (!$this->getConfig(self::XML_PATH_USE_REWRITES) @@ -770,7 +770,7 @@ public function getBaseCurrencyCode() public function getBaseCurrency() { $currency = $this->getData('base_currency'); - if (is_null($currency)) { + if ($currency === null) { $currency = Mage::getModel('Mage_Directory_Model_Currency')->load($this->getBaseCurrencyCode()); $this->setData('base_currency', $currency); } @@ -796,7 +796,7 @@ public function getDefaultCurrencyCode() public function getDefaultCurrency() { $currency = $this->getData('default_currency'); - if (is_null($currency)) { + if ($currency === null) { $currency = Mage::getModel('Mage_Directory_Model_Currency')->load($this->getDefaultCurrencyCode()); $this->setData('default_currency', $currency); } @@ -860,7 +860,7 @@ public function getCurrentCurrencyCode() public function getAvailableCurrencyCodes($skipBaseNotAllowed = false) { $codes = $this->getData('available_currency_codes'); - if (is_null($codes)) { + if ($codes === null) { $codes = explode(',', $this->getConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_ALLOW)); // add base currency, if it is not in allowed currencies $baseCurrencyCode = $this->getBaseCurrencyCode(); @@ -894,7 +894,7 @@ public function getCurrentCurrency() { $currency = $this->getData('current_currency'); - if (is_null($currency)) { + if ($currency === null) { $currency = Mage::getModel('Mage_Directory_Model_Currency')->load($this->getCurrentCurrencyCode()); $baseCurrency = $this->getBaseCurrency(); @@ -1019,10 +1019,10 @@ public function setGroup($group) */ public function getGroup() { - if (is_null($this->getGroupId())) { + if ($this->getGroupId() === null) { return false; } - if (is_null($this->_group)) { + if ($this->_group === null) { $this->_group = Mage::getModel('Mage_Core_Model_Store_Group')->load($this->getGroupId()); } return $this->_group; @@ -1218,7 +1218,7 @@ public function isReadOnly($value = null) */ public function getFrontendName() { - if (is_null($this->_frontendName)) { + if ($this->_frontendName === null) { $storeGroupName = (string) Mage::getStoreConfig('general/store_information/name', $this); $this->_frontendName = (!empty($storeGroupName)) ? $storeGroupName : $this->getGroup()->getName(); } diff --git a/app/code/core/Mage/Core/Model/Store/Group.php b/app/code/core/Mage/Core/Model/Store/Group.php index f53b7712b0627..dc5cc0b63206c 100644 --- a/app/code/core/Mage/Core/Model/Store/Group.php +++ b/app/code/core/Mage/Core/Model/Store/Group.php @@ -171,7 +171,7 @@ public function getStoreCollection() */ public function getStores() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_stores; @@ -184,7 +184,7 @@ public function getStores() */ public function getStoreIds() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storeIds; @@ -197,7 +197,7 @@ public function getStoreIds() */ public function getStoreCodes() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storeCodes; @@ -205,7 +205,7 @@ public function getStoreCodes() public function getStoresCount() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storesCount; @@ -221,7 +221,7 @@ public function getDefaultStore() if (!$this->hasDefaultStoreId()) { return false; } - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_defaultStore; @@ -284,10 +284,10 @@ public function setWebsite(Mage_Core_Model_Website $website) */ public function getWebsite() { - if (is_null($this->getWebsiteId())) { + if ($this->getWebsiteId() === null) { return false; } - if (is_null($this->_website)) { + if ($this->_website === null) { $this->_website = Mage::app()->getWebsite($this->getWebsiteId()); } return $this->_website; diff --git a/app/code/core/Mage/Core/Model/System/Store.php b/app/code/core/Mage/Core/Model/System/Store.php index 18390ec377e09..5a64416442f5d 100644 --- a/app/code/core/Mage/Core/Model/System/Store.php +++ b/app/code/core/Mage/Core/Model/System/Store.php @@ -445,7 +445,7 @@ public function getStoreCollection() */ public function reload($type = null) { - if (is_null($type)) { + if ($type === null) { $this->_loadWebsiteCollection(); $this->_loadGroupCollection(); $this->_loadStoreCollection(); diff --git a/app/code/core/Mage/Core/Model/Theme/Service.php b/app/code/core/Mage/Core/Model/Theme/Service.php index 9d77b139ace88..d900a4ba4b351 100644 --- a/app/code/core/Mage/Core/Model/Theme/Service.php +++ b/app/code/core/Mage/Core/Model/Theme/Service.php @@ -263,7 +263,7 @@ public function getThemes($page, $pageSize) */ public function getAssignedThemeCustomizations() { - if (is_null($this->_assignedThemeCustomizations)) { + if ($this->_assignedThemeCustomizations === null) { $this->_prepareThemeCustomizations(); } return $this->_assignedThemeCustomizations; @@ -277,7 +277,7 @@ public function getAssignedThemeCustomizations() */ public function getUnassignedThemeCustomizations() { - if (is_null($this->_unassignedThemeCustomizations)) { + if ($this->_unassignedThemeCustomizations === null) { $this->_prepareThemeCustomizations(); } return $this->_unassignedThemeCustomizations; diff --git a/app/code/core/Mage/Core/Model/Translate.php b/app/code/core/Mage/Core/Model/Translate.php index 9b149871abb4d..d49ac27f5bc45 100644 --- a/app/code/core/Mage/Core/Model/Translate.php +++ b/app/code/core/Mage/Core/Model/Translate.php @@ -373,7 +373,7 @@ protected function _getFileData($file) */ public function getData() { - if (is_null($this->_data)) { + if ($this->_data === null) { return array(); } return $this->_data; @@ -386,7 +386,7 @@ public function getData() */ public function getLocale() { - if (is_null($this->_locale)) { + if ($this->_locale === null) { $this->_locale = Mage::app()->getLocale()->getLocaleCode(); } return $this->_locale; @@ -415,7 +415,7 @@ public function getResource() */ public function getTranslate() { - if (is_null($this->_translate)) { + if ($this->_translate === null) { $this->_translate = new Zend_Translate('array', $this->getData(), $this->getLocale()); } return $this->_translate; @@ -432,7 +432,7 @@ public function translate($args) $text = array_shift($args); if (is_string($text) && '' == $text - || is_null($text) + || $text === null || is_bool($text) && false === $text || is_object($text) && '' == $text->getText()) { return ''; @@ -496,7 +496,7 @@ public function getTranslateInline() */ public function getCacheId() { - if (is_null($this->_cacheId)) { + if ($this->_cacheId === null) { $this->_cacheId = 'translate'; if (isset($this->_config[self::CONFIG_KEY_LOCALE])) { $this->_cacheId.= '_'.$this->_config[self::CONFIG_KEY_LOCALE]; diff --git a/app/code/core/Mage/Core/Model/Translate/Inline.php b/app/code/core/Mage/Core/Model/Translate/Inline.php index 6c2d3724a5451..e18b804917eda 100644 --- a/app/code/core/Mage/Core/Model/Translate/Inline.php +++ b/app/code/core/Mage/Core/Model/Translate/Inline.php @@ -138,14 +138,14 @@ class Mage_Core_Model_Translate_Inline */ public function isAllowed($store = null) { - if (is_null($store)) { + if ($store === null) { $store = Mage::app()->getStore(); } if (!$store instanceof Mage_Core_Model_Store) { $store = Mage::app()->getStore($store); } - if (is_null($this->_isAllowed)) { + if ($this->_isAllowed === null) { if (Mage::getDesign()->getArea() == 'adminhtml') { $active = Mage::getStoreConfigFlag('dev/translate_inline/active_admin', $store); } else { diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 4872b6baaabad..3efb41c8c326d 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -223,7 +223,7 @@ public function setRouteFrontName($name) */ public function getUseSession() { - if (is_null($this->_useSession)) { + if ($this->_useSession === null) { $this->_useSession = Mage::app()->getUseSessionInUrl(); } return $this->_useSession; @@ -248,7 +248,7 @@ public function getDefaultActionName() */ public function getConfigData($key, $prefix = null) { - if (is_null($prefix)) { + if ($prefix === null) { $prefix = 'web/' . ($this->isSecure() ? 'secure' : 'unsecure').'/'; } $path = $prefix . $key; @@ -485,7 +485,7 @@ public function getRoutePath($routeParams = array()) $routePath = $this->getActionPath(); if ($this->getRouteParams()) { foreach ($this->getRouteParams() as $key=>$value) { - if (is_null($value) || false === $value || '' === $value || !is_scalar($value)) { + if ($value === null || false === $value || '' === $value || !is_scalar($value)) { continue; } $routePath .= $key . '/' . $value . '/'; @@ -1136,7 +1136,7 @@ public function sessionUrlVar($html) public function useSessionIdForUrl($secure = false) { $key = 'use_session_id_for_url_' . (int) $secure; - if (is_null($this->getData($key))) { + if ($this->getData($key) === null) { $httpHost = Mage::app()->getFrontController()->getRequest()->getHttpHost(); $urlHost = parse_url($this->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, $secure), PHP_URL_HOST); diff --git a/app/code/core/Mage/Core/Model/Url/Rewrite.php b/app/code/core/Mage/Core/Model/Url/Rewrite.php index 0a9edf042ca9c..83d1213e38e6e 100644 --- a/app/code/core/Mage/Core/Model/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Model/Url/Rewrite.php @@ -197,13 +197,13 @@ public function rewrite(Zend_Controller_Request_Http $request=null, Zend_Control if (!Mage::isInstalled()) { return false; } - if (is_null($request)) { + if ($request === null) { $request = Mage::app()->getFrontController()->getRequest(); } - if (is_null($response)) { + if ($response === null) { $response = Mage::app()->getFrontController()->getResponse(); } - if (is_null($this->getStoreId()) || false===$this->getStoreId()) { + if ($this->getStoreId() === null || false===$this->getStoreId()) { $this->setStoreId(Mage::app()->getStore()->getId()); } diff --git a/app/code/core/Mage/Core/Model/Website.php b/app/code/core/Mage/Core/Model/Website.php index 8c2b6f4a238a4..f22e143a46721 100644 --- a/app/code/core/Mage/Core/Model/Website.php +++ b/app/code/core/Mage/Core/Model/Website.php @@ -163,7 +163,7 @@ protected function _construct() */ public function load($id, $field = null) { - if (!is_numeric($id) && is_null($field)) { + if (!is_numeric($id) && $field === null) { $this->_getResource()->load($this, $id, 'code'); return $this; } @@ -283,7 +283,7 @@ public function getGroupCollection() */ public function getGroups() { - if (is_null($this->_groups)) { + if ($this->_groups === null) { $this->_loadGroups(); } return $this->_groups; @@ -296,7 +296,7 @@ public function getGroups() */ public function getGroupIds() { - if (is_null($this->_groups)) { + if ($this->_groups === null) { $this->_loadGroups(); } return $this->_groupIds; @@ -309,7 +309,7 @@ public function getGroupIds() */ public function getGroupsCount() { - if (is_null($this->_groups)) { + if ($this->_groups === null) { $this->_loadGroups(); } return $this->_groupsCount; @@ -325,7 +325,7 @@ public function getDefaultGroup() if (!$this->hasDefaultGroupId()) { return false; } - if (is_null($this->_groups)) { + if ($this->_groups === null) { $this->_loadGroups(); } return $this->_defaultGroup; @@ -389,7 +389,7 @@ public function getStoreCollection() */ public function getStores() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_stores; @@ -402,7 +402,7 @@ public function getStores() */ public function getStoreIds() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storeIds; @@ -415,7 +415,7 @@ public function getStoreIds() */ public function getStoreCodes() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storeCodes; @@ -428,7 +428,7 @@ public function getStoreCodes() */ public function getStoresCount() { - if (is_null($this->_stores)) { + if ($this->_stores === null) { $this->_loadStores(); } return $this->_storesCount; @@ -444,7 +444,7 @@ public function isCanDelete() if ($this->_isReadOnly || !$this->getId()) { return false; } - if (is_null($this->_isCanDelete)) { + if ($this->_isCanDelete === null) { $this->_isCanDelete = (Mage::getModel('Mage_Core_Model_Website')->getCollection()->getSize() > 2) && !$this->getIsDefault(); } @@ -515,7 +515,7 @@ public function getBaseCurrencyCode() public function getBaseCurrency() { $currency = $this->getData('base_currency'); - if (is_null($currency)) { + if ($currency === null) { $currency = Mage::getModel('Mage_Directory_Model_Currency')->load($this->getBaseCurrencyCode()); $this->setData('base_currency', $currency); } diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard.php b/app/code/core/Mage/Customer/Block/Account/Dashboard.php index 961cd2b3d1a8a..116f0694e9cb4 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard.php @@ -77,7 +77,7 @@ public function getTagsUrl() public function getSubscriptionObject() { - if(is_null($this->_subscription)) { + if($this->_subscription === null) { $this->_subscription = Mage::getModel('Mage_Newsletter_Model_Subscriber')->loadByCustomer($this->getCustomer()); } diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php index dd1318a8f7e80..3f79be0541dda 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Newsletter.php @@ -36,7 +36,7 @@ class Mage_Customer_Block_Account_Dashboard_Newsletter extends Mage_Core_Block_T { public function getSubscriptionObject() { - if(is_null($this->_subscription)) { + if($this->_subscription === null) { $this->_subscription = Mage::getModel('Mage_Newsletter_Model_Subscriber') ->loadByCustomer(Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer()); } diff --git a/app/code/core/Mage/Customer/Block/Address/Book.php b/app/code/core/Mage/Customer/Block/Address/Book.php index df364132839db..c4d7c37626efe 100644 --- a/app/code/core/Mage/Customer/Block/Address/Book.php +++ b/app/code/core/Mage/Customer/Block/Address/Book.php @@ -93,7 +93,7 @@ public function getAddressHtml($address) public function getCustomer() { $customer = $this->getData('customer'); - if (is_null($customer)) { + if ($customer === null) { $customer = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer(); $this->setData('customer', $customer); } diff --git a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php index 1c026410b3270..176929c9d9be7 100644 --- a/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php +++ b/app/code/core/Mage/Customer/Block/Address/Renderer/Default.php @@ -67,7 +67,7 @@ public function setType(Varien_Object $type) public function getFormat(Mage_Customer_Model_Address_Abstract $address=null) { - $countryFormat = is_null($address) + $countryFormat = $address === null ? false : $address->getCountryModel()->getFormat($this->getType()->getCode()); $format = $countryFormat ? $countryFormat->getFormat() : $this->getType()->getDefaultFormat(); diff --git a/app/code/core/Mage/Customer/Block/Form/Login.php b/app/code/core/Mage/Customer/Block/Form/Login.php index 2cbb4ccea3225..45d9b96ca0600 100644 --- a/app/code/core/Mage/Customer/Block/Form/Login.php +++ b/app/code/core/Mage/Customer/Block/Form/Login.php @@ -59,7 +59,7 @@ public function getPostActionUrl() public function getCreateAccountUrl() { $url = $this->getData('create_account_url'); - if (is_null($url)) { + if ($url === null) { $url = $this->helper('Mage_Customer_Helper_Data')->getRegisterUrl(); } return $url; diff --git a/app/code/core/Mage/Customer/Block/Form/Register.php b/app/code/core/Mage/Customer/Block/Form/Register.php index b6e727327336e..01fa8da520d2a 100644 --- a/app/code/core/Mage/Customer/Block/Form/Register.php +++ b/app/code/core/Mage/Customer/Block/Form/Register.php @@ -62,7 +62,7 @@ public function getPostActionUrl() public function getBackUrl() { $url = $this->getData('back_url'); - if (is_null($url)) { + if ($url === null) { $url = $this->helper('Mage_Customer_Helper_Data')->getLoginUrl(); } return $url; @@ -76,7 +76,7 @@ public function getBackUrl() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $formData = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerFormData(true); $data = new Varien_Object(); if ($formData) { @@ -137,7 +137,7 @@ public function isNewsletterEnabled() */ public function getAddress() { - if (is_null($this->_address)) { + if ($this->_address === null) { $this->_address = Mage::getModel('Mage_Customer_Model_Address'); } diff --git a/app/code/core/Mage/Customer/Helper/Address.php b/app/code/core/Mage/Customer/Helper/Address.php index 90755a9a27db9..158630e38a5cb 100644 --- a/app/code/core/Mage/Customer/Helper/Address.php +++ b/app/code/core/Mage/Customer/Helper/Address.php @@ -172,7 +172,7 @@ public function canShowConfig($key) */ public function getAttributes() { - if (is_null($this->_attributes)) { + if ($this->_attributes === null) { $this->_attributes = array(); /* @var $config Mage_Eav_Model_Config */ $config = Mage::getSingleton('Mage_Eav_Model_Config'); diff --git a/app/code/core/Mage/Customer/Helper/Data.php b/app/code/core/Mage/Customer/Helper/Data.php index abea5207ac0b0..77204f5dc860a 100644 --- a/app/code/core/Mage/Customer/Helper/Data.php +++ b/app/code/core/Mage/Customer/Helper/Data.php @@ -633,7 +633,7 @@ protected function _createVatNumberValidationSoapClient($trace = false) public function extractCustomerData(Zend_Controller_Request_Http $request, $formCode, $entity, $additionalAttributes = array(), $scope = null, $eavForm = null ) { - if (is_null($eavForm)) { + if ($eavForm === null) { $eavForm = Mage::getModel('Mage_Customer_Model_Form'); } /** @var Mage_Eav_Model_Form $eavForm */ diff --git a/app/code/core/Mage/Customer/Model/Address.php b/app/code/core/Mage/Customer/Model/Address.php index 74ad94ec7e8c7..58f9ba4c529dd 100644 --- a/app/code/core/Mage/Customer/Model/Address.php +++ b/app/code/core/Mage/Customer/Model/Address.php @@ -121,7 +121,7 @@ public function delete() public function getAttributes() { $attributes = $this->getData('attributes'); - if (is_null($attributes)) { + if ($attributes === null) { $attributes = $this->_getResource() ->loadAllAttributes($this) ->getSortedAttributes(); diff --git a/app/code/core/Mage/Customer/Model/Address/Abstract.php b/app/code/core/Mage/Customer/Model/Address/Abstract.php index 7bb8e7b17ccaf..d178b6aefad3d 100644 --- a/app/code/core/Mage/Customer/Model/Address/Abstract.php +++ b/app/code/core/Mage/Customer/Model/Address/Abstract.php @@ -292,7 +292,7 @@ public function getCountryModel() */ public function getRegionModel($region=null) { - if(is_null($region)) { + if($region === null) { $region = $this->getRegionId(); } diff --git a/app/code/core/Mage/Customer/Model/Address/Config.php b/app/code/core/Mage/Customer/Model/Address/Config.php index 91e50da431ebd..76152751c7eaa 100644 --- a/app/code/core/Mage/Customer/Model/Address/Config.php +++ b/app/code/core/Mage/Customer/Model/Address/Config.php @@ -73,7 +73,7 @@ public function setStore($store) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->_store = Mage::app()->getStore(); } return $this->_store; diff --git a/app/code/core/Mage/Customer/Model/Customer.php b/app/code/core/Mage/Customer/Model/Customer.php index df4af987c47c7..9b7163c560ecb 100644 --- a/app/code/core/Mage/Customer/Model/Customer.php +++ b/app/code/core/Mage/Customer/Model/Customer.php @@ -609,7 +609,7 @@ public function getRandomConfirmationKey() public function sendPasswordReminderEmail() { $storeId = $this->getStoreId(); - if (is_null($storeId)) { + if ($storeId === null) { $storeId = $this->_getWebsiteStoreId(); } diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php index 9efd97915ab67..779824be37acc 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Billing.php @@ -36,14 +36,14 @@ class Mage_Customer_Model_Customer_Attribute_Backend_Billing extends Mage_Eav_Mo public function beforeSave($object) { $defaultBilling = $object->getDefaultBilling(); - if (is_null($defaultBilling)) { + if ($defaultBilling === null) { $object->unsetDefaultBilling(); } } - + public function afterSave($object) { - if ($defaultBilling = $object->getDefaultBilling()) + if ($defaultBilling = $object->getDefaultBilling()) { $addressId = false; /** diff --git a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php index c4fd41d34ba91..c4ceb017fdada 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Shipping.php @@ -36,14 +36,14 @@ class Mage_Customer_Model_Customer_Attribute_Backend_Shipping extends Mage_Eav_M public function beforeSave($object) { $defaultShipping = $object->getDefaultShipping(); - if (is_null($defaultShipping)) { + if ($defaultShipping === null) { $object->unsetDefaultShipping(); } } - + public function afterSave($object) { - if ($defaultShipping = $object->getDefaultShipping()) + if ($defaultShipping = $object->getDefaultShipping()) { $addressId = false; /** @@ -55,7 +55,7 @@ public function afterSave($object) $addressId = $address->getId(); } } - + if ($addressId) { $object->setDefaultShipping($addressId); $this->getAttribute()->getEntity() diff --git a/app/code/core/Mage/Directory/Block/Currency.php b/app/code/core/Mage/Directory/Block/Currency.php index def5d2c5ea8eb..7cac02a0e6e67 100644 --- a/app/code/core/Mage/Directory/Block/Currency.php +++ b/app/code/core/Mage/Directory/Block/Currency.php @@ -54,7 +54,7 @@ public function getCurrencyCount() public function getCurrencies() { $currencies = $this->getData('currencies'); - if (is_null($currencies)) { + if ($currencies === null) { $currencies = array(); $codes = Mage::app()->getStore()->getAvailableCurrencyCodes(true); if (is_array($codes) && count($codes) > 1) { @@ -104,7 +104,7 @@ public function getSwitchCurrencyUrl($code) */ public function getCurrentCurrencyCode() { - if (is_null($this->_getData('current_currency_code'))) { + if ($this->_getData('current_currency_code') === null) { // do not use Mage::app()->getStore()->getCurrentCurrencyCode() because of probability // to get an invalid (without base rate) currency from code saved in session $this->setData('current_currency_code', Mage::app()->getStore()->getCurrentCurrency()->getCode()); diff --git a/app/code/core/Mage/Directory/Block/Data.php b/app/code/core/Mage/Directory/Block/Data.php index b71e61f8bc2e6..a620e97145827 100644 --- a/app/code/core/Mage/Directory/Block/Data.php +++ b/app/code/core/Mage/Directory/Block/Data.php @@ -41,7 +41,7 @@ public function getLoadrRegionUrl() public function getCountryCollection() { $collection = $this->getData('country_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = Mage::getModel('Mage_Directory_Model_Country')->getResourceCollection() ->loadByStore(); $this->setData('country_collection', $collection); @@ -53,7 +53,7 @@ public function getCountryCollection() public function getCountryHtmlSelect($defValue=null, $name='country_id', $id='country', $title='Country') { Magento_Profiler::start('TEST: '.__METHOD__, array('group' => 'TEST', 'method' => __METHOD__)); - if (is_null($defValue)) { + if ($defValue === null) { $defValue = $this->getCountryId(); } $cacheKey = 'DIRECTORY_COUNTRY_SELECT_STORE_'.Mage::app()->getStore()->getCode(); @@ -81,7 +81,7 @@ public function getCountryHtmlSelect($defValue=null, $name='country_id', $id='co public function getRegionCollection() { $collection = $this->getData('region_collection'); - if (is_null($collection)) { + if ($collection === null) { $collection = Mage::getModel('Mage_Directory_Model_Region')->getResourceCollection() ->addCountryFilter($this->getCountryId()) ->load(); @@ -119,7 +119,7 @@ public function getRegionHtmlSelect() public function getCountryId() { $countryId = $this->getData('country_id'); - if (is_null($countryId)) { + if ($countryId === null) { $countryId = Mage::helper('Mage_Core_Helper_Data')->getDefaultCountry(); } return $countryId; diff --git a/app/code/core/Mage/Directory/Helper/Data.php b/app/code/core/Mage/Directory/Helper/Data.php index 69bb96e702288..c228c36755a7b 100644 --- a/app/code/core/Mage/Directory/Helper/Data.php +++ b/app/code/core/Mage/Directory/Helper/Data.php @@ -173,7 +173,7 @@ public function currencyConvert($amount, $from, $to = null) if (empty($this->_currencyCache[$from])) { $this->_currencyCache[$from] = Mage::getModel('Mage_Directory_Model_Currency')->load($from); } - if (is_null($to)) { + if ($to === null) { $to = Mage::app()->getStore()->getCurrentCurrencyCode(); } $converted = $this->_currencyCache[$from]->convert($amount, $to); diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index 2ad43b6587702..6cf959a293cd7 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -161,7 +161,7 @@ public function getAnyRate($toCurrency) */ public function convert($price, $toCurrency=null) { - if (is_null($toCurrency)) { + if ($toCurrency === null) { return $price; } elseif ($rate = $this->getRate($toCurrency)) { diff --git a/app/code/core/Mage/Directory/Model/Region.php b/app/code/core/Mage/Directory/Model/Region.php index 403f5bddd7634..9106f1bd4693f 100644 --- a/app/code/core/Mage/Directory/Model/Region.php +++ b/app/code/core/Mage/Directory/Model/Region.php @@ -57,7 +57,7 @@ protected function _construct() public function getName() { $name = $this->getData('name'); - if (is_null($name)) { + if ($name === null) { $name = $this->getData('default_name'); } return $name; diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 2b69a9385e4f8..344429ac9be7b 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -79,7 +79,7 @@ public function getProduct() */ public function getPurchasedSeparatelyAttribute() { - if (is_null($this->_purchasedSeparatelyAttribute)) { + if ($this->_purchasedSeparatelyAttribute === null) { $_attributeCode = 'links_purchased_separately'; $this->_purchasedSeparatelyAttribute = Mage::getModel('Mage_Eav_Model_Entity_Attribute') @@ -332,7 +332,7 @@ public function getConfigJson($type = 'links') */ public function getConfig() { - if (is_null($this->_config)) { + if ($this->_config === null) { $this->_config = new Varien_Object(); } diff --git a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index 1b949653012da..8cfba8e381c63 100644 --- a/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -202,7 +202,7 @@ public function getConfigJson() */ public function getConfig() { - if (is_null($this->_config)) { + if ($this->_config === null) { $this->_config = new Varien_Object(); } diff --git a/app/code/core/Mage/Downloadable/Helper/Download.php b/app/code/core/Mage/Downloadable/Helper/Download.php index 07db586ffca32..2af52b24bdb59 100644 --- a/app/code/core/Mage/Downloadable/Helper/Download.php +++ b/app/code/core/Mage/Downloadable/Helper/Download.php @@ -91,7 +91,7 @@ protected function _getHandle() Mage::throwException(Mage::helper('Mage_Downloadable_Helper_Data')->__('Please set resource file and link type.')); } - if (is_null($this->_handle)) { + if ($this->_handle === null) { if ($this->_linkType == self::LINK_TYPE_URL) { $port = 80; diff --git a/app/code/core/Mage/Downloadable/Model/Product/Price.php b/app/code/core/Mage/Downloadable/Model/Product/Price.php index aae88d585efb8..33b5860ec1d2e 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Price.php @@ -42,7 +42,7 @@ class Mage_Downloadable_Model_Product_Price extends Mage_Catalog_Model_Product_T */ public function getFinalPrice($qty=null, $product) { - if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) { + if ($qty === null && !is_null($product->getCalculatedFinalPrice())) { return $product->getCalculatedFinalPrice(); } diff --git a/app/code/core/Mage/Downloadable/Model/Product/Type.php b/app/code/core/Mage/Downloadable/Model/Product/Type.php index ff870d87e2ed9..f33913a63740e 100644 --- a/app/code/core/Mage/Downloadable/Model/Product/Type.php +++ b/app/code/core/Mage/Downloadable/Model/Product/Type.php @@ -43,7 +43,7 @@ class Mage_Downloadable_Model_Product_Type extends Mage_Catalog_Model_Product_Ty */ public function getLinks($product) { - if (is_null($product->getDownloadableLinks())) { + if ($product->getDownloadableLinks() === null) { $_linkCollection = Mage::getModel('Mage_Downloadable_Model_Link')->getCollection() ->addProductToFilter($product->getId()) ->addTitleToResult($product->getStoreId()) @@ -120,7 +120,7 @@ public function getLinkSelectionRequired($product) */ public function getSamples($product) { - if (is_null($product->getDownloadableSamples())) { + if ($product->getDownloadableSamples() === null) { $_sampleCollection = Mage::getModel('Mage_Downloadable_Model_Sample')->getCollection() ->addProductToFilter($product->getId()) ->addTitleToResult($product->getStoreId()); diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php index d3ab5db541f0a..b4a1c9e29a671 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Options/Abstract.php @@ -96,7 +96,7 @@ public function getAddNewButtonHtml() public function getStores() { $stores = $this->getData('stores'); - if (is_null($stores)) { + if ($stores === null) { $stores = Mage::getModel('Mage_Core_Model_Store') ->getResourceCollection() ->setLoadDefault(true) @@ -278,7 +278,7 @@ public function getLabelValues() public function getStoreOptionValues($storeId) { $values = $this->getData('store_option_values_'.$storeId); - if (is_null($values)) { + if ($values === null) { $values = array(); $valuesCollection = Mage::getResourceModel('Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection') ->setAttributeFilter($this->getAttributeObject()->getId()) diff --git a/app/code/core/Mage/Eav/Model/Attribute.php b/app/code/core/Mage/Eav/Model/Attribute.php index f3714f6919e9a..c48fbf560fbd4 100644 --- a/app/code/core/Mage/Eav/Model/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Attribute.php @@ -75,7 +75,7 @@ public function setWebsite($website) */ public function getWebsite() { - if (is_null($this->_website)) { + if ($this->_website === null) { $this->_website = Mage::app()->getWebsite(); } @@ -101,7 +101,7 @@ protected function _afterSave() public function getUsedInForms() { $forms = $this->getData('used_in_forms'); - if (is_null($forms)) { + if ($forms === null) { $forms = $this->_getResource()->getUsedInForms($this); $this->setData('used_in_forms', $forms); } diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php index f8e812a06635a..8636258b87276 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Abstract.php @@ -253,9 +253,9 @@ protected function _getFormFilter() */ protected function _dateFilterFormat($format = null) { - if (is_null($format)) { + if ($format === null) { // get format - if (is_null($this->_dateFilterFormat)) { + if ($this->_dateFilterFormat === null) { $this->_dateFilterFormat = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT; } return Mage::app()->getLocale()->getDateFormat($this->_dateFilterFormat); diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index 3b15a5fc83fd1..f2520a11a7d21 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -1196,7 +1196,7 @@ protected function _collectSaveData($newObject) $origData = $this->_getOrigObject($newObject)->getOrigData(); } - if (is_null($origData)) { + if ($origData === null) { $origData = array(); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php index f328dab80537d..7b97bd58b0dc3 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Datetime.php @@ -47,7 +47,7 @@ public function beforeSave($object) throw Mage::exception('Mage_Eav', Mage::helper('Mage_Eav_Helper_Data')->__('Invalid date')); } - if (is_null($value)) { + if ($value === null) { $value = $object->getData($attributeName); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php index 55f582c84cb3d..befa802fbca64 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Time/Created.php @@ -42,7 +42,7 @@ class Mage_Eav_Model_Entity_Attribute_Backend_Time_Created extends Mage_Eav_Mode public function beforeSave($object) { $attributeCode = $this->getAttribute()->getAttributeCode(); - if ($object->isObjectNew() && is_null($object->getData($attributeCode))) { + if ($object->isObjectNew() && $object->getData($attributeCode) === null) { $object->setData($attributeCode, Varien_Date::now()); } diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php index 699dcb3dd9767..a6c0d6a1895e5 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Source/Boolean.php @@ -41,7 +41,7 @@ class Mage_Eav_Model_Entity_Attribute_Source_Boolean extends Mage_Eav_Model_Enti */ public function getAllOptions() { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = array( array( 'label' => Mage::helper('Mage_Eav_Helper_Data')->__('Yes'), diff --git a/app/code/core/Mage/Eav/Model/Form.php b/app/code/core/Mage/Eav/Model/Form.php index c72495e503659..e1dda2b486584 100644 --- a/app/code/core/Mage/Eav/Model/Form.php +++ b/app/code/core/Mage/Eav/Model/Form.php @@ -219,7 +219,7 @@ public function setFormCode($formCode) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->_store = Mage::app()->getStore(); } return $this->_store; @@ -247,7 +247,7 @@ public function getFormCode() */ public function getEntityType() { - if (is_null($this->_entityType)) { + if ($this->_entityType === null) { $this->setEntityType($this->_entityTypeCode); } return $this->_entityType; @@ -261,7 +261,7 @@ public function getEntityType() */ public function getEntity() { - if (is_null($this->_entity)) { + if ($this->_entity === null) { Mage::throwException(Mage::helper('Mage_Eav_Helper_Data')->__('Entity instance is not defined')); } return $this->_entity; @@ -274,7 +274,7 @@ public function getEntity() */ public function getAttributes() { - if (is_null($this->_attributes)) { + if ($this->_attributes === null) { $this->_attributes = array(); $this->_userAttributes = array(); /** @var $attribute Mage_Eav_Model_Attribute */ @@ -315,7 +315,7 @@ public function getAttribute($attributeCode) */ public function getUserAttributes() { - if (is_null($this->_userAttributes)) { + if ($this->_userAttributes === null) { // load attributes $this->getAttributes(); } @@ -329,7 +329,7 @@ public function getUserAttributes() */ public function getSystemAttributes() { - if (is_null($this->_systemAttributes)) { + if ($this->_systemAttributes === null) { // load attributes $this->getAttributes(); } @@ -343,7 +343,7 @@ public function getSystemAttributes() */ public function getAllowedAttributes() { - if (is_null($this->_allowedAttributes)) { + if ($this->_allowedAttributes === null) { // load attributes $this->getAttributes(); } @@ -409,7 +409,7 @@ public function extractData(Zend_Controller_Request_Http $request, $scope = null */ protected function _getValidator(array $data) { - if (is_null($this->_validator)) { + if ($this->_validator === null) { $configFiles = Mage::getConfig()->getModuleConfigurationFiles('validation.xml'); $validatorFactory = new Magento_Validator_Config($configFiles); $builder = $validatorFactory->createValidatorBuilder('eav_entity', 'form'); diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php index 067f928a4db4f..38e9306407a24 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php @@ -219,7 +219,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) { $frontendLabel = $object->getFrontendLabel(); if (is_array($frontendLabel)) { - if (!isset($frontendLabel[0]) || is_null($frontendLabel[0]) || $frontendLabel[0] == '') { + if (!isset($frontendLabel[0]) || $frontendLabel[0] === null || $frontendLabel[0] == '') { Mage::throwException($this->_helper('Mage_Eav_Helper_Data')->__('Frontend label is not defined')); } $object->setFrontendLabel($frontendLabel[0]) diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index 8992056d04ead..bcc87b346a29c 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -71,7 +71,7 @@ public function setAttributeFilter($setId) */ public function setStoreFilter($storeId = null, $useDefaultValue = true) { - if (is_null($storeId)) { + if ($storeId === null) { $storeId = Mage::app()->getStore()->getId(); } $adapter = $this->getConnection(); diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php index 32a4eff5f3c2d..d0e73bffadb1b 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Fieldset/Collection.php @@ -83,7 +83,7 @@ public function setSortOrder() */ public function getStoreId() { - if (is_null($this->_storeId)) { + if ($this->_storeId === null) { return Mage::app()->getStore()->getId(); } return $this->_storeId; @@ -121,7 +121,7 @@ protected function _initSelect() ->getIfNullSql('store_label.label', 'default_label.label'); $joinCondition = $this->getConnection() ->quoteInto( - 'main_table.fieldset_id = store_label.fieldset_id AND store_label.store_id = ?', + 'main_table.fieldset_id = store_label.fieldset_id AND store_label.store_id = ?', (int)$this->getStoreId()); $select->joinLeft( array('store_label' => $this->getTable('eav_form_fieldset_label')), diff --git a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php index ee2c86472df9a..02deebf252618 100755 --- a/app/code/core/Mage/Eav/Model/Resource/Form/Type.php +++ b/app/code/core/Mage/Eav/Model/Resource/Form/Type.php @@ -57,7 +57,7 @@ protected function _construct() */ public function load(Mage_Core_Model_Abstract $object, $value, $field = null) { - if (is_null($field) && !is_numeric($value)) { + if ($field === null && !is_numeric($value)) { $field = 'code'; } return parent::load($object, $value, $field); diff --git a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php index c4e86a0d0d505..b12b47889b599 100644 --- a/app/code/core/Mage/GiftMessage/Block/Message/Inline.php +++ b/app/code/core/Mage/GiftMessage/Block/Message/Inline.php @@ -143,7 +143,7 @@ public function getDefaultTo() */ public function getMessage($entity=null) { - if (is_null($this->_giftMessage)) { + if ($this->_giftMessage === null) { $this->_initMessage(); } diff --git a/app/code/core/Mage/GiftMessage/Helper/Message.php b/app/code/core/Mage/GiftMessage/Helper/Message.php index bb741ffdcdbb9..becee8cee7bb2 100644 --- a/app/code/core/Mage/GiftMessage/Helper/Message.php +++ b/app/code/core/Mage/GiftMessage/Helper/Message.php @@ -151,7 +151,7 @@ public function isMessagesAvailable($type, Varien_Object $entity, $store = null) protected function _getDependenceFromStoreConfig($productGiftMessageAllow, $store=null) { $result = Mage::getStoreConfig(self::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS, $store); - if ($productGiftMessageAllow === '' || is_null($productGiftMessageAllow)) { + if ($productGiftMessageAllow === '' || $productGiftMessageAllow === null) { return $result; } else { return $productGiftMessageAllow; diff --git a/app/code/core/Mage/GoogleOptimizer/Block/Code.php b/app/code/core/Mage/GoogleOptimizer/Block/Code.php index 0312c93894d83..a8ab8a01a0a37 100644 --- a/app/code/core/Mage/GoogleOptimizer/Block/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Block/Code.php @@ -85,7 +85,7 @@ public function getScriptCode() if (!Mage::helper('Mage_GoogleOptimizer_Helper_Data')->isOptimizerActive()) { return ''; } - if (is_null($this->_scriptType)) { + if ($this->_scriptType === null) { return ''; } $this->_initGoogleOptimizerModel(); diff --git a/app/code/core/Mage/GoogleOptimizer/Model/Code.php b/app/code/core/Mage/GoogleOptimizer/Model/Code.php index c61f6a10c985c..1372853305c3e 100644 --- a/app/code/core/Mage/GoogleOptimizer/Model/Code.php +++ b/app/code/core/Mage/GoogleOptimizer/Model/Code.php @@ -101,7 +101,7 @@ public function getEntityType() */ public function loadScripts($storeId) { - if (is_null($this->getEntity()) || is_null($this->getEntityType())) { + if ($this->getEntity() === null || $this->getEntityType() === null) { return $this; } @@ -150,7 +150,7 @@ protected function _validate() */ public function saveScripts($storeId) { - if (is_null($this->getEntity()) || is_null($this->getEntityType())) { + if ($this->getEntity() === null || $this->getEntityType() === null) { return $this; } if (!$this->getEntity()->getGoogleOptimizerScripts()) { @@ -191,7 +191,7 @@ public function saveScripts($storeId) */ public function deleteScripts($storeId) { - if (is_null($this->getEntity()) || is_null($this->getEntityType())) { + if ($this->getEntity() === null || $this->getEntityType() === null) { return $this; } $this->getResource()->deleteByEntityType($this, $storeId); diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php index 825268b1f928b..b44c31f081197 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/Default.php @@ -52,7 +52,7 @@ class Mage_GoogleShopping_Model_Attribute_Default extends Mage_GoogleShopping_Mo */ public function convertAttribute($product, $entry) { - if (is_null($this->getName())) { + if ($this->getName() === null) { return $entry; } $productAttribute = Mage::helper('Mage_GoogleShopping_Helper_Product') @@ -74,13 +74,13 @@ public function convertAttribute($product, $entry) */ public function getProductAttributeValue($product) { - if (is_null($this->getAttributeId())) { + if ($this->getAttributeId() === null) { return null; } $productAttribute = Mage::helper('Mage_GoogleShopping_Helper_Product') ->getProductAttribute($product, $this->getAttributeId()); - if (is_null($productAttribute)) { + if ($productAttribute === null) { return null; } diff --git a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php index cb9f28974a884..78f8800fb2811 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php +++ b/app/code/core/Mage/GoogleShopping/Model/Attribute/SalePriceEffectiveDate.php @@ -63,12 +63,12 @@ public function convertAttribute($product, $entry) } // if we have only "from" date, send "from" day - if (!is_null($from) && is_null($to)) { + if (!is_null($from) && $to === null) { $dateString = $from->toString('YYYY-MM-dd'); } // if we have only "to" date, use "now" date for "from" - if (is_null($from) && !is_null($to)) { + if ($from === null && !is_null($to)) { $from = new Zend_Date(); // if "now" date is earlier than "to" date if ($from->isEarlier($to)) { diff --git a/app/code/core/Mage/GoogleShopping/Model/Config.php b/app/code/core/Mage/GoogleShopping/Model/Config.php index c3a4dddb15df6..13ca497988cf9 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Config.php +++ b/app/code/core/Mage/GoogleShopping/Model/Config.php @@ -186,7 +186,7 @@ public function getCountryInfo($iso, $field = null, $storeId = null) $countries = $this->getAllowedCountries($storeId); $country = isset($countries[$iso]) ? $countries[$iso] : null; $data = isset($country[$field]) ? $country[$field] : null; - return is_null($field) ? $country : $data; + return $field === null ? $country : $data; } /** diff --git a/app/code/core/Mage/GoogleShopping/Model/Item.php b/app/code/core/Mage/GoogleShopping/Model/Item.php index a4c4e17c24c80..dcbc40765a278 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Item.php +++ b/app/code/core/Mage/GoogleShopping/Model/Item.php @@ -60,7 +60,7 @@ protected function _construct() */ public function getServiceItem() { - if (is_null($this->_serviceItem)) { + if ($this->_serviceItem === null) { $this->_serviceItem = Mage::getModel('Mage_GoogleShopping_Model_Service_Item') ->setStoreId($this->getStoreId()); } @@ -175,7 +175,7 @@ public function getType() */ public function getProduct() { - if (is_null($this->getData('product')) && !is_null($this->getProductId())) { + if ($this->getData('product') === null && !is_null($this->getProductId())) { $product = Mage::getModel('Mage_Catalog_Model_Product') ->setStoreId($this->getStoreId()) ->load($this->getProductId()); diff --git a/app/code/core/Mage/GoogleShopping/Model/Type.php b/app/code/core/Mage/GoogleShopping/Model/Type.php index 0b47d158fd748..9d7bd7d2d0d62 100644 --- a/app/code/core/Mage/GoogleShopping/Model/Type.php +++ b/app/code/core/Mage/GoogleShopping/Model/Type.php @@ -206,7 +206,7 @@ protected function _createAttribute($name) */ protected function _getAttributesCollection() { - if (is_null($this->_attributesCollection)) { + if ($this->_attributesCollection === null) { $this->_attributesCollection = Mage::getResourceModel( 'Mage_GoogleShopping_Model_Resource_Attribute_Collection' ) diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php index dc5a07c6b9d3f..90c72c4e5cdf2 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php @@ -1035,10 +1035,10 @@ protected function _saveProducts() if(!is_null($previousAttributeSet)) { $rowData[Mage_ImportExport_Model_Import_Entity_Product::COL_ATTR_SET] = $previousAttributeSet; } - if(is_null($productType) && !is_null($previousType)) { + if($productType === null && !is_null($previousType)) { $productType = $previousType; } - if(is_null($productType)) { + if($productType === null) { continue; } } @@ -1190,7 +1190,7 @@ protected function _saveProductGroupPrices(array $groupPriceData) */ protected function _getUploader() { - if (is_null($this->_fileUploader)) { + if ($this->_fileUploader === null) { $this->_fileUploader = new Mage_ImportExport_Model_Import_Uploader(); $this->_fileUploader->init(); diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php index f16e9354304a7..70d7e03b91ce3 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php @@ -57,7 +57,7 @@ class Mage_ImportExport_Model_Import_Entity_Product_Type_Grouped */ public function getBehavior() { - if (is_null($this->_behavior)) { + if ($this->_behavior === null) { $this->_behavior = Mage_ImportExport_Model_Import::getDataSourceModel()->getBehavior(); } return $this->_behavior; diff --git a/app/code/core/Mage/Index/Model/Event.php b/app/code/core/Mage/Index/Model/Event.php index fddbd2368e8df..2b63b115c312c 100644 --- a/app/code/core/Mage/Index/Model/Event.php +++ b/app/code/core/Mage/Index/Model/Event.php @@ -169,7 +169,7 @@ protected function _mergeNewDataRecursive($previous, $current) if (!is_string($key) || is_array($current[$key])) { $current[$key] = $this->_mergeNewDataRecursive($previous[$key], $current[$key]); } - } elseif (!array_key_exists($key, $current) || is_null($current[$key])) { + } elseif (!array_key_exists($key, $current) || $current[$key] === null) { $current[$key] = $previous[$key]; } elseif (!is_array($previous[$key]) && !is_string($key)) { $current[] = $previous[$key]; diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index ec96eff5ed812..7260009429f31 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -551,7 +551,7 @@ public function getUpdateRequiredOptions() public function getDepends() { $depends = $this->getData('depends'); - if (is_null($depends)) { + if ($depends === null) { $depends = array(); $path = self::XML_PATH_INDEXER_DATA . '/' . $this->getIndexerCode(); $node = Mage::getConfig()->getNode($path); diff --git a/app/code/core/Mage/Index/Model/Resource/Event.php b/app/code/core/Mage/Index/Model/Resource/Event.php index 004de79d95834..fb31d0586f61a 100755 --- a/app/code/core/Mage/Index/Model/Resource/Event.php +++ b/app/code/core/Mage/Index/Model/Resource/Event.php @@ -86,7 +86,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) $this->_getWriteAdapter()->delete($processTable); } else { foreach ($processIds as $processId => $processStatus) { - if (is_null($processStatus) || $processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { + if ($processStatus === null || $processStatus == Mage_Index_Model_Process::EVENT_STATUS_DONE) { $this->_getWriteAdapter()->delete($processTable, array( 'process_id = ?' => $processId, 'event_id = ?' => $object->getId(), diff --git a/app/code/core/Mage/Install/Block/Admin.php b/app/code/core/Mage/Install/Block/Admin.php index a8d0e3c364b4f..c29660c8bf4ac 100644 --- a/app/code/core/Mage/Install/Block/Admin.php +++ b/app/code/core/Mage/Install/Block/Admin.php @@ -41,7 +41,7 @@ public function getPostUrl() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $data = Mage::getSingleton('Mage_Install_Model_Session')->getAdminData(true); $data = is_array($data) ? $data : array(); $data = new Varien_Object($data); diff --git a/app/code/core/Mage/Install/Block/Config.php b/app/code/core/Mage/Install/Block/Config.php index 4038d6fa66920..b153798de9c52 100644 --- a/app/code/core/Mage/Install/Block/Config.php +++ b/app/code/core/Mage/Install/Block/Config.php @@ -51,7 +51,7 @@ public function getPostUrl() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $data = Mage::getSingleton('Mage_Install_Model_Session')->getConfigData(true); if (empty($data)) { $data = Mage::getModel('Mage_Install_Model_Installer_Config')->getFormData(); diff --git a/app/code/core/Mage/Install/Block/Db/Main.php b/app/code/core/Mage/Install/Block/Db/Main.php index 0b986eab4fa1d..16ac566f84cf7 100644 --- a/app/code/core/Mage/Install/Block/Db/Main.php +++ b/app/code/core/Mage/Install/Block/Db/Main.php @@ -101,7 +101,7 @@ public function getDatabaseBlocks() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $data = Mage::getSingleton('Mage_Install_Model_Session')->getConfigData(true); if (empty($data)) { $data = Mage::getModel('Mage_Install_Model_Installer_Config')->getFormData(); diff --git a/app/code/core/Mage/Install/Block/Db/Type.php b/app/code/core/Mage/Install/Block/Db/Type.php index c6a3789832e66..826d3e09f0c1a 100644 --- a/app/code/core/Mage/Install/Block/Db/Type.php +++ b/app/code/core/Mage/Install/Block/Db/Type.php @@ -56,7 +56,7 @@ public function getTitle() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $data = Mage::getSingleton('Mage_Install_Model_Session')->getConfigData(true); if (empty($data)) { $data = Mage::getModel('Mage_Install_Model_Installer_Config')->getFormData(); diff --git a/app/code/core/Mage/Install/Block/End.php b/app/code/core/Mage/Install/Block/End.php index bbf5baacd5e56..f19faa0d773ef 100644 --- a/app/code/core/Mage/Install/Block/End.php +++ b/app/code/core/Mage/Install/Block/End.php @@ -36,7 +36,7 @@ class Mage_Install_Block_End extends Mage_Install_Block_Abstract public function getEncryptionKey() { $key = $this->getData('encryption_key'); - if (is_null($key)) { + if ($key === null) { $key = (string) Mage::getConfig()->getNode('global/crypt/key'); $this->setData('encryption_key', $key); } diff --git a/app/code/core/Mage/Install/Block/Locale.php b/app/code/core/Mage/Install/Block/Locale.php index 043b9ae185163..a40985cfdcd61 100644 --- a/app/code/core/Mage/Install/Block/Locale.php +++ b/app/code/core/Mage/Install/Block/Locale.php @@ -44,7 +44,7 @@ class Mage_Install_Block_Locale extends Mage_Install_Block_Abstract public function getLocale() { $locale = $this->getData('locale'); - if (is_null($locale)) { + if ($locale === null) { $locale = Mage::app()->getLocale()->getLocale(); $this->setData('locale', $locale); } @@ -157,7 +157,7 @@ public function getCurrency() public function getFormData() { $data = $this->getData('form_data'); - if (is_null($data)) { + if ($data === null) { $data = new Varien_Object(); $this->setData('form_data', $data); } diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php index 2e24f56799f88..c0f852074c795 100644 --- a/app/code/core/Mage/Install/Model/Installer.php +++ b/app/code/core/Mage/Install/Model/Installer.php @@ -65,7 +65,7 @@ public function isApplicationInstalled() */ public function getDataModel() { - if (is_null($this->_dataModel)) { + if ($this->_dataModel === null) { $this->setDataModel(Mage::getSingleton('Mage_Install_Model_Session')); } return $this->_dataModel; @@ -127,7 +127,7 @@ public function checkServer() public function getServerCheckStatus() { $status = $this->getData('server_check_status'); - if (is_null($status)) { + if ($status === null) { $status = $this->checkServer(); } return $status; diff --git a/app/code/core/Mage/Install/Model/Installer/Abstract.php b/app/code/core/Mage/Install/Model/Installer/Abstract.php index 263a97a4d1a67..de6f459428e92 100644 --- a/app/code/core/Mage/Install/Model/Installer/Abstract.php +++ b/app/code/core/Mage/Install/Model/Installer/Abstract.php @@ -48,7 +48,7 @@ class Mage_Install_Model_Installer_Abstract */ protected function _getInstaller() { - if (is_null($this->_installer)) { + if ($this->_installer === null) { $this->_installer = Mage::getSingleton('Mage_Install_Model_Installer'); } return $this->_installer; diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index 914195803d1df..cd3cb2fa3a348 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -179,7 +179,7 @@ protected function _getFlagValue($value) */ protected function _getDataModel() { - if (is_null($this->_dataModel)) { + if ($this->_dataModel === null) { $this->_dataModel = Mage::getModel('Mage_Install_Model_Installer_Data'); } return $this->_dataModel; diff --git a/app/code/core/Mage/Log/Model/Resource/Aggregation.php b/app/code/core/Mage/Log/Model/Resource/Aggregation.php index fae6a19d8550c..5513ac047c2a6 100644 --- a/app/code/core/Mage/Log/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Resource/Aggregation.php @@ -26,7 +26,7 @@ /** - * Log aggregation resource model + * Log aggregation resource model * * @category Mage * @package Mage_Log @@ -109,7 +109,7 @@ public function getCounts($from, $to, $store) public function saveLog($data, $id = null) { $adapter = $this->_getWriteAdapter(); - if (is_null($id)) { + if ($id === null) { $adapter->insert($this->getTable('log_summary'), $data); } else { $condition = $adapter->quoteInto('summary_id = ?', $id); @@ -129,7 +129,7 @@ public function removeEmpty($date) 'add_date < ?' => $date, 'customer_count = 0', 'visitor_count = 0' - ); + ); $adapter->delete($this->getTable('log_summary'), $condition); } diff --git a/app/code/core/Mage/Log/Model/Visitor/Online.php b/app/code/core/Mage/Log/Model/Visitor/Online.php index dcb51aec49cdb..21433303581f9 100644 --- a/app/code/core/Mage/Log/Model/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Visitor/Online.php @@ -100,7 +100,7 @@ public function getPrepareAt() */ public function setPrepareAt($time = null) { - if (is_null($time)) { + if ($time === null) { $time = time(); } Mage::app()->saveCache($time, 'log_visitor_online_prepare_at'); diff --git a/app/code/core/Mage/Media/Model/File/Image.php b/app/code/core/Mage/Media/Model/File/Image.php index 865dccba11779..1286f9d8b0f87 100644 --- a/app/code/core/Mage/Media/Model/File/Image.php +++ b/app/code/core/Mage/Media/Model/File/Image.php @@ -163,7 +163,7 @@ public function watermark(Mage_Media_Model_Image $object) */ public function saveAs(Mage_Media_Model_Image $object, $extension=null) { - if(is_null($extension)) { + if($extension === null) { $extension = $object->getExtension(); } diff --git a/app/code/core/Mage/Media/Model/Image.php b/app/code/core/Mage/Media/Model/Image.php index 05aba69e4541c..cae95329749ca 100644 --- a/app/code/core/Mage/Media/Model/Image.php +++ b/app/code/core/Mage/Media/Model/Image.php @@ -92,7 +92,7 @@ public function getConfig() public function getImage() { - if(is_null($this->_image)) { + if($this->_image === null) { $this->_image = $this->_getResource()->getImage($this); } @@ -101,7 +101,7 @@ public function getImage() public function getTmpImage() { - if(is_null($this->_image)) { + if($this->_image === null) { $this->_tmpImage = $this->_getResource()->getTmpImage($this); } diff --git a/app/code/core/Mage/Newsletter/Model/Problem.php b/app/code/core/Mage/Newsletter/Model/Problem.php index f3baa358cbc6a..0f9c2904a1527 100644 --- a/app/code/core/Mage/Newsletter/Model/Problem.php +++ b/app/code/core/Mage/Newsletter/Model/Problem.php @@ -46,7 +46,7 @@ class Mage_Newsletter_Model_Problem extends Mage_Core_Model_Abstract { /** * Current Subscriber - * + * * @var Mage_Newsletter_Model_Subscriber */ protected $_subscriber = null; @@ -107,7 +107,7 @@ public function getSubscriber() return null; } - if(is_null($this->_subscriber)) { + if($this->_subscriber === null) { $this->_subscriber = Mage::getModel('Mage_Newsletter_Model_Subscriber') ->load($this->getSubscriberId()); } diff --git a/app/code/core/Mage/Newsletter/Model/Queue.php b/app/code/core/Mage/Newsletter/Model/Queue.php index 1419b5d47ea9e..dcf2aad550a43 100644 --- a/app/code/core/Mage/Newsletter/Model/Queue.php +++ b/app/code/core/Mage/Newsletter/Model/Queue.php @@ -118,7 +118,7 @@ protected function _construct() */ public function isNew() { - return (is_null($this->getQueueStatus())); + return ($this->getQueueStatus() === null); } /** @@ -128,7 +128,7 @@ public function isNew() */ public function getSubscribersCollection() { - if (is_null($this->_subscribersCollection)) { + if ($this->_subscribersCollection === null) { $this->_subscribersCollection = Mage::getResourceModel( 'Mage_Newsletter_Model_Resource_Subscriber_Collection' ) @@ -146,7 +146,7 @@ public function getSubscribersCollection() */ public function setQueueStartAtByString($startAt) { - if(is_null($startAt) || $startAt == '') { + if($startAt === null || $startAt == '') { $this->setQueueStartAt(null); } else { $locale = Mage::app()->getLocale(); @@ -323,7 +323,7 @@ public function getStores() */ public function getTemplate() { - if (is_null($this->_template)) { + if ($this->_template === null) { $this->_template = Mage::getModel('Mage_Newsletter_Model_Template') ->load($this->getTemplateId()); } diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Template.php b/app/code/core/Mage/Newsletter/Model/Resource/Template.php index b585dae6fc58d..6b8c290d7ef3d 100755 --- a/app/code/core/Mage/Newsletter/Model/Resource/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Template.php @@ -99,7 +99,7 @@ public function checkUsageInQueue(Mage_Newsletter_Model_Template $template) */ public function checkCodeUsage(Mage_Newsletter_Model_Template $template) { - if ($template->getTemplateActual() != 0 || is_null($template->getTemplateActual())) { + if ($template->getTemplateActual() != 0 || $template->getTemplateActual() === null) { $bind = array( 'template_id' => $template->getId(), 'template_code' => $template->getTemplateCode(), diff --git a/app/code/core/Mage/Newsletter/Model/Subscriber.php b/app/code/core/Mage/Newsletter/Model/Subscriber.php index 0183ebf92fd2f..05d1d100cf2f1 100644 --- a/app/code/core/Mage/Newsletter/Model/Subscriber.php +++ b/app/code/core/Mage/Newsletter/Model/Subscriber.php @@ -418,7 +418,7 @@ public function subscribeCustomer($customer) if ($status != self::STATUS_UNCONFIRMED && $status != $this->getStatus()) { $sendInformationEmail = true; } - } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && (is_null($confirmation))) { + } elseif (($this->getStatus() == self::STATUS_UNCONFIRMED) && ($confirmation === null)) { $status = self::STATUS_SUBSCRIBED; $sendInformationEmail = true; } else { @@ -446,7 +446,7 @@ public function subscribeCustomer($customer) $this->save(); $sendSubscription = $customer->getData('sendSubscription') || $sendInformationEmail; - if (is_null($sendSubscription) xor $sendSubscription) { + if ($sendSubscription === null xor $sendSubscription) { if ($this->getIsStatusChanged() && $status == self::STATUS_UNSUBSCRIBED) { $this->sendUnsubscriptionEmail(); } elseif ($this->getIsStatusChanged() && $status == self::STATUS_SUBSCRIBED) { diff --git a/app/code/core/Mage/Oauth/Model/Server.php b/app/code/core/Mage/Oauth/Model/Server.php index 24bd64b88f5a9..df6092257e306 100644 --- a/app/code/core/Mage/Oauth/Model/Server.php +++ b/app/code/core/Mage/Oauth/Model/Server.php @@ -226,7 +226,7 @@ public function __construct( */ protected function _fetchParams($authHeaderValue = null) { - if (is_null($authHeaderValue)) { + if ($authHeaderValue === null) { $authHeaderValue = $this->_request->getHeader('Authorization'); } diff --git a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php index bef16fdbe834d..ec52bbdb5016e 100644 --- a/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php +++ b/app/code/core/Mage/Page/Block/Html/Breadcrumbs.php @@ -88,7 +88,7 @@ public function addCrumb($crumbName, $crumbInfo) */ public function getCacheKeyInfo() { - if (is_null($this->_cacheKeyInfo)) { + if ($this->_cacheKeyInfo === null) { $this->_cacheKeyInfo = parent::getCacheKeyInfo() + array( 'crumbs' => base64_encode(serialize($this->_crumbs)), 'name' => $this->getNameInLayout() diff --git a/app/code/core/Mage/Page/Block/Html/Topmenu.php b/app/code/core/Mage/Page/Block/Html/Topmenu.php index 5b110f7dee4f2..d456ae745506f 100644 --- a/app/code/core/Mage/Page/Block/Html/Topmenu.php +++ b/app/code/core/Mage/Page/Block/Html/Topmenu.php @@ -87,7 +87,7 @@ protected function _getHtml(Varien_Data_Tree_Node $menuTree, $childrenWrapClass) $children = $menuTree->getChildren(); $parentLevel = $menuTree->getLevel(); - $childLevel = is_null($parentLevel) ? 0 : $parentLevel + 1; + $childLevel = $parentLevel === null ? 0 : $parentLevel + 1; $counter = 1; $childrenCount = $children->count(); diff --git a/app/code/core/Mage/Page/Block/Switch.php b/app/code/core/Mage/Page/Block/Switch.php index 029fd10f15407..f97f8ce067511 100644 --- a/app/code/core/Mage/Page/Block/Switch.php +++ b/app/code/core/Mage/Page/Block/Switch.php @@ -150,7 +150,7 @@ public function getCurrentStoreCode() public function isStoreInUrl() { - if (is_null($this->_storeInUrl)) { + if ($this->_storeInUrl === null) { $this->_storeInUrl = Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_STORE_IN_URL); } return $this->_storeInUrl; diff --git a/app/code/core/Mage/Page/Block/Template/Links.php b/app/code/core/Mage/Page/Block/Template/Links.php index 04208078a9a1a..a7f241e71d81f 100644 --- a/app/code/core/Mage/Page/Block/Template/Links.php +++ b/app/code/core/Mage/Page/Block/Template/Links.php @@ -78,7 +78,7 @@ public function getLinks() public function addLink($label, $url = '', $title = '', $prepare = true, $urlParams = array(), $position = null, $liParams = null, $aParams = null, $beforeText = '', $afterText = '' ) { - if (is_null($label) || false === $label) { + if ($label === null || false === $label) { return $this; } $link = new Varien_Object(array( @@ -156,7 +156,7 @@ public function removeLinkByUrl($url) */ public function getCacheKeyInfo() { - if (is_null($this->_cacheKeyInfo)) { + if ($this->_cacheKeyInfo === null) { $links = array(); if (!empty($this->_links)) { foreach ($this->_links as $position => $link) { diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index a22db3bc6dbea..0fc36ed0f4e3a 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -977,10 +977,10 @@ protected function _initCardsStorage($payment) */ public function getCardsStorage($payment = null) { - if (is_null($payment)) { + if ($payment === null) { $payment = $this->getInfoInstance(); } - if (is_null($this->_cardsStorage)) { + if ($this->_cardsStorage === null) { $this->_initCardsStorage($payment); } return $this->_cardsStorage; @@ -994,7 +994,7 @@ public function getCardsStorage($payment = null) */ public function isPartialAuthorization($payment = null) { - if (is_null($payment)) { + if ($payment === null) { $payment = $this->getInfoInstance(); } return $payment->getAdditionalInformation($this->_splitTenderIdKey); diff --git a/app/code/core/Mage/Payment/Block/Form/Banktransfer.php b/app/code/core/Mage/Payment/Block/Form/Banktransfer.php index 7656b6eba0bbb..fa09c76a77000 100644 --- a/app/code/core/Mage/Payment/Block/Form/Banktransfer.php +++ b/app/code/core/Mage/Payment/Block/Form/Banktransfer.php @@ -46,7 +46,7 @@ class Mage_Payment_Block_Form_Banktransfer extends Mage_Payment_Block_Form */ public function getInstructions() { - if (is_null($this->_instructions)) { + if ($this->_instructions === null) { $this->_instructions = $this->getMethod()->getInstructions(); } return $this->_instructions; diff --git a/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php b/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php index 8ae3123aef172..bc105d2776612 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php +++ b/app/code/core/Mage/Payment/Block/Form/Cashondelivery.php @@ -46,7 +46,7 @@ class Mage_Payment_Block_Form_Cashondelivery extends Mage_Payment_Block_Form */ public function getInstructions() { - if (is_null($this->_instructions)) { + if ($this->_instructions === null) { $this->_instructions = $this->getMethod()->getInstructions(); } return $this->_instructions; diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 6b1227b1b82cd..805f3bc028d98 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -70,7 +70,7 @@ public function getCcAvailableTypes() public function getCcMonths() { $months = $this->getData('cc_months'); - if (is_null($months)) { + if ($months === null) { $months[0] = $this->__('Month'); $months = array_merge($months, $this->_getConfig()->getMonths()); $this->setData('cc_months', $months); @@ -86,7 +86,7 @@ public function getCcMonths() public function getCcYears() { $years = $this->getData('cc_years'); - if (is_null($years)) { + if ($years === null) { $years = $this->_getConfig()->getYears(); $years = array(0=>$this->__('Year'))+$years; $this->setData('cc_years', $years); @@ -103,7 +103,7 @@ public function hasVerification() { if ($this->getMethod()) { $configData = $this->getMethod()->getConfigData('useccv'); - if(is_null($configData)){ + if($configData === null){ return true; } return (bool) $configData; diff --git a/app/code/core/Mage/Payment/Block/Info/Checkmo.php b/app/code/core/Mage/Payment/Block/Info/Checkmo.php index 8373e45436c99..b58b240e09a6f 100644 --- a/app/code/core/Mage/Payment/Block/Info/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Info/Checkmo.php @@ -40,7 +40,7 @@ class Mage_Payment_Block_Info_Checkmo extends Mage_Payment_Block_Info */ public function getPayableTo() { - if (is_null($this->_payableTo)) { + if ($this->_payableTo === null) { $this->_convertAdditionalData(); } return $this->_payableTo; @@ -53,7 +53,7 @@ public function getPayableTo() */ public function getMailingAddress() { - if (is_null($this->_mailingAddress)) { + if ($this->_mailingAddress === null) { $this->_convertAdditionalData(); } return $this->_mailingAddress; diff --git a/app/code/core/Mage/Payment/Block/Info/Instructions.php b/app/code/core/Mage/Payment/Block/Info/Instructions.php index 181c4afc90f61..6253382783821 100644 --- a/app/code/core/Mage/Payment/Block/Info/Instructions.php +++ b/app/code/core/Mage/Payment/Block/Info/Instructions.php @@ -46,7 +46,7 @@ class Mage_Payment_Block_Info_Instructions extends Mage_Payment_Block_Info */ public function getInstructions() { - if (is_null($this->_instructions)) { + if ($this->_instructions === null) { $this->_instructions = $this->getInfo()->getAdditionalInformation('instructions') ?: $this->getMethod()->getInstructions(); } diff --git a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php index 77ffbb23ed309..892a4bd5f3adf 100644 --- a/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Payment/Model/Billing/AgreementAbstract.php @@ -76,7 +76,7 @@ abstract public function cancel(); */ public function getPaymentMethodInstance() { - if (is_null($this->_paymentMethodInstance)) { + if ($this->_paymentMethodInstance === null) { $this->_paymentMethodInstance = Mage::helper('Mage_Payment_Helper_Data')->getMethodInstance($this->getMethodCode()); } if ($this->_paymentMethodInstance) { @@ -93,7 +93,7 @@ public function getPaymentMethodInstance() public function isValid() { $this->_errors = array(); - if (is_null($this->getPaymentMethodInstance()) || !$this->getPaymentMethodInstance()->getCode()) { + if ($this->getPaymentMethodInstance() === null || !$this->getPaymentMethodInstance()->getCode()) { $this->_errors[] = Mage::helper('Mage_Payment_Helper_Data')->__('Payment method code is not set.'); } if (!$this->getReferenceId()) { diff --git a/app/code/core/Mage/Payment/Model/Info.php b/app/code/core/Mage/Payment/Model/Info.php index ff6384f94309b..3f5fc5a5d68e7 100644 --- a/app/code/core/Mage/Payment/Model/Info.php +++ b/app/code/core/Mage/Payment/Model/Info.php @@ -129,7 +129,7 @@ public function setAdditionalInformation($key, $value = null) Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Payment disallow storing objects.')); } $this->_initAdditionalInformation(); - if (is_array($key) && is_null($value)) { + if (is_array($key) && $value === null) { $this->_additionalInformation = $key; } else { $this->_additionalInformation[$key] = $value; diff --git a/app/code/core/Mage/Payment/Model/Method/Cc.php b/app/code/core/Mage/Payment/Model/Method/Cc.php index bccb62c400690..e40c74dcac14f 100644 --- a/app/code/core/Mage/Payment/Model/Method/Cc.php +++ b/app/code/core/Mage/Payment/Model/Method/Cc.php @@ -180,7 +180,7 @@ public function validate() public function hasVerification() { $configData = $this->getConfigData('useccv'); - if(is_null($configData)){ + if($configData === null){ return true; } return (bool) $configData; diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php b/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php index ea4d9f05b8b67..324356e5e54dd 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Billing.php @@ -40,7 +40,7 @@ class Mage_Paypal_Block_Express_Review_Billing extends Mage_Checkout_Block_Onepa */ public function getAddress() { - if (is_null($this->_address)) { + if ($this->_address === null) { if ($this->isCustomerLoggedIn() || $this->getQuote()->getBillingAddress()) { $this->_address = $this->getQuote()->getBillingAddress(); if (!$this->_address->getFirstname()) { diff --git a/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php b/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php index 0789c784c0af2..4623c1b3f9a67 100644 --- a/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php +++ b/app/code/core/Mage/Paypal/Block/Express/Review/Shipping.php @@ -40,7 +40,7 @@ class Mage_Paypal_Block_Express_Review_Shipping extends Mage_Checkout_Block_Onep */ public function getAddress() { - if (is_null($this->_address)) { + if ($this->_address === null) { if ($this->isCustomerLoggedIn() || $this->getQuote()->getShippingAddress()) { $this->_address = $this->getQuote()->getShippingAddress(); } else { diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 58ec500fb19b2..ce0975b436b9c 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -783,7 +783,7 @@ protected function _prepareShippingOptions( } } - if ($mayReturnEmpty && is_null($userSelectedOption)) { + if ($mayReturnEmpty && $userSelectedOption === null) { $options[] = new Varien_Object(array( 'is_default' => true, 'name' => Mage::helper('Mage_Paypal_Helper_Data')->__('N/A'), @@ -793,7 +793,7 @@ protected function _prepareShippingOptions( if ($calculateTax) { $options[$i]->setTaxAmount($address->getTaxAmount()); } - } elseif (is_null($userSelectedOption) && isset($options[$iMin])) { + } elseif ($userSelectedOption === null && isset($options[$iMin])) { $options[$iMin]->setIsDefault(true); } diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index 7b81a2a344d06..8288a8e1747a5 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro.php @@ -241,7 +241,7 @@ protected function _getUrl($path, $storeId, $secure = null) $store = Mage::app()->getStore($storeId); return Mage::getUrl($path, array( "_store" => $store, - "_secure" => is_null($secure) ? $store->isCurrentlySecure() : $secure + "_secure" => $secure === null ? $store->isCurrentlySecure() : $secure )); } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index 174763b3001ca..f122732e2fd7b 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -318,7 +318,7 @@ protected static function _isTransactionUnderReview($status) */ protected function _getTransactionUrl($testMode = null) { - $testMode = is_null($testMode) ? $this->getConfigData('sandbox_flag') : (bool)$testMode; + $testMode = $testMode === null ? $this->getConfigData('sandbox_flag') : (bool)$testMode; if ($testMode) { return self::TRANSACTION_URL_TEST_MODE; } diff --git a/app/code/core/Mage/Persistent/Helper/Session.php b/app/code/core/Mage/Persistent/Helper/Session.php index f03107354dcf3..8609a1e904ea2 100644 --- a/app/code/core/Mage/Persistent/Helper/Session.php +++ b/app/code/core/Mage/Persistent/Helper/Session.php @@ -62,7 +62,7 @@ class Mage_Persistent_Helper_Session extends Mage_Core_Helper_Data */ public function getSession() { - if (is_null($this->_sessionModel)) { + if ($this->_sessionModel === null) { $this->_sessionModel = Mage::getModel('Mage_Persistent_Model_Session'); $this->_sessionModel->loadByCookieKey(); } @@ -98,7 +98,7 @@ public function isPersistent() */ public function isRememberMeChecked() { - if (is_null($this->_isRememberMeChecked)) { + if ($this->_isRememberMeChecked === null) { //Try to get from checkout session $isRememberMeChecked = Mage::getSingleton('Mage_Checkout_Model_Session')->getRememberMeChecked(); if (!is_null($isRememberMeChecked)) { @@ -132,7 +132,7 @@ public function setRememberMeChecked($checked = true) */ public function getCustomer() { - if (is_null($this->_customer)) { + if ($this->_customer === null) { $customerId = $this->getSession()->getCustomerId(); $this->_customer = Mage::getModel('Mage_Customer_Model_Customer')->load($customerId); } diff --git a/app/code/core/Mage/Persistent/Model/Persistent/Config.php b/app/code/core/Mage/Persistent/Model/Persistent/Config.php index c8ec52f4809c0..a32a93dd2bf7e 100644 --- a/app/code/core/Mage/Persistent/Model/Persistent/Config.php +++ b/app/code/core/Mage/Persistent/Model/Persistent/Config.php @@ -68,7 +68,7 @@ public function setConfigFilePath($path) */ public function getXmlConfig() { - if (is_null($this->_xmlConfig)) { + if ($this->_xmlConfig === null) { $filePath = $this->_configFilePath; if (!is_file($filePath) || !is_readable($filePath)) { Mage::throwException(Mage::helper('Mage_Persistent_Helper_Data')->__('Cannot load configuration from file %s.', $filePath)); diff --git a/app/code/core/Mage/Persistent/Model/Session.php b/app/code/core/Mage/Persistent/Model/Session.php index b6a1a03e003ea..5445ae10d0411 100644 --- a/app/code/core/Mage/Persistent/Model/Session.php +++ b/app/code/core/Mage/Persistent/Model/Session.php @@ -147,7 +147,7 @@ protected function _afterLoad() */ public function loadByCookieKey($key = null) { - if (is_null($key)) { + if ($key === null) { $key = Mage::getSingleton('Mage_Core_Model_Cookie')->get(Mage_Persistent_Model_Session::COOKIE_NAME); } if ($key) { @@ -203,7 +203,7 @@ public function removePersistentCookie() */ public function deleteExpired($websiteId = null) { - if (is_null($websiteId)) { + if ($websiteId === null) { $websiteId = Mage::app()->getStore()->getWebsiteId(); } diff --git a/app/code/core/Mage/Poll/Model/Poll.php b/app/code/core/Mage/Poll/Model/Poll.php index 74404bfdde5f5..a0bc53b860f66 100644 --- a/app/code/core/Mage/Poll/Model/Poll.php +++ b/app/code/core/Mage/Poll/Model/Poll.php @@ -104,7 +104,7 @@ public function getPoolId($pollId = null) */ public function getPollId($pollId = null) { - if (is_null($pollId)) { + if ($pollId === null) { $pollId = $this->getId(); } return $pollId; @@ -267,7 +267,7 @@ public function addStoreId($storeId) public function getStoreIds() { $ids = $this->_getData('store_ids'); - if (is_null($ids)) { + if ($ids === null) { $this->loadStoreIds(); $ids = $this->getData('store_ids'); } diff --git a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php index b213daa2a2e15..b8864d980665d 100644 --- a/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php +++ b/app/code/core/Mage/ProductAlert/Block/Email/Abstract.php @@ -75,7 +75,7 @@ public function setStore($store) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->_store = Mage::app()->getStore(); } return $this->_store; diff --git a/app/code/core/Mage/ProductAlert/Block/Product/View.php b/app/code/core/Mage/ProductAlert/Block/Product/View.php index d28d6882cbf44..e8c438a7a14ff 100644 --- a/app/code/core/Mage/ProductAlert/Block/Product/View.php +++ b/app/code/core/Mage/ProductAlert/Block/Product/View.php @@ -95,7 +95,7 @@ protected function _prepareLayout() */ protected function _getHelper() { - if (is_null($this->_helper)) { + if ($this->_helper === null) { $this->_helper = Mage::helper('Mage_ProductAlert_Helper_Data'); } return $this->_helper; diff --git a/app/code/core/Mage/ProductAlert/Model/Email.php b/app/code/core/Mage/ProductAlert/Model/Email.php index f7e1524346bc8..dbb12ad435923 100644 --- a/app/code/core/Mage/ProductAlert/Model/Email.php +++ b/app/code/core/Mage/ProductAlert/Model/Email.php @@ -200,7 +200,7 @@ public function addStockProduct(Mage_Catalog_Model_Product $product) */ protected function _getPriceBlock() { - if (is_null($this->_priceBlock)) { + if ($this->_priceBlock === null) { $this->_priceBlock = Mage::helper('Mage_ProductAlert_Helper_Data') ->createBlock('Mage_ProductAlert_Block_Email_Price'); } @@ -214,7 +214,7 @@ protected function _getPriceBlock() */ protected function _getStockBlock() { - if (is_null($this->_stockBlock)) { + if ($this->_stockBlock === null) { $this->_stockBlock = Mage::helper('Mage_ProductAlert_Helper_Data') ->createBlock('Mage_ProductAlert_Block_Email_Stock'); } @@ -228,7 +228,7 @@ protected function _getStockBlock() */ public function send() { - if (is_null($this->_website) || is_null($this->_customer)) { + if ($this->_website === null || $this->_customer === null) { return false; } if (($this->_type == 'price' && count($this->_priceProducts) == 0) diff --git a/app/code/core/Mage/ProductAlert/Model/Observer.php b/app/code/core/Mage/ProductAlert/Model/Observer.php index 5f101851a7fbf..5d862811538bc 100644 --- a/app/code/core/Mage/ProductAlert/Model/Observer.php +++ b/app/code/core/Mage/ProductAlert/Model/Observer.php @@ -82,7 +82,7 @@ class Mage_ProductAlert_Model_Observer */ protected function _getWebsites() { - if (is_null($this->_websites)) { + if ($this->_websites === null) { try { $this->_websites = Mage::app()->getWebsites(); } diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php index 0df33d9bfd133..a8be689d620fb 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price.php @@ -51,7 +51,7 @@ protected function _construct() */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { - if (is_null($object->getId()) && $object->getCustomerId() + if ($object->getId() === null && $object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) { if ($row = $this->_getAlertRow($object)) { $price = $object->getPrice(); @@ -62,7 +62,7 @@ protected function _beforeSave(Mage_Core_Model_Abstract $object) $object->setStatus(0); } } - if (is_null($object->getAddDate())) { + if ($object->getAddDate() === null) { $object->setAddDate(Mage::getModel('Mage_Core_Model_Date')->gmtDate()); } return parent::_beforeSave($object); diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php index 1d7ea05b3ce5d..feda454be2d88 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Price/Collection.php @@ -70,7 +70,7 @@ public function addCustomerFilter($customer) */ public function addWebsiteFilter($website) { - if (is_null($website) || $website == 0) { + if ($website === null || $website == 0) { return $this; } if (is_array($website)) { diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php index 25fc9bb83c6c9..c0dece8c84a71 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock.php @@ -51,14 +51,14 @@ protected function _construct() */ protected function _beforeSave(Mage_Core_Model_Abstract $object) { - if (is_null($object->getId()) && $object->getCustomerId() + if ($object->getId() === null && $object->getCustomerId() && $object->getProductId() && $object->getWebsiteId()) { if ($row = $this->_getAlertRow($object)) { $object->addData($row); $object->setStatus(0); } } - if (is_null($object->getAddDate())) { + if ($object->getAddDate() === null) { $object->setAddDate(Mage::getModel('Mage_Core_Model_Date')->gmtDate()); $object->setStatus(0); } diff --git a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php index 53ecf937a828c..dc3241c55b93d 100755 --- a/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php +++ b/app/code/core/Mage/ProductAlert/Model/Resource/Stock/Collection.php @@ -72,7 +72,7 @@ public function addCustomerFilter($customer) public function addWebsiteFilter($website) { $adapter = $this->getConnection(); - if (is_null($website) || $website == 0) { + if ($website === null || $website == 0) { return $this; } if (is_array($website)) { diff --git a/app/code/core/Mage/Reports/Block/Adminhtml/Grid.php b/app/code/core/Mage/Reports/Block/Adminhtml/Grid.php index 2fe83ce869438..510196b1066e7 100644 --- a/app/code/core/Mage/Reports/Block/Adminhtml/Grid.php +++ b/app/code/core/Mage/Reports/Block/Adminhtml/Grid.php @@ -109,7 +109,7 @@ protected function _prepareCollection() { $filter = $this->getParam($this->getVarNameFilter(), null); - if (is_null($filter)) { + if ($filter === null) { $filter = $this->_defaultFilter; } diff --git a/app/code/core/Mage/Reports/Block/Product/Abstract.php b/app/code/core/Mage/Reports/Block/Product/Abstract.php index 03a0378cdf232..91b2758ca75f5 100644 --- a/app/code/core/Mage/Reports/Block/Product/Abstract.php +++ b/app/code/core/Mage/Reports/Block/Product/Abstract.php @@ -85,8 +85,8 @@ protected function _getProductsToSkip() */ protected function _getModel() { - if (is_null($this->_indexModel)) { - if (is_null($this->_indexName)) { + if ($this->_indexModel === null) { + if ($this->_indexName === null) { Mage::throwException(Mage::helper('Mage_Reports_Helper_Data')->__('Index model name must be defined')); } @@ -113,7 +113,7 @@ public function getModel() */ public function getItemsCollection() { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $attributes = Mage::getSingleton('Mage_Catalog_Model_Config')->getProductAttributes(); $this->_collection = $this->_getModel() diff --git a/app/code/core/Mage/Reports/Model/Event.php b/app/code/core/Mage/Reports/Model/Event.php index f48b9e951d333..5d95126522697 100644 --- a/app/code/core/Mage/Reports/Model/Event.php +++ b/app/code/core/Mage/Reports/Model/Event.php @@ -85,7 +85,7 @@ protected function _beforeSave() */ public function updateCustomerType($visitorId, $customerId, $types = null) { - if (is_null($types)) { + if ($types === null) { $types = array(); foreach (Mage::getModel('Mage_Reports_Model_Event_Type')->getCollection() as $eventType) { if ($eventType->getCustomerLogin()) { diff --git a/app/code/core/Mage/Reports/Model/Event/Observer.php b/app/code/core/Mage/Reports/Model/Event/Observer.php index 90f4b7ae923f4..f76903cd85523 100644 --- a/app/code/core/Mage/Reports/Model/Event/Observer.php +++ b/app/code/core/Mage/Reports/Model/Event/Observer.php @@ -47,7 +47,7 @@ class Mage_Reports_Model_Event_Observer */ protected function _event($eventTypeId, $objectId, $subjectId = null, $subtype = 0) { - if (is_null($subjectId)) { + if ($subjectId === null) { if (Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn()) { $customer = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer(); $subjectId = $customer->getId(); diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 3c0901ccb2d81..d8fc5acf023b1 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -98,7 +98,7 @@ public function prepareSummary($range, $customStart, $customEnd, $isFilter = 0) */ protected function _getSalesAmountExpression() { - if (is_null($this->_salesAmountExpression)) { + if ($this->_salesAmountExpression === null) { $adapter = $this->getConnection(); $expressionTransferObject = new Varien_Object(array( 'expression' => '%s - %s - %s - (%s - %s - %s)', diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 619f5657c33d8..baad668cdbb3b 100755 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -349,7 +349,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, { $column = $this->_getWriteAdapter()->quoteIdentifier($column); - if (is_null($from)) { + if ($from === null) { $selectOldest = $this->_getWriteAdapter()->select() ->from( $table, diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php index 0dce1f57c274f..cc7dde3af0aa0 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Collection/Abstract.php @@ -231,7 +231,7 @@ public function setApplyFilters($flag) */ public function isTotals($flag = null) { - if (is_null($flag)) { + if ($flag === null) { return $this->_isTotals; } $this->_isTotals = $flag; @@ -246,7 +246,7 @@ public function isTotals($flag = null) */ public function isSubTotals($flag = null) { - if (is_null($flag)) { + if ($flag === null) { return $this->_isSubTotals; } $this->_isSubTotals = $flag; diff --git a/app/code/core/Mage/Review/Helper/Action/Pager.php b/app/code/core/Mage/Review/Helper/Action/Pager.php index 1df3f128fb865..6aa5fbfc7304b 100644 --- a/app/code/core/Mage/Review/Helper/Action/Pager.php +++ b/app/code/core/Mage/Review/Helper/Action/Pager.php @@ -72,7 +72,7 @@ public function setItems(array $items) */ protected function _loadItems() { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = (array) $this->_getSession()->getData($this->_getStorageKey()); } } diff --git a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php index f70c58ffc5c65..e6f95cffb4cb2 100755 --- a/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Review/Model/Resource/Review/Product/Collection.php @@ -95,7 +95,7 @@ protected function _initSelect() */ public function addStoreFilter($storeId = null) { - if (is_null($storeId)) { + if ($storeId === null) { $storeId = $this->getStoreId(); } @@ -149,7 +149,7 @@ protected function _applyStoresFilterToSelect(Zend_Db_Select $select = null) { $adapter = $this->getConnection(); $storesIds = $this->_storesIds; - if (is_null($select)){ + if ($select === null){ $select = $this->getSelect(); } diff --git a/app/code/core/Mage/Rss/Block/Wishlist.php b/app/code/core/Mage/Rss/Block/Wishlist.php index 665caaaf40caf..7c95a65a614d1 100644 --- a/app/code/core/Mage/Rss/Block/Wishlist.php +++ b/app/code/core/Mage/Rss/Block/Wishlist.php @@ -54,7 +54,7 @@ class Mage_Rss_Block_Wishlist extends Mage_Wishlist_Block_Abstract */ protected function _getWishlist() { - if (is_null($this->_wishlist)) { + if ($this->_wishlist === null) { $this->_wishlist = Mage::getModel('Mage_Wishlist_Model_Wishlist'); $wishlistId = $this->getRequest()->getParam('wishlist_id'); if ($wishlistId) { @@ -78,7 +78,7 @@ protected function _getWishlist() */ protected function _getCustomer() { - if (is_null($this->_customer)) { + if ($this->_customer === null) { $this->_customer = Mage::getModel('Mage_Customer_Model_Customer'); $params = Mage::helper('Mage_Core_Helper_Data')->urlDecode($this->getRequest()->getParam('data')); diff --git a/app/code/core/Mage/Rss/controllers/IndexController.php b/app/code/core/Mage/Rss/controllers/IndexController.php index 7b9bcf5410afa..3e26b5d565f63 100644 --- a/app/code/core/Mage/Rss/controllers/IndexController.php +++ b/app/code/core/Mage/Rss/controllers/IndexController.php @@ -102,7 +102,7 @@ public function wishlistAction() */ protected function _getWishlist() { - if (is_null($this->_wishlist)) { + if ($this->_wishlist === null) { $this->_wishlist = Mage::getModel('Mage_Wishlist_Model_Wishlist'); $wishlistId = $this->getRequest()->getParam('wishlist_id'); if ($wishlistId) { @@ -123,7 +123,7 @@ protected function _getWishlist() */ protected function _getCustomer() { - if (is_null($this->_customer)) { + if ($this->_customer === null) { $this->_customer = Mage::getModel('Mage_Customer_Model_Customer'); $params = Mage::helper('Mage_Core_Helper_Data')->urlDecode($this->getRequest()->getParam('data')); diff --git a/app/code/core/Mage/Rule/Model/Abstract.php b/app/code/core/Mage/Rule/Model/Abstract.php index 62c9e3bacdd71..662947b5bef24 100644 --- a/app/code/core/Mage/Rule/Model/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Abstract.php @@ -221,7 +221,7 @@ public function getActions() */ protected function _resetConditions($conditions = null) { - if (is_null($conditions)) { + if ($conditions === null) { $conditions = $this->getConditionsInstance(); } $conditions->setRule($this)->setId('1')->setPrefix('conditions'); @@ -239,7 +239,7 @@ protected function _resetConditions($conditions = null) */ protected function _resetActions($actions = null) { - if (is_null($actions)) { + if ($actions === null) { $actions = $this->getActionsInstance(); } $actions->setRule($this)->setId('1')->setPrefix('actions'); diff --git a/app/code/core/Mage/Rule/Model/Condition/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Abstract.php index b5b07cd163bdb..b9c700f73c120 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Abstract.php @@ -304,7 +304,7 @@ public function getValue() public function getValueName() { $value = $this->getValue(); - if (is_null($value) || '' === $value) { + if ($value === null || '' === $value) { return '...'; } @@ -387,7 +387,7 @@ public function getTypeElementHtml() public function getAttributeElement() { - if (is_null($this->getAttribute())) { + if ($this->getAttribute() === null) { foreach ($this->getAttributeOption() as $k => $v) { $this->setAttribute($k); break; @@ -415,7 +415,7 @@ public function getAttributeElementHtml() public function getOperatorElement() { $options = $this->getOperatorSelectOptions(); - if (is_null($this->getOperator())) { + if ($this->getOperator() === null) { foreach ($options as $option) { $this->setOperator($option['value']); break; diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index f454c8e2080c8..3cc12c1578b12 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -109,7 +109,7 @@ public function getAggregatorName() public function getAggregatorElement() { - if (is_null($this->getAggregator())) { + if ($this->getAggregator() === null) { foreach ($this->getAggregatorOption() as $k=>$v) { $this->setAggregator($k); break; diff --git a/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php index 0c9a56ee9b392..b1c7f956b7afb 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Condition/Product/Abstract.php @@ -484,7 +484,7 @@ public function validate(Varien_Object $object) } } - if (is_null($oldAttrValue)) { + if ($oldAttrValue === null) { $object->unsetData($attrCode); } else { $object->setData($attrCode, $oldAttrValue); diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php index e6d6f48106bd8..578edffd6569c 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreement/View.php @@ -59,7 +59,7 @@ class Mage_Sales_Block_Billing_Agreement_View extends Mage_Core_Block_Template */ public function getRelatedOrders() { - if (is_null($this->_relatedOrders)) { + if ($this->_relatedOrders === null) { $this->_relatedOrders = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Collection') ->addFieldToSelect('*') ->addFieldToFilter('customer_id', Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer()->getId()) @@ -117,7 +117,7 @@ public function getOrderItemValue(Mage_Sales_Model_Order $order, $key) */ protected function _prepareLayout() { - if (is_null($this->_billingAgreementInstance)) { + if ($this->_billingAgreementInstance === null) { $this->_billingAgreementInstance = Mage::registry('current_billing_agreement'); } parent::_prepareLayout(); diff --git a/app/code/core/Mage/Sales/Block/Billing/Agreements.php b/app/code/core/Mage/Sales/Block/Billing/Agreements.php index 63f65a0c226da..75b7ec7645aad 100644 --- a/app/code/core/Mage/Sales/Block/Billing/Agreements.php +++ b/app/code/core/Mage/Sales/Block/Billing/Agreements.php @@ -68,7 +68,7 @@ protected function _prepareLayout() */ public function getBillingAgreements() { - if (is_null($this->_billingAgreements)) { + if ($this->_billingAgreements === null) { $this->_billingAgreements = Mage::getResourceModel('Mage_Sales_Model_Resource_Billing_Agreement_Collection') ->addFieldToFilter('customer_id', Mage::getSingleton('Mage_Customer_Model_Session')->getCustomerId()) ->setOrder('agreement_id', 'desc'); diff --git a/app/code/core/Mage/Sales/Block/Items/Abstract.php b/app/code/core/Mage/Sales/Block/Items/Abstract.php index a8158612ad343..70b7cca8aae67 100644 --- a/app/code/core/Mage/Sales/Block/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Block/Items/Abstract.php @@ -83,7 +83,7 @@ public function getItemRenderer($type) $type = 'default'; } - if (is_null($this->_itemRenders[$type]['renderer'])) { + if ($this->_itemRenders[$type]['renderer'] === null) { $this->_itemRenders[$type]['renderer'] = $this->getLayout() ->createBlock($this->_itemRenders[$type]['block']) ->setTemplate($this->_itemRenders[$type]['template']) diff --git a/app/code/core/Mage/Sales/Block/Order/Comments.php b/app/code/core/Mage/Sales/Block/Order/Comments.php index 2641a424f97ce..fa5c4a20d5d2d 100644 --- a/app/code/core/Mage/Sales/Block/Order/Comments.php +++ b/app/code/core/Mage/Sales/Block/Order/Comments.php @@ -69,7 +69,7 @@ public function getEntity() */ public function getComments() { - if (is_null($this->_commentCollection)) { + if ($this->_commentCollection === null) { $entity = $this->getEntity(); if ($entity instanceof Mage_Sales_Model_Order_Invoice) { $collectionClass = 'Mage_Sales_Model_Resource_Order_Invoice_Comment_Collection'; diff --git a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php index 1bb7319ce2eed..e55fe8f47df70 100644 --- a/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php +++ b/app/code/core/Mage/Sales/Block/Widget/Guest/Form.php @@ -72,7 +72,7 @@ public function getTypeSelectHtml() protected function _getFormOptions() { $options = $this->getData('identifymeby_options'); - if (is_null($options)) { + if ($options === null) { $options = array(); $options[] = array( 'value' => 'email', diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php index 6867c42c4c561..38e23519bafb3 100644 --- a/app/code/core/Mage/Sales/Model/Order.php +++ b/app/code/core/Mage/Sales/Model/Order.php @@ -422,7 +422,7 @@ protected function _construct() public function unsetData($key=null) { parent::unsetData($key); - if (is_null($key)) { + if ($key === null) { $this->_items = null; } return $this; @@ -1194,7 +1194,7 @@ public function getTrackingNumbers() public function getShippingCarrier() { $carrierModel = $this->getData('shipping_carrier'); - if (is_null($carrierModel)) { + if ($carrierModel === null) { $carrierModel = false; /** * $method - carrier_method @@ -1381,7 +1381,7 @@ protected function _getEmails($configPath) */ public function getAddressesCollection() { - if (is_null($this->_addresses)) { + if ($this->_addresses === null) { $this->_addresses = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Address_Collection') ->setOrderFilter($this); @@ -1421,7 +1421,7 @@ public function addAddress(Mage_Sales_Model_Order_Address $address) */ public function getItemsCollection($filterByTypes = array(), $nonChildrenOnly = false) { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Item_Collection') ->setOrderFilter($this); @@ -1571,7 +1571,7 @@ public function isNominal() */ public function getPaymentsCollection() { - if (is_null($this->_payments)) { + if ($this->_payments === null) { $this->_payments = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Payment_Collection') ->setOrderFilter($this); @@ -1634,7 +1634,7 @@ public function setPayment(Mage_Sales_Model_Order_Payment $payment) */ public function getStatusHistoryCollection($reload = false) { - if (is_null($this->_statusHistory) || $reload) { + if ($this->_statusHistory === null || $reload) { $this->_statusHistory = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Status_History_Collection') ->setOrderFilter($this) ->setOrder('created_at', 'desc') @@ -1719,7 +1719,7 @@ public function addStatusHistory(Mage_Sales_Model_Order_Status_History $history) public function getRealOrderId() { $id = $this->getData('real_order_id'); - if (is_null($id)) { + if ($id === null) { $id = $this->getIncrementId(); } return $id; @@ -1732,7 +1732,7 @@ public function getRealOrderId() */ public function getOrderCurrency() { - if (is_null($this->_orderCurrency)) { + if ($this->_orderCurrency === null) { $this->_orderCurrency = Mage::getModel('Mage_Directory_Model_Currency'); $this->_orderCurrency->load($this->getOrderCurrencyCode()); } @@ -1774,7 +1774,7 @@ public function formatPriceTxt($price) */ public function getBaseCurrency() { - if (is_null($this->_baseCurrency)) { + if ($this->_baseCurrency === null) { $this->_baseCurrency = Mage::getModel('Mage_Directory_Model_Currency')->load($this->getBaseCurrencyCode()); } return $this->_baseCurrency; @@ -1837,7 +1837,7 @@ public function getData($key='', $index=null) */ public function getInvoiceCollection() { - if (is_null($this->_invoices)) { + if ($this->_invoices === null) { $this->_invoices = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Invoice_Collection') ->setOrderFilter($this); @@ -2129,7 +2129,7 @@ protected function _afterSave() public function getStoreGroupName() { $storeId = $this->getStoreId(); - if (is_null($storeId)) { + if ($storeId === null) { return $this->getStoreName(1); // 0 - website name, 1 - store group name, 2 - store name } return $this->getStore()->getGroup()->getName(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php index d4d96435535bc..2a66a8dcdd49c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -374,7 +374,7 @@ public function canVoid() /** * If we not retrieve negative answer from payment yet */ - if (is_null($canVoid)) { + if ($canVoid === null) { $canVoid = $this->getOrder()->getPayment()->canVoid($this); if ($canVoid === false) { $this->setCanVoidFlag(false); @@ -549,7 +549,7 @@ public function register() ); $state = $this->getState(); - if (is_null($state)) { + if ($state === null) { $this->setState(self::STATE_OPEN); } return $this; @@ -562,7 +562,7 @@ public function register() */ public static function getStates() { - if (is_null(self::$_states)) { + if (self::$_states === null) { self::$_states = array( self::STATE_OPEN => Mage::helper('Mage_Sales_Helper_Data')->__('Pending'), self::STATE_REFUNDED => Mage::helper('Mage_Sales_Helper_Data')->__('Refunded'), @@ -580,11 +580,11 @@ public static function getStates() */ public function getStateName($stateId = null) { - if (is_null($stateId)) { + if ($stateId === null) { $stateId = $this->getState(); } - if (is_null(self::$_states)) { + if (self::$_states === null) { self::getStates(); } if (isset(self::$_states[$stateId])) { @@ -673,7 +673,7 @@ public function addComment($comment, $notify=false, $visibleOnFront=false) public function getCommentsCollection($reload=false) { - if (is_null($this->_comments) || $reload) { + if ($this->_comments === null || $reload) { $this->_comments = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Creditmemo_Comment_Collection') ->setCreditmemoFilter($this->getId()) ->setCreatedAtOrder(); diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php index c871d04b0bde1..80388988dc12d 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php @@ -154,7 +154,7 @@ public function setOrderItem(Mage_Sales_Model_Order_Item $item) */ public function getOrderItem() { - if (is_null($this->_orderItem)) { + if ($this->_orderItem === null) { if ($this->getCreditmemo()) { $this->_orderItem = $this->getCreditmemo()->getOrder()->getItemById($this->getOrderItemId()); } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index d0365f81f36d5..d75d090dcdcc8 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -322,7 +322,7 @@ public function canVoid() /** * If we not retrieve negative answer from payment yet */ - if (is_null($canVoid)) { + if ($canVoid === null) { $canVoid = $this->getOrder()->getPayment()->canVoid($this); if ($canVoid === false) { $this->setCanVoidFlag(false); @@ -569,7 +569,7 @@ public function addItem(Mage_Sales_Model_Order_Invoice_Item $item) */ public static function getStates() { - if (is_null(self::$_states)) { + if (self::$_states === null) { self::$_states = array( self::STATE_OPEN => Mage::helper('Mage_Sales_Helper_Data')->__('Pending'), self::STATE_PAID => Mage::helper('Mage_Sales_Helper_Data')->__('Paid'), @@ -587,11 +587,11 @@ public static function getStates() */ public function getStateName($stateId = null) { - if (is_null($stateId)) { + if ($stateId === null) { $stateId = $this->getState(); } - if (is_null(self::$_states)) { + if (self::$_states === null) { self::getStates(); } if (isset(self::$_states[$stateId])) { @@ -665,7 +665,7 @@ public function register() $order->setBaseTotalInvoicedCost($order->getBaseTotalInvoicedCost() + $this->getBaseCost()); $state = $this->getState(); - if (is_null($state)) { + if ($state === null) { $this->setState(self::STATE_OPEN); } @@ -717,7 +717,7 @@ public function addComment($comment, $notify=false, $visibleOnFront=false) public function getCommentsCollection($reload=false) { - if (is_null($this->_comments) || $reload) { + if ($this->_comments === null || $reload) { $this->_comments = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Invoice_Comment_Collection') ->setInvoiceFilter($this->getId()) ->setCreatedAtOrder(); diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index 9b6692a87100d..e872d8ce7e299 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -156,7 +156,7 @@ public function setOrderItem(Mage_Sales_Model_Order_Item $item) */ public function getOrderItem() { - if (is_null($this->_orderItem)) { + if ($this->_orderItem === null) { if ($this->getInvoice()) { $this->_orderItem = $this->getInvoice()->getOrder()->getItemById($this->getOrderItemId()); } diff --git a/app/code/core/Mage/Sales/Model/Order/Item.php b/app/code/core/Mage/Sales/Model/Order/Item.php index df3afe0acbf24..9aaf963d560ca 100644 --- a/app/code/core/Mage/Sales/Model/Order/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Item.php @@ -391,7 +391,7 @@ public function setOrder(Mage_Sales_Model_Order $order) */ public function getOrder() { - if (is_null($this->_order) && ($orderId = $this->getOrderId())) { + if ($this->_order === null && ($orderId = $this->getOrderId())) { $order = Mage::getModel('Mage_Sales_Model_Order'); $order->load($orderId); $this->setOrder($order); @@ -480,7 +480,7 @@ public function getStatus() */ public static function getStatusName($statusId) { - if (is_null(self::$_statuses)) { + if (self::$_statuses === null) { self::getStatuses(); } if (isset(self::$_statuses[$statusId])) { @@ -512,7 +512,7 @@ public function cancel() */ public static function getStatuses() { - if (is_null(self::$_statuses)) { + if (self::$_statuses === null) { self::$_statuses = array( //self::STATUS_PENDING => Mage::helper('Mage_Sales_Helper_Data')->__('Pending'), self::STATUS_PENDING => Mage::helper('Mage_Sales_Helper_Data')->__('Ordered'), @@ -537,7 +537,7 @@ public static function getStatuses() public function getOriginalPrice() { $price = $this->getData('original_price'); - if (is_null($price)) { + if ($price === null) { return $this->getPrice(); } return $price; @@ -578,7 +578,7 @@ public function getProductOptions() public function getProductOptionByCode($code=null) { $options = $this->getProductOptions(); - if (is_null($code)) { + if ($code === null) { return $options; } if (isset($options[$code])) { diff --git a/app/code/core/Mage/Sales/Model/Order/Payment.php b/app/code/core/Mage/Sales/Model/Order/Payment.php index 85c7bbe5160cf..1caed86ecc439 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment.php @@ -357,7 +357,7 @@ public function place() */ public function capture($invoice) { - if (is_null($invoice)) { + if ($invoice === null) { $invoice = $this->_invoice(); $this->setCreatedInvoice($invoice); return $this; // @see Mage_Sales_Model_Order_Invoice::capture() @@ -1518,7 +1518,7 @@ public function setTransactionAdditionalInfo($key, $value) */ public function getTransactionAdditionalInfo($key = null) { - if (is_null($key)) { + if ($key === null) { return $this->_transactionAdditionalInfo; } return isset($this->_transactionAdditionalInfo[$key]) ? $this->_transactionAdditionalInfo[$key] : null; diff --git a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php index e23003378c1d2..6e7582b880f8c 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php @@ -747,7 +747,7 @@ public function getTransactionTypes() */ public function getOrderWebsiteId() { - if (is_null($this->_orderWebsiteId)) { + if ($this->_orderWebsiteId === null) { $this->_orderWebsiteId = (int)$this->getResource()->getOrderWebsiteId($this->getOrderId()); } return $this->_orderWebsiteId; diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index aabdc660dbf9e..6ea6a91662c38 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -707,7 +707,7 @@ protected function _getRenderer($type) Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Invalid renderer model')); } - if (is_null($this->_renderers[$type]['renderer'])) { + if ($this->_renderers[$type]['renderer'] === null) { $this->_renderers[$type]['renderer'] = Mage::getSingleton($this->_renderers[$type]['model']); } diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index 75fbb9234197b..27924efc48d29 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -136,7 +136,7 @@ public function setPage(Zend_Pdf_Page $page) */ public function getOrder() { - if (is_null($this->_order)) { + if ($this->_order === null) { Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Order object is not specified.')); } return $this->_order; @@ -150,7 +150,7 @@ public function getOrder() */ public function getSource() { - if (is_null($this->_source)) { + if ($this->_source === null) { Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Source object is not specified.')); } return $this->_source; @@ -164,7 +164,7 @@ public function getSource() */ public function getItem() { - if (is_null($this->_item)) { + if ($this->_item === null) { Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('Item object is not specified.')); } return $this->_item; @@ -178,7 +178,7 @@ public function getItem() */ public function getPdf() { - if (is_null($this->_pdf)) { + if ($this->_pdf === null) { Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('PDF object is not specified.')); } return $this->_pdf; @@ -192,7 +192,7 @@ public function getPdf() */ public function getPage() { - if (is_null($this->_pdfPage)) { + if ($this->_pdfPage === null) { Mage::throwException(Mage::helper('Mage_Sales_Helper_Data')->__('PDF page object is not specified.')); } return $this->_pdfPage; diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Shipment.php index a7a0aaa8d104f..e2fb664eab61e 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment.php @@ -343,7 +343,7 @@ public function addComment($comment, $notify=false, $visibleOnFront=false) public function getCommentsCollection($reload=false) { - if (is_null($this->_comments) || $reload) { + if ($this->_comments === null || $reload) { $this->_comments = Mage::getResourceModel('Mage_Sales_Model_Resource_Order_Shipment_Comment_Collection') ->setShipmentFilter($this->getId()) ->setCreatedAtOrder(); diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php index 2151522152001..c3671dc51d1d4 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Item.php @@ -113,7 +113,7 @@ public function setOrderItem(Mage_Sales_Model_Order_Item $item) */ public function getOrderItem() { - if (is_null($this->_orderItem)) { + if ($this->_orderItem === null) { if ($this->getShipment()) { $this->_orderItem = $this->getShipment()->getOrder()->getItemById($this->getOrderItemId()); } diff --git a/app/code/core/Mage/Sales/Model/Order/Status/History.php b/app/code/core/Mage/Sales/Model/Order/Status/History.php index 486fcbab2f821..93a162fe5f047 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status/History.php +++ b/app/code/core/Mage/Sales/Model/Order/Status/History.php @@ -88,7 +88,7 @@ public function setOrder(Mage_Sales_Model_Order $order) */ public function setIsCustomerNotified($flag = null) { - if (is_null($flag)) { + if ($flag === null) { $flag = self::CUSTOMER_NOTIFICATION_NOT_APPLICABLE; } diff --git a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php index cb22023824072..b56d81bfd9629 100644 --- a/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php +++ b/app/code/core/Mage/Sales/Model/Payment/Method/Billing/AgreementAbstract.php @@ -56,7 +56,7 @@ abstract class Mage_Sales_Model_Payment_Method_Billing_AgreementAbstract extends */ public function isAvailable($quote = null) { - if (is_null($this->_isAvailable)) { + if ($this->_isAvailable === null) { if (is_object($quote) && $quote->getCustomer()) { $availableBA = Mage::getModel('Mage_Sales_Model_Billing_Agreement')->getAvailableCustomerBillingAgreements( $quote->getCustomer()->getId() diff --git a/app/code/core/Mage/Sales/Model/Quote.php b/app/code/core/Mage/Sales/Model/Quote.php index ae3c29c909526..13ecf62146a91 100644 --- a/app/code/core/Mage/Sales/Model/Quote.php +++ b/app/code/core/Mage/Sales/Model/Quote.php @@ -236,7 +236,7 @@ public function setStore(Mage_Core_Model_Store $store) public function getSharedStoreIds() { $ids = $this->_getData('shared_store_ids'); - if (is_null($ids) || !is_array($ids)) { + if ($ids === null || !is_array($ids)) { if ($website = $this->getWebsite()) { return $website->getStoreIds(); } @@ -402,7 +402,7 @@ public function assignCustomerWithAddressChange( } } - if (is_null($shippingAddress)) { + if ($shippingAddress === null) { $defaultShippingAddress = $customer->getDefaultShippingAddress(); if ($defaultShippingAddress && $defaultShippingAddress->getId()) { $shippingAddress = Mage::getModel('Mage_Sales_Model_Quote_Address') @@ -438,7 +438,7 @@ public function setCustomer(Mage_Customer_Model_Customer $customer) */ public function getCustomer() { - if (is_null($this->_customer)) { + if ($this->_customer === null) { $this->_customer = Mage::getModel('Mage_Customer_Model_Customer'); if ($customerId = $this->getCustomerId()) { $this->_customer->load($customerId); @@ -487,7 +487,7 @@ public function getCustomerTaxClassId() */ public function getAddressesCollection() { - if (is_null($this->_addresses)) { + if ($this->_addresses === null) { $this->_addresses = Mage::getModel('Mage_Sales_Model_Quote_Address')->getCollection() ->setQuoteFilter($this->getId()); @@ -713,7 +713,7 @@ public function getItemsCollection($useCache = true) if ($this->hasItemsCollection()) { return $this->getData('items_collection'); } - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = Mage::getModel('Mage_Sales_Model_Quote_Item')->getCollection(); $this->_items->setQuote($this); } @@ -878,7 +878,7 @@ public function removeItem($itemId) public function removeAllItems() { foreach ($this->getItemsCollection() as $itemId => $item) { - if (is_null($item->getId())) { + if ($item->getId() === null) { $this->getItemsCollection()->removeItemByKey($itemId); } else { $item->isDeleted(true); @@ -1157,7 +1157,7 @@ public function getItemByProduct($product) public function getItemsSummaryQty() { $qty = $this->getData('all_items_qty'); - if (is_null($qty)) { + if ($qty === null) { $qty = 0; foreach ($this->getAllItems() as $item) { if ($item->getParentItem()) { @@ -1180,7 +1180,7 @@ public function getItemsSummaryQty() public function getItemVirtualQty() { $qty = $this->getData('virtual_items_qty'); - if (is_null($qty)) { + if ($qty === null) { $qty = 0; foreach ($this->getAllItems() as $item) { if ($item->getParentItem()) { @@ -1207,7 +1207,7 @@ public function getItemVirtualQty() /*********************** PAYMENTS ***************************/ public function getPaymentsCollection() { - if (is_null($this->_payments)) { + if ($this->_payments === null) { $this->_payments = Mage::getModel('Mage_Sales_Model_Quote_Payment')->getCollection() ->setQuoteFilter($this->getId()); @@ -1411,7 +1411,7 @@ public function getTotals() public function addMessage($message, $index = 'error') { $messages = $this->getData('messages'); - if (is_null($messages)) { + if ($messages === null) { $messages = array(); } @@ -1436,7 +1436,7 @@ public function addMessage($message, $index = 'error') public function getMessages() { $messages = $this->getData('messages'); - if (is_null($messages)) { + if ($messages === null) { $messages = array(); $this->setData('messages', $messages); } @@ -1586,7 +1586,7 @@ public function removeErrorInfosByParams($type = 'error', $params) public function removeMessageByText($type = 'error', $text) { $messages = $this->getData('messages'); - if (is_null($messages)) { + if ($messages === null) { $messages = array(); } diff --git a/app/code/core/Mage/Sales/Model/Quote/Address.php b/app/code/core/Mage/Sales/Model/Quote/Address.php index 935efaad3a029..007aa11bb46be 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Address.php +++ b/app/code/core/Mage/Sales/Model/Quote/Address.php @@ -358,7 +358,7 @@ public function toArray(array $arrAttributes = array()) */ public function getItemsCollection() { - if (is_null($this->_items)) { + if ($this->_items === null) { $this->_items = Mage::getModel('Mage_Sales_Model_Quote_Address_Item')->getCollection() ->setAddressFilter($this->getId()); @@ -657,7 +657,7 @@ public function addItem(Mage_Sales_Model_Quote_Item_Abstract $item, $qty=null) */ public function getShippingRatesCollection() { - if (is_null($this->_rates)) { + if ($this->_rates === null) { $this->_rates = Mage::getModel('Mage_Sales_Model_Quote_Address_Rate')->getCollection() ->setAddressFilter($this->getId()); if ($this->getQuote()->hasNominalItems(false)) { diff --git a/app/code/core/Mage/Sales/Model/Quote/Item.php b/app/code/core/Mage/Sales/Model/Quote/Item.php index 98734c3f4ee40..6d48f0e1d6612 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item.php @@ -328,7 +328,7 @@ public function setQty($qty) public function getQtyOptions() { $qtyOptions = $this->getData('qty_options'); - if (is_null($qtyOptions)) { + if ($qtyOptions === null) { $productIds = array(); $qtyOptions = array(); foreach ($this->getOptions() as $option) { diff --git a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php index f11b4a9f9a034..956b757ce9504 100644 --- a/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php @@ -353,7 +353,7 @@ public function calcRowTotal() public function getCalculationPrice() { $price = $this->_getData('calculation_price'); - if (is_null($price)) { + if ($price === null) { if ($this->hasCustomPrice()) { $price = $this->getCustomPrice(); } else { @@ -373,7 +373,7 @@ public function getCalculationPrice() public function getCalculationPriceOriginal() { $price = $this->_getData('calculation_price'); - if (is_null($price)) { + if ($price === null) { if ($this->hasOriginalCustomPrice()) { $price = $this->getOriginalCustomPrice(); } else { @@ -462,7 +462,7 @@ public function getIsNominal() public function getOriginalPrice() { $price = $this->_getData('original_price'); - if (is_null($price)) { + if ($price === null) { $price = $this->getStore()->convertPrice($this->getBaseOriginalPrice()); $this->setData('original_price', $price); } @@ -533,7 +533,7 @@ public function setPrice($value) public function getConvertedPrice() { $price = $this->_getData('converted_price'); - if (is_null($price)) { + if ($price === null) { $price = $this->getStore()->convertPrice($this->getPrice()); $this->setData('converted_price', $price); } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php index 9fa31961a588c..bf7d27f54bedd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Billing.php @@ -42,7 +42,7 @@ class Mage_Sales_Model_Resource_Order_Attribute_Backend_Billing extends Mage_Eav public function beforeSave($object) { $billingAddressId = $object->getBillingAddressId(); - if (is_null($billingAddressId)) { + if ($billingAddressId === null) { $object->unsetBillingAddressId(); } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php index d9d6817cc3768..abe1fe57690dd 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Attribute/Backend/Shipping.php @@ -43,7 +43,7 @@ class Mage_Sales_Model_Resource_Order_Attribute_Backend_Shipping public function beforeSave($object) { $shippingAddressId = $object->getShippingAddressId(); - if (is_null($shippingAddressId)) { + if ($shippingAddressId === null) { $object->unsetShippingAddressId(); } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php index 0affd38ed90e7..5c879ba9521c5 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Collection.php @@ -68,7 +68,7 @@ protected function _construct() */ public function addItemCountExpr() { - if (is_null($this->_fieldsToSelect)) { + if ($this->_fieldsToSelect === null) { // If we select all fields from table, we need to add column alias $this->getSelect()->columns(array('items_count'=>'total_item_count')); } else { diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php index d2d6475f16bce..b4f6a23ab6115 100755 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Collection/Abstract.php @@ -61,7 +61,7 @@ public function addOrderStatusFilter($orderStatus) */ protected function _applyOrderStatusFilter() { - if (is_null($this->_orderStatus)) { + if ($this->_orderStatus === null) { return $this; } $orderStatus = $this->_orderStatus; diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php index b6c5f8bd1b06d..0a6b1a23b42ab 100755 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule/Collection.php @@ -124,7 +124,7 @@ public function setValidationFilter($websiteId, $customerGroupId, $couponCode = public function addWebsiteGroupDateFilter($websiteId, $customerGroupId, $now = null) { if (!$this->getFlag('website_group_date_filter')) { - if (is_null($now)) { + if ($now === null) { $now = Mage::getModel('Mage_Core_Model_Date')->date('Y-m-d'); } diff --git a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php index 23a02ed326582..efceeeda6f3d6 100755 --- a/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/core/Mage/Sitemap/Model/Resource/Catalog/Product.php @@ -328,7 +328,7 @@ protected function _getAllProductImages($product, $storeId) */ protected function _getMediaGalleryModel() { - if (is_null($this->_mediaGalleryModel)) { + if ($this->_mediaGalleryModel === null) { /** @var $eavConfig Mage_Eav_Model_Config */ $eavConfig = Mage::getModel('Mage_Eav_Model_Config'); /** @var $eavConfig Mage_Eav_Model_Attribute */ diff --git a/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Accordion.php b/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Accordion.php index 294e13b99a3d0..5ddad7f698372 100644 --- a/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Accordion.php +++ b/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Accordion.php @@ -40,7 +40,7 @@ class Mage_Tag_Block_Adminhtml_Edit_Accordion extends Mage_Adminhtml_Block_Widge */ protected function _prepareLayout() { - if (is_null(Mage::registry('current_tag')->getId())) { + if (Mage::registry('current_tag')->getId() === null) { return $this; } diff --git a/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Assigned.php b/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Assigned.php index 1771d54ee7a7b..e4f56fd9d9d76 100644 --- a/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Assigned.php +++ b/app/code/core/Mage/Tag/Block/Adminhtml/Edit/Assigned.php @@ -40,7 +40,7 @@ class Mage_Tag_Block_Adminhtml_Edit_Assigned extends Mage_Adminhtml_Block_Widget */ protected function _prepareLayout() { - if (is_null(Mage::registry('current_tag')->getId())) { + if (Mage::registry('current_tag')->getId() === null) { return $this; } diff --git a/app/code/core/Mage/Tag/Block/Customer/View.php b/app/code/core/Mage/Tag/Block/Customer/View.php index 2088731953570..8430c8f7f4c28 100644 --- a/app/code/core/Mage/Tag/Block/Customer/View.php +++ b/app/code/core/Mage/Tag/Block/Customer/View.php @@ -65,7 +65,7 @@ protected function _construct() */ public function getTagInfo() { - if (is_null($this->_tagInfo)) { + if ($this->_tagInfo === null) { $this->_tagInfo = Mage::getModel('Mage_Tag_Model_Tag') ->load($this->getTagId()); } @@ -145,7 +145,7 @@ public function getMode() */ protected function _getCollection() { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $this->_collection = Mage::getModel('Mage_Tag_Model_Tag') ->getEntityCollection() ->addTagFilter($this->getTagId()) diff --git a/app/code/core/Mage/Tag/Block/Product/List.php b/app/code/core/Mage/Tag/Block/Product/List.php index 0857eb6b598c8..ce17c1dd2f673 100644 --- a/app/code/core/Mage/Tag/Block/Product/List.php +++ b/app/code/core/Mage/Tag/Block/Product/List.php @@ -114,7 +114,7 @@ public function renderTags($pattern, $glue = ' ') */ public function getUniqueHtmlId($prefix = '') { - if (is_null($this->_uniqueHtmlId)) { + if ($this->_uniqueHtmlId === null) { $this->_uniqueHtmlId = Mage::helper('Mage_Core_Helper_Data')->uniqHash($prefix); } return $this->_uniqueHtmlId; diff --git a/app/code/core/Mage/Tag/Block/Product/Result.php b/app/code/core/Mage/Tag/Block/Product/Result.php index 313a91c9c3a31..f2b5837908882 100644 --- a/app/code/core/Mage/Tag/Block/Product/Result.php +++ b/app/code/core/Mage/Tag/Block/Product/Result.php @@ -78,7 +78,7 @@ public function getProductListHtml() protected function _getProductCollection() { - if(is_null($this->_productCollection)) { + if($this->_productCollection === null) { $tagModel = Mage::getModel('Mage_Tag_Model_Tag'); $this->_productCollection = $tagModel->getEntityCollection() ->addAttributeToSelect(Mage::getSingleton('Mage_Catalog_Model_Config')->getProductAttributes()) diff --git a/app/code/core/Mage/Tag/Model/Tag.php b/app/code/core/Mage/Tag/Model/Tag.php index 7c49bfdcb8911..22cb01e26db10 100644 --- a/app/code/core/Mage/Tag/Model/Tag.php +++ b/app/code/core/Mage/Tag/Model/Tag.php @@ -256,7 +256,7 @@ public function getRelatedProductIds() */ public function isAvailableInStore($storeId = null) { - $storeId = (is_null($storeId)) ? Mage::app()->getStore()->getId() : $storeId; + $storeId = ($storeId === null) ? Mage::app()->getStore()->getId() : $storeId; return in_array($storeId, $this->getVisibleInStoreIds()); } diff --git a/app/code/core/Mage/Tag/Model/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Tag/Relation.php index e58f832aece3a..a2988fb895f86 100644 --- a/app/code/core/Mage/Tag/Model/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Tag/Relation.php @@ -123,7 +123,7 @@ public function loadByTagCustomer($productId=null, $tagId, $customerId, $storeId public function getProductIds() { $ids = $this->getData('product_ids'); - if (is_null($ids)) { + if ($ids === null) { $ids = $this->_getResource()->getProductIds($this); $this->setProductIds($ids); } @@ -137,7 +137,7 @@ public function getProductIds() */ public function getRelatedTagIds() { - if (is_null($this->getData('related_tag_ids'))) { + if ($this->getData('related_tag_ids') === null) { $this->setRelatedTagIds($this->_getResource()->getRelatedTagIds($this)); } return $this->getData('related_tag_ids'); diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 720defc1443e8..b1e94610b2ecf 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -410,7 +410,7 @@ public function getPrice($product, $price, $includingTax = null, $shippingAddres if (!$this->needPriceConversion($store)) { return $store->roundPrice($price); } - if (is_null($priceIncludesTax)) { + if ($priceIncludesTax === null) { $priceIncludesTax = $this->priceIncludesTax($store); } @@ -418,7 +418,7 @@ public function getPrice($product, $price, $includingTax = null, $shippingAddres $includingPercent = null; $taxClassId = $product->getTaxClassId(); - if (is_null($percent)) { + if ($percent === null) { if ($taxClassId) { $request = Mage::getSingleton('Mage_Tax_Model_Calculation') ->getRateRequest($shippingAddress, $billingAddress, $ctc, $store); @@ -432,7 +432,7 @@ public function getPrice($product, $price, $includingTax = null, $shippingAddres ->getRate($request->setProductClassId($taxClassId)); } - if ($percent === false || is_null($percent)) { + if ($percent === false || $percent === null) { if ($priceIncludesTax && !$includingPercent) { return $price; } diff --git a/app/code/core/Mage/Tax/Model/Calculation.php b/app/code/core/Mage/Tax/Model/Calculation.php index d3b45a906d800..dc0c4b00c80ae 100644 --- a/app/code/core/Mage/Tax/Model/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Calculation.php @@ -280,9 +280,9 @@ public function getRateRequest( || ($billingAddress === false && $basedOn == 'billing')) { $basedOn = 'default'; } else { - if ((($billingAddress === false || is_null($billingAddress) || !$billingAddress->getCountryId()) + if ((($billingAddress === false || $billingAddress === null || !$billingAddress->getCountryId()) && $basedOn == 'billing') - || (($shippingAddress === false || is_null($shippingAddress) || !$shippingAddress->getCountryId()) + || (($shippingAddress === false || $shippingAddress === null || !$shippingAddress->getCountryId()) && $basedOn == 'shipping') ){ if ($customer) { @@ -324,7 +324,7 @@ public function getRateRequest( break; } - if (is_null($customerTaxClass) && $customer) { + if ($customerTaxClass === null && $customer) { $customerTaxClass = $customer->getTaxClassId(); } elseif (($customerTaxClass === false) || !$customer) { $customerTaxClass = $this->getDefaultCustomerTaxClass($store); diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rate.php b/app/code/core/Mage/Tax/Model/Calculation/Rate.php index f62826d003858..45f0869cfcff4 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rate.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rate.php @@ -161,7 +161,7 @@ protected function _afterDelete() public function saveTitles($titles = null) { - if (is_null($titles)) { + if ($titles === null) { $titles = $this->getTitle(); } @@ -182,7 +182,7 @@ public function saveTitles($titles = null) public function getTitleModel() { - if (is_null($this->_titleModel)) { + if ($this->_titleModel === null) { $this->_titleModel = Mage::getModel('Mage_Tax_Model_Calculation_Rate_Title'); } return $this->_titleModel; @@ -190,7 +190,7 @@ public function getTitleModel() public function getTitles() { - if (is_null($this->_titles)) { + if ($this->_titles === null) { $this->_titles = $this->getTitleModel()->getCollection()->loadByRateId($this->getId()); } return $this->_titles; diff --git a/app/code/core/Mage/Tax/Model/Calculation/Rule.php b/app/code/core/Mage/Tax/Model/Calculation/Rule.php index 924a96399e489..ba86948fae71e 100644 --- a/app/code/core/Mage/Tax/Model/Calculation/Rule.php +++ b/app/code/core/Mage/Tax/Model/Calculation/Rule.php @@ -142,7 +142,7 @@ public function saveCalculationData() public function getCalculationModel() { - if (is_null($this->_calculationModel)) { + if ($this->_calculationModel === null) { $this->_calculationModel = Mage::getSingleton('Mage_Tax_Model_Calculation'); } return $this->_calculationModel; diff --git a/app/code/core/Mage/Tax/Model/Class/Source/Product.php b/app/code/core/Mage/Tax/Model/Class/Source/Product.php index 3da5f98f2daa0..b6ce5cea13c4f 100644 --- a/app/code/core/Mage/Tax/Model/Class/Source/Product.php +++ b/app/code/core/Mage/Tax/Model/Class/Source/Product.php @@ -34,7 +34,7 @@ class Mage_Tax_Model_Class_Source_Product extends Mage_Eav_Model_Entity_Attribut */ public function getAllOptions($withEmpty = false) { - if (is_null($this->_options)) { + if ($this->_options === null) { $this->_options = Mage::getResourceModel('Mage_Tax_Model_Resource_Class_Collection') ->addFieldToFilter('class_type', Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) ->load() diff --git a/app/code/core/Mage/Tax/Model/Observer.php b/app/code/core/Mage/Tax/Model/Observer.php index b32241d372de7..b05fcbc4fdfb3 100644 --- a/app/code/core/Mage/Tax/Model/Observer.php +++ b/app/code/core/Mage/Tax/Model/Observer.php @@ -106,7 +106,7 @@ public function salesEventOrderAfterSave(Varien_Event_Observer $observer) foreach ($taxes as $id => $row) { foreach ($row['rates'] as $tax) { - if (is_null($row['percent'])) { + if ($row['percent'] === null) { $baseRealAmount = $row['base_amount']; } else { if ($row['percent'] == 0 || $tax['percent'] == 0) { diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index edacc77ad1e28..aa4957f97d2fd 100755 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -123,7 +123,7 @@ public function getRate($request) */ public function getCalculationProcess($request, $rates = null) { - if (is_null($rates)) { + if ($rates === null) { $rates = $this->_getRates($request); } diff --git a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php index e1859c503548c..56081f63b3544 100644 --- a/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php +++ b/app/code/core/Mage/Tax/Model/Sales/Total/Quote/Subtotal.php @@ -649,7 +649,7 @@ protected function _recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item */ protected function _getStoreTaxRequest($address) { - if (is_null($this->_storeTaxRequest)) { + if ($this->_storeTaxRequest === null) { $this->_storeTaxRequest = $this->_calculator->getRateOriginRequest($address->getQuote()->getStore()); } return $this->_storeTaxRequest; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index 38703003b15f2..8fc25d6fb6d46 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -538,7 +538,7 @@ protected function _getRateAmountOriginBased($rate) } } - if (is_null($amount)) { + if ($amount === null) { $amount = (string)$rate->RatedShipmentDetails[0]->ShipmentRateDetail->TotalNetCharge->Amount; } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 7706f43629cf3..2196406e8c7da 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -1796,7 +1796,7 @@ public function getCustomizableContainerTypes() * @return int|null */ protected function _getDeliveryConfirmationLevel($countyDest = null) { - if (is_null($countyDest)) { + if ($countyDest === null) { return null; } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php index a33956124047a..e47180ca2ce8b 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Usps.php @@ -1677,7 +1677,7 @@ protected function _doShipmentRequest(Varien_Object $request) */ public function getContainerTypes(Varien_Object $params = null) { - if (is_null($params)) { + if ($params === null) { return $this->_getAllowedContainers(); } return $this->_isUSCountry($params->getCountryRecipient()) ? array() : $this->_getAllowedContainers($params); diff --git a/app/code/core/Mage/User/controllers/Adminhtml/UserController.php b/app/code/core/Mage/User/controllers/Adminhtml/UserController.php index 9b003052bd873..ec3a3ef04e66f 100644 --- a/app/code/core/Mage/User/controllers/Adminhtml/UserController.php +++ b/app/code/core/Mage/User/controllers/Adminhtml/UserController.php @@ -100,7 +100,7 @@ public function saveAction() $model = $this->_prepareUserForSave($userId, $data); - if (is_null($model)) { + if ($model === null) { return; } diff --git a/app/code/core/Mage/Webapi/Controller/Dispatcher/Soap/Handler.php b/app/code/core/Mage/Webapi/Controller/Dispatcher/Soap/Handler.php index 539e6f056c71e..ef59fb609a0de 100644 --- a/app/code/core/Mage/Webapi/Controller/Dispatcher/Soap/Handler.php +++ b/app/code/core/Mage/Webapi/Controller/Dispatcher/Soap/Handler.php @@ -113,7 +113,7 @@ public function __call($operation, $arguments) $this->_processSoapHeader($operation, $arguments); } else { try { - if (is_null($this->_usernameToken)) { + if ($this->_usernameToken === null) { throw new Mage_Webapi_Exception( $this->_helper->__('WS-Security UsernameToken is not found in SOAP-request.'), Mage_Webapi_Exception::HTTP_UNAUTHORIZED diff --git a/app/code/core/Mage/Webapi/Controller/Front.php b/app/code/core/Mage/Webapi/Controller/Front.php index 94193c0370065..2bf0c17aaa47e 100644 --- a/app/code/core/Mage/Webapi/Controller/Front.php +++ b/app/code/core/Mage/Webapi/Controller/Front.php @@ -118,7 +118,7 @@ public function dispatch() */ protected function _getDispatcher() { - if (is_null($this->_dispatcher)) { + if ($this->_dispatcher === null) { $this->_dispatcher = $this->_dispatcherFactory->get($this->determineApiType()); } return $this->_dispatcher; @@ -146,7 +146,7 @@ public function getListOfAvailableApiTypes() */ public function determineApiType() { - if (is_null($this->_apiType)) { + if ($this->_apiType === null) { $request = $this->_application->getRequest(); $apiRoute = $this->_routeFactory->createRoute( 'Mage_Webapi_Controller_Router_Route_Webapi', diff --git a/app/code/core/Mage/Webapi/Controller/Request/Rest/Interpreter/Xml.php b/app/code/core/Mage/Webapi/Controller/Request/Rest/Interpreter/Xml.php index 2a8a0656e4e54..5026384fffc58 100644 --- a/app/code/core/Mage/Webapi/Controller/Request/Rest/Interpreter/Xml.php +++ b/app/code/core/Mage/Webapi/Controller/Request/Rest/Interpreter/Xml.php @@ -114,7 +114,7 @@ public function interpret($xmlRequestBody) */ public function handleErrors($errorNumber, $errorMessage, $errorFile, $errorLine) { - if (is_null($this->_errorMessage)) { + if ($this->_errorMessage === null) { $this->_errorMessage = $errorMessage; } else { $this->_errorMessage .= $errorMessage; diff --git a/app/code/core/Mage/Webapi/Helper/Data.php b/app/code/core/Mage/Webapi/Helper/Data.php index a9aa45f94a597..031bad482562c 100644 --- a/app/code/core/Mage/Webapi/Helper/Data.php +++ b/app/code/core/Mage/Webapi/Helper/Data.php @@ -102,7 +102,7 @@ public function prepareMethodParams( */ protected function _formatParamData($data, $dataType, Mage_Webapi_Model_ConfigAbstract $apiConfig) { - if ($this->_configHelper->isTypeSimple($dataType) || is_null($data)) { + if ($this->_configHelper->isTypeSimple($dataType) || $data === null) { $formattedData = $data; } elseif ($this->_configHelper->isArrayType($dataType)) { $formattedData = $this->_formatArrayData($data, $dataType, $apiConfig); diff --git a/app/code/core/Mage/Webapi/Model/Authorization/Config.php b/app/code/core/Mage/Webapi/Model/Authorization/Config.php index b5edcd6425bd9..8071bdf03fdb9 100644 --- a/app/code/core/Mage/Webapi/Model/Authorization/Config.php +++ b/app/code/core/Mage/Webapi/Model/Authorization/Config.php @@ -74,7 +74,7 @@ protected function _getAclResourceFiles() */ protected function _getReader() { - if (is_null($this->_reader)) { + if ($this->_reader === null) { $aclResourceFiles = $this->_getAclResourceFiles(); $this->_reader = $this->_readerFactory->createReader(array($aclResourceFiles)); } diff --git a/app/code/core/Mage/Webapi/Model/Config/Reader/TypeProcessor.php b/app/code/core/Mage/Webapi/Model/Config/Reader/TypeProcessor.php index 91c6295b37f49..40d47f984af60 100644 --- a/app/code/core/Mage/Webapi/Model/Config/Reader/TypeProcessor.php +++ b/app/code/core/Mage/Webapi/Model/Config/Reader/TypeProcessor.php @@ -166,7 +166,7 @@ protected function _processProperty( $this->_types[$typeName]['parameters'][$propertyName] = array( 'type' => $this->process($varType), - 'required' => !$isOptional && is_null($defaultProperties[$propertyName]), + 'required' => !$isOptional && $defaultProperties[$propertyName] === null, 'default' => $defaultProperties[$propertyName], 'documentation' => $varInlineDoc . $this->_getDescription($propertyDocBlock) ); diff --git a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php index b44a38b5ed54e..71ff8f48fddf6 100644 --- a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php @@ -98,7 +98,7 @@ public function isMultiWebsites() public function getCountries() { - if (is_null($this->_countries)) { + if ($this->_countries === null) { $this->_countries = Mage::getModel('Mage_Directory_Model_Config_Source_Country') ->toOptionArray(); } diff --git a/app/code/core/Mage/Weee/Helper/Data.php b/app/code/core/Mage/Weee/Helper/Data.php index 1299edebe11bf..29b3ba3470090 100644 --- a/app/code/core/Mage/Weee/Helper/Data.php +++ b/app/code/core/Mage/Weee/Helper/Data.php @@ -170,7 +170,7 @@ public function typeOfDisplay($product, $compareTo = null, $zone = null, $store break; } - if (is_null($compareTo)) { + if ($compareTo === null) { return $type; } else { if (is_array($compareTo)) { diff --git a/app/code/core/Mage/Weee/Model/Tax.php b/app/code/core/Mage/Weee/Model/Tax.php index b5f07ccecdf9c..5206e02570c5d 100644 --- a/app/code/core/Mage/Weee/Model/Tax.php +++ b/app/code/core/Mage/Weee/Model/Tax.php @@ -95,7 +95,7 @@ public function getWeeeTaxAttributeCodes($forceEnabled = false) return array(); } - if (is_null($this->_allAttributes)) { + if ($this->_allAttributes === null) { $this->_allAttributes = Mage::getModel('Mage_Eav_Model_Entity_Attribute')->getAttributeCodesByFrontendType('weee'); } return $this->_allAttributes; diff --git a/app/code/core/Mage/Widget/Model/Widget/Instance.php b/app/code/core/Mage/Widget/Model/Widget/Instance.php index a2f69698a4666..6f6d51a34d7d0 100644 --- a/app/code/core/Mage/Widget/Model/Widget/Instance.php +++ b/app/code/core/Mage/Widget/Model/Widget/Instance.php @@ -244,7 +244,7 @@ public function getWidgetParameters() { if (is_string($this->getData('widget_parameters'))) { return unserialize($this->getData('widget_parameters')); - } else if (is_null($this->getData('widget_parameters'))) { + } else if ($this->getData('widget_parameters') === null) { return array(); } return (is_array($this->getData('widget_parameters'))) ? $this->getData('widget_parameters') : array(); diff --git a/app/code/core/Mage/Wishlist/Block/Abstract.php b/app/code/core/Mage/Wishlist/Block/Abstract.php index f62ffa70efa2a..e118d70c13a45 100644 --- a/app/code/core/Mage/Wishlist/Block/Abstract.php +++ b/app/code/core/Mage/Wishlist/Block/Abstract.php @@ -134,7 +134,7 @@ protected function _createWishlistItemCollection() */ public function getWishlistItems() { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $this->_collection = $this->_createWishlistItemCollection(); $this->_prepareCollection($this->_collection); } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php index ea841a7b0f2a2..dd3bbfdba04a2 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sharing.php @@ -72,7 +72,7 @@ public function getSendUrl() */ public function getEnteredData($key) { - if (is_null($this->_enteredData)) { + if ($this->_enteredData === null) { $this->_enteredData = Mage::getSingleton('Mage_Wishlist_Model_Session') ->getData('sharing_form', true); } diff --git a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php index 10d42a01984de..6df416dbebc0b 100644 --- a/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php +++ b/app/code/core/Mage/Wishlist/Block/Customer/Sidebar.php @@ -92,7 +92,7 @@ public function getCanDisplayWishlist() */ public function getWishlistItems() { - if (is_null($this->_collection)) { + if ($this->_collection === null) { $this->_collection = clone $this->_createWishlistItemCollection(); $this->_collection->clear(); $this->_prepareCollection($this->_collection); diff --git a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php index 98497e6156fc0..c43cb82e59930 100644 --- a/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Block/Share/Wishlist.php @@ -65,7 +65,7 @@ protected function _prepareLayout() */ public function getWishlistCustomer() { - if (is_null($this->_customer)) { + if ($this->_customer === null) { $this->_customer = Mage::getModel('Mage_Customer_Model_Customer') ->load($this->_getWishlist()->getCustomerId()); } diff --git a/app/code/core/Mage/Wishlist/Helper/Data.php b/app/code/core/Mage/Wishlist/Helper/Data.php index 9db61368f4ff7..baadd185e41df 100644 --- a/app/code/core/Mage/Wishlist/Helper/Data.php +++ b/app/code/core/Mage/Wishlist/Helper/Data.php @@ -132,7 +132,7 @@ public function getCustomer() */ public function getWishlist() { - if (is_null($this->_wishlist)) { + if ($this->_wishlist === null) { if (Mage::registry('shared_wishlist')) { $this->_wishlist = Mage::registry('shared_wishlist'); } @@ -189,7 +189,7 @@ protected function _createWishlistItemCollection() */ public function getWishlistItemCollection() { - if (is_null($this->_wishlistItemCollection)) { + if ($this->_wishlistItemCollection === null) { $this->_wishlistItemCollection = $this->_createWishlistItemCollection(); } return $this->_wishlistItemCollection; diff --git a/app/code/core/Mage/Wishlist/Model/Item.php b/app/code/core/Mage/Wishlist/Model/Item.php index f485d72b65d64..6c46c5770800e 100644 --- a/app/code/core/Mage/Wishlist/Model/Item.php +++ b/app/code/core/Mage/Wishlist/Model/Item.php @@ -264,12 +264,12 @@ protected function _beforeSave() $this->validate(); // set current store id if it is not defined - if (is_null($this->getStoreId())) { + if ($this->getStoreId() === null) { $this->setStoreId(Mage::app()->getStore()->getId()); } // set current date if added at data is not defined - if (is_null($this->getAddedAt())) { + if ($this->getAddedAt() === null) { $this->setAddedAt(Mage::getSingleton('Mage_Core_Model_Date')->gmtDate()); } @@ -303,7 +303,7 @@ public function loadByProductWishlist($wishlistId, $productId, $sharedStores) public function getProduct() { $product = $this->_getData('product'); - if (is_null($product)) { + if ($product === null) { if (!$this->getProductId()) { Mage::throwException(Mage::helper('Mage_Wishlist_Helper_Data')->__('Cannot specify product.')); } diff --git a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php index 6004cb4bf9459..830c5263c463a 100755 --- a/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/core/Mage/Wishlist/Model/Resource/Item/Collection.php @@ -445,7 +445,7 @@ public function setOrderByProductName($dir) */ public function getItemsQty() { - if (is_null($this->_itemsQty)) { + if ($this->_itemsQty === null) { $this->_itemsQty = 0; foreach ($this as $wishlistItem) { $qty = $wishlistItem->getQty(); diff --git a/app/code/core/Mage/Wishlist/Model/Wishlist.php b/app/code/core/Mage/Wishlist/Model/Wishlist.php index ac478bf286d85..a9accf519b02f 100644 --- a/app/code/core/Mage/Wishlist/Model/Wishlist.php +++ b/app/code/core/Mage/Wishlist/Model/Wishlist.php @@ -241,7 +241,7 @@ protected function _addCatalogProduct(Mage_Catalog_Model_Product $product, $qty */ public function getItemCollection() { - if (is_null($this->_itemCollection)) { + if ($this->_itemCollection === null) { /** @var $currentWebsiteOnly boolean */ $currentWebsiteOnly = !Mage::app()->getStore()->isAdmin(); $this->_itemCollection = Mage::getResourceModel('Mage_Wishlist_Model_Resource_Item_Collection') @@ -411,7 +411,7 @@ public function getDataForSave() */ public function getSharedStoreIds($current = true) { - if (is_null($this->_storeIds) || !is_array($this->_storeIds)) { + if ($this->_storeIds === null || !is_array($this->_storeIds)) { if ($current) { $this->_storeIds = $this->getStore()->getWebsite()->getStoreIds(); } else { @@ -445,7 +445,7 @@ public function setSharedStoreIds($storeIds) */ public function getStore() { - if (is_null($this->_store)) { + if ($this->_store === null) { $this->setStore(Mage::app()->getStore()); } return $this->_store; diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index e467cf7285246..b0baa747b8b6d 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -363,7 +363,7 @@ public function updateAction() if (isset($post['qty'][$itemId])) { $qty = $this->_processLocalizedQty($post['qty'][$itemId]); } - if (is_null($qty)) { + if ($qty === null) { $qty = $item->getQty(); if (!$qty) { $qty = 1; diff --git a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php index a35eadadb0831..e0898c133f911 100644 --- a/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Mage/Core/Block/AbstractTest.php @@ -704,7 +704,7 @@ protected function _createBlockWithLayout($name = 'block', $alias = null, $type . 'Mock' ); } - if (is_null($this->_layout)) { + if ($this->_layout === null) { $this->_layout = Mage::getModel('Mage_Core_Model_Layout'); } $block = $this->_layout->addBlock($mockClass, $name, '', $alias); diff --git a/dev/tests/integration/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php b/dev/tests/integration/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php index 79877153058c4..110964db2139d 100644 --- a/dev/tests/integration/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php +++ b/dev/tests/integration/testsuite/Varien/Db/Adapter/Pdo/MysqlTest.php @@ -105,7 +105,7 @@ protected function _setWaitTimeout($waitTimeout) */ protected function _getConnection() { - if (is_null($this->_connection)) { + if ($this->_connection === null) { /** @var $coreResource Mage_Core_Model_Resource */ $coreResource = Mage::getSingleton('Mage_Core_Model_Resource'); $this->_connection = $coreResource->getConnection(Mage_Core_Model_Resource::DEFAULT_WRITE_RESOURCE); diff --git a/dev/tests/unit/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerCompositeTest.php b/dev/tests/unit/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerCompositeTest.php index e976db932ba13..2f38b0ecffb68 100644 --- a/dev/tests/unit/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerCompositeTest.php +++ b/dev/tests/unit/testsuite/Mage/ImportExport/Model/Import/Entity/CustomerCompositeTest.php @@ -172,7 +172,7 @@ protected function tearDown() */ protected function _getCustomerEntityMock(array $mockedMethods = null) { - if (is_null($mockedMethods)) { + if ($mockedMethods === null) { $mockedMethods = $this->_entityMockedMethods; } $mockedMethods[] = 'getAttributeCollection'; @@ -203,7 +203,7 @@ protected function _getCustomerEntityMock(array $mockedMethods = null) */ protected function _getAddressEntityMock(array $mockedMethods = null) { - if (is_null($mockedMethods)) { + if ($mockedMethods === null) { $mockedMethods = $this->_entityMockedMethods; } $mockedMethods[] = 'getAttributeCollection'; diff --git a/downloader/Maged/Controller.php b/downloader/Maged/Controller.php index e4ca50a09e6a7..4a24cbe0521c9 100755 --- a/downloader/Maged/Controller.php +++ b/downloader/Maged/Controller.php @@ -592,7 +592,7 @@ public function model($model = null, $singleton = false) return $this->_singletons[$model]; } - if (is_null($model)) { + if ($model === null) { $class = 'Maged_Model'; } else { $class = 'Maged_Model_' . str_replace(' ', '_', ucwords(str_replace('_', ' ', $model))); @@ -663,7 +663,7 @@ public function session() */ public function setAction($action=null) { - if (is_null($action)) { + if ($action === null) { if (!empty($this->_action)) { return $this; } @@ -798,7 +798,7 @@ public function dispatch() */ public function isWritable() { - if (is_null($this->_writable)) { + if ($this->_writable === null) { $this->_writable = is_writable($this->getMageDir() . DIRECTORY_SEPARATOR) && is_writable($this->filepath()) && (!file_exists($this->filepath('config.ini') || is_writable($this->filepath('config.ini')))); @@ -843,7 +843,7 @@ public function isInstalled() */ protected function _getMaintenanceFlag() { - if (is_null($this->_maintenance)) { + if ($this->_maintenance === null) { $this->_maintenance = !empty($_REQUEST['maintenance']) && $_REQUEST['maintenance'] == '1' ? true : false; } return $this->_maintenance; @@ -856,7 +856,7 @@ protected function _getMaintenanceFlag() */ protected function _getMaintenanceFilePath() { - if (is_null($this->_maintenanceFile)) { + if ($this->_maintenanceFile === null) { $path = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR; $this->_maintenanceFile = $path . 'maintenance.flag'; } diff --git a/downloader/Maged/Model/Connect.php b/downloader/Maged/Model/Connect.php index 5cea58eb8a600..fd3fd5388b703 100644 --- a/downloader/Maged/Model/Connect.php +++ b/downloader/Maged/Model/Connect.php @@ -352,7 +352,7 @@ public function installPackage($id, $force=false) */ public function getPreferredState() { - if (is_null($this->get('preferred_state'))) { + if ($this->get('preferred_state') === null) { $connectConfig = $this->connect()->getConfig(); $this->set('preferred_state', $connectConfig->__get('preferred_state')); } @@ -366,7 +366,7 @@ public function getPreferredState() */ public function getProtocol() { - if (is_null($this->get('protocol'))) { + if ($this->get('protocol') === null) { $connectConfig = $this->connect()->getConfig(); $this->set('protocol', $connectConfig->__get('protocol')); } diff --git a/downloader/lib/Mage/Backup/Snapshot.php b/downloader/lib/Mage/Backup/Snapshot.php index b3205d85992c8..a4d9b1cb77475 100755 --- a/downloader/lib/Mage/Backup/Snapshot.php +++ b/downloader/lib/Mage/Backup/Snapshot.php @@ -121,7 +121,7 @@ protected function _createDbBackupInstance() */ protected function _getDbBackupManager() { - if (is_null($this->_dbBackupManager)) { + if ($this->_dbBackupManager === null) { $this->_dbBackupManager = $this->_createDbBackupInstance(); } diff --git a/downloader/lib/Mage/Connect/Channel/Generator.php b/downloader/lib/Mage/Connect/Channel/Generator.php index 66905b99442af..c602ece71b574 100644 --- a/downloader/lib/Mage/Connect/Channel/Generator.php +++ b/downloader/lib/Mage/Connect/Channel/Generator.php @@ -44,7 +44,7 @@ public function getFile() public function getGenerator() { - if (is_null($this->_generator)) { + if ($this->_generator === null) { $this->_generator = new Mage_Xml_Generator(); } return $this->_generator; diff --git a/downloader/lib/Mage/Connect/Channel/VO.php b/downloader/lib/Mage/Connect/Channel/VO.php index 20d3381cde709..53fd231f62660 100644 --- a/downloader/lib/Mage/Connect/Channel/VO.php +++ b/downloader/lib/Mage/Connect/Channel/VO.php @@ -92,7 +92,7 @@ public function fromArray(array $arr) private function validator() { - if(is_null($this->_validator)) { + if($this->_validator === null) { $this->_validator = new Mage_Connect_Validator(); } return $this->_validator; diff --git a/downloader/lib/Mage/Connect/Command.php b/downloader/lib/Mage/Connect/Command.php index c42238a32b136..e07cc36585b81 100644 --- a/downloader/lib/Mage/Connect/Command.php +++ b/downloader/lib/Mage/Connect/Command.php @@ -242,7 +242,7 @@ public function ui() */ public function validator() { - if(is_null(self::$_validator)) { + if(self::$_validator === null) { self::$_validator = new Mage_Connect_Validator(); } return self::$_validator; @@ -255,7 +255,7 @@ public function validator() */ public function rest() { - if(is_null(self::$_rest)) { + if(self::$_rest === null) { self::$_rest = new Mage_Connect_Rest(self::config()->protocol); } return self::$_rest; diff --git a/downloader/lib/Mage/Connect/Package.php b/downloader/lib/Mage/Connect/Package.php index 818389181ea7e..f38c8318b77ec 100644 --- a/downloader/lib/Mage/Connect/Package.php +++ b/downloader/lib/Mage/Connect/Package.php @@ -149,7 +149,7 @@ public function __construct($source=null) } } elseif (is_resource($source)) { $this->_loadResource($source); - } elseif (is_null($source)) { + } elseif ($source === null) { $this->_init(); } else { throw new Mage_Exception('Invalid package source'); @@ -201,7 +201,7 @@ protected function _init($definition=null) */ protected function _loadFile($filename='') { - if (is_null($this->_reader)) { + if ($this->_reader === null) { $this->_reader = new Mage_Connect_Package_Reader($filename); } $content = $this->_reader->load(); @@ -232,7 +232,7 @@ public function save($path) protected function _savePackage($path) { $fileName = $this->getReleaseFilename(); - if (is_null($this->_writer)) { + if ($this->_writer === null) { $this->_writer = new Mage_Connect_Package_Writer($this->getContents(), $path.$fileName); } $this->_writer @@ -1060,7 +1060,7 @@ public function getPackageXml() */ protected function validator() { - if(is_null($this->_validator)) { + if($this->_validator === null) { $this->_validator = new Mage_Connect_Validator(); } return $this->_validator; diff --git a/downloader/lib/Mage/Connect/Package/Reader.php b/downloader/lib/Mage/Connect/Package/Reader.php index 758dd905cad14..89b965a66a9e7 100644 --- a/downloader/lib/Mage/Connect/Package/Reader.php +++ b/downloader/lib/Mage/Connect/Package/Reader.php @@ -81,7 +81,7 @@ public function __construct($file='') */ protected function _getArchivator() { - if (is_null($this->_archivator)) { + if ($this->_archivator === null) { $this->_archivator = new Mage_Archive(); } return $this->_archivator; diff --git a/downloader/lib/Mage/Connect/Package/Target.php b/downloader/lib/Mage/Connect/Package/Target.php index b452ae0440313..357d3507c352a 100644 --- a/downloader/lib/Mage/Connect/Package/Target.php +++ b/downloader/lib/Mage/Connect/Package/Target.php @@ -56,7 +56,7 @@ class Mage_Connect_Package_Target */ protected function _getTargetMap() { - if (is_null($this->_targetMap)) { + if ($this->_targetMap === null) { $this->_targetMap = array(); $this->_targetMap[] = array('name'=>"magelocal" ,'label'=>"Magento Local module file" , 'uri'=>"./app/code/local"); $this->_targetMap[] = array('name'=>"magecommunity" ,'label'=>"Magento Community module file" , 'uri'=>"./app/code/community"); @@ -70,7 +70,7 @@ protected function _getTargetMap() $this->_targetMap[] = array('name'=>"mageweb" ,'label'=>"Magento Other web accessible file" , 'uri'=>"."); $this->_targetMap[] = array('name'=>"magetest" ,'label'=>"Magento PHPUnit test" , 'uri'=>"./tests"); $this->_targetMap[] = array('name'=>"mage" ,'label'=>"Magento other" , 'uri'=>"."); - } + } return $this->_targetMap; } @@ -81,9 +81,9 @@ protected function _getTargetMap() */ public function getTargets() { - if (!is_array($this->_targets)) { + if (!is_array($this->_targets)) { $this->_targets = array(); - if($this->_getTargetMap()) { + if($this->_getTargetMap()) { foreach ($this->_getTargetMap() as $_target) { $this->_targets[$_target['name']] = (string)$_target['uri']; } diff --git a/downloader/lib/Mage/Connect/Package/Writer.php b/downloader/lib/Mage/Connect/Package/Writer.php index e167128b7bb96..0cea6160c504a 100644 --- a/downloader/lib/Mage/Connect/Package/Writer.php +++ b/downloader/lib/Mage/Connect/Package/Writer.php @@ -101,7 +101,7 @@ public function __construct($files, $namePackage='') */ protected function _getArchivator() { - if (is_null($this->_archivator)) { + if ($this->_archivator === null) { $this->_archivator = new Mage_Archive(); } return $this->_archivator; @@ -115,11 +115,11 @@ protected function _getArchivator() */ public function composePackage() { - @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true); + @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true); $root = self::PATH_TO_TEMPORARY_DIRECTORY . basename($this->_namePackage); @mkdir($root, 0777, true); foreach ($this->_files as $file) { - + if (is_dir($file) || is_file($file)) { $fileName = basename($file); $filePath = dirname($file); @@ -163,7 +163,7 @@ public function archivePackage() Mage_System_Dirs::rm(array("-r", $this->_temporaryPackageDir)); return $this; } - + /** * Getter for pathToArchive * diff --git a/downloader/lib/Mage/Connect/Packager.php b/downloader/lib/Mage/Connect/Packager.php index 54308ffcff3e3..c47648ccd192a 100644 --- a/downloader/lib/Mage/Connect/Packager.php +++ b/downloader/lib/Mage/Connect/Packager.php @@ -82,7 +82,7 @@ class Mage_Connect_Packager */ public function getArchiver() { - if(is_null($this->_archiver)) { + if($this->_archiver === null) { $this->_archiver = new Mage_Archive(); } return $this->_archiver; @@ -94,7 +94,7 @@ public function getArchiver() */ public function getDownloader() { - if(is_null($this->_http)) { + if($this->_http === null) { $this->_http = Mage_HTTP_Client::getInstance(); } return $this->_http; diff --git a/downloader/lib/Mage/Connect/Rest.php b/downloader/lib/Mage/Connect/Rest.php index 8fe3aef483c9c..fa93f353ff809 100644 --- a/downloader/lib/Mage/Connect/Rest.php +++ b/downloader/lib/Mage/Connect/Rest.php @@ -115,7 +115,7 @@ public function setChannel($uri) */ public function getLoader() { - if (is_null($this->_loader)) { + if ($this->_loader === null) { $this->_loader = Mage_Connect_Loader::getInstance($this->_protocol); } return $this->_loader; @@ -128,7 +128,7 @@ public function getLoader() */ protected function getParser() { - if (is_null($this->_parser)) { + if ($this->_parser === null) { $this->_parser = new Mage_Xml_Parser(); } return $this->_parser; diff --git a/downloader/lib/Mage/HTTP/Client/Curl.php b/downloader/lib/Mage/HTTP/Client/Curl.php index e1522e49ee08c..49287bae0789b 100644 --- a/downloader/lib/Mage/HTTP/Client/Curl.php +++ b/downloader/lib/Mage/HTTP/Client/Curl.php @@ -306,7 +306,7 @@ public function getCookies() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = trim($val); @@ -333,7 +333,7 @@ public function getCookiesFull() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = array('value'=>trim($val)); diff --git a/downloader/lib/Mage/HTTP/Client/Socket.php b/downloader/lib/Mage/HTTP/Client/Socket.php index c50b923601caa..ded7d8af187ba 100644 --- a/downloader/lib/Mage/HTTP/Client/Socket.php +++ b/downloader/lib/Mage/HTTP/Client/Socket.php @@ -326,7 +326,7 @@ public function getCookies() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = trim($val); @@ -353,7 +353,7 @@ public function getCookiesFull() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = array('value'=>trim($val)); diff --git a/lib/Mage/Backup/Snapshot.php b/lib/Mage/Backup/Snapshot.php index b3205d85992c8..a4d9b1cb77475 100644 --- a/lib/Mage/Backup/Snapshot.php +++ b/lib/Mage/Backup/Snapshot.php @@ -121,7 +121,7 @@ protected function _createDbBackupInstance() */ protected function _getDbBackupManager() { - if (is_null($this->_dbBackupManager)) { + if ($this->_dbBackupManager === null) { $this->_dbBackupManager = $this->_createDbBackupInstance(); } diff --git a/lib/Mage/Connect/Channel/Generator.php b/lib/Mage/Connect/Channel/Generator.php index 31c04f927e170..7ab9f1efd5b54 100644 --- a/lib/Mage/Connect/Channel/Generator.php +++ b/lib/Mage/Connect/Channel/Generator.php @@ -44,7 +44,7 @@ public function getFile() public function getGenerator() { - if (is_null($this->_generator)) { + if ($this->_generator === null) { $this->_generator = new Mage_Xml_Generator(); } return $this->_generator; diff --git a/lib/Mage/Connect/Channel/VO.php b/lib/Mage/Connect/Channel/VO.php index 2bffdd6025ce0..5baaaf3c0e6fb 100644 --- a/lib/Mage/Connect/Channel/VO.php +++ b/lib/Mage/Connect/Channel/VO.php @@ -27,9 +27,9 @@ class Mage_Connect_Channel_VO implements Iterator { - + private $_validator = null; - + protected $properties = array( 'name' => '', 'uri' => '', @@ -81,7 +81,7 @@ public function toArray() { return array('channel' => $this->properties); } - + public function fromArray(array $arr) { foreach($arr as $k=>$v) { @@ -89,15 +89,15 @@ public function fromArray(array $arr) } } - + private function validator() - { - if(is_null($this->_validator)) { + { + if($this->_validator === null) { $this->_validator = new Mage_Connect_Validator(); } return $this->_validator; } - + /** Stub for validation result */ diff --git a/lib/Mage/Connect/Command.php b/lib/Mage/Connect/Command.php index ed66d3153a9a9..e0beb06dcf066 100644 --- a/lib/Mage/Connect/Command.php +++ b/lib/Mage/Connect/Command.php @@ -134,22 +134,22 @@ public static function getInstance($commandName) return new $currentCommand['class'](); } - + public static function setSconfig($obj) { self::$_sconfig = $obj; } - + /** - * + * * @return Mage_Connect_Singleconfig */ public function getSconfig() { return self::$_sconfig; } - - + + /** * Sets frontend object for all commands * @@ -172,7 +172,7 @@ public static function setConfigObject($obj) self::$_config = $obj; } - + /** * Non-static getter for config * @return Mage_Connect_Config @@ -198,7 +198,7 @@ public function ui() */ public function validator() { - if(is_null(self::$_validator)) { + if(self::$_validator === null) { self::$_validator = new Mage_Connect_Validator(); } return self::$_validator; @@ -210,7 +210,7 @@ public function validator() */ public function rest() { - if(is_null(self::$_rest)) { + if(self::$_rest === null) { self::$_rest = new Mage_Connect_Rest(self::config()->protocol); } return self::$_rest; @@ -374,17 +374,17 @@ public function splitPackageArgs(array & $params) } } - + /** * Get packager instance * @return Mage_Connect_Pacakger */ - public function getPackager() + public function getPackager() { if(!self::$_packager) { self::$_packager = new Mage_Connect_Packager(); } - return self::$_packager; + return self::$_packager; } - + } \ No newline at end of file diff --git a/lib/Mage/Connect/Package.php b/lib/Mage/Connect/Package.php index 3f2223ced0ee1..c9ab193462098 100644 --- a/lib/Mage/Connect/Package.php +++ b/lib/Mage/Connect/Package.php @@ -149,7 +149,7 @@ public function __construct($source=null) } } elseif (is_resource($source)) { $this->_loadResource($source); - } elseif (is_null($source)) { + } elseif ($source === null) { $this->_init(); } else { throw new Mage_Exception('Invalid package source'); @@ -201,7 +201,7 @@ protected function _init($definition=null) */ protected function _loadFile($filename='') { - if (is_null($this->_reader)) { + if ($this->_reader === null) { $this->_reader = new Mage_Connect_Package_Reader($filename); } $content = $this->_reader->load(); @@ -246,7 +246,7 @@ public function saveV1x($path) protected function _savePackage($path) { $fileName = $this->getReleaseFilename(); - if (is_null($this->_writer)) { + if ($this->_writer === null) { $this->_writer = new Mage_Connect_Package_Writer($this->getContents(), $path.$fileName); } $this->_writer @@ -1239,7 +1239,7 @@ public function getPackageXml() */ protected function validator() { - if(is_null($this->_validator)) { + if($this->_validator === null) { $this->_validator = new Mage_Connect_Validator(); } return $this->_validator; diff --git a/lib/Mage/Connect/Package/Reader.php b/lib/Mage/Connect/Package/Reader.php index 3a071d2c42b2d..cfbd1b5fb7642 100644 --- a/lib/Mage/Connect/Package/Reader.php +++ b/lib/Mage/Connect/Package/Reader.php @@ -81,7 +81,7 @@ public function __construct($file='') */ protected function _getArchivator() { - if (is_null($this->_archivator)) { + if ($this->_archivator === null) { $this->_archivator = new Mage_Archive(); } return $this->_archivator; diff --git a/lib/Mage/Connect/Package/Target.php b/lib/Mage/Connect/Package/Target.php index d602ddc33f9c6..3e1563d05524d 100644 --- a/lib/Mage/Connect/Package/Target.php +++ b/lib/Mage/Connect/Package/Target.php @@ -56,7 +56,7 @@ class Mage_Connect_Package_Target */ protected function _getTargetMap() { - if (is_null($this->_targetMap)) { + if ($this->_targetMap === null) { $this->_targetMap = array(); $this->_targetMap[] = array('name'=>"magelocal" ,'label'=>"Magento Local module file" , 'uri'=>"./app/code/local"); $this->_targetMap[] = array('name'=>"magecommunity" ,'label'=>"Magento Community module file" , 'uri'=>"./app/code/community"); @@ -70,7 +70,7 @@ protected function _getTargetMap() $this->_targetMap[] = array('name'=>"mageweb" ,'label'=>"Magento Other web accessible file" , 'uri'=>"."); $this->_targetMap[] = array('name'=>"magetest" ,'label'=>"Magento PHPUnit test" , 'uri'=>"./tests"); $this->_targetMap[] = array('name'=>"mage" ,'label'=>"Magento other" , 'uri'=>"."); - } + } return $this->_targetMap; } @@ -81,9 +81,9 @@ protected function _getTargetMap() */ public function getTargets() { - if (!is_array($this->_targets)) { + if (!is_array($this->_targets)) { $this->_targets = array(); - if($this->_getTargetMap()) { + if($this->_getTargetMap()) { foreach ($this->_getTargetMap() as $_target) { $this->_targets[$_target['name']] = (string)$_target['uri']; } diff --git a/lib/Mage/Connect/Package/Writer.php b/lib/Mage/Connect/Package/Writer.php index 47a0dda46924a..47880cbe61d8d 100644 --- a/lib/Mage/Connect/Package/Writer.php +++ b/lib/Mage/Connect/Package/Writer.php @@ -101,7 +101,7 @@ public function __construct($files, $namePackage='') */ protected function _getArchivator() { - if (is_null($this->_archivator)) { + if ($this->_archivator === null) { $this->_archivator = new Mage_Archive(); } return $this->_archivator; @@ -115,11 +115,11 @@ protected function _getArchivator() */ public function composePackage() { - @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true); + @mkdir(self::PATH_TO_TEMPORARY_DIRECTORY, 0777, true); $root = self::PATH_TO_TEMPORARY_DIRECTORY . basename($this->_namePackage); @mkdir($root, 0777, true); foreach ($this->_files as $file) { - + if (is_dir($file) || is_file($file)) { $fileName = basename($file); $filePath = dirname($file); @@ -195,7 +195,7 @@ public function archivePackage() Mage_System_Dirs::rm(array("-r", $this->_temporaryPackageDir)); return $this; } - + /** * Getter for pathToArchive * diff --git a/lib/Mage/Connect/Packager.php b/lib/Mage/Connect/Packager.php index 26a1d2b99986f..a26765617c840 100644 --- a/lib/Mage/Connect/Packager.php +++ b/lib/Mage/Connect/Packager.php @@ -56,7 +56,7 @@ public function __construct() */ public function getArchiver() { - if(is_null($this->_archiver)) { + if($this->_archiver === null) { $this->_archiver = new Mage_Archive(); } return $this->_archiver; @@ -64,7 +64,7 @@ public function getArchiver() public function getDownloader() { - if(is_null($this->_http)) { + if($this->_http === null) { $this->_http = Mage_HTTP_Client::getInstance(); } return $this->_http; diff --git a/lib/Mage/Connect/Rest.php b/lib/Mage/Connect/Rest.php index e6508878d4c4e..01a4ec3eb0f65 100644 --- a/lib/Mage/Connect/Rest.php +++ b/lib/Mage/Connect/Rest.php @@ -100,7 +100,7 @@ public function setChannel($uri) */ protected function getLoader() { - if(is_null($this->_loader)) { + if($this->_loader === null) { $this->_loader = Mage_Connect_Loader::getInstance($this->_protocol); } return $this->_loader; @@ -114,7 +114,7 @@ protected function getLoader() */ protected function getParser() { - if(is_null($this->_parser)) { + if($this->_parser === null) { $this->_parser = new Mage_Xml_Parser(); } return $this->_parser; @@ -217,15 +217,15 @@ public function getPackagesHashed() } $return = $output; } - + $out = array(); foreach($return as $name=>$package) { $stabilities = array_map(array($this, 'shortStateToLong'), array_keys($package)); - $versions = array_map('trim', array_values($package)); + $versions = array_map('trim', array_values($package)); $package = array_combine($versions, $stabilities); ksort($package); $out[$name] = $package; - } + } return $out; } @@ -335,8 +335,8 @@ public function downloadPackageFileOfRelease($package, $version, $targetFile) } } } - - + + $out = $this->loadChannelUri($package."/".$version."/".$package."-".$version.".".self::EXT); $statusCode = $this->getLoader()->getStatus(); @@ -353,12 +353,12 @@ public function downloadPackageFileOfRelease($package, $version, $targetFile) } protected $states = array('b'=>'beta', 'd'=>'dev', 's'=>'stable', 'a'=>'alpha'); - + public function shortStateToLong($s) { return isset($this->states[$s]) ? $this->states[$s] : 'dev'; } - - + + } diff --git a/lib/Mage/HTTP/Client/Curl.php b/lib/Mage/HTTP/Client/Curl.php index c0fd0170f1842..ac34a86f0dbb1 100644 --- a/lib/Mage/HTTP/Client/Curl.php +++ b/lib/Mage/HTTP/Client/Curl.php @@ -288,7 +288,7 @@ public function getCookies() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = trim($val); @@ -315,7 +315,7 @@ public function getCookiesFull() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = array('value'=>trim($val)); @@ -376,7 +376,7 @@ protected function makeRequest($method, $uri, $params = array()) } $this->curlOption(CURLOPT_COOKIE, implode(";", $cookies)); } - + if($this->_timeout) { $this->curlOption(CURLOPT_TIMEOUT, $this->_timeout); } @@ -388,7 +388,7 @@ protected function makeRequest($method, $uri, $params = array()) //$this->curlOption(CURLOPT_HEADER, 1); $this->curlOption(CURLOPT_RETURNTRANSFER, 1); $this->curlOption(CURLOPT_HEADERFUNCTION, array($this,'parseHeaders')); - + if(count($this->_curlUserOptions)) { foreach($this->_curlUserOptions as $k=>$v) { @@ -455,7 +455,7 @@ protected function parseHeaders($ch, $data) } $this->_headerCount++; - + return strlen($data); } diff --git a/lib/Mage/HTTP/Client/Socket.php b/lib/Mage/HTTP/Client/Socket.php index 284d9fb869d23..d0e835b1d81e7 100644 --- a/lib/Mage/HTTP/Client/Socket.php +++ b/lib/Mage/HTTP/Client/Socket.php @@ -47,55 +47,55 @@ class Mage_HTTP_Client_Socket private $_port = 80; /** - * Stream resource + * Stream resource * @var object */ private $_sock = null; - + /** * Request headers * @var array */ private $_headers = array(); - - + + /** * Fields for POST method - hash * @var array */ private $_postFields = array(); - + /** - * Request cookies + * Request cookies * @var array */ private $_cookies = array(); - + /** * Response headers * @var array */ private $_responseHeaders = array(); - + /** * Response body * @var string */ private $_responseBody = ''; - + /** * Response status * @var int */ private $_responseStatus = 0; - - + + /** * Request timeout * @var int */ private $_timeout = 300; - + /** * TODO * @var int @@ -105,8 +105,8 @@ class Mage_HTTP_Client_Socket /** * Set request timeout, msec - * - * @param int $value + * + * @param int $value */ public function setTimeout($value) { @@ -114,8 +114,8 @@ public function setTimeout($value) } /** - * Constructor - * @param string $host + * Constructor + * @param string $host * @param int $port */ public function __construct($host = null, $port = 80) @@ -128,7 +128,7 @@ public function __construct($host = null, $port = 80) /** * Set connection params * - * @param string $host + * @param string $host * @param int $port */ public function connect($host, $port = 80) @@ -137,7 +137,7 @@ public function connect($host, $port = 80) $this->_port = (int) $port; } - + /** * Disconnect */ @@ -148,18 +148,18 @@ public function disconnect() /** * Set headers from hash - + * @param array $headers - */ + */ public function setHeaders($headers) { $this->_headers = $headers; } - + /** * Add header - * + * * @param $name name, ex. "Location" * @param $value value ex. "http://google.com" */ @@ -168,10 +168,10 @@ public function addHeader($name, $value) $this->_headers[$name] = $value; } - + /** * Remove specified header - * + * * @param string $name */ public function removeHeader($name) @@ -183,7 +183,7 @@ public function removeHeader($name) /** * Authorization: Basic header * Login credentials support - * + * * @param string $login username * @param string $pass password */ @@ -195,9 +195,9 @@ public function setCredentials($login, $pass) /** * Add cookie - * + * * @param string $name - * @param string $value + * @param string $value */ public function addCookie($name, $value) { @@ -205,10 +205,10 @@ public function addCookie($name, $value) } /** - * Remove cookie - * + * Remove cookie + * * @param string $name - */ + */ public function removeCookie($name) { unset($this->_cookies[$name]); @@ -216,7 +216,7 @@ public function removeCookie($name) /** * Set cookies array - * + * * @param array $cookies */ public function setCookies($cookies) @@ -232,25 +232,25 @@ public function removeCookies() $this->setCookies(array()); } - + /** * Make GET request - * + * * @param string $uri full uri path */ public function get($uri) - { - $this->makeRequest("GET",$this->parseUrl($uri)); + { + $this->makeRequest("GET",$this->parseUrl($uri)); } /** * Set host, port from full url - * and return relative url - * + * and return relative url + * * @param string $uri ex. http://google.com/index.php?a=b * @return string ex. /index.php?a=b */ - protected function parseUrl($uri) + protected function parseUrl($uri) { $parts = parse_url($uri); if(!empty($parts['user']) && !empty($parts['pass'])) { @@ -259,14 +259,14 @@ protected function parseUrl($uri) if(!empty($parts['port'])) { $this->_port = (int) $parts['port']; } - + if(!empty($parts['host'])) { $this->_host = $parts['host']; } else { - throw new InvalidArgumentException("Uri doesn't contain host part"); + throw new InvalidArgumentException("Uri doesn't contain host part"); } - - + + if(!empty($parts['path'])) { $requestUri = $parts['path']; } else { @@ -277,7 +277,7 @@ protected function parseUrl($uri) } return $requestUri; } - + /** * Make POST request */ @@ -289,19 +289,19 @@ public function post($uri, $params) /** * Get response headers - * - * @return array + * + * @return array */ public function getHeaders() { return $this->_responseHeaders; } - + /** * Get response body - * - * @return string + * + * @return string */ public function getBody() { @@ -309,9 +309,9 @@ public function getBody() } /** - * Get cookies response hash + * Get cookies response hash * - * @return array + * @return array */ public function getCookies() { @@ -326,7 +326,7 @@ public function getCookies() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = trim($val); @@ -353,7 +353,7 @@ public function getCookiesFull() continue; } list($key, $val) = explode("=", $values[0]); - if(is_null($val)) { + if($val === null) { continue; } $out[trim($key)] = array('value'=>trim($val)); @@ -387,7 +387,7 @@ protected function processResponseHeaders() if(count($out) == 2) { $name = $out[0]; $value = $out[1]; - } + } if(!empty($value)) { if($name == "Set-Cookie") { if(!isset($this->_responseHeaders[$name])) { @@ -414,7 +414,7 @@ protected function processResponseBody() } /** - * Process response + * Process response */ protected function processResponse() { @@ -442,7 +442,7 @@ protected function processRedirect() // TODO: implement redircets support } - + /** * Get response status code * @see lib/Mage/HTTP/Mage_HTTP_Client#getStatus() @@ -454,7 +454,7 @@ public function getStatus() /** * Make request - * @param string $method + * @param string $method * @param string $uri * @param array $params * @return null @@ -484,11 +484,11 @@ protected function makeRequest($method, $uri, $params = array()) if($paramsStr) { $out .= $paramsStr.$crlf; } - + fwrite($this->_sock, $out); $this->processResponse(); } - + /** * Throw error excpetion * @param $string @@ -500,7 +500,7 @@ public function doError($string) } /** - * Convert headers hash to string + * Convert headers hash to string * @param $delimiter * @param $append * @return string @@ -525,7 +525,7 @@ public function setOptions($arr) { // Stub } - + /** * TODO */ diff --git a/lib/Magento/Acl/Config/Reader.php b/lib/Magento/Acl/Config/Reader.php index 16969223587f4..5da1ea60e459d 100644 --- a/lib/Magento/Acl/Config/Reader.php +++ b/lib/Magento/Acl/Config/Reader.php @@ -82,7 +82,7 @@ protected function _getIdAttributes() */ protected function _getDomConfigModel() { - if (is_null($this->_domConfig)) { + if ($this->_domConfig === null) { $this->_domConfig = new Magento_Acl_Config_Reader_Dom( $this->_getInitialXml(), $this->_getIdAttributes() diff --git a/lib/Magento/Config/XmlAbstract.php b/lib/Magento/Config/XmlAbstract.php index 7bc72827990bf..5e37b06b4af0f 100644 --- a/lib/Magento/Config/XmlAbstract.php +++ b/lib/Magento/Config/XmlAbstract.php @@ -117,7 +117,7 @@ protected function _merge($configFiles) protected function _performValidate($file = null) { if (!$this->_getDomConfigModel()->validate($this->getSchemaFile(), $errors)) { - $message = is_null($file) ? "Invalid Document \n" : "Invalid XML-file: {$file}\n"; + $message = $file === null ? "Invalid Document \n" : "Invalid XML-file: {$file}\n"; throw new Magento_Exception($message . implode("\n", $errors)); } return $this; @@ -141,7 +141,7 @@ protected function _isRuntimeValidated() */ protected function _getDomConfigModel() { - if (is_null($this->_domConfig)) { + if ($this->_domConfig === null) { $schemaFile = $this->getPerFileSchemaFile() && $this->_isRuntimeValidated() ? $this->getPerFileSchemaFile() : null; diff --git a/lib/Magento/Di/Zend.php b/lib/Magento/Di/Zend.php index 159dc4bdd3a64..0e2f735db168e 100644 --- a/lib/Magento/Di/Zend.php +++ b/lib/Magento/Di/Zend.php @@ -51,7 +51,7 @@ public function __construct( Zend\Di\Config $config = null, $definitionsFile = null ) { - if (is_null($definitions)) { + if ($definitions === null) { if (is_string($definitionsFile) && is_file($definitionsFile) && is_readable($definitionsFile)) { $definitionProvider = new Magento_Di_Definition_ArrayDefinition_Zend( unserialize(file_get_contents($definitionsFile)) diff --git a/lib/Magento/Filesystem/Adapter/Zlib.php b/lib/Magento/Filesystem/Adapter/Zlib.php index 5dcd3d364e870..f50938ecee782 100644 --- a/lib/Magento/Filesystem/Adapter/Zlib.php +++ b/lib/Magento/Filesystem/Adapter/Zlib.php @@ -119,7 +119,7 @@ public function createStream($path) */ protected function _isCompressionAvailable() { - if (is_null($this->_hasCompression)) { + if ($this->_hasCompression === null) { $this->_hasCompression = extension_loaded("zlib"); } return $this->_hasCompression; diff --git a/lib/Magento/Validator/ValidatorAbstract.php b/lib/Magento/Validator/ValidatorAbstract.php index 03dc7faa2dd2b..94169eb7305f9 100644 --- a/lib/Magento/Validator/ValidatorAbstract.php +++ b/lib/Magento/Validator/ValidatorAbstract.php @@ -81,7 +81,7 @@ public function setTranslator($translator = null) */ public function getTranslator() { - if (is_null($this->_translator)) { + if ($this->_translator === null) { return self::getDefaultTranslator(); } return $this->_translator; diff --git a/lib/PEAR/HTTP/Request.php b/lib/PEAR/HTTP/Request.php index 45ca9455f321d..cd3850696ae47 100644 --- a/lib/PEAR/HTTP/Request.php +++ b/lib/PEAR/HTTP/Request.php @@ -1256,10 +1256,10 @@ function process($saveBody = true, $canHaveBody = true) } else { $this->_toRead = $this->_headers['content-length']; } - while (!$this->_sock->eof() && (is_null($this->_toRead) || 0 < $this->_toRead)) { + while (!$this->_sock->eof() && ($this->_toRead === null || 0 < $this->_toRead)) { if ($chunked) { $data = $this->_readChunked(); - } elseif (is_null($this->_toRead)) { + } elseif ($this->_toRead === null) { $data = $this->_sock->read(4096); } else { $data = $this->_sock->read(min(4096, $this->_toRead)); diff --git a/lib/PEAR/Net/Socket.php b/lib/PEAR/Net/Socket.php index 73bb4dd11f124..8fdde91d8515e 100644 --- a/lib/PEAR/Net/Socket.php +++ b/lib/PEAR/Net/Socket.php @@ -327,10 +327,10 @@ function write($data, $blocksize = null) return $this->raiseError('not connected'); } - if (is_null($blocksize) && !OS_WINDOWS) { + if ($blocksize === null && !OS_WINDOWS) { return @fwrite($this->fp, $data); } else { - if (is_null($blocksize)) { + if ($blocksize === null) { $blocksize = 1024; } diff --git a/lib/PEAR/Net/URL.php b/lib/PEAR/Net/URL.php index 0c964a9f428f2..de197d4edaeef 100644 --- a/lib/PEAR/Net/URL.php +++ b/lib/PEAR/Net/URL.php @@ -438,7 +438,7 @@ function getStandardPort($scheme) function setProtocol($protocol, $port = null) { $this->protocol = $protocol; - $this->port = is_null($port) ? $this->getStandardPort($protocol) : $port; + $this->port = $port === null ? $this->getStandardPort($protocol) : $port; } /** diff --git a/lib/PEAR/PEAR.php b/lib/PEAR/PEAR.php index b4633bf3b8bd6..d9a36b95cf3dd 100644 --- a/lib/PEAR/PEAR.php +++ b/lib/PEAR/PEAR.php @@ -279,7 +279,7 @@ function registerShutdownFunc($func, $args = array()) public static function isError($data, $code = null) { if ($data instanceof PEAR_Error) { - if (is_null($code)) { + if ($code === null) { return true; } elseif (is_string($code)) { return $data->getMessage() == $code; @@ -885,7 +885,7 @@ function PEAR_Error($message = 'unknown error', $code = null, $this->callback = null; } if ($this->mode & PEAR_ERROR_PRINT) { - if (is_null($options) || is_int($options)) { + if ($options === null || is_int($options)) { $format = "%s"; } else { $format = $options; @@ -897,7 +897,7 @@ function PEAR_Error($message = 'unknown error', $code = null, } if ($this->mode & PEAR_ERROR_DIE) { $msg = $this->getMessage(); - if (is_null($options) || is_int($options)) { + if ($options === null || is_int($options)) { $format = "%s"; if (substr($msg, -1) != "\n") { $msg .= "\n"; diff --git a/lib/PEAR/PEAR/PEAR.php b/lib/PEAR/PEAR/PEAR.php index b4633bf3b8bd6..d9a36b95cf3dd 100644 --- a/lib/PEAR/PEAR/PEAR.php +++ b/lib/PEAR/PEAR/PEAR.php @@ -279,7 +279,7 @@ function registerShutdownFunc($func, $args = array()) public static function isError($data, $code = null) { if ($data instanceof PEAR_Error) { - if (is_null($code)) { + if ($code === null) { return true; } elseif (is_string($code)) { return $data->getMessage() == $code; @@ -885,7 +885,7 @@ function PEAR_Error($message = 'unknown error', $code = null, $this->callback = null; } if ($this->mode & PEAR_ERROR_PRINT) { - if (is_null($options) || is_int($options)) { + if ($options === null || is_int($options)) { $format = "%s"; } else { $format = $options; @@ -897,7 +897,7 @@ function PEAR_Error($message = 'unknown error', $code = null, } if ($this->mode & PEAR_ERROR_DIE) { $msg = $this->getMessage(); - if (is_null($options) || is_int($options)) { + if ($options === null || is_int($options)) { $format = "%s"; if (substr($msg, -1) != "\n") { $msg .= "\n"; diff --git a/lib/PEAR/SOAP/Base.php b/lib/PEAR/SOAP/Base.php index 14f96c12ca387..4ec39bae4828d 100644 --- a/lib/PEAR/SOAP/Base.php +++ b/lib/PEAR/SOAP/Base.php @@ -598,7 +598,7 @@ function _serializeValue($value, $name = null, $type = null, if ($xmlout_type) { $xmlout_type = " xsi:type=\"$xmlout_type\""; } - if (is_null($xmlout_value)) { + if ($xmlout_value === null) { $xml = "\r\n<$xmlout_name$xmlout_type$xmlns$xmlout_arrayType" . "$xml_attr xsi:nil=\"true\"/>"; } else { @@ -608,7 +608,7 @@ function _serializeValue($value, $name = null, $type = null, } elseif ($type->name == 'Array' && !empty($options['keep_arrays_flat'])) { $xml = $xmlout_value; } else { - if (is_null($xmlout_value)) { + if ($xmlout_value === null) { $xml = "\r\n<$xmlout_name$xmlns$xml_attr/>"; } else { $xml = "\r\n<$xmlout_name$xmlns$xml_attr>" . diff --git a/lib/PEAR/XML/Serializer.php b/lib/PEAR/XML/Serializer.php index b9f2f0880c512..9748dafd5f348 100644 --- a/lib/PEAR/XML/Serializer.php +++ b/lib/PEAR/XML/Serializer.php @@ -160,7 +160,7 @@ define('XML_SERIALIZER_OPTION_PREPEND_ATTRIBUTES', 'prependAttributes'); /** - * option: indent the attributes, if set to '_auto', + * option: indent the attributes, if set to '_auto', * it will indent attributes so they all start at the same column * * Possible values: @@ -171,7 +171,7 @@ define('XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES', 'indentAttributes'); /** - * option: use 'simplexml' to use parent name as tagname + * option: use 'simplexml' to use parent name as tagname * if transforming an indexed array * * Possible values: @@ -190,7 +190,7 @@ define('XML_SERIALIZER_OPTION_DOCTYPE_ENABLED', 'addDoctype'); /** - * option: supply a string or an array with id and uri + * option: supply a string or an array with id and uri * ({@see XML_Util::getDoctypeDeclaration()} * * Possible values: @@ -225,8 +225,8 @@ define('XML_SERIALIZER_OPTION_ATTRIBUTES_KEY', 'attributesArray'); /** - * option: this value will be used directly as content, - * instead of creating a new tag, may only be used + * option: this value will be used directly as content, + * instead of creating a new tag, may only be used * in conjuction with attributesArray * * Possible values: @@ -385,7 +385,7 @@ * XML_SERIALIZER_OPTION_INDENT => "\t", // indent with tabs * XML_SERIALIZER_OPTION_LINEBREAKS => "\n", // use UNIX line breaks * XML_SERIALIZER_OPTION_ROOT_NAME => 'rdf:RDF',// root tag - * XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item' // tag for values + * XML_SERIALIZER_OPTION_DEFAULT_TAG => 'item' // tag for values * // with numeric keys * ); * @@ -497,18 +497,18 @@ class XML_Serializer extends PEAR // prepend string for attributes XML_SERIALIZER_OPTION_PREPEND_ATTRIBUTES => '', - // indent the attributes, if set to '_auto', + // indent the attributes, if set to '_auto', // it will indent attributes so they all start at the same column XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES => false, - // use XML_SERIALIZER_MODE_SIMPLEXML to use parent name as tagname + // use XML_SERIALIZER_MODE_SIMPLEXML to use parent name as tagname // if transforming an indexed array XML_SERIALIZER_OPTION_MODE => XML_SERIALIZER_MODE_DEFAULT, // add a doctype declaration XML_SERIALIZER_OPTION_DOCTYPE_ENABLED => false, - // supply a string or an array with id and uri + // supply a string or an array with id and uri // ({@see XML_Util::getDoctypeDeclaration()} XML_SERIALIZER_OPTION_DOCTYPE => null, @@ -521,13 +521,13 @@ class XML_Serializer extends PEAR // all values in this key will be treated as attributes XML_SERIALIZER_OPTION_ATTRIBUTES_KEY => null, - // this value will be used directly as content, - // instead of creating a new tag, may only be used + // this value will be used directly as content, + // instead of creating a new tag, may only be used // in conjuction with attributesArray XML_SERIALIZER_OPTION_CONTENT_KEY => null, - // this value will be used directly as comment, - // instead of creating a new tag, may only be used + // this value will be used directly as comment, + // instead of creating a new tag, may only be used // in conjuction with attributesArray XML_SERIALIZER_OPTION_COMMENT_KEY => null, @@ -622,7 +622,7 @@ function resetOptions() /** * set an option * - * You can use this method if you do not want + * You can use this method if you do not want * to set all options in the constructor * * @param string $name option name @@ -640,7 +640,7 @@ function setOption($name, $value) /** * sets several options at once * - * You can use this method if you do not want + * You can use this method if you do not want * to set all options in the constructor * * @param array $options options array @@ -669,7 +669,7 @@ function serialize($data, $options = null) // of the previously defined ones if (is_array($options)) { $optionsBak = $this->options; - if (isset($options['overrideOptions']) + if (isset($options['overrideOptions']) && $options['overrideOptions'] == true ) { $this->options = array_merge($this->_defaultOptions, $options); @@ -684,11 +684,11 @@ function serialize($data, $options = null) $this->_tagDepth = 0; $rootAttributes = $this->options[XML_SERIALIZER_OPTION_ROOT_ATTRIBS]; - if (isset($this->options[XML_SERIALIZER_OPTION_NAMESPACE]) + if (isset($this->options[XML_SERIALIZER_OPTION_NAMESPACE]) && is_array($this->options[XML_SERIALIZER_OPTION_NAMESPACE]) ) { $rootAttributes['xmlns:' - . $this->options[XML_SERIALIZER_OPTION_NAMESPACE][0]] = + . $this->options[XML_SERIALIZER_OPTION_NAMESPACE][0]] = $this->options[XML_SERIALIZER_OPTION_NAMESPACE][1]; } @@ -701,7 +701,7 @@ function serialize($data, $options = null) $tagName = 'array'; } - $this->_serializedData .= + $this->_serializedData .= $this->_serializeArray($data, $tagName, $rootAttributes); } elseif (is_object($data)) { // serialize an object @@ -710,7 +710,7 @@ function serialize($data, $options = null) } else { $tagName = get_class($data); } - $this->_serializedData .= + $this->_serializedData .= $this->_serializeObject($data, $tagName, $rootAttributes); } else { $tag = array(); @@ -732,8 +732,8 @@ function serialize($data, $options = null) // add doctype declaration if ($this->options[XML_SERIALIZER_OPTION_DOCTYPE_ENABLED] === true) { - $this->_serializedData = - XML_Util::getDoctypeDeclaration($tagName, + $this->_serializedData = + XML_Util::getDoctypeDeclaration($tagName, $this->options[XML_SERIALIZER_OPTION_DOCTYPE]) . $this->options[XML_SERIALIZER_OPTION_LINEBREAKS] . $this->_serializedData; @@ -742,7 +742,7 @@ function serialize($data, $options = null) // build xml declaration if ($this->options[XML_SERIALIZER_OPTION_XML_DECL_ENABLED]) { $atts = array(); - $this->_serializedData = XML_Util::getXMLDeclaration('1.0', + $this->_serializedData = XML_Util::getXMLDeclaration('1.0', $this->options[XML_SERIALIZER_OPTION_XML_ENCODING]) . $this->options[XML_SERIALIZER_OPTION_LINEBREAKS] . $this->_serializedData; @@ -771,7 +771,7 @@ function getSerializedData() { if ($this->_serializedData == null) { return $this->raiseError('No serialized data available. ' - . 'Use XML_Serializer::serialize() first.', + . 'Use XML_Serializer::serialize() first.', XML_SERIALIZER_ERROR_NO_SERIALIZATION); } return $this->_serializedData; @@ -826,7 +826,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) if ($this->options[XML_SERIALIZER_OPTION_COMMENT_KEY] !== null) { if (isset($array[$this->options[XML_SERIALIZER_OPTION_COMMENT_KEY]]) ) { - $_comment = + $_comment = $array[$this->options[XML_SERIALIZER_OPTION_COMMENT_KEY]]; unset($array[$this->options[XML_SERIALIZER_OPTION_COMMENT_KEY]]); } @@ -838,7 +838,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) if ($this->options[XML_SERIALIZER_OPTION_ATTRIBUTES_KEY] !== null) { if (isset($array[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTES_KEY]]) ) { - $attributes = + $attributes = $array[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTES_KEY]]; unset($array[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTES_KEY]]); } @@ -848,7 +848,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) if ($this->options[XML_SERIALIZER_OPTION_CONTENT_KEY] !== null) { if (isset($array[$this->options[XML_SERIALIZER_OPTION_CONTENT_KEY]]) ) { - $_content = + $_content = XML_Util::replaceEntities($array [$this->options[XML_SERIALIZER_OPTION_CONTENT_KEY]]); unset($array[$this->options[XML_SERIALIZER_OPTION_CONTENT_KEY]]); @@ -858,7 +858,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) if ($this->options[XML_SERIALIZER_OPTION_IGNORE_NULL] === true) { foreach (array_keys($array) as $key) { - if (is_null($array[$key])) { + if ($array[$key] === null) { unset($array[$key]); } } @@ -868,8 +868,8 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) * if mode is set to simpleXML, check whether * the array is associative or indexed */ - if (is_array($array) && !empty($array) - && $this->options[XML_SERIALIZER_OPTION_MODE] + if (is_array($array) && !empty($array) + && $this->options[XML_SERIALIZER_OPTION_MODE] == XML_SERIALIZER_MODE_SIMPLEXML ) { $indexed = true; @@ -880,8 +880,8 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) } } - if ($indexed - && $this->options[XML_SERIALIZER_OPTION_MODE] + if ($indexed + && $this->options[XML_SERIALIZER_OPTION_MODE] == XML_SERIALIZER_MODE_SIMPLEXML ) { $string = ''; @@ -890,11 +890,11 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) $string .= $this->options[XML_SERIALIZER_OPTION_LINEBREAKS]; // do indentation - if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null + if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null && $this->_tagDepth>0 ) { - $string .= - str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], + $string .= + str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], $this->_tagDepth); } } @@ -903,11 +903,11 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) } $scalarAsAttributes = false; - if (is_array($this->options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES]) + if (is_array($this->options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES]) && isset($this->options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES] [$tagName]) ) { - $scalarAsAttributes = + $scalarAsAttributes = $this->options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES][$tagName]; } elseif ($this->options[XML_SERIALIZER_OPTION_SCALAR_AS_ATTRIBUTES] === true ) { @@ -952,10 +952,10 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) $tmp = $_content . $this->options[XML_SERIALIZER_OPTION_LINEBREAKS]; foreach ($array as $key => $value) { // do indentation - if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null + if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null && $this->_tagDepth>0 ) { - $tmp .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], + $tmp .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], $this->_tagDepth); } @@ -966,7 +966,7 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) $valid = XML_Util::isValidName($key); $this->popExpect(); if (PEAR::isError($valid)) { - if ($this->options[XML_SERIALIZER_OPTION_CLASSNAME_AS_TAGNAME] + if ($this->options[XML_SERIALIZER_OPTION_CLASSNAME_AS_TAGNAME] && is_object($value) ) { $key = get_class($value); @@ -982,10 +982,10 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) $atts = array(); if ($this->options[XML_SERIALIZER_OPTION_TYPEHINTS] === true) { - $atts[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTE_TYPE]] = + $atts[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTE_TYPE]] = gettype($value); if ($key !== $origKey) { - $atts[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTE_KEY]] = + $atts[$this->options[XML_SERIALIZER_OPTION_ATTRIBUTE_KEY]] = (string)$origKey; } } @@ -999,10 +999,10 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) } $this->_tagDepth--; - if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null + if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null && $this->_tagDepth>0 ) { - $tmp .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], + $tmp .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], $this->_tagDepth); } @@ -1029,10 +1029,10 @@ function _serializeArray(&$array, $tagName = null, $attributes = array()) if (!is_null($_comment)) { $string .= XML_Util::createComment($_comment); $string .= $this->options[XML_SERIALIZER_OPTION_LINEBREAKS]; - if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null + if ($this->options[XML_SERIALIZER_OPTION_INDENT]!==null && $this->_tagDepth>0 ) { - $string .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], + $string .= str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], $this->_tagDepth); } } @@ -1134,10 +1134,10 @@ function _createXMLTag($tag, $firstCall = true) // build fully qualified tag name if ($this->options[XML_SERIALIZER_OPTION_NAMESPACE] !== null) { if (is_array($this->options[XML_SERIALIZER_OPTION_NAMESPACE])) { - $tag['qname'] = $this->options[XML_SERIALIZER_OPTION_NAMESPACE][0] + $tag['qname'] = $this->options[XML_SERIALIZER_OPTION_NAMESPACE][0] . ':' . $tag['qname']; } else { - $tag['qname'] = $this->options[XML_SERIALIZER_OPTION_NAMESPACE] + $tag['qname'] = $this->options[XML_SERIALIZER_OPTION_NAMESPACE] . ':' . $tag['qname']; } } @@ -1145,7 +1145,7 @@ function _createXMLTag($tag, $firstCall = true) // attribute indentation if ($this->options[XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES] !== false) { $multiline = true; - $indent = str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], + $indent = str_repeat($this->options[XML_SERIALIZER_OPTION_INDENT], $this->_tagDepth); if ($this->options[XML_SERIALIZER_OPTION_INDENT_ATTRIBUTES] == '_auto') { @@ -1175,18 +1175,18 @@ function _createXMLTag($tag, $firstCall = true) $replaceEntities = $this->options[XML_SERIALIZER_OPTION_ENTITIES]; } } else { - // this is a nested call, so value is already encoded + // this is a nested call, so value is already encoded // and must not be encoded again $replaceEntities = XML_SERIALIZER_ENTITIES_NONE; // but attributes need to be encoded anyways // (done here because the rest of the code assumes the same encoding // can be used both for attributes and content) foreach ($tag['attributes'] as $k => &$v) { - $v = XML_Util::replaceEntities($v, + $v = XML_Util::replaceEntities($v, $this->options[XML_SERIALIZER_OPTION_ENTITIES]); } } - if (is_scalar($tag['content']) || is_null($tag['content'])) { + if (is_scalar($tag['content']) || $tag['content'] === null) { if ($this->options[XML_SERIALIZER_OPTION_ENCODE_FUNC]) { if ($firstCall === true) { $tag['content'] = call_user_func($this-> @@ -1195,13 +1195,13 @@ function _createXMLTag($tag, $firstCall = true) $tag['attributes'] = array_map($this-> options[XML_SERIALIZER_OPTION_ENCODE_FUNC], $tag['attributes']); } - $tag = XML_Util::createTagFromArray($tag, $replaceEntities, $multiline, + $tag = XML_Util::createTagFromArray($tag, $replaceEntities, $multiline, $indent, $this->options[XML_SERIALIZER_OPTION_LINEBREAKS]); } elseif (is_array($tag['content'])) { - $tag = $this->_serializeArray($tag['content'], $tag['qname'], + $tag = $this->_serializeArray($tag['content'], $tag['qname'], $tag['attributes']); } elseif (is_object($tag['content'])) { - $tag = $this->_serializeObject($tag['content'], $tag['qname'], + $tag = $this->_serializeObject($tag['content'], $tag['qname'], $tag['attributes']); } elseif (is_resource($tag['content'])) { settype($tag['content'], 'string'); @@ -1211,7 +1211,7 @@ function _createXMLTag($tag, $firstCall = true) options[XML_SERIALIZER_OPTION_ENCODE_FUNC], $tag['content']); } $tag['attributes'] = array_map($this-> - options[XML_SERIALIZER_OPTION_ENCODE_FUNC], + options[XML_SERIALIZER_OPTION_ENCODE_FUNC], $tag['attributes']); } $tag = XML_Util::createTagFromArray($tag, $replaceEntities); diff --git a/lib/Varien/Convert/Container/Abstract.php b/lib/Varien/Convert/Container/Abstract.php index df1798765bb2d..e83a519af42ae 100644 --- a/lib/Varien/Convert/Container/Abstract.php +++ b/lib/Varien/Convert/Container/Abstract.php @@ -53,7 +53,7 @@ public function getVars() public function setVar($key, $value=null) { - if (is_array($key) && is_null($value)) { + if (is_array($key) && $value === null) { $this->_vars = $key; } else { $this->_vars[$key] = $value; @@ -74,7 +74,7 @@ public function setData($data) public function validateDataString($data=null) { - if (is_null($data)) { + if ($data === null) { $data = $this->getData(); } if (!is_string($data)) { @@ -85,7 +85,7 @@ public function validateDataString($data=null) public function validateDataGrid($data=null) { - if (is_null($data)) { + if ($data === null) { $data = $this->getData(); } if (!is_array($data) || !is_array(current($data))) { diff --git a/lib/Varien/Data/Collection.php b/lib/Varien/Data/Collection.php index 68ce10f37f957..16a37bbb00e09 100644 --- a/lib/Varien/Data/Collection.php +++ b/lib/Varien/Data/Collection.php @@ -252,7 +252,7 @@ public function getPageSize() public function getSize() { $this->load(); - if (is_null($this->_totalRecords)) { + if ($this->_totalRecords === null) { $this->_totalRecords = count($this->getItems()); } return intval($this->_totalRecords); diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index 760d590c71436..059036871e411 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -224,7 +224,7 @@ public function getConnection() */ public function getSize() { - if (is_null($this->_totalRecords)) { + if ($this->_totalRecords === null) { $sql = $this->getSelectCountSql(); $this->_totalRecords = $this->getConnection()->fetchOne($sql, $this->_bindParams); } @@ -691,11 +691,11 @@ public function loadData($printQuery = false, $logQuery = false) public function printLogQuery($printQuery = false, $logQuery = false, $sql = null) { if ($printQuery) { - echo is_null($sql) ? $this->getSelect()->__toString() : $sql; + echo $sql === null ? $this->getSelect()->__toString() : $sql; } if ($logQuery) { - Mage::log(is_null($sql) ? $this->getSelect()->__toString() : $sql); + Mage::log($sql === null ? $this->getSelect()->__toString() : $sql); } return $this; } @@ -829,9 +829,9 @@ protected function _getCacheTags() */ public function addFilterToMap($filter, $alias, $group = 'fields') { - if (is_null($this->_map)) { + if ($this->_map === null) { $this->_map = array($group => array()); - } elseif (is_null($this->_map[$group])) { + } elseif ($this->_map[$group] === null) { $this->_map[$group] = array(); } $this->_map[$group][$filter] = $alias; diff --git a/lib/Varien/Data/Form/Element/Abstract.php b/lib/Varien/Data/Form/Element/Abstract.php index e8a74030ca1b0..3d7761f8d0ef7 100644 --- a/lib/Varien/Data/Form/Element/Abstract.php +++ b/lib/Varien/Data/Form/Element/Abstract.php @@ -250,7 +250,7 @@ public function getLabelHtml($idSuffix = '') public function getDefaultHtml() { $html = $this->getData('default_html'); - if (is_null($html)) { + if ($html === null) { $html = ( $this->getNoSpan() === true ) ? '' : ''."\n"; $html.= $this->getLabelHtml(); $html.= $this->getElementHtml(); diff --git a/lib/Varien/Data/Form/Element/Hidden.php b/lib/Varien/Data/Form/Element/Hidden.php index 37cc3b137e847..0cdfe951ffa3e 100644 --- a/lib/Varien/Data/Form/Element/Hidden.php +++ b/lib/Varien/Data/Form/Element/Hidden.php @@ -43,7 +43,7 @@ public function __construct($attributes=array()) public function getDefaultHtml() { $html = $this->getData('default_html'); - if (is_null($html)) { + if ($html === null) { $html = $this->getElementHtml(); } return $html; diff --git a/lib/Varien/Data/Form/Element/Radios.php b/lib/Varien/Data/Form/Element/Radios.php index 3928d525237bf..be0fe509d8184 100644 --- a/lib/Varien/Data/Form/Element/Radios.php +++ b/lib/Varien/Data/Form/Element/Radios.php @@ -42,7 +42,7 @@ public function __construct($attributes=array()) public function getSeparator() { $separator = $this->getData('separator'); - if (is_null($separator)) { + if ($separator === null) { $separator = ' '; } return $separator; diff --git a/lib/Varien/Data/Form/Filter/Date.php b/lib/Varien/Data/Form/Filter/Date.php index 2c63417faaffb..f68c409441717 100644 --- a/lib/Varien/Data/Form/Filter/Date.php +++ b/lib/Varien/Data/Form/Filter/Date.php @@ -56,7 +56,7 @@ class Varien_Data_Form_Filter_Date implements Varien_Data_Form_Filter_Interface */ public function __construct($format = null, $locale = null) { - if (is_null($format)) { + if ($format === null) { $format = Varien_Date::DATE_INTERNAL_FORMAT; } $this->_dateFormat = $format; diff --git a/lib/Varien/Data/Tree/Db.php b/lib/Varien/Data/Tree/Db.php index 1a0c94997379c..370a7a8fa5360 100644 --- a/lib/Varien/Data/Tree/Db.php +++ b/lib/Varien/Data/Tree/Db.php @@ -133,7 +133,7 @@ public function setDbSelect($select) */ public function load($parentNode=null, $recursionLevel=100) { - if (is_null($parentNode)) { + if ($parentNode === null) { $this->_loadFullTree(); return $this; } @@ -204,7 +204,7 @@ public function moveNodeTo($node, $parentNode, $prevNode=null) $data[$this->_parentField] = $parentNode->getId(); $data[$this->_levelField] = $parentNode->getData($this->_levelField)+1; // New node order - if (is_null($prevNode) || is_null($prevNode->getData($this->_orderField))) { + if ($prevNode === null || $prevNode->getData($this->_orderField) === null) { $data[$this->_orderField] = 1; } else { diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index b2c45adad511a..2500cf9f88f4b 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -1733,7 +1733,7 @@ public function modifyColumnByDdl($tableName, $columnName, $definition, $flushDa { $definition = array_change_key_case($definition, CASE_UPPER); $definition['COLUMN_TYPE'] = $this->_getColumnTypeByDdl($definition); - if (array_key_exists('DEFAULT', $definition) && is_null($definition['DEFAULT'])) { + if (array_key_exists('DEFAULT', $definition) && $definition['DEFAULT'] === null) { unset($definition['DEFAULT']); } @@ -2317,7 +2317,7 @@ protected function _getColumnDefinition($options, $ddlType = null) } else { $cDefault = false; } - } else if (is_null($cDefault) && $cNullable) { + } else if ($cDefault === null && $cNullable) { $cDefault = new Zend_Db_Expr('NULL'); } @@ -2769,7 +2769,7 @@ public function prepareColumnValue(array $column, $value) } // return null - if (is_null($value) && $column['NULLABLE']) { + if ($value === null && $column['NULLABLE']) { return null; } @@ -3032,7 +3032,7 @@ public function getDatePartSql($date) */ public function getSubstringSql($stringExpression, $pos, $len = null) { - if (is_null($len)) { + if ($len === null) { return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s)', $stringExpression, $pos)); } return new Zend_Db_Expr(sprintf('SUBSTRING(%s, %s, %s)', $stringExpression, $pos, $len)); diff --git a/lib/Varien/Db/Ddl/Table.php b/lib/Varien/Db/Ddl/Table.php index 69d9c16d1e8e9..eb043620ee084 100644 --- a/lib/Varien/Db/Ddl/Table.php +++ b/lib/Varien/Db/Ddl/Table.php @@ -222,7 +222,7 @@ public function setComment($comment) */ public function getName() { - if (is_null($this->_tableName)) { + if ($this->_tableName === null) { throw new Zend_Db_Exception('Table name is not defined'); } return $this->_tableName; diff --git a/lib/Varien/Debug.php b/lib/Varien/Debug.php index baf60b245ea67..79bc7a4c80ccc 100644 --- a/lib/Varien/Debug.php +++ b/lib/Varien/Debug.php @@ -48,7 +48,7 @@ class Varien_Debug */ public static function getRootPath() { - if (is_null(self::$_filePath)) { + if (self::$_filePath === null) { if (defined('BP')) { self::$_filePath = BP; } else { @@ -185,7 +185,7 @@ protected static function _formatCalledArgument($arg) } else { $out .= 'array(' . join(', ', $args) . ')'; } - } else if (is_null($arg)) { + } else if ($arg === null) { $out .= 'NULL'; } else if (is_numeric($arg) || is_float($arg)) { $out .= $arg; diff --git a/lib/Varien/Http/Adapter/Curl.php b/lib/Varien/Http/Adapter/Curl.php index afb0feabb494d..0b72ea326628b 100644 --- a/lib/Varien/Http/Adapter/Curl.php +++ b/lib/Varien/Http/Adapter/Curl.php @@ -226,7 +226,7 @@ public function close() */ protected function _getResource() { - if (is_null($this->_resource)) { + if ($this->_resource === null) { $this->_resource = curl_init(); } return $this->_resource; diff --git a/lib/Varien/Io/Ftp.php b/lib/Varien/Io/Ftp.php index 01f1acd15f192..c38ae4374ec73 100644 --- a/lib/Varien/Io/Ftp.php +++ b/lib/Varien/Io/Ftp.php @@ -217,7 +217,7 @@ public function read($filename, $dest=null) } else { if (is_resource($dest)) { $stream = $dest; - } elseif (is_null($dest)) { + } elseif ($dest === null) { $stream = tmpfile(); } else { $this->_error = self::ERROR_INVALID_DESTINATION; @@ -226,7 +226,7 @@ public function read($filename, $dest=null) $result = ftp_fget($this->_conn, $stream, $filename, $this->_config['file_mode']); - if (is_null($dest)) { + if ($dest === null) { fseek($stream, 0); $result = ''; for ($result = ''; $s = fread($stream, 4096); $result .= $s); diff --git a/lib/Varien/Io/Sftp.php b/lib/Varien/Io/Sftp.php index 58c6625ad4699..dcaaa999a7c92 100644 --- a/lib/Varien/Io/Sftp.php +++ b/lib/Varien/Io/Sftp.php @@ -167,7 +167,7 @@ public function cd($dir) */ public function read($filename, $dest=null) { - if (is_null($dest)) { + if ($dest === null) { $dest = false; } return $this->_connection->get($filename, $dest); diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index e3695af3c6e1d..333cbfc5f2767 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -213,7 +213,7 @@ public function setData($key, $value = null) */ public function unsetData($key = null) { - if (is_null($key)) { + if ($key === null) { $this->setData(array()); } elseif (is_string($key)) { if (array_key_exists($key, $this->_data)) { @@ -602,7 +602,7 @@ public function serialize($keys = array(), $valueSeparator = '=', $fieldSeparato */ public function setOrigData($key = null, $data = null) { - if (is_null($key)) { + if ($key === null) { $this->_origData = $this->_data; } else { $this->_origData[$key] = $data; @@ -618,7 +618,7 @@ public function setOrigData($key = null, $data = null) */ public function getOrigData($key = null) { - if (is_null($key)) { + if ($key === null) { return $this->_origData; } return isset($this->_origData[$key]) ? $this->_origData[$key] : null; @@ -658,7 +658,7 @@ public function setDataChanges($value) */ public function debug($data = null, &$objects = array()) { - if (is_null($data)) { + if ($data === null) { $hash = spl_object_hash($this); if (!empty($objects[$hash])) { return '*** RECURSION ***'; diff --git a/lib/Varien/Object/Cache.php b/lib/Varien/Object/Cache.php index 8fdee1d5a36e3..5c7abd305029e 100644 --- a/lib/Varien/Object/Cache.php +++ b/lib/Varien/Object/Cache.php @@ -162,7 +162,7 @@ public function save($object, $idx=null, $tags=null) return $this->_hashes[$hash]; } - if (is_null($idx)) { + if ($idx === null) { $idx = '#'.(++$this->_idx); } diff --git a/lib/Varien/Pear/Frontend.php b/lib/Varien/Pear/Frontend.php index 22c1fbbe4ec53..953f795b8a892 100644 --- a/lib/Varien/Pear/Frontend.php +++ b/lib/Varien/Pear/Frontend.php @@ -57,7 +57,7 @@ public function getLogStream() public function log($msg, $append_crlf = true) { - if (is_null($msg) || false===$msg or ''===$msg) { + if ($msg === null || false===$msg or ''===$msg) { return; } diff --git a/lib/Varien/Pear/Package.php b/lib/Varien/Pear/Package.php index ab7b6387bb523..d2c008b2b4649 100644 --- a/lib/Varien/Pear/Package.php +++ b/lib/Varien/Pear/Package.php @@ -143,7 +143,7 @@ public function setPfm($pfm) public function getPfm($package=null) { if (!$this->_pfm) { - if (is_null($package)) { + if ($package === null) { $this->_pfm = new PEAR_PackageFileManager2; $this->_pfm->setOptions($this->get('options')); } else { diff --git a/lib/Varien/Simplexml/Config.php b/lib/Varien/Simplexml/Config.php index 173a9eabac7a8..641bca43fca43 100644 --- a/lib/Varien/Simplexml/Config.php +++ b/lib/Varien/Simplexml/Config.php @@ -108,7 +108,7 @@ class Varien_Simplexml_Config * @param string $sourceType */ public function __construct($sourceData=null) { - if (is_null($sourceData)) { + if ($sourceData === null) { return; } if ($sourceData instanceof Varien_Simplexml_Element) { @@ -291,7 +291,7 @@ public function getCacheLifetime() */ public function setCacheChecksum($data) { - if (is_null($data)) { + if ($data === null) { $this->_cacheChecksum = null; } elseif (false===$data || 0===$data) { $this->_cacheChecksum = false; @@ -361,7 +361,7 @@ public function validateCacheChecksum() if (false===$newChecksum) { return false; } - if (is_null($newChecksum)) { + if ($newChecksum === null) { return true; } $cachedChecksum = $this->getCache()->load($this->getCacheChecksumId()); @@ -405,7 +405,7 @@ public function saveCache($tags=null) return $this; } - if (is_null($tags)) { + if ($tags === null) { $tags = $this->_cacheTags; } diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index 09cd1be25ff80..17113e4adacf3 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -110,7 +110,7 @@ public function getAttribute($name){ /* public function addAttribute($name, $value=null, $namespace=null) { - if (is_null($value)) { + if ($value === null) { return parent::addAttribute($name); } else { if (!is_null($value)) { @@ -126,7 +126,7 @@ public function addAttribute($name, $value=null, $namespace=null) public function addChild($name, $value=null, $namespace=null) { - if (is_null($value)) { + if ($value === null) { return parent::addChild($name); } else { if (!is_null($value)) { @@ -332,7 +332,7 @@ public function innerXml($level=0) */ public function xmlentities($value = null) { - if (is_null($value)) { + if ($value === null) { $value = $this; } $value = (string)$value; @@ -448,7 +448,7 @@ public function extendChild($source, $overwrite=false) $targetChild = $this->$sourceName; } - if (is_null($targetChild)) { + if ($targetChild === null) { // if child target is not found create new and descend $targetChild = $this->addChild($sourceName); $targetChild->setParent($this); @@ -576,7 +576,7 @@ public function extendChildByNode($source, $overwrite=false, $mergeBy='name') } } - if (is_null($targetChild)) { + if ($targetChild === null) { // if child target is not found create new and descend $targetChild = $this->addChild($sourceName); foreach ($source->attributes() as $key=>$value) { @@ -642,7 +642,7 @@ public function extendChildByAttribute($source, $overwrite=false, $mergeBy='name } } - if (is_null($targetChild)) { + if ($targetChild === null) { // if child target is not found create new and descend $targetChild = $this->addChild($sourceName); foreach ($source->attributes() as $key=>$value) { diff --git a/lib/googlecheckout/googlerequest.php b/lib/googlecheckout/googlerequest.php index 9abb804caee06..e8a90b7265406 100644 --- a/lib/googlecheckout/googlerequest.php +++ b/lib/googlecheckout/googlerequest.php @@ -716,7 +716,7 @@ function parse_headers($message) { case '200': $parsed = $this->parse_headers(substr($message, $head_end + strlen(DOUBLE_ENTER))); - return is_null($parsed)?$headers:$parsed; + return $parsed === null?$headers:$parsed; break; default: return $headers; diff --git a/pub/errors/processor.php b/pub/errors/processor.php index 95e34426517e8..236d25a66b6a7 100644 --- a/pub/errors/processor.php +++ b/pub/errors/processor.php @@ -383,7 +383,7 @@ protected function _renderPage($template) */ protected function _getFilePath($file, $directories = null) { - if (is_null($directories)) { + if ($directories === null) { $directories = array(); if (!$this->_root) { From 8f96fb78e44be440c7bd9934f75bcc6a167058e5 Mon Sep 17 00:00:00 2001 From: Cyrill Schumacher Date: Thu, 31 Jan 2013 22:01:36 +0100 Subject: [PATCH 2/3] Replaced is_null() with === null according to http://framework.zend.com/issues/browse/ZF-5413 Fixed parse errors --- app/code/core/Mage/Backend/Block/Widget/Grid/Column.php | 2 +- app/code/core/Mage/Backend/Model/Menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php index 6060fedd2dc09..a3fdab3d92f12 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column.php @@ -459,7 +459,7 @@ public function getFilter() { if ($this->_filter === null) { $filterClass = $this->getData('filter'); - if (false === (bool) $filterClass && false === $filterClass === null) { + if (false === (bool) $filterClass && false === ($filterClass === null)) { return false; } if (!$filterClass) { diff --git a/app/code/core/Mage/Backend/Model/Menu.php b/app/code/core/Mage/Backend/Model/Menu.php index b45877b2588ba..4e63197935289 100644 --- a/app/code/core/Mage/Backend/Model/Menu.php +++ b/app/code/core/Mage/Backend/Model/Menu.php @@ -205,7 +205,7 @@ public function getFirstAvailable() if ($item->isAllowed() && !$item->isDisabled()) { if ($item->hasChildren()) { $result = $item->getChildren()->getFirstAvailable(); - if (false == $result === null) { + if (false === ($result === null)) { break; } } else { From 2c0355ed966822391a78dea9773f14b1a863daca Mon Sep 17 00:00:00 2001 From: Cyrill Schumacher Date: Thu, 31 Jan 2013 22:12:07 +0100 Subject: [PATCH 3/3] Replaced !is_null() with !== null according to http://framework.zend.com/issues/browse/ZF-5413 --- .../Mage/AdminNotification/Model/Inbox.php | 2 +- .../Block/Catalog/Category/Abstract.php | 2 +- .../Product/Edit/Tab/Price/Group/Abstract.php | 2 +- .../Block/Customer/Edit/Tab/Account.php | 2 +- .../Block/Customer/Edit/Tab/View/Sales.php | 2 +- .../Adminhtml/Block/Customer/Group/Edit.php | 2 +- .../Block/Customer/Group/Edit/Form.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Graph.php | 2 +- .../Adminhtml/Block/Notification/Window.php | 2 +- .../Block/Promo/Quote/Edit/Tab/Coupons.php | 2 +- .../Grid/Column/Renderer/Blanknumber.php | 2 +- .../Adminhtml/Block/Sales/Items/Abstract.php | 14 ++++----- .../Block/Sales/Order/Create/Form.php | 8 ++--- .../Block/Sales/Order/Create/Header.php | 4 +-- .../Block/Sales/Order/Invoice/Create/Form.php | 2 +- .../Block/Tax/Rate/Grid/Renderer/Data.php | 2 +- .../Adminhtml/Model/Sales/Order/Create.php | 6 ++-- .../controllers/Customer/GroupController.php | 6 ++-- .../System/Config/ValidatevatController.php | 2 +- .../sales/order/create/totals/tax.phtml | 2 +- .../adminhtml/sales/order/totals/tax.phtml | 4 +-- .../Mage/Backend/Block/Store/Switcher.php | 2 +- .../Block/Widget/Grid/Column/Filter/Price.php | 4 +-- .../Widget/Grid/Column/Filter/Select.php | 2 +- .../Block/Widget/Grid/Column/Filter/Theme.php | 2 +- .../Widget/Grid/Column/Renderer/Number.php | 2 +- .../Widget/Grid/Column/Renderer/Select.php | 2 +- .../core/Mage/Backend/Block/Widget/Tabs.php | 2 +- app/code/core/Mage/Backend/Model/Menu.php | 2 +- .../Model/Menu/Builder/CommandAbstract.php | 2 +- .../core/Mage/Backend/Model/Menu/Item.php | 2 +- .../Backend/Model/Menu/Item/Validator.php | 4 +-- app/code/core/Mage/Backend/Model/Url.php | 2 +- .../widget/form/element/gallery.phtml | 2 +- app/code/core/Mage/Backup/Model/Backup.php | 2 +- app/code/core/Mage/Bundle/Model/Observer.php | 4 +-- .../core/Mage/Bundle/Model/Product/Price.php | 6 ++-- .../core/Mage/Bundle/Model/Product/Type.php | 2 +- .../Bundle/Model/Resource/Indexer/Price.php | 2 +- .../Bundle/Model/Resource/Indexer/Stock.php | 4 +-- .../Bundle/Model/Resource/Price/Index.php | 2 +- .../Block/Product/View/Options/Abstract.php | 2 +- .../Block/Product/View/Options/Type/Date.php | 2 +- app/code/core/Mage/Catalog/Model/Abstract.php | 2 +- .../Catalog/Model/Layer/Filter/Category.php | 2 +- .../Model/Layer/Filter/Price/Algorithm.php | 8 ++--- .../Model/Product/Attribute/Backend/Media.php | 4 +-- .../core/Mage/Catalog/Model/Product/Link.php | 8 ++--- .../Model/Product/Type/Configurable.php | 8 ++--- .../Model/Product/Type/Configurable/Price.php | 2 +- .../Catalog/Model/Product/Type/Grouped.php | 2 +- .../Model/Product/Type/Grouped/Price.php | 2 +- .../Mage/Catalog/Model/Product/Type/Price.php | 6 ++-- .../Catalog/Model/Resource/Category/Flat.php | 2 +- .../Catalog/Model/Resource/Category/Tree.php | 2 +- .../Model/Resource/Layer/Filter/Price.php | 12 ++++---- .../Attribute/Backend/Groupprice/Abstract.php | 6 ++-- .../Model/Resource/Product/Collection.php | 4 +-- .../Resource/Product/Indexer/Abstract.php | 6 ++-- .../Resource/Product/Indexer/Eav/Abstract.php | 2 +- .../Resource/Product/Indexer/Eav/Decimal.php | 2 +- .../Resource/Product/Indexer/Eav/Source.php | 4 +-- .../Product/Indexer/Price/Default.php | 2 +- .../Product/Indexer/Price/Grouped.php | 2 +- .../Adminhtml/Form/Field/Customergroup.php | 2 +- .../Mage/CatalogInventory/Model/Observer.php | 30 +++++++++---------- .../Resource/Indexer/Stock/Configurable.php | 2 +- .../Model/Resource/Indexer/Stock/Default.php | 2 +- .../Model/Resource/Indexer/Stock/Grouped.php | 2 +- .../CatalogInventory/Model/Stock/Status.php | 2 +- .../core/Mage/CatalogRule/Model/Observer.php | 2 +- .../Mage/CatalogRule/Model/Resource/Rule.php | 6 ++-- .../Model/Resource/Advanced/Collection.php | 2 +- .../CatalogSearch/Model/Resource/Fulltext.php | 8 ++--- .../Model/Resource/Fulltext/Engine.php | 4 +-- app/code/core/Mage/Centinel/Model/Service.php | 2 +- .../Checkout/Block/Cart/Item/Renderer.php | 2 +- .../core/Mage/Checkout/Model/Type/Onepage.php | 2 +- .../Checkout/view/frontend/total/tax.phtml | 2 +- app/code/core/Mage/Cms/Helper/Page.php | 4 +-- .../core/Mage/Cms/Model/Resource/Page.php | 2 +- app/code/core/Mage/Core/Block/Html/Link.php | 2 +- app/code/core/Mage/Core/Block/Html/Select.php | 2 +- .../core/Mage/Core/Block/Template/Zend.php | 2 +- .../Mage/Core/Controller/Varien/Action.php | 4 +-- .../core/Mage/Core/Helper/File/Storage.php | 2 +- app/code/core/Mage/Core/Model/App.php | 2 +- app/code/core/Mage/Core/Model/Config.php | 2 +- app/code/core/Mage/Core/Model/Cookie.php | 2 +- app/code/core/Mage/Core/Model/Date.php | 4 +-- .../core/Mage/Core/Model/Resource/Config.php | 2 +- .../Mage/Core/Model/Resource/Db/Abstract.php | 6 ++-- .../core/Mage/Core/Model/Resource/Design.php | 16 +++++----- .../core/Mage/Core/Model/Resource/Setup.php | 6 ++-- .../Mage/Core/Model/Resource/Url/Rewrite.php | 2 +- .../core/Mage/Core/Model/Session/Abstract.php | 2 +- app/code/core/Mage/Core/Model/Template.php | 2 +- app/code/core/Mage/Core/Model/Url.php | 2 +- app/code/core/Mage/Core/Model/Url/Rewrite.php | 2 +- .../Block/Address/Renderer/Default.php | 2 +- .../core/Mage/Customer/Model/Customer.php | 2 +- app/code/core/Mage/Customer/Model/Group.php | 2 +- .../core/Mage/Customer/Service/Customer.php | 4 +-- .../Mage/Downloadable/Model/Product/Price.php | 2 +- .../Eav/Model/Attribute/Data/Abstract.php | 2 +- .../core/Mage/GiftMessage/Helper/Message.php | 2 +- app/code/core/Mage/GiftMessage/Helper/Url.php | 2 +- .../Block/Adminhtml/Shipping/Merchant.php | 4 +-- .../GoogleCheckout/Model/Api/Xml/Callback.php | 2 +- .../core/Mage/GoogleOptimizer/Helper/Data.php | 2 +- .../Block/Adminhtml/Types/Edit.php | 2 +- .../core/Mage/GoogleShopping/Helper/Data.php | 2 +- .../Model/Attribute/Condition.php | 2 +- .../Model/Attribute/Content.php | 4 +-- .../Model/Attribute/Default.php | 4 +-- .../GoogleShopping/Model/Attribute/Price.php | 10 +++---- .../Attribute/SalePriceEffectiveDate.php | 8 ++--- .../GoogleShopping/Model/Attribute/Title.php | 4 +-- .../core/Mage/GoogleShopping/Model/Item.php | 2 +- .../core/Mage/GoogleShopping/Model/Type.php | 4 +-- .../Googleshopping/TypesController.php | 4 +-- .../Model/Import/Entity/Product.php | 8 ++--- .../ImportExport/Model/Import/Uploader.php | 2 +- app/code/core/Mage/Index/Model/Event.php | 4 +-- .../Mage/Index/Model/Resource/Abstract.php | 2 +- .../Newsletter/Model/Resource/Template.php | 2 +- .../core/Mage/Newsletter/Model/Subscriber.php | 2 +- app/code/core/Mage/Oauth/Helper/Data.php | 2 +- app/code/core/Mage/Oauth/Model/Server.php | 2 +- app/code/core/Mage/Page/Block/Html/Head.php | 4 +-- app/code/core/Mage/Page/Block/Html/Header.php | 2 +- app/code/core/Mage/Paygate/Helper/Data.php | 2 +- .../Mage/Paypal/Block/Express/Shortcut.php | 2 +- app/code/core/Mage/Paypal/Model/Config.php | 2 +- .../Mage/Paypal/Model/Express/Checkout.php | 2 +- app/code/core/Mage/PaypalUk/Model/Api/Nvp.php | 2 +- .../core/Mage/Persistent/Helper/Session.php | 2 +- .../core/Mage/ProductAlert/Helper/Data.php | 2 +- .../core/Mage/ProductAlert/Model/Price.php | 2 +- .../core/Mage/ProductAlert/Model/Stock.php | 2 +- .../Model/Resource/Report/Product/Viewed.php | 2 +- .../Report/Product/Viewed/Collection.php | 4 +-- .../Mage/Rss/controllers/OrderController.php | 2 +- .../Rule/Model/Condition/Product/Abstract.php | 2 +- app/code/core/Mage/Sales/Model/Quote.php | 2 +- .../Sales/Model/Quote/Address/Total/Tax.php | 2 +- .../Report/Bestsellers/Collection.php | 4 +-- .../Sales/Model/Resource/Sale/Collection.php | 12 ++++---- .../core/Mage/Sendfriend/Model/Sendfriend.php | 2 +- .../Mage/Shipping/Model/Carrier/Abstract.php | 2 +- .../Model/Resource/Carrier/Tablerate.php | 4 +-- .../Tag/Model/Resource/Product/Collection.php | 6 ++-- .../Tag/Model/Resource/Tag/Collection.php | 2 +- .../Mage/Tag/Model/Resource/Tag/Relation.php | 4 +-- app/code/core/Mage/Tag/Model/Tag/Relation.php | 2 +- app/code/core/Mage/Tax/Helper/Data.php | 2 +- .../Mage/Tax/Model/Sales/Total/Quote/Tax.php | 2 +- .../Mage/Tax/view/frontend/checkout/tax.phtml | 2 +- .../Mage/Tax/view/frontend/order/tax.phtml | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Ups.php | 2 +- app/code/core/Mage/User/Model/User.php | 4 +-- .../core/Mage/Webapi/Model/ConfigAbstract.php | 2 +- .../Mage/Weee/Block/Renderer/Weee/Tax.php | 2 +- .../default/iphone/Mage_Tax/order/tax.phtml | 2 +- .../Filter/Price/AlgorithmAdvancedTest.php | 2 +- .../Layer/Filter/Price/AlgorithmBaseTest.php | 2 +- .../Entity/Eav/Customer/AddressTest.php | 2 +- .../Model/Export/Entity/Eav/CustomerTest.php | 2 +- .../Model/Import/Entity/ProductTest.php | 2 +- .../Adminhtml/ExportControllerTest.php | 2 +- .../Editor/Toolbar/HandlesHierarchyTest.php | 2 +- .../Import/Entity/Product/OptionTest.php | 2 +- downloader/Maged/Controller.php | 2 +- downloader/lib/Mage/Connect/Package.php | 2 +- .../lib/Mage/Connect/Package/Hotfix.php | 2 +- downloader/lib/Mage/System/Args.php | 2 +- lib/Mage/Connect/Package.php | 2 +- lib/Mage/Connect/Package/Hotfix.php | 2 +- lib/Mage/System/Args.php | 2 +- lib/Magento/Validator/ValidatorAbstract.php | 2 +- lib/PEAR/HTTP/HTTP.php | 8 ++--- lib/PEAR/Net/URL.php | 2 +- lib/PEAR/SOAP/Base.php | 4 +-- lib/PEAR/SOAP/Client.php | 2 +- lib/PEAR/XML/Parser.php | 24 +++++++-------- lib/PEAR/XML/Serializer.php | 2 +- lib/Varien/Convert/Container/Abstract.php | 2 +- lib/Varien/Data/Collection.php | 2 +- lib/Varien/Data/Collection/Db.php | 2 +- lib/Varien/Data/Form/Element/Abstract.php | 2 +- lib/Varien/Data/Form/Element/Gallery.php | 2 +- lib/Varien/Data/Tree.php | 2 +- lib/Varien/Db/Adapter/Mysqli.php | 4 +-- lib/Varien/Db/Adapter/Pdo/Mysql.php | 2 +- lib/Varien/Filter/Sprintf.php | 6 ++-- lib/Varien/Gdata/Gshopping/Content.php | 2 +- lib/Varien/Io/File.php | 6 ++-- lib/Varien/Object.php | 2 +- lib/Varien/Object/Cache.php | 4 +-- lib/Varien/Simplexml/Config.php | 2 +- lib/Varien/Simplexml/Element.php | 8 ++--- lib/googlecheckout/googleresponse.php | 4 +-- pub/errors/processor.php | 4 +-- 203 files changed, 338 insertions(+), 338 deletions(-) diff --git a/app/code/core/Mage/AdminNotification/Model/Inbox.php b/app/code/core/Mage/AdminNotification/Model/Inbox.php index bcbfeaa57fe3c..b562603825f25 100644 --- a/app/code/core/Mage/AdminNotification/Model/Inbox.php +++ b/app/code/core/Mage/AdminNotification/Model/Inbox.php @@ -74,7 +74,7 @@ public function getSeverities($severity = null) self::SEVERITY_NOTICE => Mage::helper('Mage_AdminNotification_Helper_Data')->__('notice'), ); - if (!is_null($severity)) { + if ($severity !== null) { if (isset($severities[$severity])) { return $severities[$severity]; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index e6a2f20f13aa1..2d2af8e15dfdb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -81,7 +81,7 @@ public function getStore() public function getRoot($parentNodeCategory=null, $recursionLevel=3) { - if (!is_null($parentNodeCategory) && $parentNodeCategory->getId()) { + if ($parentNodeCategory !== null && $parentNodeCategory->getId()) { return $this->getNode($parentNodeCategory, $recursionLevel); } $root = Mage::registry('root'); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php index ba92e02f1d645..2fe0205b176bc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Price/Group/Abstract.php @@ -200,7 +200,7 @@ public function isMultiWebsites() */ public function getWebsites() { - if (!is_null($this->_websites)) { + if ($this->_websites !== null) { return $this->_websites; } diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php index 0f177639744e5..da8345b97dfd4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php @@ -241,7 +241,7 @@ protected function _addNewCustomerFormFields($form, $fieldset) $websites = array(); foreach (Mage::app()->getWebsites(true) as $website) { - $websites[$website->getId()] = !is_null($website->getDefaultStore()); + $websites[$website->getId()] = $website->getDefaultStore() !== null; } $prefix = $form->getHtmlIdPrefix(); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php index e4ea154691b8a..b6ec1afd44ce9 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View/Sales.php @@ -72,7 +72,7 @@ public function _beforeToHtml() $this->_groupedCollection = array(); foreach ($this->_collection as $sale) { - if (!is_null($sale->getStoreId())) { + if ($sale->getStoreId() !== null) { $store = Mage::app()->getStore($sale->getStoreId()); $websiteId = $store->getWebsiteId(); $groupId = $store->getGroupId(); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php index d2a7d26390d2a..c07c4153dcc15 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit.php @@ -52,7 +52,7 @@ protected function _construct() public function getHeaderText() { - if(!is_null(Mage::registry('current_group')->getId())) { + if(Mage::registry('current_group')->getId() !== null) { return Mage::helper('Mage_Customer_Helper_Data')->__('Edit Customer Group "%s"', $this->escapeHtml(Mage::registry('current_group')->getCustomerGroupCode())); } else { return Mage::helper('Mage_Customer_Helper_Data')->__('New Customer Group'); diff --git a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php index 8dc22f2524a1f..255de01f5a9b8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Customer/Group/Edit/Form.php @@ -72,7 +72,7 @@ protected function _prepareLayout() ) ); - if (!is_null($customerGroup->getId())) { + if ($customerGroup->getId() !== null) { // If edit add id $form->addField('id', 'hidden', array( diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index 64e979bcdccf3..f8da396371599 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -532,7 +532,7 @@ protected function getHeight() */ protected function _prepareData() { - if (!is_null($this->getDataHelperName())) { + if ($this->getDataHelperName() !== null) { $availablePeriods = array_keys($this->helper('Mage_Adminhtml_Helper_Dashboard_Data')->getDatePeriods()); $period = $this->getRequest()->getParam('period'); $this->getDataHelper()->setParam('period', diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php index 58685e2110410..b998b646da95b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Window.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Window.php @@ -91,7 +91,7 @@ protected function _construct() */ public function canShow() { - if (!is_null($this->_available)) { + if ($this->_available !== null) { return $this->_available; } diff --git a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php index bae7a2998f9e8..ec8dd3f32e6b1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Coupons.php @@ -83,6 +83,6 @@ public function isHidden() protected function _isEditing() { $priceRule = Mage::registry('current_promo_quote_rule'); - return !is_null($priceRule->getRuleId()); + return $priceRule->getRuleId() !== null; } } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php index 0dec850abb1d4..04dc1228371fc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Blanknumber.php @@ -37,7 +37,7 @@ class Mage_Adminhtml_Block_Report_Grid_Column_Renderer_Blanknumber extends Mage_ protected function _getValue(Varien_Object $row) { $data = parent::_getValue($row); - if (!is_null($data)) { + if ($data !== null) { $value = $data * 1; return $value ? $value: ''; // fixed for showing blank cell in grid /** diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php index 24bcd90271e8b..07665487f7f65 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Items/Abstract.php @@ -100,7 +100,7 @@ public function addItemRender($type, $block, $template) */ public function addColumnRender($column, $block, $template, $type=null) { - if (!is_null($type)) { + if ($type !== null) { $column .= '_' . $type; } $this->_columnRenders[$column] = array( @@ -212,7 +212,7 @@ public function getColumnHtml(Varien_Object $item, $column, $field = null) if ($block) { $block->setItem($item); - if (!is_null($field)) { + if ($field !== null) { $block->setField($field); } return $block->toHtml(); @@ -465,7 +465,7 @@ public function canEditQty() /** * If parent block has set */ - if (!is_null($this->_canEditQty)) { + if ($this->_canEditQty !== null) { return $this->_canEditQty; } @@ -537,7 +537,7 @@ public function canReturnToStock() { */ public function canReturnItemToStock($item=null) { $canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT); - if (!is_null($item)) { + if ($item !== null) { if (!$item->hasCanReturnToStock()) { $product = Mage::getModel('Mage_Catalog_Model_Product')->load($item->getOrderItem()->getProductId()); if ( $product->getId() && $product->getStockItem()->getManageStock() ) { @@ -559,7 +559,7 @@ public function canReturnItemToStock($item=null) { public function canParentReturnToStock($item = null) { $canReturnToStock = Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_CAN_SUBTRACT); - if (!is_null($item)) { + if ($item !== null) { if ( $item->getCreditmemo()->getOrder()->hasCanReturnToStock() ) { $canReturnToStock = $item->getCreditmemo()->getOrder()->getCanReturnToStock(); } @@ -581,7 +581,7 @@ public function canShipPartially($order = null) $order = Mage::registry('current_shipment')->getOrder(); } $value = $order->getCanShipPartially(); - if (!is_null($value) && !$value) { + if ($value !== null && !$value) { return false; } return true; @@ -599,7 +599,7 @@ public function canShipPartiallyItem($order = null) $order = Mage::registry('current_shipment')->getOrder(); } $value = $order->getCanShipPartiallyItem(); - if (!is_null($value) && !$value) { + if ($value !== null && !$value) { return false; } return true; diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php index a359b2a8c0f03..5f1e8a49f9cd8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Form.php @@ -71,7 +71,7 @@ public function getStoreSelectorDisplay() { $storeId = $this->getStoreId(); $customerId = $this->getCustomerId(); - if (!is_null($customerId) && !$storeId) { + if ($customerId !== null && !$storeId) { return 'block'; } return 'none'; @@ -81,7 +81,7 @@ public function getDataSelectorDisplay() { $storeId = $this->getStoreId(); $customerId = $this->getCustomerId(); - if (!is_null($customerId) && $storeId) { + if ($customerId !== null && $storeId) { return 'block'; } return 'none'; @@ -90,7 +90,7 @@ public function getDataSelectorDisplay() public function getOrderDataJson() { $data = array(); - if (!is_null($this->getCustomerId())) { + if ($this->getCustomerId() !== null) { $data['customer_id'] = $this->getCustomerId(); $data['addresses'] = array(); @@ -103,7 +103,7 @@ public function getOrderDataJson() ->outputData(Mage_Customer_Model_Attribute_Data::OUTPUT_FORMAT_JSON); } } - if (!is_null($this->getStoreId())) { + if ($this->getStoreId() !== null) { $data['store_id'] = $this->getStoreId(); $currency = Mage::app()->getLocale()->currency($this->getStore()->getCurrentCurrencyCode()); $symbol = $currency->getSymbol() ? $currency->getSymbol() : $currency->getShortName(); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php index cd41790847f50..4f84ae71d7ead 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Header.php @@ -43,13 +43,13 @@ protected function _toHtml() if ($customerId && $storeId) { $out.= Mage::helper('Mage_Sales_Helper_Data')->__('Create New Order for %s in %s', $this->getCustomer()->getName(), $this->getStore()->getName()); } - elseif (!is_null($customerId) && $storeId){ + elseif ($customerId !== null && $storeId){ $out.= Mage::helper('Mage_Sales_Helper_Data')->__('Create New Order for New Customer in %s', $this->getStore()->getName()); } elseif ($customerId) { $out.= Mage::helper('Mage_Sales_Helper_Data')->__('Create New Order for %s', $this->getCustomer()->getName()); } - elseif (!is_null($customerId)){ + elseif ($customerId !== null){ $out.= Mage::helper('Mage_Sales_Helper_Data')->__('Create New Order for New Customer'); } else { diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php index f2d7a2e6f5908..02db31eafe9d8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Invoice/Create/Form.php @@ -111,7 +111,7 @@ public function hasInvoiceShipmentTypeMismatch() { public function canShipPartiallyItem() { $value = $this->getOrder()->getCanShipPartiallyItem(); - if (!is_null($value) && !$value) { + if ($value !== null && !$value) { return false; } return true; diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php index 54766946ff8f8..433dc184e4277 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rate/Grid/Renderer/Data.php @@ -40,7 +40,7 @@ protected function _getValue (Varien_Object $row) if (intval($data) == $data) { return (string) number_format($data, 2); } - if (!is_null($data)) { + if ($data !== null) { return $data * 1; } return $this->getColumn()->getDefault(); diff --git a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php index 7a502e248826b..74262f35c32a3 100644 --- a/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php @@ -438,7 +438,7 @@ public function initFromOrderItem(Mage_Sales_Model_Order_Item $orderItem, $qty = */ public function getCustomerWishlist($cacheReload = false) { - if (!is_null($this->_wishlist) && !$cacheReload) { + if ($this->_wishlist !== null && !$cacheReload) { return $this->_wishlist; } @@ -462,7 +462,7 @@ public function getCustomerWishlist($cacheReload = false) */ public function getCustomerCart() { - if (!is_null($this->_cart)) { + if ($this->_cart !== null) { return $this->_cart; } @@ -487,7 +487,7 @@ public function getCustomerCart() */ public function getCustomerCompareList() { - if (!is_null($this->_compareList)) { + if ($this->_compareList !== null) { return $this->_compareList; } diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php index 58155838a9e02..bb55448eb5a27 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/GroupController.php @@ -39,7 +39,7 @@ protected function _initGroup() Mage::register('current_group', Mage::getModel('Mage_Customer_Model_Group')); $groupId = $this->getRequest()->getParam('id'); - if (!is_null($groupId)) { + if ($groupId !== null) { Mage::registry('current_group')->load($groupId); } @@ -71,7 +71,7 @@ public function newAction() $currentGroup = Mage::registry('current_group'); - if (!is_null($currentGroup->getId())) { + if ($currentGroup->getId() !== null) { $this->_addBreadcrumb(Mage::helper('Mage_Customer_Helper_Data')->__('Edit Group'), Mage::helper('Mage_Customer_Helper_Data')->__('Edit Customer Groups')); } else { $this->_addBreadcrumb(Mage::helper('Mage_Customer_Helper_Data')->__('New Group'), Mage::helper('Mage_Customer_Helper_Data')->__('New Customer Groups')); @@ -100,7 +100,7 @@ public function saveAction() { $customerGroup = Mage::getModel('Mage_Customer_Model_Group'); $id = $this->getRequest()->getParam('id'); - if (!is_null($id)) { + if ($id !== null) { $customerGroup->load((int)$id); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php index ab140a92e76f2..9dc2a698e9dce 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/System/Config/ValidatevatController.php @@ -73,7 +73,7 @@ public function validateAdvancedAction() // ID of the store where order is placed $storeId = $this->getRequest()->getParam('store_id'); // Sanitize value if needed - if (!is_null($storeId)) { + if ($storeId !== null) { $storeId = (int)$storeId; } diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml index 483bdb1198621..4aadc60b9182c 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/create/totals/tax.phtml @@ -38,7 +38,7 @@ escapeHtml($rate['title']); ?> - + (%)
diff --git a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml index c1735a6a0c4fc..ae7a06edb5bdc 100644 --- a/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml +++ b/app/code/core/Mage/Adminhtml/view/adminhtml/sales/order/totals/tax.phtml @@ -47,7 +47,7 @@ $_fullInfo = $this->getFullTaxInfo(); - + (%)

@@ -72,7 +72,7 @@ $_fullInfo = $this->getFullTaxInfo(); ?> - + escapeHtml($info['title']); ?> (%)
escapeHtml($info['title']); ?>
diff --git a/app/code/core/Mage/Backend/Block/Store/Switcher.php b/app/code/core/Mage/Backend/Block/Store/Switcher.php index e899dc9f8cb71..8f8856ece4a51 100644 --- a/app/code/core/Mage/Backend/Block/Store/Switcher.php +++ b/app/code/core/Mage/Backend/Block/Store/Switcher.php @@ -154,7 +154,7 @@ public function getWebsiteCollection() $collection = $this->_websiteFactory->create()->getResourceCollection(); $websiteIds = $this->getWebsiteIds(); - if (!is_null($websiteIds)) { + if ($websiteIds !== null) { $collection->addIdFilter($this->getWebsiteIds()); } diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php index 9f4cd41aef4f6..207571e86a0e4 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Price.php @@ -65,7 +65,7 @@ public function getHtml() public function getDisplayCurrencySelect() { - if (!is_null($this->getColumn()->getData('display_currency_select'))) { + if ($this->getColumn()->getData('display_currency_select') !== null) { return $this->getColumn()->getData('display_currency_select'); } else { return true; @@ -74,7 +74,7 @@ public function getDisplayCurrencySelect() public function getCurrencyAffect() { - if (!is_null($this->getColumn()->getData('currency_affect'))) { + if ($this->getColumn()->getData('currency_affect') !== null) { return $this->getColumn()->getData('currency_affect'); } else { return true; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php index e476b22234b1f..3e78e41c5900d 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Select.php @@ -63,7 +63,7 @@ protected function _getOptions() */ protected function _renderOption($option, $value) { - $selected = (($option['value'] == $value && (!is_null($value))) ? ' selected="selected"' : '' ); + $selected = (($option['value'] == $value && ($value !== null)) ? ' selected="selected"' : '' ); return ''; diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php index 0114d64d0b48f..ff67779816974 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Filter/Theme.php @@ -97,7 +97,7 @@ protected function _drawOptions($options) . $this->_drawOptions($option['value']) . ''; } else { - $selected = (($option['value'] == $value && (!is_null($value))) ? ' selected="selected"' : ''); + $selected = (($option['value'] == $value && ($value !== null)) ? ' selected="selected"' : ''); $html .= ''; } } diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Number.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Number.php index 809c7bd8d878e..f84c6dfd5eda7 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Number.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Number.php @@ -45,7 +45,7 @@ class Mage_Backend_Block_Widget_Grid_Column_Renderer_Number protected function _getValue(Varien_Object $row) { $data = parent::_getValue($row); - if (!is_null($data)) { + if ($data !== null) { $value = $data * 1; $sign = (bool)(int)$this->getColumn()->getShowNumberSign() && ($value > 0) ? '+' : ''; if ($sign) { diff --git a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Select.php b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Select.php index 6a8522a6bee33..ff958572b9909 100644 --- a/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Select.php +++ b/app/code/core/Mage/Backend/Block/Widget/Grid/Column/Renderer/Select.php @@ -48,7 +48,7 @@ public function render(Varien_Object $row) $html = '