or
$styles['width'] = (int) $val * 50;
$styles['unit'] = \PhpOffice\PhpWord\SimpleType\TblWidth::PERCENT;
} else {
// e.g. , where "2" = 2px (always pixels)
- $val = (int) $val . 'px';
- $styles['cellSpacing'] = Converter::cssToTwip($val);
+ $styles['cellSpacing'] = Converter::pixelToTwip(self::convertHtmlSize($val));
break;
case 'bgcolor':
@@ -185,7 +188,7 @@ class Html
* Parse a node and add a corresponding element to the parent element.
*
* @param DOMNode $node node to parse
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element object to add an element corresponding with the node
+ * @param AbstractContainer $element object to add an element corresponding with the node
* @param array $styles Array with all styles
* @param array $data Array to transport data to a next level in the DOM tree, for example level of listitems
*/
@@ -208,16 +211,16 @@ class Html
// Node mapping table
$nodes = [
- // $method $node $element $styles $data $argument1 $argument2
- 'p' => ['Paragraph', $node, $element, $styles, null, null, null],
- 'h1' => ['Heading', null, $element, $styles, null, 'Heading1', null],
- 'h2' => ['Heading', null, $element, $styles, null, 'Heading2', null],
- 'h3' => ['Heading', null, $element, $styles, null, 'Heading3', null],
- 'h4' => ['Heading', null, $element, $styles, null, 'Heading4', null],
- 'h5' => ['Heading', null, $element, $styles, null, 'Heading5', null],
- 'h6' => ['Heading', null, $element, $styles, null, 'Heading6', null],
- '#text' => ['Text', $node, $element, $styles, null, null, null],
- 'strong' => ['Property', null, null, $styles, null, 'bold', true],
+ // $method $node $element $styles $data $argument1 $argument2
+ 'p' => ['Paragraph', $node, $element, $styles, null, null, null],
+ 'h1' => ['Heading', $node, $element, $styles, null, 'Heading1', null],
+ 'h2' => ['Heading', $node, $element, $styles, null, 'Heading2', null],
+ 'h3' => ['Heading', $node, $element, $styles, null, 'Heading3', null],
+ 'h4' => ['Heading', $node, $element, $styles, null, 'Heading4', null],
+ 'h5' => ['Heading', $node, $element, $styles, null, 'Heading5', null],
+ 'h6' => ['Heading', $node, $element, $styles, null, 'Heading6', null],
+ '#text' => ['Text', $node, $element, $styles, null, null, null],
+ 'strong' => ['Property', null, null, $styles, null, 'bold', true],
'b' => ['Property', null, null, $styles, null, 'bold', true],
'em' => ['Property', null, null, $styles, null, 'italic', true],
'i' => ['Property', null, null, $styles, null, 'italic', true],
@@ -238,6 +241,7 @@ class Html
'a' => ['Link', $node, $element, $styles, null, null, null],
'input' => ['Input', $node, $element, $styles, null, null, null],
'hr' => ['HorizRule', $node, $element, $styles, null, null, null],
+ 'ruby' => ['Ruby', $node, $element, $styles, null, null, null],
];
$newElement = null;
@@ -276,7 +280,7 @@ class Html
* Parse child nodes.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer|Row|Table $element
+ * @param AbstractContainer|Row|Table $element
* @param array $styles
* @param array $data
*/
@@ -298,10 +302,10 @@ class Html
* Parse paragraph node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
*
- * @return \PhpOffice\PhpWord\Element\PageBreak|\PhpOffice\PhpWord\Element\TextRun
+ * @return \PhpOffice\PhpWord\Element\PageBreak|TextRun
*/
protected static function parseParagraph($node, $element, &$styles)
{
@@ -317,7 +321,7 @@ class Html
* Parse input node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
*/
protected static function parseInput($node, $element, &$styles): void
@@ -341,28 +345,25 @@ class Html
/**
* Parse heading node.
*
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
- * @param array &$styles
* @param string $argument1 Name of heading style
*
- * @return \PhpOffice\PhpWord\Element\TextRun
- *
* @todo Think of a clever way of defining header styles, now it is only based on the assumption, that
* Heading1 - Heading6 are already defined somewhere
*/
- protected static function parseHeading($element, &$styles, $argument1)
+ protected static function parseHeading(DOMNode $node, AbstractContainer $element, array &$styles, string $argument1): TextRun
{
- $styles['paragraph'] = $argument1;
- $newElement = $element->addTextRun($styles['paragraph']);
+ $style = new Paragraph();
+ $style->setStyleName($argument1);
+ $style->setStyleByArray(self::parseInlineStyle($node, $styles['paragraph']));
- return $newElement;
+ return $element->addTextRun($style);
}
/**
* Parse text node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
*/
protected static function parseText($node, $element, &$styles): void
@@ -406,7 +407,7 @@ class Html
* Parse table node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
*
* @return Table $element
@@ -437,7 +438,7 @@ class Html
* Parse a table row.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\Table $element
+ * @param Table $element
* @param array &$styles
*
* @return Row $element
@@ -460,10 +461,10 @@ class Html
* Parse table cell.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\Table $element
+ * @param Table $element
* @param array &$styles
*
- * @return \PhpOffice\PhpWord\Element\Cell|\PhpOffice\PhpWord\Element\TextRun $element
+ * @return \PhpOffice\PhpWord\Element\Cell|TextRun $element
*/
protected static function parseCell($node, $element, &$styles)
{
@@ -554,7 +555,7 @@ class Html
* Parse list node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
* @param array &$data
*/
@@ -627,15 +628,15 @@ class Html
return [
'type' => 'hybridMultilevel',
'levels' => [
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 720, 'left' => 720, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => 'o', 'alignment' => 'left', 'tabPos' => 1440, 'left' => 1440, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 2160, 'left' => 2160, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 2880, 'left' => 2880, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => 'o', 'alignment' => 'left', 'tabPos' => 3600, 'left' => 3600, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 4320, 'left' => 4320, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 5040, 'left' => 5040, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => 'o', 'alignment' => 'left', 'tabPos' => 5760, 'left' => 5760, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
- ['format' => NumberFormat::BULLET, 'text' => '', 'alignment' => 'left', 'tabPos' => 6480, 'left' => 6480, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 720, 'left' => 720, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '◦', 'alignment' => 'left', 'tabPos' => 1440, 'left' => 1440, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 2160, 'left' => 2160, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 2880, 'left' => 2880, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '◦', 'alignment' => 'left', 'tabPos' => 3600, 'left' => 3600, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 4320, 'left' => 4320, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 5040, 'left' => 5040, 'hanging' => 360, 'font' => 'Symbol', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '◦', 'alignment' => 'left', 'tabPos' => 5760, 'left' => 5760, 'hanging' => 360, 'font' => 'Courier New', 'hint' => 'default'],
+ ['format' => NumberFormat::BULLET, 'text' => '•', 'alignment' => 'left', 'tabPos' => 6480, 'left' => 6480, 'hanging' => 360, 'font' => 'Wingdings', 'hint' => 'default'],
],
];
}
@@ -644,7 +645,7 @@ class Html
* Parse list item node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array &$styles
* @param array $data
*
@@ -704,6 +705,10 @@ class Html
case 'text-align':
$styles['alignment'] = self::mapAlign($value, $bidi);
+ break;
+ case 'ruby-align':
+ $styles['rubyAlignment'] = self::mapRubyAlign($value);
+
break;
case 'display':
$styles['hidden'] = $value === 'none' || $value === 'hidden';
@@ -733,7 +738,7 @@ class Html
break;
case 'line-height':
$matches = [];
- if ($value === 'normal') {
+ if ($value === 'normal' || $value === 'inherit') {
$spacingLineRule = \PhpOffice\PhpWord\SimpleType\LineSpacingRule::AUTO;
$spacing = 0;
} elseif (preg_match('/([0-9]+\.?[0-9]*[a-z]+)/', $value, $matches)) {
@@ -803,6 +808,58 @@ class Html
$styles['spaceAfter'] = Converter::cssToTwip($value);
break;
+
+ case 'padding':
+ $valueTop = $valueRight = $valueBottom = $valueLeft = null;
+ $cValue = preg_replace('# +#', ' ', trim($value));
+ $paddingArr = explode(' ', $cValue);
+ $countParams = count($paddingArr);
+ if ($countParams == 1) {
+ $valueTop = $valueRight = $valueBottom = $valueLeft = $paddingArr[0];
+ } elseif ($countParams == 2) {
+ $valueTop = $valueBottom = $paddingArr[0];
+ $valueRight = $valueLeft = $paddingArr[1];
+ } elseif ($countParams == 3) {
+ $valueTop = $paddingArr[0];
+ $valueRight = $valueLeft = $paddingArr[1];
+ $valueBottom = $paddingArr[2];
+ } elseif ($countParams == 4) {
+ $valueTop = $paddingArr[0];
+ $valueRight = $paddingArr[1];
+ $valueBottom = $paddingArr[2];
+ $valueLeft = $paddingArr[3];
+ }
+ if ($valueTop !== null) {
+ $styles['paddingTop'] = Converter::cssToTwip($valueTop);
+ }
+ if ($valueRight !== null) {
+ $styles['paddingRight'] = Converter::cssToTwip($valueRight);
+ }
+ if ($valueBottom !== null) {
+ $styles['paddingBottom'] = Converter::cssToTwip($valueBottom);
+ }
+ if ($valueLeft !== null) {
+ $styles['paddingLeft'] = Converter::cssToTwip($valueLeft);
+ }
+
+ break;
+ case 'padding-top':
+ $styles['paddingTop'] = Converter::cssToTwip($value);
+
+ break;
+ case 'padding-right':
+ $styles['paddingRight'] = Converter::cssToTwip($value);
+
+ break;
+ case 'padding-bottom':
+ $styles['paddingBottom'] = Converter::cssToTwip($value);
+
+ break;
+ case 'padding-left':
+ $styles['paddingLeft'] = Converter::cssToTwip($value);
+
+ break;
+
case 'border-color':
self::mapBorderColor($styles, $value);
@@ -886,7 +943,7 @@ class Html
* Parse image node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
*
* @return \PhpOffice\PhpWord\Element\Image
*/
@@ -901,36 +958,12 @@ class Html
break;
case 'width':
- $width = $attribute->value;
-
- // pt
- if (false !== strpos($width, 'pt')) {
- $width = Converter::pointToPixel((float) str_replace('pt', '', $width));
- }
-
- // px
- if (false !== strpos($width, 'px')) {
- $width = str_replace('px', '', $width);
- }
-
- $style['width'] = $width;
+ $style['width'] = self::convertHtmlSize($attribute->value);
$style['unit'] = \PhpOffice\PhpWord\Style\Image::UNIT_PX;
break;
case 'height':
- $height = $attribute->value;
-
- // pt
- if (false !== strpos($height, 'pt')) {
- $height = Converter::pointToPixel((float) str_replace('pt', '', $height));
- }
-
- // px
- if (false !== strpos($height, 'px')) {
- $height = str_replace('px', '', $height);
- }
-
- $style['height'] = $height;
+ $style['height'] = self::convertHtmlSize($attribute->value);
$style['unit'] = \PhpOffice\PhpWord\Style\Image::UNIT_PX;
break;
@@ -970,14 +1003,15 @@ class Html
$match = [];
preg_match('/data:image\/(\w+);base64,(.+)/', $src, $match);
+ if (!empty($match)) {
+ $src = $imgFile = $tmpDir . uniqid() . '.' . $match[1];
- $src = $imgFile = $tmpDir . uniqid() . '.' . $match[1];
+ $ifp = fopen($imgFile, 'wb');
- $ifp = fopen($imgFile, 'wb');
-
- if ($ifp !== false) {
- fwrite($ifp, base64_decode($match[2]));
- fclose($ifp);
+ if ($ifp !== false) {
+ fwrite($ifp, base64_decode($match[2]));
+ fclose($ifp);
+ }
}
}
$src = urldecode($src);
@@ -1073,6 +1107,23 @@ class Html
}
}
+ /**
+ * Transforms a HTML/CSS ruby alignment into a \PhpOffice\PhpWord\SimpleType\Jc.
+ */
+ protected static function mapRubyAlign(string $cssRubyAlignment): string
+ {
+ switch ($cssRubyAlignment) {
+ case 'center':
+ return RubyProperties::ALIGNMENT_CENTER;
+ case 'start':
+ return RubyProperties::ALIGNMENT_LEFT;
+ case 'space-between':
+ return RubyProperties::ALIGNMENT_DISTRIBUTE_SPACE;
+ default:
+ return '';
+ }
+ }
+
/**
* Transforms a HTML/CSS vertical alignment.
*
@@ -1129,7 +1180,7 @@ class Html
/**
* Parse line break.
*
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
*/
protected static function parseLineBreak($element): void
{
@@ -1140,7 +1191,7 @@ class Html
* Parse link node.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
* @param array $styles
*/
protected static function parseLink($node, $element, &$styles)
@@ -1172,7 +1223,7 @@ class Html
* Note: Word rule is not the same as HTML's since it does not support width and thus neither alignment.
*
* @param DOMNode $node
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
+ * @param AbstractContainer $element
*/
protected static function parseHorizRule($node, $element): void
{
@@ -1201,6 +1252,59 @@ class Html
// - repeated text, e.g. underline "_", because of unpredictable line wrapping
}
+ /**
+ * Parse ruby node.
+ *
+ * @param DOMNode $node
+ * @param AbstractContainer $element
+ * @param array $styles
+ */
+ protected static function parseRuby($node, $element, &$styles)
+ {
+ $rubyProperties = new RubyProperties();
+ $baseTextRun = new TextRun($styles['paragraph']);
+ $rubyTextRun = new TextRun(null);
+ if ($node->hasAttributes()) {
+ $langAttr = $node->attributes->getNamedItem('lang');
+ if ($langAttr !== null) {
+ $rubyProperties->setLanguageId($langAttr->textContent);
+ }
+ $styleAttr = $node->attributes->getNamedItem('style');
+ if ($styleAttr !== null) {
+ $styles = self::parseStyle($styleAttr, $styles['paragraph']);
+ if (isset($styles['rubyAlignment']) && $styles['rubyAlignment'] !== '') {
+ $rubyProperties->setAlignment($styles['rubyAlignment']);
+ }
+ if (isset($styles['size']) && $styles['size'] !== '') {
+ $rubyProperties->setFontSizeForBaseText($styles['size']);
+ }
+ $baseTextRun->setParagraphStyle($styles);
+ }
+ }
+ foreach ($node->childNodes as $child) {
+ if ($child->nodeName === '#text') {
+ $content = trim($child->textContent);
+ if ($content !== '') {
+ $baseTextRun->addText($content);
+ }
+ } elseif ($child->nodeName === 'rt') {
+ $rubyTextRun->addText(trim($child->textContent));
+ if ($child->hasAttributes()) {
+ $styleAttr = $child->attributes->getNamedItem('style');
+ if ($styleAttr !== null) {
+ $styles = self::parseStyle($styleAttr, []);
+ if (isset($styles['size']) && $styles['size'] !== '') {
+ $rubyProperties->setFontFaceSize($styles['size']);
+ }
+ $rubyTextRun->setParagraphStyle($styles);
+ }
+ }
+ }
+ }
+
+ return $element->addRuby($baseTextRun, $rubyTextRun, $rubyProperties);
+ }
+
private static function convertRgb(string $rgb): string
{
if (preg_match(self::RGB_REGEXP, $rgb, $matches) === 1) {
@@ -1209,4 +1313,22 @@ class Html
return trim($rgb, '# ');
}
+
+ /**
+ * Transform HTML sizes (pt, px) in pixels.
+ */
+ protected static function convertHtmlSize(string $size): float
+ {
+ // pt
+ if (false !== strpos($size, 'pt')) {
+ return Converter::pointToPixel((float) str_replace('pt', '', $size));
+ }
+
+ // px
+ if (false !== strpos($size, 'px')) {
+ return (float) str_replace('px', '', $size);
+ }
+
+ return (float) $size;
+ }
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Shared/Microsoft/PasswordEncoder.php b/vendor/phpoffice/phpword/src/PhpWord/Shared/Microsoft/PasswordEncoder.php
index d6cf69fc..4762cc71 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Shared/Microsoft/PasswordEncoder.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Shared/Microsoft/PasswordEncoder.php
@@ -1,4 +1,5 @@
tempDir . DIRECTORY_SEPARATOR . $filenameParts['basename'], 'wb');
- fwrite($handle, $contents);
- fclose($handle);
+ if ($handle) {
+ fwrite($handle, $contents);
+ fclose($handle);
+ }
// Add temp file to zip
$filename = $this->tempDir . DIRECTORY_SEPARATOR . $filenameParts['basename'];
@@ -420,4 +423,15 @@ class ZipArchive
return ($listIndex > -1) ? $listIndex : false;
}
+
+ /**
+ * Add an empty directory to the zip archive (emulate \ZipArchive).
+ *
+ * @param string $dirname Directory name to add to the zip archive
+ */
+ public function addEmptyDir(string $dirname): bool
+ {
+ // Create a directory entry by adding an empty file with trailing slash
+ return $this->addFromString(rtrim($dirname, '/') . '/', '');
+ }
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/SimpleType/Border.php b/vendor/phpoffice/phpword/src/PhpWord/SimpleType/Border.php
index 6cb42f04..acd1c1a1 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/SimpleType/Border.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/SimpleType/Border.php
@@ -1,4 +1,5 @@
vAlign = null;
+
+ return $this;
+ }
+
VerticalJc::validate($value);
$this->vAlign = $this->setEnumVal($value, VerticalJc::values(), $this->vAlign);
@@ -235,7 +262,7 @@ class Cell extends Border
/**
* Get vertical merge (rowspan).
*
- * @return string
+ * @return null|string
*/
public function getVMerge()
{
@@ -245,12 +272,18 @@ class Cell extends Border
/**
* Set vertical merge (rowspan).
*
- * @param string $value
+ * @param null|string $value
*
* @return self
*/
public function setVMerge($value = null)
{
+ if ($value === null) {
+ $this->vMerge = null;
+
+ return $this;
+ }
+
$enum = [self::VMERGE_RESTART, self::VMERGE_CONTINUE];
$this->vMerge = $this->setEnumVal($value, $enum, $this->vMerge);
@@ -260,7 +293,7 @@ class Cell extends Border
/**
* Get shading.
*
- * @return \PhpOffice\PhpWord\Style\Shading
+ * @return Shading
*/
public function getShading()
{
@@ -344,4 +377,84 @@ class Cell extends Border
{
return $this->noWrap;
}
+
+ /**
+ * Get style padding-top.
+ */
+ public function getPaddingTop(): ?int
+ {
+ return $this->paddingTop;
+ }
+
+ /**
+ * Set style padding-top.
+ *
+ * @return $this
+ */
+ public function setPaddingTop(int $value): self
+ {
+ $this->paddingTop = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get style padding-bottom.
+ */
+ public function getPaddingBottom(): ?int
+ {
+ return $this->paddingBottom;
+ }
+
+ /**
+ * Set style padding-bottom.
+ *
+ * @return $this
+ */
+ public function setPaddingBottom(int $value): self
+ {
+ $this->paddingBottom = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get style padding-left.
+ */
+ public function getPaddingLeft(): ?int
+ {
+ return $this->paddingLeft;
+ }
+
+ /**
+ * Set style padding-left.
+ *
+ * @return $this
+ */
+ public function setPaddingLeft(int $value): self
+ {
+ $this->paddingLeft = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get style padding-right.
+ */
+ public function getPaddingRight(): ?int
+ {
+ return $this->paddingRight;
+ }
+
+ /**
+ * Set style padding-right.
+ *
+ * @return $this
+ */
+ public function setPaddingRight(int $value): self
+ {
+ $this->paddingRight = $value;
+
+ return $this;
+ }
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Style/Chart.php b/vendor/phpoffice/phpword/src/PhpWord/Style/Chart.php
index 9dbc8db0..6cffc4d5 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Style/Chart.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Style/Chart.php
@@ -1,4 +1,5 @@
color;
}
@@ -682,7 +681,7 @@ class Font extends AbstractStyle
*
* @param string $value
*
- * @return \PhpOffice\PhpWord\Style\Table
+ * @return Table
*/
public function setBgColor($value = null)
{
@@ -812,7 +811,7 @@ class Font extends AbstractStyle
/**
* Get paragraph style.
*
- * @return \PhpOffice\PhpWord\Style\Paragraph
+ * @return Paragraph
*/
public function getParagraph()
{
@@ -860,7 +859,7 @@ class Font extends AbstractStyle
/**
* Get shading.
*
- * @return \PhpOffice\PhpWord\Style\Shading
+ * @return Shading
*/
public function getShading()
{
@@ -884,7 +883,7 @@ class Font extends AbstractStyle
/**
* Get language.
*
- * @return null|\PhpOffice\PhpWord\Style\Language
+ * @return null|Language
*/
public function getLang()
{
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Style/Frame.php b/vendor/phpoffice/phpword/src/PhpWord/Style/Frame.php
index 45fc583e..016722f3 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Style/Frame.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Style/Frame.php
@@ -1,4 +1,5 @@
left;
}
/**
* Set left.
- *
- * @param float|int $value
- *
- * @return self
*/
- public function setLeft($value)
+ public function setLeft(?float $value): self
{
- $this->left = $this->setNumericVal($value, $this->left);
+ $this->left = $this->setNumericVal($value);
return $this;
}
/**
* Get right.
- *
- * @return float|int
*/
- public function getRight()
+ public function getRight(): ?float
{
return $this->right;
}
/**
* Set right.
- *
- * @param float|int $value
- *
- * @return self
*/
- public function setRight($value)
+ public function setRight(?float $value): self
{
- $this->right = $this->setNumericVal($value, $this->right);
+ $this->right = $this->setNumericVal($value);
return $this;
}
/**
* Get first line.
- *
- * @return float|int
*/
- public function getFirstLine()
+ public function getFirstLine(): ?float
{
return $this->firstLine;
}
/**
* Set first line.
- *
- * @param float|int $value
- *
- * @return self
*/
- public function setFirstLine($value)
+ public function setFirstLine(?float $value): self
{
- $this->firstLine = $this->setNumericVal($value, $this->firstLine);
+ $this->firstLine = $this->setNumericVal($value);
+
+ return $this;
+ }
+
+ /**
+ * Get first line chars.
+ */
+ public function getFirstLineChars(): int
+ {
+ return $this->firstLineChars;
+ }
+
+ /**
+ * Set first line chars.
+ */
+ public function setFirstLineChars(int $value): self
+ {
+ $this->firstLineChars = $this->setIntVal($value, $this->firstLineChars);
return $this;
}
/**
* Get hanging.
- *
- * @return float|int
*/
- public function getHanging()
+ public function getHanging(): ?float
{
return $this->hanging;
}
/**
* Set hanging.
- *
- * @param float|int $value
- *
- * @return self
*/
- public function setHanging($value = null)
+ public function setHanging(?float $value = null): self
{
- $this->hanging = $this->setNumericVal($value, $this->hanging);
+ $this->hanging = $this->setNumericVal($value);
return $this;
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Style/Language.php b/vendor/phpoffice/phpword/src/PhpWord/Style/Language.php
index 18e7f76e..54e43765 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Style/Language.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Style/Language.php
@@ -1,4 +1,5 @@
numId;
}
/**
* Set Id.
- *
- * @param int $value
- *
- * @return self
*/
- public function setNumId($value)
+ public function setNumId(int $value): self
{
$this->numId = $this->setIntVal($value, $this->numId);
@@ -78,22 +73,16 @@ class Numbering extends AbstractStyle
/**
* Get multilevel type.
- *
- * @return string
*/
- public function getType()
+ public function getType(): ?string
{
return $this->type;
}
/**
* Set multilevel type.
- *
- * @param string $value
- *
- * @return self
*/
- public function setType($value)
+ public function setType(string $value): self
{
$enum = ['singleLevel', 'multilevel', 'hybridMultilevel'];
$this->type = $this->setEnumVal($value, $enum, $this->type);
@@ -106,19 +95,15 @@ class Numbering extends AbstractStyle
*
* @return NumberingLevel[]
*/
- public function getLevels()
+ public function getLevels(): array
{
return $this->levels;
}
/**
* Set multilevel type.
- *
- * @param array $values
- *
- * @return self
*/
- public function setLevels($values)
+ public function setLevels(array $values): self
{
if (is_array($values)) {
foreach ($values as $key => $value) {
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Style/NumberingLevel.php b/vendor/phpoffice/phpword/src/PhpWord/Style/NumberingLevel.php
index 39c0d839..31ec3738 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Style/NumberingLevel.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Style/NumberingLevel.php
@@ -1,4 +1,5 @@
getChildStyleValue($this->indentation, 'hanging');
+ }
+
/**
* Get indentation.
*
- * @return null|\PhpOffice\PhpWord\Style\Indentation
+ * @deprecated 1.4.0 Use getIndentLeft
*/
- public function getIndentation()
+ public function getIndent(): ?float
+ {
+ return $this->getChildStyleValue($this->indentation, 'left');
+ }
+
+ /**
+ * Get indentation.
+ */
+ public function getIndentation(): ?Indentation
{
return $this->indentation;
}
/**
- * Set shading.
- *
- * @param mixed $value
- *
- * @return self
+ * Get firstLine.
*/
- public function setIndentation($value = null)
+ public function getIndentFirstLine(): ?float
{
+ return $this->getChildStyleValue($this->indentation, 'firstLine');
+ }
+
+ /**
+ * Get left indentation.
+ */
+ public function getIndentLeft(): ?float
+ {
+ return $this->getChildStyleValue($this->indentation, 'left');
+ }
+
+ /**
+ * Get right indentation.
+ */
+ public function getIndentRight(): ?float
+ {
+ return $this->getChildStyleValue($this->indentation, 'right');
+ }
+
+ /**
+ * Set hanging.
+ *
+ * @deprecated 1.4.0 Use setIndentHanging
+ */
+ public function setHanging(?float $value = null): self
+ {
+ return $this->setIndentation(['hanging' => $value]);
+ }
+
+ /**
+ * Set indentation.
+ *
+ * @deprecated 1.4.0 Use setIndentLeft
+ */
+ public function setIndent(?float $value = null): self
+ {
+ return $this->setIndentation(['left' => $value]);
+ }
+
+ /**
+ * Set indentation.
+ *
+ * @param array{
+ * left?:null|float|int|numeric-string,
+ * right?:null|float|int|numeric-string,
+ * hanging?:null|float|int|numeric-string,
+ * firstLine?:null|float|int|numeric-string
+ * } $value
+ */
+ public function setIndentation(array $value = []): self
+ {
+ $value = array_map(function ($indent) {
+ if (is_string($indent) || is_numeric($indent)) {
+ $indent = $this->setFloatVal($indent);
+ }
+
+ return $indent;
+ }, $value);
$this->setObjectVal($value, 'Indentation', $this->indentation);
return $this;
}
/**
- * Get indentation.
- *
- * @return int
+ * Set hanging indentation.
*/
- public function getIndent()
- {
- return $this->getChildStyleValue($this->indentation, 'left');
- }
-
- /**
- * Set indentation.
- *
- * @param int $value
- *
- * @return self
- */
- public function setIndent($value = null)
- {
- return $this->setIndentation(['left' => $value]);
- }
-
- /**
- * Get hanging.
- *
- * @return int
- */
- public function getHanging()
- {
- return $this->getChildStyleValue($this->indentation, 'hanging');
- }
-
- /**
- * Set hanging.
- *
- * @param int $value
- *
- * @return self
- */
- public function setHanging($value = null)
+ public function setIndentHanging(?float $value = null): self
{
return $this->setIndentation(['hanging' => $value]);
}
+ /**
+ * Set firstline indentation.
+ */
+ public function setIndentFirstLine(?float $value = null): self
+ {
+ return $this->setIndentation(['firstLine' => $value]);
+ }
+
+ /**
+ * Set firstlineChars indentation.
+ */
+ public function setIndentFirstLineChars(int $value = 0): self
+ {
+ return $this->setIndentation(['firstLineChars' => $value]);
+ }
+
+ /**
+ * Set left indentation.
+ */
+ public function setIndentLeft(?float $value = null): self
+ {
+ return $this->setIndentation(['left' => $value]);
+ }
+
+ /**
+ * Set right indentation.
+ */
+ public function setIndentRight(?float $value = null): self
+ {
+ return $this->setIndentation(['right' => $value]);
+ }
+
/**
* Get spacing.
*
- * @return \PhpOffice\PhpWord\Style\Spacing
+ * @return Spacing
*
* @todo Rename to getSpacing in 1.0
*/
@@ -498,7 +565,7 @@ class Paragraph extends Border
*
* @param string $value Possible values are defined in LineSpacingRule
*
- * @return \PhpOffice\PhpWord\Style\Paragraph
+ * @return Paragraph
*/
public function setSpacingLineRule($value)
{
@@ -686,7 +753,7 @@ class Paragraph extends Border
/**
* Get tabs.
*
- * @return \PhpOffice\PhpWord\Style\Tab[]
+ * @return Tab[]
*/
public function getTabs()
{
@@ -712,7 +779,7 @@ class Paragraph extends Border
/**
* Get shading.
*
- * @return \PhpOffice\PhpWord\Style\Shading
+ * @return Shading
*/
public function getShading()
{
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Style/Row.php b/vendor/phpoffice/phpword/src/PhpWord/Style/Row.php
index 765c54f8..31ae3ded 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Style/Row.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Style/Row.php
@@ -1,4 +1,5 @@
zip()->AddFromString("word/media/image1.jpg", file_get_contents($file));
* To read a file: $templateProcessor->zip()->getFromName("word/media/image1.jpg");
*
- * @return \PhpOffice\PhpWord\Shared\ZipArchive
+ * @return ZipArchive
*/
public function zip()
{
@@ -269,7 +269,7 @@ class TemplateProcessor
*/
protected static function ensureUtf8Encoded($subject)
{
- return $subject ? Text::toUTF8($subject) : '';
+ return (null !== $subject) ? Text::toUTF8($subject) : '';
}
/**
@@ -281,7 +281,7 @@ class TemplateProcessor
$objectClass = 'PhpOffice\\PhpWord\\Writer\\Word2007\\Element\\' . $elementName;
$xmlWriter = new XMLWriter();
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Element\AbstractElement $elementWriter */
+ /** @var Writer\Word2007\Element\AbstractElement $elementWriter */
$elementWriter = new $objectClass($xmlWriter, $complexType, true);
$elementWriter->write();
@@ -308,7 +308,7 @@ class TemplateProcessor
$objectClass = 'PhpOffice\\PhpWord\\Writer\\Word2007\\Element\\' . $elementName;
$xmlWriter = new XMLWriter();
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Element\AbstractElement $elementWriter */
+ /** @var Writer\Word2007\Element\AbstractElement $elementWriter */
$elementWriter = new $objectClass($xmlWriter, $complexType, false);
$elementWriter->write();
@@ -362,10 +362,10 @@ class TemplateProcessor
/**
* Set values from a one-dimensional array of "variable => value"-pairs.
*/
- public function setValues(array $values): void
+ public function setValues(array $values, int $limit = self::MAXIMUM_REPLACEMENTS_DEFAULT): void
{
foreach ($values as $macro => $replace) {
- $this->setValue($macro, $replace);
+ $this->setValue($macro, $replace, $limit);
}
}
@@ -406,7 +406,7 @@ class TemplateProcessor
$filename = "charts/chart{$rId}.xml";
// Get the part writer
- $writerPart = new \PhpOffice\PhpWord\Writer\Word2007\Part\Chart();
+ $writerPart = new Writer\Word2007\Part\Chart();
$writerPart->setElement($chart);
// ContentTypes.xml
@@ -499,20 +499,22 @@ class TemplateProcessor
$widthFloat = $heightFloat * $imageRatio;
$matches = [];
preg_match('/\\d([a-z%]+)$/', $height, $matches);
- $width = $widthFloat . $matches[1];
+ $width = $widthFloat . (!empty($matches) ? $matches[1] : 'px');
} elseif ($height === '') { // defined height is empty
$widthFloat = (float) $width;
$heightFloat = $widthFloat / $imageRatio;
$matches = [];
preg_match('/\\d([a-z%]+)$/', $width, $matches);
- $height = $heightFloat . $matches[1];
+ $height = $heightFloat . (!empty($matches) ? $matches[1] : 'px');
} else { // we have defined size, but we need also check it aspect ratio
$widthMatches = [];
preg_match('/\\d([a-z%]+)$/', $width, $widthMatches);
$heightMatches = [];
preg_match('/\\d([a-z%]+)$/', $height, $heightMatches);
// try to fix only if dimensions are same
- if ($widthMatches[1] == $heightMatches[1]) {
+ if (!empty($widthMatches)
+ && !empty($heightMatches)
+ && $widthMatches[1] == $heightMatches[1]) {
$dimention = $widthMatches[1];
$widthFloat = (float) $width;
$heightFloat = (float) $height;
@@ -1287,7 +1289,7 @@ class TemplateProcessor
* @param int $count
* @param string $xmlBlock
*
- * @return string
+ * @return array
*/
protected function indexClonedVariables($count, $xmlBlock)
{
@@ -1339,7 +1341,7 @@ class TemplateProcessor
* @param string $block New block content
* @param string $blockType XML tag type of block
*
- * @return \PhpOffice\PhpWord\TemplateProcessor Fluent interface
+ * @return TemplateProcessor Fluent interface
*/
public function replaceXmlBlock($macro, $block, $blockType = 'w:p')
{
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/AbstractWriter.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/AbstractWriter.php
index 8ebf98c7..13859d82 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/AbstractWriter.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/AbstractWriter.php
@@ -1,4 +1,5 @@
parts as $partName) {
$partClass = 'PhpOffice\\PhpWord\\Writer\\HTML\\Part\\' . $partName;
if (class_exists($partClass)) {
- /** @var \PhpOffice\PhpWord\Writer\HTML\Part\AbstractPart $part Type hint */
+ /** @var HTML\Part\AbstractPart $part Type hint */
$part = new $partClass();
$part->setParentWriter($this);
$this->writerParts[strtolower($partName)] = $part;
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/AbstractElement.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/AbstractElement.php
index 7c7bde31..0e6a112e 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/AbstractElement.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/AbstractElement.php
@@ -1,4 +1,5 @@
namespace, $elementClass);
if (class_exists($writerClass)) {
- /** @var \PhpOffice\PhpWord\Writer\HTML\Element\AbstractElement $writer Type hint */
+ /** @var AbstractElement $writer Type hint */
$writer = new $writerClass($this->parentWriter, $element, $withoutP);
$content .= $writer->write();
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Endnote.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Endnote.php
index 1c35e8fa..7e7f31d4 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Endnote.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/Endnote.php
@@ -1,4 +1,5 @@
element;
- $text = $this->parentWriter->escapeHTML($element->getText());
+ $text = $this->parentWriter->escapeHTML($element->getText() ?? '');
if (!$this->withoutP && !trim($text)) {
$text = ' ';
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextBreak.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextBreak.php
index af73cb4a..576f6a83 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextBreak.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Element/TextBreak.php
@@ -1,4 +1,5 @@
' . PHP_EOL;
-
+ $defaultFontColor = Settings::getDefaultFontColor();
// Default styles
$astarray = [
'font-family' => $this->getFontFamily(Settings::getDefaultFontName(), $this->getParentWriter()->getDefaultGenericFont()),
'font-size' => Settings::getDefaultFontSize() . 'pt',
+ 'color' => "#{$defaultFontColor}",
];
// Mpdf sometimes needs separate tag for body; doesn't harm others.
$bodyarray = $astarray;
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/AbstractStyle.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/AbstractStyle.php
index a6507867..4672347b 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/AbstractStyle.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/HTML/Style/AbstractStyle.php
@@ -1,4 +1,5 @@
getVAlign();
+ }
foreach (['Top', 'Left', 'Bottom', 'Right'] as $direction) {
$method = 'getBorder' . $direction . 'Style';
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText.php
index 616119e5..c9a524e8 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText.php
@@ -1,4 +1,5 @@
parts) as $partName) {
$partClass = static::class . '\\Part\\' . $partName;
if (class_exists($partClass)) {
- /** @var \PhpOffice\PhpWord\Writer\ODText\Part\AbstractPart $partObject Type hint */
+ /** @var AbstractPart $partObject Type hint */
$partObject = new $partClass();
$partObject->setParentWriter($this);
$this->writerParts[strtolower($partName)] = $partObject;
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php
index 5cd396aa..97d1875c 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/AbstractElement.php
@@ -1,4 +1,5 @@
startElement('text:s');
+ $xmlWriter->writeAttributeIf($num > 1, 'text:c', "$num");
+ $xmlWriter->endElement();
+ $text = preg_replace('/^ +/', '', $text);
+ }
+ preg_match_all('/([\\s\\S]*?)(\\t| +| ?$)/', $text, $matches, PREG_SET_ORDER);
+ foreach ($matches as $match) {
+ $this->writeText($match[1]);
+ if ($match[2] === '') {
+ break;
+ } elseif ($match[2] === "\t") {
+ $xmlWriter->writeElement('text:tab');
+ } elseif ($match[2] === ' ') {
+ $xmlWriter->writeElement('text:s');
+
+ break;
+ } else {
+ $num = strlen($match[2]);
+ $xmlWriter->startElement('text:s');
+ $xmlWriter->writeAttributeIf($num > 1, 'text:c', "$num");
+ $xmlWriter->endElement();
+ }
+ }
+ }
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Container.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Container.php
index 6e6b88ea..6b0fee8c 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Container.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Container.php
@@ -1,4 +1,5 @@
+ */
+ protected $containerWithoutP = ['TextRun', 'Footnote', 'Endnote'];
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Field.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Field.php
index 46f62b0f..6b548078 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Field.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Field.php
@@ -1,4 +1,5 @@
getXmlWriter();
$element = $this->getElement();
- if (!$element instanceof \PhpOffice\PhpWord\Element\Image) {
+ if (!$element instanceof ElementImage) {
return;
}
@@ -43,11 +44,16 @@ class Image extends AbstractElement
$width = Converter::pixelToCm($style->getWidth());
$height = Converter::pixelToCm($style->getHeight());
- $xmlWriter->startElement('text:p');
- $xmlWriter->writeAttribute('text:style-name', 'IM' . $mediaIndex);
+ $xmlWriter = $this->getXmlWriter();
+
+ if (!$this->withoutP) {
+ $xmlWriter->startElement('text:p');
+ $xmlWriter->writeAttribute('text:style-name', 'IM' . $mediaIndex);
+ }
$xmlWriter->startElement('draw:frame');
$xmlWriter->writeAttribute('draw:style-name', 'fr' . $mediaIndex);
+ $xmlWriter->writeAttributeIf($this->withoutP, 'draw:text-style-name', 'IM' . $mediaIndex);
$xmlWriter->writeAttribute('draw:name', $element->getElementId());
$xmlWriter->writeAttribute('text:anchor-type', 'as-char');
$xmlWriter->writeAttribute('svg:width', $width . 'cm');
@@ -63,6 +69,8 @@ class Image extends AbstractElement
$xmlWriter->endElement(); // draw:frame
- $xmlWriter->endElement(); // text:p
+ if (!$this->withoutP) {
+ $xmlWriter->endElement(); // text:p
+ }
}
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Link.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Link.php
index 0375b11b..9ef35692 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Link.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Link.php
@@ -1,4 +1,5 @@
getXmlWriter();
$element = $this->getElement();
- if (!$element instanceof \PhpOffice\PhpWord\Element\Table) {
+ if (!$element instanceof TableElement) {
return;
}
$rows = $element->getRows();
@@ -77,7 +78,7 @@ class Table extends AbstractElement
private function writeRow(XMLWriter $xmlWriter, RowElement $row): void
{
$xmlWriter->startElement('table:table-row');
- /** @var \PhpOffice\PhpWord\Element\Row $row Type hint */
+ /** @var RowElement $row Type hint */
foreach ($row->getCells() as $cell) {
$xmlWriter->startElement('table:table-cell');
$xmlWriter->writeAttribute('office:value-type', 'string');
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Text.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Text.php
index 75fb9308..39969723 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Text.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/Text.php
@@ -1,4 +1,5 @@
writeAttribute('text:change-id', $element->getTrackChange()->getElementId());
$xmlWriter->endElement();
} else {
- if (empty($fontStyle)) {
- if (empty($paragraphStyle)) {
- if (!$this->withoutP) {
- $xmlWriter->writeAttribute('text:style-name', 'Normal');
- }
- } elseif (is_string($paragraphStyle)) {
- if (!$this->withoutP) {
- $xmlWriter->writeAttribute('text:style-name', $paragraphStyle);
- }
+ if (empty($paragraphStyle)) {
+ if (!$this->withoutP) {
+ $xmlWriter->writeAttribute('text:style-name', 'Normal');
}
- $this->writeChangeInsertion(true, $element->getTrackChange());
- $this->replaceTabs($element->getText(), $xmlWriter);
- $this->writeChangeInsertion(false, $element->getTrackChange());
- } else {
- if (empty($paragraphStyle)) {
- if (!$this->withoutP) {
- $xmlWriter->writeAttribute('text:style-name', 'Normal');
- }
- } elseif (is_string($paragraphStyle)) {
- if (!$this->withoutP) {
- $xmlWriter->writeAttribute('text:style-name', $paragraphStyle);
- }
+ } elseif (is_string($paragraphStyle)) {
+ if (!$this->withoutP) {
+ $xmlWriter->writeAttribute('text:style-name', $paragraphStyle);
}
+ }
+
+ if (!empty($fontStyle)) {
// text:span
$xmlWriter->startElement('text:span');
if (is_string($fontStyle)) {
$xmlWriter->writeAttribute('text:style-name', $fontStyle);
}
- $this->writeChangeInsertion(true, $element->getTrackChange());
- $this->replaceTabs($element->getText(), $xmlWriter);
- $this->writeChangeInsertion(false, $element->getTrackChange());
+ }
+
+ $this->writeChangeInsertion(true, $element->getTrackChange());
+ $this->replaceTabs($element->getText(), $xmlWriter);
+ $this->writeChangeInsertion(false, $element->getTrackChange());
+
+ if (!empty($fontStyle)) {
$xmlWriter->endElement();
}
}
@@ -96,35 +89,6 @@ class Text extends AbstractElement
}
}
- private function replacetabs($text, $xmlWriter): void
- {
- if (preg_match('/^ +/', $text, $matches)) {
- $num = strlen($matches[0]);
- $xmlWriter->startElement('text:s');
- $xmlWriter->writeAttributeIf($num > 1, 'text:c', "$num");
- $xmlWriter->endElement();
- $text = preg_replace('/^ +/', '', $text);
- }
- preg_match_all('/([\\s\\S]*?)(\\t| +| ?$)/', $text, $matches, PREG_SET_ORDER);
- foreach ($matches as $match) {
- $this->writeText($match[1]);
- if ($match[2] === '') {
- break;
- } elseif ($match[2] === "\t") {
- $xmlWriter->writeElement('text:tab');
- } elseif ($match[2] === ' ') {
- $xmlWriter->writeElement('text:s');
-
- break;
- } else {
- $num = strlen($match[2]);
- $xmlWriter->startElement('text:s');
- $xmlWriter->writeAttributeIf($num > 1, 'text:c', "$num");
- $xmlWriter->endElement();
- }
- }
- }
-
private function writeChangeInsertion($start = true, ?TrackChange $trackChange = null): void
{
if ($trackChange == null || $trackChange->getChangeType() != TrackChange::INSERTED) {
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextBreak.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextBreak.php
index 1bfe3988..1a697007 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextBreak.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Element/TextBreak.php
@@ -1,4 +1,5 @@
imageParagraphStyles as $style) {
- $styleWriter = new \PhpOffice\PhpWord\Writer\ODText\Style\Paragraph($xmlWriter, $style);
+ $styleWriter = new ParagraphStyleWriter($xmlWriter, $style);
$styleWriter->write();
}
}
@@ -256,7 +257,7 @@ class Content extends AbstractPart
*
* Table style can be null or string of the style name
*
- * @param \PhpOffice\PhpWord\Element\AbstractContainer $container
+ * @param AbstractContainer $container
* @param int $paragraphStyleCount
* @param int $fontStyleCount
*
@@ -277,7 +278,7 @@ class Content extends AbstractPart
$style = $element->getStyle();
$style->setStyleName('fr' . $element->getMediaIndex());
$this->autoStyles['Image'][] = $style;
- $sty = new \PhpOffice\PhpWord\Style\Paragraph();
+ $sty = new Paragraph();
$sty->setStyleName('IM' . $element->getMediaIndex());
$sty->setAuto();
$sty->setAlignment($style->getAlignment());
@@ -300,7 +301,7 @@ class Content extends AbstractPart
/**
* Get style of individual element.
*
- * @param \PhpOffice\PhpWord\Element\Text $element
+ * @param Text $element
* @param int $paragraphStyleCount
* @param int $fontStyleCount
*/
@@ -346,7 +347,7 @@ class Content extends AbstractPart
/**
* Get font style of individual field element.
*
- * @param \PhpOffice\PhpWord\Element\Field $element
+ * @param Field $element
* @param int $fontStyleCount
*/
private function getElementStyleField($element, &$fontStyleCount): void
@@ -371,7 +372,7 @@ class Content extends AbstractPart
/**
* Get style of individual element.
*
- * @param \PhpOffice\PhpWord\Element\TextRun $element
+ * @param TextRun $element
* @param int $paragraphStyleCount
*/
private function getElementStyleTextRun($element, &$paragraphStyleCount): void
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Part/Manifest.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Part/Manifest.php
index 37fb7979..200da158 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Part/Manifest.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Part/Manifest.php
@@ -1,4 +1,5 @@
startElement('style:text-properties');
- $xmlWriter->writeAttribute('style:use-window-font-color', 'true');
+ $xmlWriter->writeAttribute('style:use-window-font-color', 'false');
$xmlWriter->writeAttribute('style:font-name', Settings::getDefaultFontName());
$xmlWriter->writeAttribute('fo:font-size', Settings::getDefaultFontSize() . 'pt');
$xmlWriter->writeAttribute('fo:language', $latinLang[0]);
$xmlWriter->writeAttribute('fo:country', $latinLang[1]);
+ $xmlWriter->writeAttribute('fo:color', '#' . Settings::getDefaultFontColor());
$xmlWriter->writeAttribute('style:letter-kerning', 'true');
$xmlWriter->writeAttribute('style:font-name-asian', Settings::getDefaultFontName() . '2');
$xmlWriter->writeAttribute('style:font-size-asian', Settings::getDefaultFontSize() . 'pt');
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/AbstractStyle.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/AbstractStyle.php
index 439434c9..3545009f 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/AbstractStyle.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/AbstractStyle.php
@@ -1,4 +1,5 @@
setStyleName($style->getStyleName());
- $temp2 = new \PhpOffice\PhpWord\Writer\ODText\Style\Paragraph($xmlWriter, $temp1);
+ $temp2 = new Paragraph($xmlWriter, $temp1);
$temp2->write();
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Image.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Image.php
index 79ddfc50..56c4f57a 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Image.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Image.php
@@ -1,4 +1,5 @@
getStyle();
- if (!$style instanceof \PhpOffice\PhpWord\Style\Paragraph) {
+ if (!$style instanceof Style\Paragraph) {
return;
}
$xmlWriter = $this->getXmlWriter();
@@ -73,13 +74,13 @@ class Paragraph extends AbstractStyle
} elseif (substr($styleName, 0, 2) === 'HD') {
$styleAuto = true;
$psm = 'Heading_' . substr($styleName, 2);
- $stylep = \PhpOffice\PhpWord\Style::getStyle($psm);
- if ($stylep instanceof \PhpOffice\PhpWord\Style\Font) {
+ $stylep = Style::getStyle($psm);
+ if ($stylep instanceof Style\Font) {
if (method_exists($stylep, 'getParagraph')) {
$stylep = $stylep->getParagraph();
}
}
- if ($stylep instanceof \PhpOffice\PhpWord\Style\Paragraph) {
+ if ($stylep instanceof Style\Paragraph) {
if ($stylep->hasPageBreakBefore()) {
$breakbefore = true;
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Section.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Section.php
index 0a250194..05152a39 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Section.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/ODText/Style/Section.php
@@ -1,4 +1,5 @@
parts as $partName) {
$partClass = static::class . '\\Part\\' . $partName;
if (class_exists($partClass)) {
- /** @var \PhpOffice\PhpWord\Writer\RTF\Part\AbstractPart $part Type hint */
+ /** @var RTF\Part\AbstractPart $part Type hint */
$part = new $partClass();
$part->setParentWriter($this);
$this->writerParts[strtolower($partName)] = $part;
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/AbstractElement.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/AbstractElement.php
index 5c33868a..e007e6aa 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/AbstractElement.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/AbstractElement.php
@@ -1,4 +1,5 @@
parentWriter;
/** @var \PhpOffice\PhpWord\Element\Text $element Type hint */
@@ -188,7 +189,7 @@ abstract class AbstractElement
return '';
}
- /** @var \PhpOffice\PhpWord\Writer\RTF $parentWriter Type hint */
+ /** @var WriterRTF $parentWriter Type hint */
$parentWriter = $this->parentWriter;
// Create style writer and set color/name index
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Container.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Container.php
index 5e198aec..dcac8ec0 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Container.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Element/Container.php
@@ -1,4 +1,5 @@
element;
$elementClass = str_replace('\\Writer\\RTF', '', static::class);
- if (!$element instanceof $elementClass || !is_string($element->getText())) {
+ if (!$element instanceof $elementClass) {
return '';
}
+ $textToWrite = $element->getText();
+ if ($textToWrite instanceof \PhpOffice\PhpWord\Element\TextRun) {
+ $textToWrite = $textToWrite->getText(); // gets text from TextRun
+ }
+
$this->getStyles();
$content = '';
@@ -82,7 +88,7 @@ class Title extends Text
$content .= '{';
$content .= $this->writeFontStyle();
- $content .= $this->writeText($element->getText());
+ $content .= $this->writeText($textToWrite);
$content .= '}';
$content .= $this->writeClosing();
$content .= $endout;
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/AbstractPart.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/AbstractPart.php
index be772b93..a07f70bb 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/AbstractPart.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/AbstractPart.php
@@ -1,4 +1,5 @@
getHeaders() as $header) {
$type = $header->getType();
- if ($evenOdd || $type !== FOOTER::EVEN) {
+ if ($evenOdd || $type !== Footer::EVEN) {
$content .= '{\\header';
if ($type === Footer::FIRST) {
$content .= 'f';
} elseif ($evenOdd) {
- $content .= ($type === FOOTER::EVEN) ? 'l' : 'r';
+ $content .= ($type === Footer::EVEN) ? 'l' : 'r';
}
foreach ($header->getElements() as $element) {
$cl = get_class($element);
@@ -182,12 +183,12 @@ class Document extends AbstractPart
}
foreach ($section->getFooters() as $footer) {
$type = $footer->getType();
- if ($evenOdd || $type !== FOOTER::EVEN) {
+ if ($evenOdd || $type !== Footer::EVEN) {
$content .= '{\\footer';
if ($type === Footer::FIRST) {
$content .= 'f';
} elseif ($evenOdd) {
- $content .= ($type === FOOTER::EVEN) ? 'l' : 'r';
+ $content .= ($type === Footer::EVEN) ? 'l' : 'r';
}
foreach ($footer->getElements() as $element) {
$cl = get_class($element);
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/Header.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/Header.php
index 7f8cc84b..97644fe4 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/Header.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part/Header.php
@@ -1,4 +1,5 @@
parts) as $partName) {
$partClass = static::class . '\\Part\\' . $partName;
if (class_exists($partClass)) {
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $part Type hint */
+ /** @var Word2007\Part\AbstractPart $part Type hint */
$part = new $partClass();
$part->setParentWriter($this);
$this->writerParts[strtolower($partName)] = $part;
@@ -179,7 +178,7 @@ class Word2007 extends AbstractWriter implements WriterInterface
$this->registerContentTypes($media);
}
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $writerPart Type hint */
+ /** @var Word2007\Part\AbstractPart $writerPart Type hint */
$writerPart = $this->getWriterPart('relspart')->setMedia($media);
$zip->addFromString("word/_rels/{$file}.xml.rels", $writerPart->write());
}
@@ -206,7 +205,7 @@ class Word2007 extends AbstractWriter implements WriterInterface
$this->contentTypes['override']["/word/$elmFile"] = $elmType;
$this->relationships[] = ['target' => $elmFile, 'type' => $elmType, 'rID' => $rId];
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $writerPart Type hint */
+ /** @var Word2007\Part\AbstractPart $writerPart Type hint */
$writerPart = $this->getWriterPart($elmType)->setElement($element);
$zip->addFromString("word/$elmFile", $writerPart->write());
}
@@ -236,7 +235,7 @@ class Word2007 extends AbstractWriter implements WriterInterface
// Write relationships file, e.g. word/_rels/footnotes.xml
if (!empty($media)) {
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Part\AbstractPart $writerPart Type hint */
+ /** @var Word2007\Part\AbstractPart $writerPart Type hint */
$writerPart = $this->getWriterPart('relspart')->setMedia($media);
$zip->addFromString("word/_rels/{$partName}.xml.rels", $writerPart->write());
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/AbstractElement.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/AbstractElement.php
index b677556d..5743c8c7 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/AbstractElement.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/AbstractElement.php
@@ -1,4 +1,5 @@
xmlWriter = $xmlWriter;
$this->element = $element;
@@ -76,7 +75,7 @@ abstract class AbstractElement
/**
* Get XML Writer.
*
- * @return \PhpOffice\PhpWord\Shared\XMLWriter
+ * @return XMLWriter
*/
protected function getXmlWriter()
{
@@ -86,7 +85,7 @@ abstract class AbstractElement
/**
* Get element.
*
- * @return \PhpOffice\PhpWord\Element\AbstractElement
+ * @return Element
*/
protected function getElement()
{
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Bookmark.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Bookmark.php
index 1e618af9..ba61ad69 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Bookmark.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Bookmark.php
@@ -1,4 +1,5 @@
+ */
+ protected $containerWithoutP = ['TextRun', 'Footnote', 'Endnote', 'ListItemRun'];
+
/**
* Write element.
*/
@@ -46,7 +52,7 @@ class Container extends AbstractElement
return;
}
$containerClass = substr(get_class($container), strrpos(get_class($container), '\\') + 1);
- $withoutP = in_array($containerClass, ['TextRun', 'Footnote', 'Endnote', 'ListItemRun']);
+ $withoutP = in_array($containerClass, $this->containerWithoutP);
$xmlWriter = $this->getXmlWriter();
// Loop through elements
@@ -62,7 +68,7 @@ class Container extends AbstractElement
$writeLastTextBreak = ($containerClass == 'Cell') && ($elementClass == '' || $elementClass == 'Table');
if ($writeLastTextBreak) {
$writerClass = $this->namespace . '\\TextBreak';
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Element\AbstractElement $writer Type hint */
+ /** @var AbstractElement $writer Type hint */
$writer = new $writerClass($xmlWriter, new TextBreakElement(), $withoutP);
$writer->write();
}
@@ -70,18 +76,14 @@ class Container extends AbstractElement
/**
* Write individual element.
- *
- * @param bool $withoutP
- *
- * @return string
*/
- private function writeElement(XMLWriter $xmlWriter, Element $element, $withoutP)
+ private function writeElement(XMLWriter $xmlWriter, Element $element, bool $withoutP): string
{
$elementClass = substr(get_class($element), strrpos(get_class($element), '\\') + 1);
$writerClass = $this->namespace . '\\' . $elementClass;
if (class_exists($writerClass)) {
- /** @var \PhpOffice\PhpWord\Writer\Word2007\Element\AbstractElement $writer Type hint */
+ /** @var AbstractElement $writer Type hint */
$writer = new $writerClass($xmlWriter, $element, $withoutP);
$writer->setPart($this->getPart());
$writer->write();
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Endnote.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Endnote.php
index f96ac797..6a00ed5b 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Endnote.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Endnote.php
@@ -1,4 +1,5 @@
endElement(); // w:r
if ($element->getText() != null) {
- if ($element->getText() instanceof \PhpOffice\PhpWord\Element\TextRun) {
+ if ($element->getText() instanceof TextRun) {
$containerWriter = new Container($xmlWriter, $element->getText(), true);
$containerWriter->write();
}
@@ -262,7 +263,7 @@ class Field extends Text
$xmlWriter->endElement(); // w:r
if ($element->getText() != null) {
- if ($element->getText() instanceof \PhpOffice\PhpWord\Element\TextRun) {
+ if ($element->getText() instanceof TextRun) {
$containerWriter = new Container($xmlWriter, $element->getText(), true);
$containerWriter->write();
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Footnote.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Footnote.php
index 77073a23..68f998e3 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Footnote.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Footnote.php
@@ -1,4 +1,5 @@
startElement('w:r');
$xmlWriter->startElement('w:instrText');
$xmlWriter->writeAttribute('xml:space', 'preserve');
- $xmlWriter->text("PAGEREF _Toc{$rId} \\h");
+ $xmlWriter->text("PAGEREF $rId \\h");
$xmlWriter->endElement();
$xmlWriter->endElement();
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Table.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Table.php
index a32cc196..2bb1b3f3 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Table.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/Table.php
@@ -1,4 +1,5 @@
getBgColor()) {
$xmlWriter->writeAttribute('fillcolor', $style->getBgColor());
+ } else {
+ $xmlWriter->writeAttribute('filled', 'f');
+ }
+
+ if (!$style->getBorderColor()) {
+ $xmlWriter->writeAttribute('stroked', 'f');
+ $xmlWriter->writeAttribute('strokecolor', 'white');
}
$styleWriter->write();
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextBreak.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextBreak.php
index bcae3b2e..4c2ecde7 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextBreak.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Element/TextBreak.php
@@ -1,4 +1,5 @@
getSalt() == null) {
- $documentProtection->setSalt(openssl_random_pseudo_bytes(16));
+ $documentProtection->setSalt((string) openssl_random_pseudo_bytes(16));
}
$passwordHash = PasswordEncoder::hashPassword($documentProtection->getPassword(), $documentProtection->getAlgorithm(), $documentProtection->getSalt(), $documentProtection->getSpinCount());
$this->settings['w:documentProtection'] = [
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Styles.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Styles.php
index 2112fd3c..edf0314c 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Styles.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Styles.php
@@ -1,4 +1,5 @@
getParentWriter()->getPhpWord();
$fontName = $phpWord->getDefaultFontName();
+ $asianFontName = $phpWord->getDefaultAsianFontName();
$fontSize = $phpWord->getDefaultFontSize();
+ $fontColor = $phpWord->getDefaultFontColor();
$language = $phpWord->getSettings()->getThemeFontLang();
$latinLanguage = ($language == null || $language->getLatin() === null) ? 'en-US' : $language->getLatin();
@@ -94,9 +97,12 @@ class Styles extends AbstractPart
$xmlWriter->startElement('w:rFonts');
$xmlWriter->writeAttribute('w:ascii', $fontName);
$xmlWriter->writeAttribute('w:hAnsi', $fontName);
- $xmlWriter->writeAttribute('w:eastAsia', $fontName);
+ $xmlWriter->writeAttribute('w:eastAsia', $asianFontName);
$xmlWriter->writeAttribute('w:cs', $fontName);
$xmlWriter->endElement(); // w:rFonts
+ $xmlWriter->startElement('w:color');
+ $xmlWriter->writeAttribute('w:val', $fontColor);
+ $xmlWriter->endElement();
$xmlWriter->startElement('w:sz');
$xmlWriter->writeAttribute('w:val', $fontSize * 2);
$xmlWriter->endElement(); // w:sz
@@ -125,7 +131,7 @@ class Styles extends AbstractPart
if (isset($styles['Normal'])) {
$normalStyle = $styles['Normal'];
// w:pPr
- if ($normalStyle instanceof Fontstyle && $normalStyle->getParagraph() != null) {
+ if ($normalStyle instanceof FontStyle && $normalStyle->getParagraph() != null) {
$styleWriter = new ParagraphStyleWriter($xmlWriter, $normalStyle->getParagraph());
$styleWriter->write();
} elseif ($normalStyle instanceof ParagraphStyle) {
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Theme.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Theme.php
index ad57d664..a70c248d 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Theme.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Part/Theme.php
@@ -1,4 +1,5 @@
write();
}
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Cell.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Cell.php
index 6e22597d..bb0d6d71 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Cell.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Cell.php
@@ -1,4 +1,5 @@
endElement(); // w:tcW
}
+ $paddingTop = $style->getPaddingTop();
+ $paddingLeft = $style->getPaddingLeft();
+ $paddingBottom = $style->getPaddingBottom();
+ $paddingRight = $style->getPaddingRight();
+
+ if ($paddingTop !== null || $paddingLeft !== null || $paddingBottom !== null || $paddingRight !== null) {
+ $xmlWriter->startElement('w:tcMar');
+ if ($paddingTop !== null) {
+ $xmlWriter->startElement('w:top');
+ $xmlWriter->writeAttribute('w:w', $paddingTop);
+ $xmlWriter->writeAttribute('w:type', \PhpOffice\PhpWord\SimpleType\TblWidth::TWIP);
+ $xmlWriter->endElement(); // w:top
+ }
+ if ($paddingLeft !== null) {
+ $xmlWriter->startElement('w:start');
+ $xmlWriter->writeAttribute('w:w', $paddingLeft);
+ $xmlWriter->writeAttribute('w:type', \PhpOffice\PhpWord\SimpleType\TblWidth::TWIP);
+ $xmlWriter->endElement(); // w:start
+ }
+ if ($paddingBottom !== null) {
+ $xmlWriter->startElement('w:bottom');
+ $xmlWriter->writeAttribute('w:w', $paddingBottom);
+ $xmlWriter->writeAttribute('w:type', \PhpOffice\PhpWord\SimpleType\TblWidth::TWIP);
+ $xmlWriter->endElement(); // w:bottom
+ }
+ if ($paddingRight !== null) {
+ $xmlWriter->startElement('w:end');
+ $xmlWriter->writeAttribute('w:w', $paddingRight);
+ $xmlWriter->writeAttribute('w:type', \PhpOffice\PhpWord\SimpleType\TblWidth::TWIP);
+ $xmlWriter->endElement(); // w:end
+ }
+ $xmlWriter->endElement(); // w:tcMar
+ }
+
// Text direction
$textDir = $style->getTextDirection();
$xmlWriter->writeElementIf(null !== $textDir, 'w:textDirection', 'w:val', $textDir);
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Extrusion.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Extrusion.php
index f6ad6221..8bb92187 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Extrusion.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Extrusion.php
@@ -1,4 +1,5 @@
getFirstLine();
$xmlWriter->writeAttributeIf(null !== $firstLine, 'w:firstLine', $this->convertTwip($firstLine));
+ $firstLineChars = $style->getFirstLineChars();
+ $xmlWriter->writeAttributeIf(0 !== $firstLineChars, 'w:firstLineChars', $this->convertTwip($firstLineChars));
+
$hanging = $style->getHanging();
$xmlWriter->writeAttributeIf(null !== $hanging, 'w:hanging', $this->convertTwip($hanging));
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Line.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Line.php
index 90107f8e..2603545f 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Line.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Line.php
@@ -1,4 +1,5 @@
startElement('w:numPr');
diff --git a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Row.php b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Row.php
index 7e1468e8..2b9d804f 100644
--- a/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Row.php
+++ b/vendor/phpoffice/phpword/src/PhpWord/Writer/Word2007/Style/Row.php
@@ -1,4 +1,5 @@
=5.3.0"
- },
- "autoload": {
- "psr-4": {
- "Psr\\Cache\\": "src/"
- }
- },
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- }
-}
diff --git a/vendor/psr/cache/src/CacheException.php b/vendor/psr/cache/src/CacheException.php
deleted file mode 100644
index e27f22f8..00000000
--- a/vendor/psr/cache/src/CacheException.php
+++ /dev/null
@@ -1,10 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ApcClassLoader implements a wrapping autoloader cached in APC for PHP 5.3.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allows using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * use Symfony\Component\ClassLoader\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new ApcClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- */
-class ApcClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- protected $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The APC namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!function_exists('apcu_fetch')) {
- throw new \RuntimeException('Unable to use ApcClassLoader as APC is not installed.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to APC.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $file = apcu_fetch($this->prefix.$class, $success);
-
- if (!$success) {
- apcu_store($this->prefix.$class, $file = $this->decorated->findFile($class) ?: null);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/vendor/symfony/class-loader/CHANGELOG.md b/vendor/symfony/class-loader/CHANGELOG.md
deleted file mode 100644
index 64ef8d9c..00000000
--- a/vendor/symfony/class-loader/CHANGELOG.md
+++ /dev/null
@@ -1,36 +0,0 @@
-CHANGELOG
-=========
-
-3.0.0
------
-
- * The DebugClassLoader class has been removed
- * The DebugUniversalClassLoader class has been removed
- * The UniversalClassLoader class has been removed
- * The ApcUniversalClassLoader class has been removed
-
-2.4.0
------
-
- * deprecated the UniversalClassLoader in favor of the ClassLoader class instead
- * deprecated the ApcUniversalClassLoader in favor of the ApcClassLoader class instead
- * deprecated the DebugUniversalClassLoader in favor of the DebugClassLoader class from the Debug component
- * deprecated the DebugClassLoader as it has been moved to the Debug component instead
-
-2.3.0
------
-
- * added a WinCacheClassLoader for WinCache
-
-2.1.0
------
-
- * added a DebugClassLoader able to wrap any autoloader providing a findFile
- method
- * added a new ApcClassLoader and XcacheClassLoader using composition to wrap
- other loaders
- * added a new ClassLoader which does not distinguish between namespaced and
- pear-like classes (as the PEAR convention is a subset of PSR-0) and
- supports using Composer's namespace maps
- * added a class map generator
- * added support for loading globally-installed PEAR packages
diff --git a/vendor/symfony/class-loader/ClassCollectionLoader.php b/vendor/symfony/class-loader/ClassCollectionLoader.php
deleted file mode 100644
index 1d53c482..00000000
--- a/vendor/symfony/class-loader/ClassCollectionLoader.php
+++ /dev/null
@@ -1,444 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassCollectionLoader.
- *
- * @author Fabien Potencier
- */
-class ClassCollectionLoader
-{
- private static $loaded;
- private static $seen;
- private static $useTokenizer = true;
-
- /**
- * Loads a list of classes and caches them in one big file.
- *
- * @param array $classes An array of classes to load
- * @param string $cacheDir A cache directory
- * @param string $name The cache name prefix
- * @param bool $autoReload Whether to flush the cache when the cache is stale or not
- * @param bool $adaptive Whether to remove already declared classes or not
- * @param string $extension File extension of the resulting file
- *
- * @throws \InvalidArgumentException When class can't be loaded
- */
- public static function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
- {
- // each $name can only be loaded once per PHP process
- if (isset(self::$loaded[$name])) {
- return;
- }
-
- self::$loaded[$name] = true;
-
- if ($adaptive) {
- $declared = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
-
- // don't include already declared classes
- $classes = array_diff($classes, $declared);
-
- // the cache is different depending on which classes are already declared
- $name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
- }
-
- $classes = array_unique($classes);
-
- // cache the core classes
- if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
- throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
- }
- $cacheDir = rtrim(realpath($cacheDir) ?: $cacheDir, '/'.DIRECTORY_SEPARATOR);
- $cache = $cacheDir.'/'.$name.$extension;
-
- // auto-reload
- $reload = false;
- if ($autoReload) {
- $metadata = $cache.'.meta';
- if (!is_file($metadata) || !is_file($cache)) {
- $reload = true;
- } else {
- $time = filemtime($cache);
- $meta = unserialize(file_get_contents($metadata));
-
- sort($meta[1]);
- sort($classes);
-
- if ($meta[1] != $classes) {
- $reload = true;
- } else {
- foreach ($meta[0] as $resource) {
- if (!is_file($resource) || filemtime($resource) > $time) {
- $reload = true;
-
- break;
- }
- }
- }
- }
- }
-
- if (!$reload && file_exists($cache)) {
- require_once $cache;
-
- return;
- }
- if (!$adaptive) {
- $declared = array_merge(get_declared_classes(), get_declared_interfaces(), get_declared_traits());
- }
-
- $files = self::inline($classes, $cache, $declared);
-
- if ($autoReload) {
- // save the resources
- self::writeCacheFile($metadata, serialize(array(array_values($files), $classes)));
- }
- }
-
- /**
- * Generates a file where classes and their parents are inlined.
- *
- * @param array $classes An array of classes to load
- * @param string $cache The file where classes are inlined
- * @param array $excluded An array of classes that won't be inlined
- *
- * @return array The source map of inlined classes, with classes as keys and files as values
- *
- * @throws \RuntimeException When class can't be loaded
- */
- public static function inline($classes, $cache, array $excluded)
- {
- $declared = array();
- foreach (self::getOrderedClasses($excluded) as $class) {
- $declared[$class->getName()] = true;
- }
-
- // cache the core classes
- $cacheDir = dirname($cache);
- if (!is_dir($cacheDir) && !@mkdir($cacheDir, 0777, true) && !is_dir($cacheDir)) {
- throw new \RuntimeException(sprintf('Class Collection Loader was not able to create directory "%s"', $cacheDir));
- }
-
- $spacesRegex = '(?:\s*+(?:(?:\#|//)[^\n]*+\n|/\*(?:(?getName()])) {
- continue;
- }
- $declared[$class->getName()] = true;
-
- $files[$class->getName()] = $file = $class->getFileName();
- $c = file_get_contents($file);
-
- if (preg_match($dontInlineRegex, $c)) {
- $file = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $file));
-
- for ($i = 0; isset($file[$i], $cacheDir[$i]); ++$i) {
- if ($file[$i] !== $cacheDir[$i]) {
- break;
- }
- }
- if (1 >= $i) {
- $file = var_export(implode('/', $file), true);
- } else {
- $file = array_slice($file, $i);
- $file = str_repeat('../', count($cacheDir) - $i).implode('/', $file);
- $file = '__DIR__.'.var_export('/'.$file, true);
- }
-
- $c = "\nnamespace {require $file;}";
- } else {
- $c = preg_replace(array('/^\s*<\?php/', '/\?>\s*$/'), '', $c);
-
- // fakes namespace declaration for global code
- if (!$class->inNamespace()) {
- $c = "\nnamespace\n{\n".$c."\n}\n";
- }
-
- $c = self::fixNamespaceDeclarations('= 70000) {
- // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
- unset($tokens, $rawChunk);
- gc_mem_caches();
- }
-
- return $output;
- }
-
- /**
- * This method is only useful for testing.
- */
- public static function enableTokenizer($bool)
- {
- self::$useTokenizer = (bool) $bool;
- }
-
- /**
- * Strips leading & trailing ws, multiple EOL, multiple ws.
- *
- * @param string $code Original PHP code
- *
- * @return string compressed code
- */
- private static function compressCode($code)
- {
- return preg_replace(
- array('/^\s+/m', '/\s+$/m', '/([\n\r]+ *[\n\r]+)+/', '/[ \t]+/'),
- array('', '', "\n", ' '),
- $code
- );
- }
-
- /**
- * Writes a cache file.
- *
- * @param string $file Filename
- * @param string $content Temporary file content
- *
- * @throws \RuntimeException when a cache file cannot be written
- */
- private static function writeCacheFile($file, $content)
- {
- $dir = dirname($file);
- if (!is_writable($dir)) {
- throw new \RuntimeException(sprintf('Cache directory "%s" is not writable.', $dir));
- }
-
- $tmpFile = tempnam($dir, basename($file));
-
- if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
- @chmod($file, 0666 & ~umask());
-
- return;
- }
-
- throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file));
- }
-
- /**
- * Gets an ordered array of passed classes including all their dependencies.
- *
- * @param array $classes
- *
- * @return \ReflectionClass[] An array of sorted \ReflectionClass instances (dependencies added if needed)
- *
- * @throws \InvalidArgumentException When a class can't be loaded
- */
- private static function getOrderedClasses(array $classes)
- {
- $map = array();
- self::$seen = array();
- foreach ($classes as $class) {
- try {
- $reflectionClass = new \ReflectionClass($class);
- } catch (\ReflectionException $e) {
- throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
- }
-
- $map = array_merge($map, self::getClassHierarchy($reflectionClass));
- }
-
- return $map;
- }
-
- private static function getClassHierarchy(\ReflectionClass $class)
- {
- if (isset(self::$seen[$class->getName()])) {
- return array();
- }
-
- self::$seen[$class->getName()] = true;
-
- $classes = array($class);
- $parent = $class;
- while (($parent = $parent->getParentClass()) && $parent->isUserDefined() && !isset(self::$seen[$parent->getName()])) {
- self::$seen[$parent->getName()] = true;
-
- array_unshift($classes, $parent);
- }
-
- $traits = array();
-
- foreach ($classes as $c) {
- foreach (self::resolveDependencies(self::computeTraitDeps($c), $c) as $trait) {
- if ($trait !== $c) {
- $traits[] = $trait;
- }
- }
- }
-
- return array_merge(self::getInterfaces($class), $traits, $classes);
- }
-
- private static function getInterfaces(\ReflectionClass $class)
- {
- $classes = array();
-
- foreach ($class->getInterfaces() as $interface) {
- $classes = array_merge($classes, self::getInterfaces($interface));
- }
-
- if ($class->isUserDefined() && $class->isInterface() && !isset(self::$seen[$class->getName()])) {
- self::$seen[$class->getName()] = true;
-
- $classes[] = $class;
- }
-
- return $classes;
- }
-
- private static function computeTraitDeps(\ReflectionClass $class)
- {
- $traits = $class->getTraits();
- $deps = array($class->getName() => $traits);
- while ($trait = array_pop($traits)) {
- if ($trait->isUserDefined() && !isset(self::$seen[$trait->getName()])) {
- self::$seen[$trait->getName()] = true;
- $traitDeps = $trait->getTraits();
- $deps[$trait->getName()] = $traitDeps;
- $traits = array_merge($traits, $traitDeps);
- }
- }
-
- return $deps;
- }
-
- /**
- * Dependencies resolution.
- *
- * This function does not check for circular dependencies as it should never
- * occur with PHP traits.
- *
- * @param array $tree The dependency tree
- * @param \ReflectionClass $node The node
- * @param \ArrayObject $resolved An array of already resolved dependencies
- * @param \ArrayObject $unresolved An array of dependencies to be resolved
- *
- * @return \ArrayObject The dependencies for the given node
- *
- * @throws \RuntimeException if a circular dependency is detected
- */
- private static function resolveDependencies(array $tree, $node, \ArrayObject $resolved = null, \ArrayObject $unresolved = null)
- {
- if (null === $resolved) {
- $resolved = new \ArrayObject();
- }
- if (null === $unresolved) {
- $unresolved = new \ArrayObject();
- }
- $nodeName = $node->getName();
-
- if (isset($tree[$nodeName])) {
- $unresolved[$nodeName] = $node;
- foreach ($tree[$nodeName] as $dependency) {
- if (!$resolved->offsetExists($dependency->getName())) {
- self::resolveDependencies($tree, $dependency, $resolved, $unresolved);
- }
- }
- $resolved[$nodeName] = $node;
- unset($unresolved[$nodeName]);
- }
-
- return $resolved;
- }
-}
diff --git a/vendor/symfony/class-loader/ClassLoader.php b/vendor/symfony/class-loader/ClassLoader.php
deleted file mode 100644
index a506dc09..00000000
--- a/vendor/symfony/class-loader/ClassLoader.php
+++ /dev/null
@@ -1,203 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassLoader implements an PSR-0 class loader.
- *
- * See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
- *
- * $loader = new ClassLoader();
- *
- * // register classes with namespaces
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // activate the autoloader
- * $loader->register();
- *
- * // to enable searching the include path (e.g. for PEAR packages)
- * $loader->setUseIncludePath(true);
- *
- * In this example, if you try to use a class in the Symfony\Component
- * namespace or one of its children (Symfony\Component\Console for instance),
- * the autoloader will first look for the class under the component/
- * directory, and it will then fallback to the framework/ directory if not
- * found before giving up.
- *
- * @author Fabien Potencier
- * @author Jordi Boggiano
- */
-class ClassLoader
-{
- private $prefixes = array();
- private $fallbackDirs = array();
- private $useIncludePath = false;
-
- /**
- * Returns prefixes.
- *
- * @return array
- */
- public function getPrefixes()
- {
- return $this->prefixes;
- }
-
- /**
- * Returns fallback directories.
- *
- * @return array
- */
- public function getFallbackDirs()
- {
- return $this->fallbackDirs;
- }
-
- /**
- * Adds prefixes.
- *
- * @param array $prefixes Prefixes to add
- */
- public function addPrefixes(array $prefixes)
- {
- foreach ($prefixes as $prefix => $path) {
- $this->addPrefix($prefix, $path);
- }
- }
-
- /**
- * Registers a set of classes.
- *
- * @param string $prefix The classes prefix
- * @param array|string $paths The location(s) of the classes
- */
- public function addPrefix($prefix, $paths)
- {
- if (!$prefix) {
- foreach ((array) $paths as $path) {
- $this->fallbackDirs[] = $path;
- }
-
- return;
- }
- if (isset($this->prefixes[$prefix])) {
- if (is_array($paths)) {
- $this->prefixes[$prefix] = array_unique(array_merge(
- $this->prefixes[$prefix],
- $paths
- ));
- } elseif (!in_array($paths, $this->prefixes[$prefix])) {
- $this->prefixes[$prefix][] = $paths;
- }
- } else {
- $this->prefixes[$prefix] = array_unique((array) $paths);
- }
- }
-
- /**
- * Turns on searching the include for class files.
- *
- * @param bool $useIncludePath
- */
- public function setUseIncludePath($useIncludePath)
- {
- $this->useIncludePath = (bool) $useIncludePath;
- }
-
- /**
- * Can be used to check if the autoloader uses the include path to check
- * for classes.
- *
- * @return bool
- */
- public function getUseIncludePath()
- {
- return $this->useIncludePath;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|null The path, if found
- */
- public function findFile($class)
- {
- if (false !== $pos = strrpos($class, '\\')) {
- // namespaced class name
- $classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)).DIRECTORY_SEPARATOR;
- $className = substr($class, $pos + 1);
- } else {
- // PEAR-like class name
- $classPath = null;
- $className = $class;
- }
-
- $classPath .= str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
-
- foreach ($this->prefixes as $prefix => $dirs) {
- if ($class === strstr($class, $prefix)) {
- foreach ($dirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
- }
- }
- }
- }
-
- foreach ($this->fallbackDirs as $dir) {
- if (file_exists($dir.DIRECTORY_SEPARATOR.$classPath)) {
- return $dir.DIRECTORY_SEPARATOR.$classPath;
- }
- }
-
- if ($this->useIncludePath && $file = stream_resolve_include_path($classPath)) {
- return $file;
- }
- }
-}
diff --git a/vendor/symfony/class-loader/ClassMapGenerator.php b/vendor/symfony/class-loader/ClassMapGenerator.php
deleted file mode 100644
index baeb4c1a..00000000
--- a/vendor/symfony/class-loader/ClassMapGenerator.php
+++ /dev/null
@@ -1,156 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * ClassMapGenerator.
- *
- * @author Gyula Sallai
- */
-class ClassMapGenerator
-{
- /**
- * Generate a class map file.
- *
- * @param array|string $dirs Directories or a single path to search in
- * @param string $file The name of the class map file
- */
- public static function dump($dirs, $file)
- {
- $dirs = (array) $dirs;
- $maps = array();
-
- foreach ($dirs as $dir) {
- $maps = array_merge($maps, static::createMap($dir));
- }
-
- file_put_contents($file, sprintf('isFile()) {
- continue;
- }
-
- $path = $file->getRealPath() ?: $file->getPathname();
-
- if (pathinfo($path, PATHINFO_EXTENSION) !== 'php') {
- continue;
- }
-
- $classes = self::findClasses($path);
-
- if (\PHP_VERSION_ID >= 70000) {
- // PHP 7 memory manager will not release after token_get_all(), see https://bugs.php.net/70098
- gc_mem_caches();
- }
-
- foreach ($classes as $class) {
- $map[$class] = $path;
- }
- }
-
- return $map;
- }
-
- /**
- * Extract the classes in the given file.
- *
- * @param string $path The file to check
- *
- * @return array The found classes
- */
- private static function findClasses($path)
- {
- $contents = file_get_contents($path);
- $tokens = token_get_all($contents);
-
- $classes = array();
-
- $namespace = '';
- for ($i = 0; isset($tokens[$i]); ++$i) {
- $token = $tokens[$i];
-
- if (!isset($token[1])) {
- continue;
- }
-
- $class = '';
-
- switch ($token[0]) {
- case T_NAMESPACE:
- $namespace = '';
- // If there is a namespace, extract it
- while (isset($tokens[++$i][1])) {
- if (in_array($tokens[$i][0], array(T_STRING, T_NS_SEPARATOR))) {
- $namespace .= $tokens[$i][1];
- }
- }
- $namespace .= '\\';
- break;
- case T_CLASS:
- case T_INTERFACE:
- case T_TRAIT:
- // Skip usage of ::class constant
- $isClassConstant = false;
- for ($j = $i - 1; $j > 0; --$j) {
- if (!isset($tokens[$j][1])) {
- break;
- }
-
- if (T_DOUBLE_COLON === $tokens[$j][0]) {
- $isClassConstant = true;
- break;
- } elseif (!in_array($tokens[$j][0], array(T_WHITESPACE, T_DOC_COMMENT, T_COMMENT))) {
- break;
- }
- }
-
- if ($isClassConstant) {
- break;
- }
-
- // Find the classname
- while (isset($tokens[++$i][1])) {
- $t = $tokens[$i];
- if (T_STRING === $t[0]) {
- $class .= $t[1];
- } elseif ('' !== $class && T_WHITESPACE === $t[0]) {
- break;
- }
- }
-
- $classes[] = ltrim($namespace.$class, '\\');
- break;
- default:
- break;
- }
- }
-
- return $classes;
- }
-}
diff --git a/vendor/symfony/class-loader/LICENSE b/vendor/symfony/class-loader/LICENSE
deleted file mode 100644
index 17d16a13..00000000
--- a/vendor/symfony/class-loader/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2004-2017 Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/symfony/class-loader/MapClassLoader.php b/vendor/symfony/class-loader/MapClassLoader.php
deleted file mode 100644
index 1d8bcc2a..00000000
--- a/vendor/symfony/class-loader/MapClassLoader.php
+++ /dev/null
@@ -1,68 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * A class loader that uses a mapping file to look up paths.
- *
- * @author Fabien Potencier
- */
-class MapClassLoader
-{
- private $map = array();
-
- /**
- * Constructor.
- *
- * @param array $map A map where keys are classes and values the absolute file path
- */
- public function __construct(array $map)
- {
- $this->map = $map;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- */
- public function loadClass($class)
- {
- if (isset($this->map[$class])) {
- require $this->map[$class];
- }
- }
-
- /**
- * Finds the path to the file where the class is defined.
- *
- * @param string $class The name of the class
- *
- * @return string|null The path, if found
- */
- public function findFile($class)
- {
- if (isset($this->map[$class])) {
- return $this->map[$class];
- }
- }
-}
diff --git a/vendor/symfony/class-loader/Psr4ClassLoader.php b/vendor/symfony/class-loader/Psr4ClassLoader.php
deleted file mode 100644
index 84647b75..00000000
--- a/vendor/symfony/class-loader/Psr4ClassLoader.php
+++ /dev/null
@@ -1,93 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * A PSR-4 compatible class loader.
- *
- * See http://www.php-fig.org/psr/psr-4/
- *
- * @author Alexander M. Turek
- */
-class Psr4ClassLoader
-{
- /**
- * @var array
- */
- private $prefixes = array();
-
- /**
- * @param string $prefix
- * @param string $baseDir
- */
- public function addPrefix($prefix, $baseDir)
- {
- $prefix = trim($prefix, '\\').'\\';
- $baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
- $this->prefixes[] = array($prefix, $baseDir);
- }
-
- /**
- * @param string $class
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $class = ltrim($class, '\\');
-
- foreach ($this->prefixes as list($currentPrefix, $currentBaseDir)) {
- if (0 === strpos($class, $currentPrefix)) {
- $classWithoutPrefix = substr($class, strlen($currentPrefix));
- $file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
- if (file_exists($file)) {
- return $file;
- }
- }
- }
- }
-
- /**
- * @param string $class
- *
- * @return bool
- */
- public function loadClass($class)
- {
- $file = $this->findFile($class);
- if (null !== $file) {
- require $file;
-
- return true;
- }
-
- return false;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Removes this instance from the registered autoloaders.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-}
diff --git a/vendor/symfony/class-loader/README.md b/vendor/symfony/class-loader/README.md
deleted file mode 100644
index d61992b6..00000000
--- a/vendor/symfony/class-loader/README.md
+++ /dev/null
@@ -1,14 +0,0 @@
-ClassLoader Component
-=====================
-
-The ClassLoader component provides tools to autoload your classes and cache
-their locations for performance.
-
-Resources
----------
-
- * [Documentation](https://symfony.com/doc/current/components/class_loader/index.html)
- * [Contributing](https://symfony.com/doc/current/contributing/index.html)
- * [Report issues](https://github.com/symfony/symfony/issues) and
- [send Pull Requests](https://github.com/symfony/symfony/pulls)
- in the [main Symfony repository](https://github.com/symfony/symfony)
diff --git a/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php b/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php
deleted file mode 100644
index 8ad7132e..00000000
--- a/vendor/symfony/class-loader/Tests/ApcClassLoaderTest.php
+++ /dev/null
@@ -1,197 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\ClassLoader\ApcClassLoader;
-use Symfony\Component\ClassLoader\ClassLoader;
-
-class ApcClassLoaderTest extends TestCase
-{
- protected function setUp()
- {
- if (!(ini_get('apc.enabled') && ini_get('apc.enable_cli'))) {
- $this->markTestSkipped('The apc extension is not enabled.');
- } else {
- apcu_clear_cache();
- }
- }
-
- protected function tearDown()
- {
- if (ini_get('apc.enabled') && ini_get('apc.enable_cli')) {
- apcu_clear_cache();
- }
- }
-
- public function testConstructor()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
-
- $loader = new ApcClassLoader('test.prefix.', $loader);
-
- $this->assertEquals($loader->findFile('\Apc\Namespaced\FooBar'), apcu_fetch('test.prefix.\Apc\Namespaced\FooBar'), '__construct() takes a prefix as its first argument');
- }
-
- /**
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
-
- $loader = new ApcClassLoader('test.prefix.', $loader);
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassTests()
- {
- return array(
- array('\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'),
- array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'),
- );
- }
-
- /**
- * @dataProvider getLoadClassFromFallbackTests
- */
- public function testLoadClassFromFallback($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Apc\Namespaced', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Apc_Pearlike_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/fallback'));
-
- $loader = new ApcClassLoader('test.prefix.fallback', $loader);
- $loader->loadClass($testClassName);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassFromFallbackTests()
- {
- return array(
- array('\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'),
- array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'),
- array('\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'),
- array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'),
- );
- }
-
- /**
- * @dataProvider getLoadClassNamespaceCollisionTests
- */
- public function testLoadClassNamespaceCollision($namespaces, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($namespaces);
-
- $loader = new ApcClassLoader('test.prefix.collision.', $loader);
- $loader->loadClass($className);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassNamespaceCollisionTests()
- {
- return array(
- array(
- array(
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- ),
- 'Apc\NamespaceCollision\A\Foo',
- '->loadClass() loads NamespaceCollision\A\Foo from alpha.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- ),
- 'Apc\NamespaceCollision\A\Bar',
- '->loadClass() loads NamespaceCollision\A\Bar from alpha.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- ),
- 'Apc\NamespaceCollision\A\B\Foo',
- '->loadClass() loads NamespaceCollision\A\B\Foo from beta.',
- ),
- array(
- array(
- 'Apc\\NamespaceCollision\\A\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta',
- 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha',
- ),
- 'Apc\NamespaceCollision\A\B\Bar',
- '->loadClass() loads NamespaceCollision\A\B\Bar from beta.',
- ),
- );
- }
-
- /**
- * @dataProvider getLoadClassPrefixCollisionTests
- */
- public function testLoadClassPrefixCollision($prefixes, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($prefixes);
-
- $loader = new ApcClassLoader('test.prefix.collision.', $loader);
- $loader->loadClass($className);
-
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassPrefixCollisionTests()
- {
- return array(
- array(
- array(
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- ),
- 'ApcPrefixCollision_A_Foo',
- '->loadClass() loads ApcPrefixCollision_A_Foo from alpha.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- ),
- 'ApcPrefixCollision_A_Bar',
- '->loadClass() loads ApcPrefixCollision_A_Bar from alpha.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- ),
- 'ApcPrefixCollision_A_B_Foo',
- '->loadClass() loads ApcPrefixCollision_A_B_Foo from beta.',
- ),
- array(
- array(
- 'ApcPrefixCollision_A_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/beta/Apc',
- 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc',
- ),
- 'ApcPrefixCollision_A_B_Bar',
- '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.',
- ),
- );
- }
-}
diff --git a/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php b/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php
deleted file mode 100644
index 42bb04d9..00000000
--- a/vendor/symfony/class-loader/Tests/ClassCollectionLoaderTest.php
+++ /dev/null
@@ -1,316 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\ClassLoader\ClassCollectionLoader;
-use Symfony\Component\ClassLoader\Tests\Fixtures\DeclaredClass;
-use Symfony\Component\ClassLoader\Tests\Fixtures\WarmedClass;
-
-require_once __DIR__.'/Fixtures/ClassesWithParents/GInterface.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/CInterface.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/B.php';
-require_once __DIR__.'/Fixtures/ClassesWithParents/A.php';
-
-class ClassCollectionLoaderTest extends TestCase
-{
- public function testTraitDependencies()
- {
- require_once __DIR__.'/Fixtures/deps/traits.php';
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, array('CTFoo'));
-
- $this->assertEquals(
- array('TD', 'TC', 'TB', 'TA', 'TZ', 'CTFoo'),
- array_map(function ($class) { return $class->getName(); }, $ordered)
- );
-
- $ordered = $m->invoke(null, array('CTBar'));
-
- $this->assertEquals(
- array('TD', 'TZ', 'TC', 'TB', 'TA', 'CTBar'),
- array_map(function ($class) { return $class->getName(); }, $ordered)
- );
- }
-
- /**
- * @dataProvider getDifferentOrders
- */
- public function testClassReordering(array $classes)
- {
- $expected = array(
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- public function getDifferentOrders()
- {
- return array(
- array(array(
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\B',
- )),
- array(array(
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\CInterface',
- )),
- array(array(
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- )),
- array(array(
- 'ClassesWithParents\\A',
- )),
- );
- }
-
- /**
- * @dataProvider getDifferentOrdersForTraits
- */
- public function testClassWithTraitsReordering(array $classes)
- {
- require_once __DIR__.'/Fixtures/ClassesWithParents/ATrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/BTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/D.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/E.php';
-
- $expected = array(
- 'ClassesWithParents\\GInterface',
- 'ClassesWithParents\\CInterface',
- 'ClassesWithParents\\ATrait',
- 'ClassesWithParents\\BTrait',
- 'ClassesWithParents\\CTrait',
- 'ClassesWithParents\\B',
- 'ClassesWithParents\\A',
- 'ClassesWithParents\\D',
- 'ClassesWithParents\\E',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- public function getDifferentOrdersForTraits()
- {
- return array(
- array(array(
- 'ClassesWithParents\\E',
- 'ClassesWithParents\\ATrait',
- )),
- array(array(
- 'ClassesWithParents\\E',
- )),
- );
- }
-
- public function testFixClassWithTraitsOrdering()
- {
- require_once __DIR__.'/Fixtures/ClassesWithParents/CTrait.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/F.php';
- require_once __DIR__.'/Fixtures/ClassesWithParents/G.php';
-
- $classes = array(
- 'ClassesWithParents\\F',
- 'ClassesWithParents\\G',
- );
-
- $expected = array(
- 'ClassesWithParents\\CTrait',
- 'ClassesWithParents\\F',
- 'ClassesWithParents\\G',
- );
-
- $r = new \ReflectionClass('Symfony\Component\ClassLoader\ClassCollectionLoader');
- $m = $r->getMethod('getOrderedClasses');
- $m->setAccessible(true);
-
- $ordered = $m->invoke(null, $classes);
-
- $this->assertEquals($expected, array_map(function ($class) { return $class->getName(); }, $ordered));
- }
-
- /**
- * @dataProvider getFixNamespaceDeclarationsData
- */
- public function testFixNamespaceDeclarations($source, $expected)
- {
- $this->assertEquals('assertEquals('assertEquals(<<<'EOF'
-namespace Namespaced
-{
-class WithComments
-{
-public static $loaded = true;
-}
-$string ='string should not be modified {$string}';
-$heredoc = (<<assertTrue(class_exists(WarmedClass::class, true));
-
- @unlink($cache = sys_get_temp_dir().'/inline.php');
-
- $classes = array(WarmedClass::class);
- $excluded = array(DeclaredClass::class);
-
- ClassCollectionLoader::inline($classes, $cache, $excluded);
-
- $this->assertSame(<<<'EOTXT'
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\ClassLoader\ClassLoader;
-
-class ClassLoaderTest extends TestCase
-{
- public function testGetPrefixes()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Bar', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Bas', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertArrayNotHasKey('Foo1', $prefixes);
- $this->assertArrayHasKey('Bar', $prefixes);
- $this->assertArrayHasKey('Bas', $prefixes);
- }
-
- public function testGetFallbackDirs()
- {
- $loader = new ClassLoader();
- $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix(null, __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $fallback_dirs = $loader->getFallbackDirs();
- $this->assertCount(2, $fallback_dirs);
- }
-
- /**
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassTests()
- {
- return array(
- array('\\Namespaced2\\Foo', 'Namespaced2\\Foo', '->loadClass() loads Namespaced2\Foo class'),
- array('\\Pearlike2_Foo', 'Pearlike2_Foo', '->loadClass() loads Pearlike2_Foo class'),
- );
- }
-
- /**
- * @dataProvider getLoadNonexistentClassTests
- */
- public function testLoadNonexistentClass($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->loadClass($testClassName);
- $this->assertFalse(class_exists($className), $message);
- }
-
- public function getLoadNonexistentClassTests()
- {
- return array(
- array('\\Pearlike3_Bar', '\\Pearlike3_Bar', '->loadClass() loads non existing Pearlike3_Bar class with a leading slash'),
- );
- }
-
- public function testAddPrefixSingle()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Foo', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(1, $prefixes['Foo']);
- }
-
- public function testAddPrefixesSingle()
- {
- $loader = new ClassLoader();
- $loader->addPrefixes(array('Foo' => array('foo', 'foo')));
- $loader->addPrefixes(array('Foo' => array('foo')));
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(1, $prefixes['Foo'], print_r($prefixes, true));
- }
-
- public function testAddPrefixMulti()
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Foo', 'foo');
- $loader->addPrefix('Foo', 'bar');
- $prefixes = $loader->getPrefixes();
- $this->assertArrayHasKey('Foo', $prefixes);
- $this->assertCount(2, $prefixes['Foo']);
- $this->assertContains('foo', $prefixes['Foo']);
- $this->assertContains('bar', $prefixes['Foo']);
- }
-
- public function testUseIncludePath()
- {
- $loader = new ClassLoader();
- $this->assertFalse($loader->getUseIncludePath());
-
- $this->assertNull($loader->findFile('Foo'));
-
- $includePath = get_include_path();
-
- $loader->setUseIncludePath(true);
- $this->assertTrue($loader->getUseIncludePath());
-
- set_include_path(__DIR__.'/Fixtures/includepath'.PATH_SEPARATOR.$includePath);
-
- $this->assertEquals(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'includepath'.DIRECTORY_SEPARATOR.'Foo.php', $loader->findFile('Foo'));
-
- set_include_path($includePath);
- }
-
- /**
- * @dataProvider getLoadClassFromFallbackTests
- */
- public function testLoadClassFromFallback($className, $testClassName, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefix('Namespaced2\\', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('Pearlike2_', __DIR__.DIRECTORY_SEPARATOR.'Fixtures');
- $loader->addPrefix('', array(__DIR__.DIRECTORY_SEPARATOR.'Fixtures/fallback'));
- $loader->loadClass($testClassName);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassFromFallbackTests()
- {
- return array(
- array('\\Namespaced2\\Baz', 'Namespaced2\\Baz', '->loadClass() loads Namespaced2\Baz class'),
- array('\\Pearlike2_Baz', 'Pearlike2_Baz', '->loadClass() loads Pearlike2_Baz class'),
- array('\\Namespaced2\\FooBar', 'Namespaced2\\FooBar', '->loadClass() loads Namespaced2\Baz class from fallback dir'),
- array('\\Pearlike2_FooBar', 'Pearlike2_FooBar', '->loadClass() loads Pearlike2_Baz class from fallback dir'),
- );
- }
-
- /**
- * @dataProvider getLoadClassNamespaceCollisionTests
- */
- public function testLoadClassNamespaceCollision($namespaces, $className, $message)
- {
- $loader = new ClassLoader();
- $loader->addPrefixes($namespaces);
-
- $loader->loadClass($className);
- $this->assertTrue(class_exists($className), $message);
- }
-
- public function getLoadClassNamespaceCollisionTests()
- {
- return array(
- array(
- array(
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'NamespaceCollision\C\Foo',
- '->loadClass() loads NamespaceCollision\C\Foo from alpha.',
- ),
- array(
- array(
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'NamespaceCollision\C\Bar',
- '->loadClass() loads NamespaceCollision\C\Bar from alpha.',
- ),
- array(
- array(
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'NamespaceCollision\C\B\Foo',
- '->loadClass() loads NamespaceCollision\C\B\Foo from beta.',
- ),
- array(
- array(
- 'NamespaceCollision\\C\\B' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'NamespaceCollision\\C' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'NamespaceCollision\C\B\Bar',
- '->loadClass() loads NamespaceCollision\C\B\Bar from beta.',
- ),
- array(
- array(
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'PrefixCollision_C_Foo',
- '->loadClass() loads PrefixCollision_C_Foo from alpha.',
- ),
- array(
- array(
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'PrefixCollision_C_Bar',
- '->loadClass() loads PrefixCollision_C_Bar from alpha.',
- ),
- array(
- array(
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- ),
- 'PrefixCollision_C_B_Foo',
- '->loadClass() loads PrefixCollision_C_B_Foo from beta.',
- ),
- array(
- array(
- 'PrefixCollision_C_B_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/beta',
- 'PrefixCollision_C_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/alpha',
- ),
- 'PrefixCollision_C_B_Bar',
- '->loadClass() loads PrefixCollision_C_B_Bar from beta.',
- ),
- );
- }
-}
diff --git a/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php b/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php
deleted file mode 100644
index 44359268..00000000
--- a/vendor/symfony/class-loader/Tests/ClassMapGeneratorTest.php
+++ /dev/null
@@ -1,148 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\ClassLoader\ClassMapGenerator;
-
-class ClassMapGeneratorTest extends TestCase
-{
- /**
- * @var string|null
- */
- private $workspace = null;
-
- public function prepare_workspace()
- {
- $this->workspace = sys_get_temp_dir().'/'.microtime(true).'.'.mt_rand();
- mkdir($this->workspace, 0777, true);
- $this->workspace = realpath($this->workspace);
- }
-
- /**
- * @param string $file
- */
- private function clean($file)
- {
- if (is_dir($file) && !is_link($file)) {
- $dir = new \FilesystemIterator($file);
- foreach ($dir as $childFile) {
- $this->clean($childFile);
- }
-
- rmdir($file);
- } else {
- unlink($file);
- }
- }
-
- /**
- * @dataProvider getTestCreateMapTests
- */
- public function testDump($directory)
- {
- $this->prepare_workspace();
-
- $file = $this->workspace.'/file';
-
- $generator = new ClassMapGenerator();
- $generator->dump($directory, $file);
- $this->assertFileExists($file);
-
- $this->clean($this->workspace);
- }
-
- /**
- * @dataProvider getTestCreateMapTests
- */
- public function testCreateMap($directory, $expected)
- {
- $this->assertEqualsNormalized($expected, ClassMapGenerator::createMap($directory));
- }
-
- public function getTestCreateMapTests()
- {
- $data = array(
- array(__DIR__.'/Fixtures/Namespaced', array(
- 'Namespaced\\Bar' => realpath(__DIR__).'/Fixtures/Namespaced/Bar.php',
- 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php',
- 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php',
- 'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php',
- 'Namespaced\\WithStrictTypes' => realpath(__DIR__).'/Fixtures/Namespaced/WithStrictTypes.php',
- 'Namespaced\\WithHaltCompiler' => realpath(__DIR__).'/Fixtures/Namespaced/WithHaltCompiler.php',
- 'Namespaced\\WithDirMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithDirMagic.php',
- 'Namespaced\\WithFileMagic' => realpath(__DIR__).'/Fixtures/Namespaced/WithFileMagic.php',
- )),
- array(__DIR__.'/Fixtures/beta/NamespaceCollision', array(
- 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
- 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
- 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php',
- 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
- )),
- array(__DIR__.'/Fixtures/Pearlike', array(
- 'Pearlike_Foo' => realpath(__DIR__).'/Fixtures/Pearlike/Foo.php',
- 'Pearlike_Bar' => realpath(__DIR__).'/Fixtures/Pearlike/Bar.php',
- 'Pearlike_Baz' => realpath(__DIR__).'/Fixtures/Pearlike/Baz.php',
- 'Pearlike_WithComments' => realpath(__DIR__).'/Fixtures/Pearlike/WithComments.php',
- )),
- array(__DIR__.'/Fixtures/classmap', array(
- 'Foo\\Bar\\A' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
- 'Foo\\Bar\\B' => realpath(__DIR__).'/Fixtures/classmap/sameNsMultipleClasses.php',
- 'A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Alpha\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Alpha\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Beta\\A' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'Beta\\B' => realpath(__DIR__).'/Fixtures/classmap/multipleNs.php',
- 'ClassMap\\SomeInterface' => realpath(__DIR__).'/Fixtures/classmap/SomeInterface.php',
- 'ClassMap\\SomeParent' => realpath(__DIR__).'/Fixtures/classmap/SomeParent.php',
- 'ClassMap\\SomeClass' => realpath(__DIR__).'/Fixtures/classmap/SomeClass.php',
- )),
- array(__DIR__.'/Fixtures/php5.4', array(
- 'TFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'CFoo' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\TBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\IBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- 'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
- )),
- array(__DIR__.'/Fixtures/php5.5', array(
- 'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
- )),
- );
-
- return $data;
- }
-
- public function testCreateMapFinderSupport()
- {
- $finder = new \Symfony\Component\Finder\Finder();
- $finder->files()->in(__DIR__.'/Fixtures/beta/NamespaceCollision');
-
- $this->assertEqualsNormalized(array(
- 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php',
- 'NamespaceCollision\\A\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Foo.php',
- 'NamespaceCollision\\C\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Bar.php',
- 'NamespaceCollision\\C\\B\\Foo' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/C/B/Foo.php',
- ), ClassMapGenerator::createMap($finder));
- }
-
- protected function assertEqualsNormalized($expected, $actual, $message = null)
- {
- foreach ($expected as $ns => $path) {
- $expected[$ns] = str_replace('\\', '/', $path);
- }
- foreach ($actual as $ns => $path) {
- $actual[$ns] = str_replace('\\', '/', $path);
- }
- $this->assertEquals($expected, $actual, $message);
- }
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php
deleted file mode 100644
index 4259f145..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Bar.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php
deleted file mode 100644
index 3ddb595e..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Baz.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Baz
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php
deleted file mode 100644
index cf0a4b74..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php
deleted file mode 100644
index bbbc8151..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Namespaced/FooBar.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php
deleted file mode 100644
index e774cb9b..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/Pearlike/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php
deleted file mode 100644
index 184a1b1d..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/alpha/Apc/NamespaceCollision/A/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php
deleted file mode 100644
index 3892f706..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/ApcPrefixCollision/A/B/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A\B;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php
deleted file mode 100644
index 450eeb50..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/beta/Apc/NamespaceCollision/A/B/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\NamespaceCollision\A\B;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php
deleted file mode 100644
index 96f2f76c..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Apc/fallback/Apc/Pearlike/FooBar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Apc\Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php b/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php
deleted file mode 100644
index b0f94259..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/ClassesWithParents/A.php
+++ /dev/null
@@ -1,7 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php
deleted file mode 100644
index 0b0bbd05..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Baz.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Baz
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php
deleted file mode 100644
index df5e1f4c..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php b/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php
deleted file mode 100644
index 361e53de..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Namespaced/WithComments.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class WithComments
-{
- /** @Boolean */
- public static $loaded = true;
-}
-
-$string = 'string should not be modified {$string}';
-
-$heredoc = (<<
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-class Pearlike_WithComments
-{
- /** @Boolean */
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php
deleted file mode 100644
index 7f5f7977..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/Pearlike2/Bar.php
+++ /dev/null
@@ -1,6 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php
deleted file mode 100644
index aee6a080..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/A/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php
deleted file mode 100644
index c1b8dd65..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/alpha/NamespaceCollision/C/Bar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A\B;
-
-class Bar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php b/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php
deleted file mode 100644
index f5f2d727..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/A/B/Foo.php
+++ /dev/null
@@ -1,17 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace NamespaceCollision\A\B;
-
-class Foo
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php b/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php
deleted file mode 100644
index 4bb03dc7..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/beta/NamespaceCollision/C/B/Bar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-class SomeClass extends SomeParent implements SomeInterface
-{
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php
deleted file mode 100644
index 1fe5e09a..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeInterface.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-interface SomeInterface
-{
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php
deleted file mode 100644
index ce2f9fc6..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/SomeParent.php
+++ /dev/null
@@ -1,16 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace ClassMap;
-
-abstract class SomeParent
-{
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php b/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php
deleted file mode 100644
index c7cec646..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/classmap/multipleNs.php
+++ /dev/null
@@ -1,25 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Foo\Bar;
-
-class A
-{
-}
-class B
-{
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php b/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php
deleted file mode 100644
index 82b30a6f..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/deps/traits.php
+++ /dev/null
@@ -1,37 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Namespaced;
-
-class FooBar
-{
- public static $loaded = true;
-}
diff --git a/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php b/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php
deleted file mode 100644
index 1036d435..00000000
--- a/vendor/symfony/class-loader/Tests/Fixtures/fallback/Namespaced2/FooBar.php
+++ /dev/null
@@ -1,8 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader\Tests;
-
-use PHPUnit\Framework\TestCase;
-use Symfony\Component\ClassLoader\Psr4ClassLoader;
-
-class Psr4ClassLoaderTest extends TestCase
-{
- /**
- * @param string $className
- * @dataProvider getLoadClassTests
- */
- public function testLoadClass($className)
- {
- $loader = new Psr4ClassLoader();
- $loader->addPrefix(
- 'Acme\\DemoLib',
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
- );
- $loader->loadClass($className);
- $this->assertTrue(class_exists($className), sprintf('loadClass() should load %s', $className));
- }
-
- /**
- * @return array
- */
- public function getLoadClassTests()
- {
- return array(
- array('Acme\\DemoLib\\Foo'),
- array('Acme\\DemoLib\\Class_With_Underscores'),
- array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'),
- array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'),
- );
- }
-
- /**
- * @param string $className
- * @dataProvider getLoadNonexistentClassTests
- */
- public function testLoadNonexistentClass($className)
- {
- $loader = new Psr4ClassLoader();
- $loader->addPrefix(
- 'Acme\\DemoLib',
- __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
- );
- $loader->loadClass($className);
- $this->assertFalse(class_exists($className), sprintf('loadClass() should not load %s', $className));
- }
-
- /**
- * @return array
- */
- public function getLoadNonexistentClassTests()
- {
- return array(
- array('Acme\\DemoLib\\I_Do_Not_Exist'),
- array('UnknownVendor\\SomeLib\\I_Do_Not_Exist'),
- );
- }
-}
diff --git a/vendor/symfony/class-loader/WinCacheClassLoader.php b/vendor/symfony/class-loader/WinCacheClassLoader.php
deleted file mode 100644
index b95a1d79..00000000
--- a/vendor/symfony/class-loader/WinCacheClassLoader.php
+++ /dev/null
@@ -1,140 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * WinCacheClassLoader implements a wrapping autoloader cached in WinCache.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allow using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new WinCacheClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- * @author Artem Ryzhkov
- */
-class WinCacheClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- protected $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The WinCache namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!extension_loaded('wincache')) {
- throw new \RuntimeException('Unable to use WinCacheClassLoader as WinCache is not enabled.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to WinCache.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- $file = wincache_ucache_get($this->prefix.$class, $success);
-
- if (!$success) {
- wincache_ucache_set($this->prefix.$class, $file = $this->decorated->findFile($class) ?: null, 0);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/vendor/symfony/class-loader/XcacheClassLoader.php b/vendor/symfony/class-loader/XcacheClassLoader.php
deleted file mode 100644
index bf309a69..00000000
--- a/vendor/symfony/class-loader/XcacheClassLoader.php
+++ /dev/null
@@ -1,141 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\ClassLoader;
-
-/**
- * XcacheClassLoader implements a wrapping autoloader cached in XCache for PHP 5.3.
- *
- * It expects an object implementing a findFile method to find the file. This
- * allows using it as a wrapper around the other loaders of the component (the
- * ClassLoader for instance) but also around any other autoloaders following
- * this convention (the Composer one for instance).
- *
- * // with a Symfony autoloader
- * $loader = new ClassLoader();
- * $loader->addPrefix('Symfony\Component', __DIR__.'/component');
- * $loader->addPrefix('Symfony', __DIR__.'/framework');
- *
- * // or with a Composer autoloader
- * use Composer\Autoload\ClassLoader;
- *
- * $loader = new ClassLoader();
- * $loader->add('Symfony\Component', __DIR__.'/component');
- * $loader->add('Symfony', __DIR__.'/framework');
- *
- * $cachedLoader = new XcacheClassLoader('my_prefix', $loader);
- *
- * // activate the cached autoloader
- * $cachedLoader->register();
- *
- * // eventually deactivate the non-cached loader if it was registered previously
- * // to be sure to use the cached one.
- * $loader->unregister();
- *
- * @author Fabien Potencier
- * @author Kris Wallsmith
- * @author Kim Hemsø Rasmussen
- */
-class XcacheClassLoader
-{
- private $prefix;
-
- /**
- * A class loader object that implements the findFile() method.
- *
- * @var object
- */
- private $decorated;
-
- /**
- * Constructor.
- *
- * @param string $prefix The XCache namespace prefix to use
- * @param object $decorated A class loader object that implements the findFile() method
- *
- * @throws \RuntimeException
- * @throws \InvalidArgumentException
- */
- public function __construct($prefix, $decorated)
- {
- if (!extension_loaded('xcache')) {
- throw new \RuntimeException('Unable to use XcacheClassLoader as XCache is not enabled.');
- }
-
- if (!method_exists($decorated, 'findFile')) {
- throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
- }
-
- $this->prefix = $prefix;
- $this->decorated = $decorated;
- }
-
- /**
- * Registers this instance as an autoloader.
- *
- * @param bool $prepend Whether to prepend the autoloader or not
- */
- public function register($prepend = false)
- {
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
- }
-
- /**
- * Unregisters this instance as an autoloader.
- */
- public function unregister()
- {
- spl_autoload_unregister(array($this, 'loadClass'));
- }
-
- /**
- * Loads the given class or interface.
- *
- * @param string $class The name of the class
- *
- * @return bool|null True, if loaded
- */
- public function loadClass($class)
- {
- if ($file = $this->findFile($class)) {
- require $file;
-
- return true;
- }
- }
-
- /**
- * Finds a file by class name while caching lookups to Xcache.
- *
- * @param string $class A class name to resolve to file
- *
- * @return string|null
- */
- public function findFile($class)
- {
- if (xcache_isset($this->prefix.$class)) {
- $file = xcache_get($this->prefix.$class);
- } else {
- $file = $this->decorated->findFile($class) ?: null;
- xcache_set($this->prefix.$class, $file);
- }
-
- return $file;
- }
-
- /**
- * Passes through all unknown calls onto the decorated object.
- */
- public function __call($method, $args)
- {
- return call_user_func_array(array($this->decorated, $method), $args);
- }
-}
diff --git a/vendor/symfony/class-loader/composer.json b/vendor/symfony/class-loader/composer.json
deleted file mode 100644
index 634c647c..00000000
--- a/vendor/symfony/class-loader/composer.json
+++ /dev/null
@@ -1,40 +0,0 @@
-{
- "name": "symfony/class-loader",
- "type": "library",
- "description": "Symfony ClassLoader Component",
- "keywords": [],
- "homepage": "https://symfony.com",
- "license": "MIT",
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "minimum-stability": "dev",
- "require": {
- "php": ">=5.5.9"
- },
- "require-dev": {
- "symfony/finder": "~2.8|~3.0",
- "symfony/polyfill-apcu": "~1.1"
- },
- "suggest": {
- "symfony/polyfill-apcu": "For using ApcClassLoader on HHVM"
- },
- "autoload": {
- "psr-4": { "Symfony\\Component\\ClassLoader\\": "" },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "extra": {
- "branch-alias": {
- "dev-master": "3.2-dev"
- }
- }
-}
diff --git a/vendor/symfony/class-loader/phpunit.xml.dist b/vendor/symfony/class-loader/phpunit.xml.dist
deleted file mode 100644
index 5158b22f..00000000
--- a/vendor/symfony/class-loader/phpunit.xml.dist
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
- ./Tests/
-
-
-
-
-
- ./
-
- ./Resources
- ./Tests
- ./vendor
-
-
-
-
diff --git a/vendor/topthink/think-captcha/src/Captcha.php b/vendor/topthink/think-captcha/src/Captcha.php
index c97e49d9..6c7f8f4a 100644
--- a/vendor/topthink/think-captcha/src/Captcha.php
+++ b/vendor/topthink/think-captcha/src/Captcha.php
@@ -12,7 +12,6 @@
namespace think\captcha;
use think\Session;
-use think\Cache;
/**
* @property mixed seKey
@@ -231,14 +230,7 @@ class Captcha
$secode['verify_code'] = $code; // 把校验码保存到session
$secode['verify_time'] = time(); // 验证码创建时间
Session::set($key . $id, $secode, '');
- //存储到数据库
-// Db::table('t_captcha')->insert(array(
-// 'code'=>$code,
-// 'vkey'=>md5($id),
-// 'time'=> time()
-// ));
- //存储到缓存
- Cache::set(md5($id),$code,3600);
+
ob_start();
// 输出图像
imagepng($this->im);
|