fml update (1.2 final)

This commit is contained in:
Steffen Schröder
2014-05-20 15:44:45 +02:00
parent 63981d8002
commit 0fc03e1d08
77 changed files with 166 additions and 152 deletions

View File

@ -5,7 +5,7 @@ namespace FML\Script;
/**
* Builder Class offering Methods to build ManiaScript
*
* @author steeffeen
* @author steeffeen <mail@steeffeen.com>
* @copyright FancyManiaLinks Copyright © 2014 Steffen Schröder
* @license http://www.gnu.org/licenses/ GNU General Public License, Version 3
*/
@ -111,11 +111,18 @@ abstract class Builder {
* Get the Include Command for the given File and Namespace
*
* @param string $file Include File
* @param string $namespace Include Namespace
* @param string $namespace (optional) Include Namespace
* @return string
*/
public static function getInclude($file, $namespace) {
$includeText = "#Include \"{$file}\" as {$namespace}" . PHP_EOL;
public static function getInclude($file, $namespace = null) {
if (!$namespace && stripos($file, '.') === false) {
$namespace = $file;
}
$includeText = "#Include \"{$file}\"";
if ($namespace) {
$includeText .= " as {$namespace}";
}
$includeText .= PHP_EOL;
return $includeText;
}