Browse Source

* Implement base as an abstract class instead of an interface
* Fix errors in app class
* Fix error in router class

Nathaniel van Diepen 8 years ago
parent
commit
5d79d51e52
3 changed files with 5 additions and 5 deletions
  1. 3 3
      app.class.php
  2. 1 1
      base.class.php
  3. 1 1
      router.class.php

+ 3 - 3
app.class.php

@@ -3,13 +3,13 @@
 	require_once('router.class.php');
 	require_once('response.class.php');
 	require_once('events.class.php');
-	class App implements Base, Events {
+	class App extends Base implements Events {
 		private static $apps = array();
 		private $routers;
 		public function __construct($name){
 			$this->name = $name;
 			$this->routers = array();
-			static::$apps[] $this;
+			static::$apps[] = $this;
 		}
 		public function __destruct(){
 			$this->routers = array();
@@ -68,7 +68,7 @@
 		}
 		public function create_router($type, $path){
 			$router = new Router();
-			if(!isset($this->routers[$type]){
+			if(!isset($this->routers[$type])){
 				$this->routers[$type] = array();
 			}
 			$this->routers[$type][] = $router;

+ 1 - 1
base.interface.php → base.class.php

@@ -1,5 +1,5 @@
 <?php
-	interface Base extends JsonSerializable{
+	abstract class Base{
 		private $data;
 		public function __construct(){
 			$this->data = array();

+ 1 - 1
router.class.php

@@ -44,7 +44,7 @@
 		}
 		public function paths($paths){
 			foreach($paths as $path => $fn){
-				pthis->ath($path,$fn);
+				$this->path($path,$fn);
 			}
 		}
 		public function clear(){