for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* For licensing information, please see the LICENSE file accompanied with this file.
*
* @author Gerard van Helden <[email protected]>
* @copyright 2012 Gerard van Helden <http://melp.nl>
*/
namespace Zicht\Tool\Packager\Node;
use Zicht\Tool\Script\Buffer;
* PHAR stub for a dynamic Z build
class DynamicStub extends Stub
{
* Construct the stub with the specified details
* @param \Phar $phar
* @param string $appName
* @param string $appVersion
* @param string $configFileName
public function __construct(\Phar $phar, $appName, $appVersion, $configFileName)
parent::__construct($phar, $appName, $appVersion);
$this->configFilename = $configFileName;
configFilename
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
class MyClass { } $x = new MyClass(); $x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:
class MyClass { public $foo; } $x = new MyClass(); $x->foo = true;
}
* Writes the initialization code for a dynamic build
* @param \Zicht\Tool\Script\Buffer $buffer
* @return void
protected function compileInitialization(Buffer $buffer)
$buffer->write('$app = new Zicht\Tool\Application(')
->asPhp($this->appName)
->raw(', Zicht\Version\Version::fromString(')
->asPhp($this->appVersion)
->raw(') ?: new Zicht\Version\Version(), Zicht\Tool\Configuration\ConfigurationLoader::fromEnv(')->asPhp($this->configFilename)->raw(')')
->raw(');')
->eol();
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: