I am getting the following error and I can't seem to figure out why or how it's getting triggered.
Fatal error: Cannot access empty property in /home/content/p/l/a/plai1870/html/com/php/Bone/Compiler.php on line 18
Line 18 is
throw new LogicException($this->$compilers[$language]." is not a supported compiler.");
Here is Compiler.php
<?php
namespace Bone;
use LogicException;
class Compiler implements \Bone\Interfaces\Compiler {
protected $compiler;
protected $compilers = array(
"php" => "PHP",
"as3" => "ActionScript3",
"javascript" => "Javascript"
);
public function __construct($language) {
$language = strtolower($language);
if (!isset($this->$compilers[$language])) {
throw new LogicException($this->$compilers[$language]." is not a supported compiler.");
}
$compiler = "\Bone\Compilers\\".$this->$compilers[$language]."\Compiler";
$this->compiler = new $compiler();
}
public function buildDefinition($object, $path = null) {
return $this->compiler()->buildInterface($object, $path);
}
public function buildObject($object, $path = null) {
return $this->compiler->buildObject($object, $path);
}
public function parameters($method) {
return;
}
public function save($data, $path) {
return;
}
}
?>
EDIT And I'm calling it with:
$compiler = new \Bone\Compiler("php");
$this->$compilers--->$this->compilers- remove the$after->.