for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* A small factory to handle creation of the profile saver instance.
*
* This class only exists to handle cases where an incompatible version of pimple
* exists in the host application.
*/
class Xhgui_Saver
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.
{
* Get a saver instance based on configuration data.
* @param array $config The configuration data.
* @return Xhgui_Saver_File|Xhgui_Saver_Mongo|Xhgui_Saver_Upload
public static function factory($config)
switch ($config['save.handler']) {
case 'file':
return new Xhgui_Saver_File($config['save.handler.filename']);
case 'upload':
$timeout = 3;
if (isset($config['save.handler.upload.timeout'])) {
$timeout = $config['save.handler.upload.timeout'];
}
return new Xhgui_Saver_Upload(
$config['save.handler.upload.uri'],
$timeout
);
case 'mongodb':
default:
$mongo = new MongoClient($config['db.host'], $config['db.options']);
$collection = $mongo->{$config['db.db']}->results;
$collection->findOne();
return new Xhgui_Saver_Mongo($collection);
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.