Fix blocking namespace issue

This commit is contained in:
ArthurHoaro 2017-03-08 19:59:00 +01:00
parent 7c26f6626a
commit e6cd773f5a
5 changed files with 24 additions and 20 deletions

View file

@ -1,5 +1,6 @@
<?php <?php
namespace Shaarli\Config;
use Shaarli\Config\Exception\PluginConfigOrderException;
/** /**
* Plugin configuration helper functions. * Plugin configuration helper functions.
@ -110,17 +111,3 @@ function load_plugin_parameter_values($plugins, $conf)
return $out; return $out;
} }
/**
* Exception used if an error occur while saving plugin configuration.
*/
class PluginConfigOrderException extends \Exception
{
/**
* Construct exception.
*/
public function __construct()
{
$this->message = 'An error occurred while trying to save plugins loading order.';
}
}

View file

@ -0,0 +1,17 @@
<?php
namespace Shaarli\Config\Exception;
/**
* Exception used if an error occur while saving plugin configuration.
*/
class PluginConfigOrderException extends \Exception
{
/**
* Construct exception.
*/
public function __construct()
{
$this->message = 'An error occurred while trying to save plugins loading order.';
}
}

View file

@ -29,7 +29,8 @@
"Shaarli\\Api\\": "application/api/", "Shaarli\\Api\\": "application/api/",
"Shaarli\\Api\\Controllers\\": "application/api/controllers", "Shaarli\\Api\\Controllers\\": "application/api/controllers",
"Shaarli\\Api\\Exceptions\\": "application/api/exceptions", "Shaarli\\Api\\Exceptions\\": "application/api/exceptions",
"Shaarli\\Config\\": "application/config/" "Shaarli\\Config\\": "application/config/",
"Shaarli\\Config\\Exception\\": "application/config/exception"
} }
} }
} }

View file

@ -62,6 +62,7 @@
require_once 'application/ApplicationUtils.php'; require_once 'application/ApplicationUtils.php';
require_once 'application/Cache.php'; require_once 'application/Cache.php';
require_once 'application/CachedPage.php'; require_once 'application/CachedPage.php';
require_once 'application/config/ConfigPlugin.php';
require_once 'application/FeedBuilder.php'; require_once 'application/FeedBuilder.php';
require_once 'application/FileUtils.php'; require_once 'application/FileUtils.php';
require_once 'application/HttpUtils.php'; require_once 'application/HttpUtils.php';

View file

@ -1,9 +1,7 @@
<?php <?php
namespace Shaarli\Config; namespace Shaarli\Config;
/** use Shaarli\Config\Exception\PluginConfigOrderException;
* Config' tests
*/
require_once 'application/config/ConfigPlugin.php'; require_once 'application/config/ConfigPlugin.php';
@ -41,7 +39,7 @@ public function testSavePluginConfigValid()
/** /**
* Test save_plugin_config with invalid data. * Test save_plugin_config with invalid data.
* *
* @expectedException Shaarli\Config\PluginConfigOrderException * @expectedException Shaarli\Config\Exception\PluginConfigOrderException
*/ */
public function testSavePluginConfigInvalid() public function testSavePluginConfigInvalid()
{ {