Aggiornato Composer
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
/*
|
||||
* This file is part of PharIo\Manifest.
|
||||
*
|
||||
* (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
|
||||
* Copyright (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> and contributors
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*
|
||||
*/
|
||||
namespace PharIo\Manifest;
|
||||
|
||||
@@ -13,6 +14,9 @@ use PharIo\Version\AnyVersionConstraint;
|
||||
use PharIo\Version\Version;
|
||||
use PharIo\Version\VersionConstraint;
|
||||
use XMLWriter;
|
||||
use function count;
|
||||
use function file_put_contents;
|
||||
use function str_repeat;
|
||||
|
||||
/** @psalm-suppress MissingConstructor */
|
||||
class ManifestSerializer {
|
||||
@@ -20,7 +24,7 @@ class ManifestSerializer {
|
||||
private $xmlWriter;
|
||||
|
||||
public function serializeToFile(Manifest $manifest, string $filename): void {
|
||||
\file_put_contents(
|
||||
file_put_contents(
|
||||
$filename,
|
||||
$this->serializeToString($manifest)
|
||||
);
|
||||
@@ -41,7 +45,7 @@ class ManifestSerializer {
|
||||
$xmlWriter = new XMLWriter();
|
||||
$xmlWriter->openMemory();
|
||||
$xmlWriter->setIndent(true);
|
||||
$xmlWriter->setIndentString(\str_repeat(' ', 4));
|
||||
$xmlWriter->setIndentString(str_repeat(' ', 4));
|
||||
$xmlWriter->startDocument('1.0', 'UTF-8');
|
||||
$xmlWriter->startElement('phar');
|
||||
$xmlWriter->writeAttribute('xmlns', 'https://phar.io/xml/manifest/1.0');
|
||||
@@ -144,7 +148,7 @@ class ManifestSerializer {
|
||||
}
|
||||
|
||||
private function addBundles(BundledComponentCollection $bundledComponentCollection): void {
|
||||
if (\count($bundledComponentCollection) === 0) {
|
||||
if (count($bundledComponentCollection) === 0) {
|
||||
return;
|
||||
}
|
||||
$this->xmlWriter->startElement('bundles');
|
||||
|
||||
Reference in New Issue
Block a user