Skip to content

Commit

Permalink
default error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
wjiec committed Aug 13, 2017
1 parent 7fc5d4c commit a023d8a
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 109 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# PhpStorm Directory
.idea
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
php-router
----------

**Waiting**
***Documents are being planned***
31 changes: 6 additions & 25 deletions src/Abstracts/ErrorNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,36 +28,17 @@ abstract public function errno();
abstract public function error();

/**
* definition match callback function
* main entry
*
* @param array $parameters
* @return mixed
*/
public function __construct() {
}

/**
* current request url path
*
* @return string
*/
public static function get_current_url(array $parameters) {
return $parameters['__url__'];
}

/**
* current request method
*
* @return string
*/
public function get_current_method(array $parameters) {
return $parameters['__method__'];
}

abstract function entry_point(array $parameters);

/**
* store Widget_Route parse parameters
* definition match callback function
*
* @var array
*/
protected $_router_parameters = null;
final public function __construct() {
}
}
26 changes: 4 additions & 22 deletions src/Abstracts/HookNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,14 @@ abstract class HookNode {
abstract public function hook_name();

/**
* definition match callback function
*
*/
public function __construct() {
}

/**
* current request url path
*
* @return string
* main entry pointer
*/
public static function get_current_url(array $parameters) {
return $parameters['__url__'];
}
abstract function entry_point(array $parameters);

/**
* current request method
* definition match callback function
*
* @return string
*/
public function get_current_method(array $parameters) {
return $parameters['__method__'];
final public function __construct() {
}

/**
* main entry pointer
*/
abstract function entry_point(array $parameters);
}
31 changes: 6 additions & 25 deletions src/Abstracts/RouteNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,17 @@ abstract public function methods();
abstract public function hooks();

/**
* definition match callback function
*
*/
public function __construct() {
}

/**
* current request url path
* main entry
*
* @return string
* @param array $parameters
* @return mixed
*/
public static function get_current_url(array $parameters) {
return $parameters['__url__'];
}

/**
* current request method
*
* @return string
*/
public function get_current_method(array $parameters) {
return $parameters['__method__'];
}

abstract function entry_point(array $parameters);

/**
* store Widget_Route parse parameters
* definition match callback function
*
* @var array
*/
protected $_router_parameters = null;
final public function __construct() {
}
}
Loading

0 comments on commit a023d8a

Please sign in to comment.