Skip to content

Commit

Permalink
Use a common base exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 28, 2017
1 parent b3732a6 commit 15f2c21
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
13 changes: 0 additions & 13 deletions framework/Refactor/Test.php

This file was deleted.

1 change: 1 addition & 0 deletions framework/Refactor/bin/horde-refactor
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
*/

require_once 'Horde/Autoloader/Default.php';
throw new Horde\Refactor\Exception\NotFound();
Horde\Refactor\Cli::main();
27 changes: 27 additions & 0 deletions framework/Refactor/lib/Horde/Refactor/Exception.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php
/**
* Copyright 2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (BSD). If you
* did not receive this file, see http://www.horde.org/licenses/bsd.
*
* @author Jan Schneider <jan@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/bsd BSD
* @package Refactor
*/

namespace Horde\Refactor;

/**
* Exception thrown if an unexpected token was found.
*
* @author Jan Schneider <jan@horde.org>
* @category Horde
* @copyright 2017 Horde LLC
* @license http://www.horde.org/licenses/bsd BSD
* @package Refactor
*/
class Exception extends \Horde_Exception_Wrapped
{
}
3 changes: 2 additions & 1 deletion framework/Refactor/lib/Horde/Refactor/Exception/NotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

namespace Horde\Refactor\Exception;
use Horde\Refactor\Exception;
use Horde\Refactor\Translation;

/**
Expand All @@ -23,7 +24,7 @@
* @license http://www.horde.org/licenses/bsd BSD
* @package Refactor
*/
class NotFound extends \Horde_Exception_NotFound
class NotFound extends Exception
{
/**
* Constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

namespace Horde\Refactor\Exception;
use Horde\Refactor\Exception;
use Horde\Refactor\Translation;

/**
Expand All @@ -23,7 +24,7 @@
* @license http://www.horde.org/licenses/bsd BSD
* @package Refactor
*/
class UnexpectedToken extends \Horde_Exception
class UnexpectedToken extends Exception
{
/**
* Constructor.
Expand Down
8 changes: 4 additions & 4 deletions framework/Refactor/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2017-02-27</date>
<date>2017-02-28</date>
<version>
<release>1.0.0alpha1</release>
<api>1.0.0alpha1</api>
Expand Down Expand Up @@ -48,6 +48,7 @@
<file name="Php4Constructor.php" role="php" />
</dir> <!-- /lib/Horde/Refactor/Rule -->
<file name="Cli.php" role="php" />
<file name="Exception.php" role="php" />
<file name="Regexp.php" role="php" />
<file name="Rule.php" role="php" />
<file name="Tokens.php" role="php" />
Expand All @@ -65,7 +66,6 @@
</dir> <!-- /locale/de -->
<file name="Horde_Refactor.pot" role="data" />
</dir> <!-- /locale -->
<file name="Test.php" role="php" />
</dir> <!-- / -->
</contents>
<dependencies>
Expand Down Expand Up @@ -94,10 +94,10 @@
</dependencies>
<phprelease>
<filelist>
<install as="" name="Test.php" />
<install as="horde-refactor" name="bin/horde-refactor" />
<install as="Horde/Refactor/LICENSE" name="docs/Horde/Refactor/LICENSE" />
<install as="Horde/Refactor/Cli.php" name="lib/Horde/Refactor/Cli.php" />
<install as="Horde/Refactor/Exception.php" name="lib/Horde/Refactor/Exception.php" />
<install as="Horde/Refactor/Regexp.php" name="lib/Horde/Refactor/Regexp.php" />
<install as="Horde/Refactor/Rule.php" name="lib/Horde/Refactor/Rule.php" />
<install as="Horde/Refactor/Tokens.php" name="lib/Horde/Refactor/Tokens.php" />
Expand All @@ -119,7 +119,7 @@
<release>alpha</release>
<api>alpha</api>
</stability>
<date>2017-02-27</date>
<date>2017-02-28</date>
<license uri="TODO">TODO</license>
<notes>
* Initial release.
Expand Down

0 comments on commit 15f2c21

Please sign in to comment.