for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Basic UPS Class
*
* PHP version 5
* @category PHP
* @package PSI_UPS
* @author Michael Cramer <[email protected]>
* @copyright 2009 phpSysInfo
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @version SVN: $Id: class.ups.inc.php 661 2012-08-27 11:26:39Z namiltd $
* @link http://phpsysinfo.sourceforge.net
*/
* Basic UPS functions for all UPS classes
* @version Release: 3.0
abstract class UPS implements PSI_Interface_UPS
You can fix this by adding a namespace to your class:
namespace YourVendor; class YourClass { }
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.
{
* object for error handling
* @var Error
public $error;
* main object for ups information
* @var UPSInfo
protected $upsinfo;
* build the global Error object
public function __construct()
$this->error = PSI_Error::singleton();
$this->error
\PSI_Error::singleton()
PSI_Error::singleton()
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
class A { function getObject() { return null; } } $a = new A(); $object = $a->getObject();
The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
$this->upsinfo = new UPSInfo();
}
* build and return the ups information
* @see PSI_Interface_UPS::getUPSInfo()
* @return UPSInfo
final public function getUPSInfo()
$this->build();
return $this->upsinfo;
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.