$value) { if ($associative) { if (is_string($key)) { $arrayText .= '"' . self::escapeText($key) . '"'; } else { $arrayText .= $key; } $arrayText .= ' => '; } if (is_string($value)) { $arrayText .= '"' . self::escapeText($value) . '"'; } else { $arrayText .= $value; } if ($index < $count - 1) { $arrayText .= ', '; $index++; } } $arrayText .= ']'; return $arrayText; } /** * Get the Include Command for the given File and Namespace * * @param string $file Include File * @param string $namespace Include Namespace * @return string */ public static function getInclude($file, $namespace) { $includeText = "#Include \"{$file}\" as {$namespace}" . PHP_EOL; return $includeText; } /** * Get the Constant Command for the given Name and Value * * @param string $name Constant Name * @param string $value Constant Value * @return string */ public static function getConstant($name, $value) { if (is_string($value)) { $value = '"' . $value . '"'; } $constantText = "#Const {$name} {$value}" . PHP_EOL; return $constantText; } }