Merge pull request #5 from gianarb/remove-empty-control-line
Fixed #4 It doesn't print line if control value is empty
This commit is contained in:
commit
6e42141c12
|
@ -33,20 +33,20 @@ class StandardFile
|
||||||
implements \ArrayAccess
|
implements \ArrayAccess
|
||||||
{
|
{
|
||||||
private $_keys = array(
|
private $_keys = array(
|
||||||
'Package' => '',
|
'Package' => false,
|
||||||
'Version' => '0.1',
|
'Version' => '0.1',
|
||||||
"Section" => "web",
|
"Section" => "web",
|
||||||
"Priority" => "optional",
|
"Priority" => "optional",
|
||||||
"Architecture" => "all",
|
"Architecture" => "all",
|
||||||
"Essential" => "no",
|
"Essential" => "no",
|
||||||
"Depends" => "",
|
"Depends" => false,
|
||||||
"Pre-Depends" => "",
|
"Pre-Depends" => false,
|
||||||
"Recommends" => "",
|
"Recommends" => false,
|
||||||
"Suggests" => "",
|
"Suggests" => false,
|
||||||
"Installed-Size" => 1024,
|
"Installed-Size" => 1024,
|
||||||
"Maintainer" => "name [email]",
|
"Maintainer" => "name [email]",
|
||||||
"Conflicts" => "",
|
"Conflicts" => false,
|
||||||
"Replaces" => "",
|
"Replaces" => false,
|
||||||
"Provides" => "your-company",
|
"Provides" => "your-company",
|
||||||
"Description" => "Your description"
|
"Description" => "Your description"
|
||||||
);
|
);
|
||||||
|
@ -183,7 +183,9 @@ class StandardFile
|
||||||
{
|
{
|
||||||
$control = '';
|
$control = '';
|
||||||
foreach ($this->_keys as $key => $value) {
|
foreach ($this->_keys as $key => $value) {
|
||||||
$control .= "{$key}: {$value}" . PHP_EOL;
|
if($value){
|
||||||
|
$control .= "{$key}: {$value}" . PHP_EOL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $control;
|
return $control;
|
||||||
|
|
Loading…
Reference in a new issue