Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Store/StoreAdReferrerAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
*
* @copyright 2009-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
*/
class StoreAdReferrerAggregator extends SiteCommandLineApplication
{
/**
* A convenience reference to the database object.
*
* @var MDB2_Driver
* @var MDB2_Driver_Common
*/
public $db;

Expand Down
12 changes: 12 additions & 0 deletions Store/StoreApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
*
* @copyright 2005-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property SiteDatabaseModule $database
* @property SiteAccountSessionModule $session
* @property SiteCookieModule $cookie
* @property StoreCartModule $cart
* @property StoreCheckoutModule $checkout
* @property SiteMessagesModule $messages
* @property SiteConfigModule $config
* @property SiteAdModule $ads
* @property SiteAnalyticsModule $analytics
* @property SiteTimerModule $timer
* @property SiteCryptModule $crypt
*/
abstract class StoreApplication extends SiteWebApplication
{
Expand Down
5 changes: 5 additions & 0 deletions Store/StoreCacheTableUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
*
* @copyright 2006-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
*/
class StoreCacheTableUpdater extends SiteCommandLineApplication
{
public MDB2_Driver_Common $db;
Copy link
Contributor

Choose a reason for hiding this comment

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

Above, we set the type with a docblock comment. The worry I have with explicitly typing the property would be that we run into the "access before setting" issue ... in which case it needs to be nullable (and then we need to do null checks throughout the code).

Any concerns on your end?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had that concern as well. I did test the cache table updater and it runs correctly. I think if we ever had a access before setting issue in the code, we'd also have a null-dereference issue as none of the code checks for null on this property.


public function run()
{
$this->initModules();
Expand Down
6 changes: 6 additions & 0 deletions Store/StoreCartCleaner.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@
*
* @copyright 2005-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
* @property SiteSessionModule $session
*/
class StoreCartCleaner extends SiteCommandLineApplication
{
public MDB2_Driver_Common $db;

public function init()
{
$this->initModules();
Expand Down
5 changes: 4 additions & 1 deletion Store/StoreOrderCommentDigestMailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
* Sends out a digest email of new order comments.
*
* @copyright 2012-2016 silverorange
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
*/
class StoreOrderCommentDigestMailer extends SiteCommandLineApplication
{
/**
* A convenience reference to the database object.
*
* @var MDB2_Driver
* @var MDB2_Driver_Common
*/
public $db;

Expand Down
2 changes: 2 additions & 0 deletions Store/StorePrivateDataDeleterApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*
* @copyright 2006-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property StoreCommandLineConfigModule $config
*/
class StorePrivateDataDeleterApplication extends SitePrivateDataDeleterApplication
{
Expand Down
3 changes: 3 additions & 0 deletions Store/StoreProductAttributeBindingQueueUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*
* @copyright 2010-2016 silverorange
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
*/
class StoreProductAttributeBindingQueueUpdater extends SiteCommandLineApplication
{
Expand Down
5 changes: 5 additions & 0 deletions Store/StoreProductFileFtpUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@
* @license http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
*
* @todo Figure out when setPath() is used, it may be a dead code path.
*
* @property StoreCommandLineConfigModule $config
* @property SiteDatabaseModule $database
*/
abstract class StoreProductFileFtpUploader extends SiteCommandLineApplication
{
public MDB2_Driver_Common $db;

private $path = '';
private $upload = true;
private $display = false;
Expand Down
4 changes: 2 additions & 2 deletions Store/admin/components/Product/Details.php
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,8 @@ private function buildItemGroups()

$first_group = $groups->getFirst();
if (
$first_group === null ||
(count($groups) === 1 && $first_group->item_group === 0)
$first_group === null
|| (count($groups) === 1 && $first_group->item_group === 0)
) {
$num_groups = 0;
} elseif ($first_group->item_group === 0) {
Expand Down
Loading