Skip to content

Commit

Permalink
Fix blocking namespace issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHoaro committed Mar 8, 2017
1 parent 7c26f66 commit e6cd773
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
17 changes: 2 additions & 15 deletions application/config/ConfigPlugin.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php
namespace Shaarli\Config;

use Shaarli\Config\Exception\PluginConfigOrderException;

/**
* Plugin configuration helper functions.
Expand Down Expand Up @@ -110,17 +111,3 @@ function load_plugin_parameter_values($plugins, $conf)

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.';
}
}
17 changes: 17 additions & 0 deletions application/config/exception/PluginConfigOrderException.php
Original file line number Diff line number Diff line change
@@ -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.';
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"Shaarli\\Api\\": "application/api/",
"Shaarli\\Api\\Controllers\\": "application/api/controllers",
"Shaarli\\Api\\Exceptions\\": "application/api/exceptions",
"Shaarli\\Config\\": "application/config/"
"Shaarli\\Config\\": "application/config/",
"Shaarli\\Config\\Exception\\": "application/config/exception"
}
}
}
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
require_once 'application/ApplicationUtils.php';
require_once 'application/Cache.php';
require_once 'application/CachedPage.php';
require_once 'application/config/ConfigPlugin.php';
require_once 'application/FeedBuilder.php';
require_once 'application/FileUtils.php';
require_once 'application/HttpUtils.php';
Expand Down
6 changes: 2 additions & 4 deletions tests/config/ConfigPluginTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
namespace Shaarli\Config;

/**
* Config' tests
*/
use Shaarli\Config\Exception\PluginConfigOrderException;

require_once 'application/config/ConfigPlugin.php';

Expand Down Expand Up @@ -41,7 +39,7 @@ public function testSavePluginConfigValid()
/**
* Test save_plugin_config with invalid data.
*
* @expectedException Shaarli\Config\PluginConfigOrderException
* @expectedException Shaarli\Config\Exception\PluginConfigOrderException
*/
public function testSavePluginConfigInvalid()
{
Expand Down

0 comments on commit e6cd773

Please sign in to comment.