├── Controller └── PrintTaskController.php ├── LICENSE ├── Locale └── pt_BR │ └── translations.php ├── Makefile ├── Misc └── 1_Test Task.pdf ├── Model └── PrintModel.php ├── Plugin.php ├── README.md ├── Template ├── config │ └── font_toggle.php ├── print.php ├── printlayout │ ├── comments.php │ ├── comments_show.php │ ├── description.php │ ├── details.php │ ├── file_table.php │ ├── files.php │ ├── i_links_table.php │ ├── internal_links.php │ ├── printlayout_cjk.php │ ├── printlayout_n.php │ ├── subtable.php │ └── subtasks.php └── project_header │ └── print_project.php ├── _config.yml ├── composer.json ├── composer.lock ├── font └── DroidSansFallback.ttf └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── InstalledVersions.php ├── LICENSE ├── autoload_classmap.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php ├── installed.json ├── installed.php └── platform_check.php ├── dompdf └── dompdf │ ├── AUTHORS.md │ ├── LICENSE.LGPL │ ├── README.md │ ├── VERSION │ ├── composer.json │ ├── lib │ ├── Cpdf.php │ ├── fonts │ │ ├── Courier-Bold.afm │ │ ├── Courier-BoldOblique.afm │ │ ├── Courier-Oblique.afm │ │ ├── Courier.afm │ │ ├── DejaVuSans-Bold.ttf │ │ ├── DejaVuSans-Bold.ufm │ │ ├── DejaVuSans-Bold.ufm.json │ │ ├── DejaVuSans-BoldOblique.ttf │ │ ├── DejaVuSans-BoldOblique.ufm │ │ ├── DejaVuSans-Oblique.ttf │ │ ├── DejaVuSans-Oblique.ufm │ │ ├── DejaVuSans-Oblique.ufm.json │ │ ├── DejaVuSans.ttf │ │ ├── DejaVuSans.ufm │ │ ├── DejaVuSans.ufm.json │ │ ├── DejaVuSansMono-Bold.ttf │ │ ├── DejaVuSansMono-Bold.ufm │ │ ├── DejaVuSansMono-BoldOblique.ttf │ │ ├── DejaVuSansMono-BoldOblique.ufm │ │ ├── DejaVuSansMono-Oblique.ttf │ │ ├── DejaVuSansMono-Oblique.ufm │ │ ├── DejaVuSansMono.ttf │ │ ├── DejaVuSansMono.ufm │ │ ├── DejaVuSerif-Bold.ttf │ │ ├── DejaVuSerif-Bold.ufm │ │ ├── DejaVuSerif-BoldItalic.ttf │ │ ├── DejaVuSerif-BoldItalic.ufm │ │ ├── DejaVuSerif-Italic.ttf │ │ ├── DejaVuSerif-Italic.ufm │ │ ├── DejaVuSerif.ttf │ │ ├── DejaVuSerif.ufm │ │ ├── Helvetica-Bold.afm │ │ ├── Helvetica-BoldOblique.afm │ │ ├── Helvetica-Oblique.afm │ │ ├── Helvetica.afm │ │ ├── Symbol.afm │ │ ├── Times-Bold.afm │ │ ├── Times-BoldItalic.afm │ │ ├── Times-Italic.afm │ │ ├── Times-Roman.afm │ │ ├── ZapfDingbats.afm │ │ ├── installed-fonts.dist.json │ │ └── mustRead.html │ └── res │ │ ├── broken_image.png │ │ ├── broken_image.svg │ │ └── html.css │ └── src │ ├── Adapter │ ├── CPDF.php │ ├── GD.php │ └── PDFLib.php │ ├── Canvas.php │ ├── CanvasFactory.php │ ├── Cellmap.php │ ├── Css │ ├── AttributeTranslator.php │ ├── Color.php │ ├── Style.php │ └── Stylesheet.php │ ├── Dompdf.php │ ├── Exception.php │ ├── Exception │ └── ImageException.php │ ├── FontMetrics.php │ ├── Frame.php │ ├── Frame │ ├── Factory.php │ ├── FrameListIterator.php │ ├── FrameTree.php │ └── FrameTreeIterator.php │ ├── FrameDecorator │ ├── AbstractFrameDecorator.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── ListBulletImage.php │ ├── NullFrameDecorator.php │ ├── Page.php │ ├── Table.php │ ├── TableCell.php │ ├── TableRow.php │ ├── TableRowGroup.php │ └── Text.php │ ├── FrameReflower │ ├── AbstractFrameReflower.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── NullFrameReflower.php │ ├── Page.php │ ├── Table.php │ ├── TableCell.php │ ├── TableRow.php │ ├── TableRowGroup.php │ └── Text.php │ ├── Helpers.php │ ├── Image │ └── Cache.php │ ├── JavascriptEmbedder.php │ ├── LineBox.php │ ├── Options.php │ ├── PhpEvaluator.php │ ├── Positioner │ ├── Absolute.php │ ├── AbstractPositioner.php │ ├── Block.php │ ├── Fixed.php │ ├── Inline.php │ ├── ListBullet.php │ ├── NullPositioner.php │ ├── TableCell.php │ └── TableRow.php │ ├── Renderer.php │ └── Renderer │ ├── AbstractRenderer.php │ ├── Block.php │ ├── Image.php │ ├── Inline.php │ ├── ListBullet.php │ ├── TableCell.php │ ├── TableRowGroup.php │ └── Text.php ├── masterminds └── html5 │ ├── CREDITS │ ├── LICENSE.txt │ ├── README.md │ ├── RELEASE.md │ ├── UPGRADING.md │ ├── bin │ └── entities.php │ ├── composer.json │ └── src │ ├── HTML5.php │ └── HTML5 │ ├── Elements.php │ ├── Entities.php │ ├── Exception.php │ ├── InstructionProcessor.php │ ├── Parser │ ├── CharacterReference.php │ ├── DOMTreeBuilder.php │ ├── EventHandler.php │ ├── FileInputStream.php │ ├── InputStream.php │ ├── ParseError.php │ ├── README.md │ ├── Scanner.php │ ├── StringInputStream.php │ ├── Tokenizer.php │ ├── TreeBuildingRules.php │ └── UTF8Utils.php │ └── Serializer │ ├── HTML5Entities.php │ ├── OutputRules.php │ ├── README.md │ ├── RulesInterface.php │ └── Traverser.php ├── phenx ├── php-font-lib │ ├── .github │ │ └── workflows │ │ │ └── phpunit.yml │ ├── .htaccess │ ├── LICENSE │ ├── README.md │ ├── bower.json │ ├── composer.json │ ├── index.php │ ├── maps │ │ ├── adobe-standard-encoding.map │ │ ├── cp1250.map │ │ ├── cp1251.map │ │ ├── cp1252.map │ │ ├── cp1253.map │ │ ├── cp1254.map │ │ ├── cp1255.map │ │ ├── cp1257.map │ │ ├── cp1258.map │ │ ├── cp874.map │ │ ├── iso-8859-1.map │ │ ├── iso-8859-11.map │ │ ├── iso-8859-15.map │ │ ├── iso-8859-16.map │ │ ├── iso-8859-2.map │ │ ├── iso-8859-4.map │ │ ├── iso-8859-5.map │ │ ├── iso-8859-7.map │ │ ├── iso-8859-9.map │ │ ├── koi8-r.map │ │ └── koi8-u.map │ └── src │ │ └── FontLib │ │ ├── AdobeFontMetrics.php │ │ ├── Autoloader.php │ │ ├── BinaryStream.php │ │ ├── EOT │ │ ├── File.php │ │ └── Header.php │ │ ├── EncodingMap.php │ │ ├── Exception │ │ └── FontNotFoundException.php │ │ ├── Font.php │ │ ├── Glyph │ │ ├── Outline.php │ │ ├── OutlineComponent.php │ │ ├── OutlineComposite.php │ │ └── OutlineSimple.php │ │ ├── Header.php │ │ ├── OpenType │ │ ├── File.php │ │ └── TableDirectoryEntry.php │ │ ├── Table │ │ ├── DirectoryEntry.php │ │ ├── Table.php │ │ └── Type │ │ │ ├── cmap.php │ │ │ ├── glyf.php │ │ │ ├── head.php │ │ │ ├── hhea.php │ │ │ ├── hmtx.php │ │ │ ├── kern.php │ │ │ ├── loca.php │ │ │ ├── maxp.php │ │ │ ├── name.php │ │ │ ├── nameRecord.php │ │ │ ├── os2.php │ │ │ └── post.php │ │ ├── TrueType │ │ ├── Collection.php │ │ ├── File.php │ │ ├── Header.php │ │ └── TableDirectoryEntry.php │ │ └── WOFF │ │ ├── File.php │ │ ├── Header.php │ │ └── TableDirectoryEntry.php └── php-svg-lib │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ └── Svg │ ├── CssLength.php │ ├── DefaultStyle.php │ ├── Document.php │ ├── Gradient │ └── Stop.php │ ├── Style.php │ ├── Surface │ ├── CPdf.php │ ├── SurfaceCpdf.php │ ├── SurfaceInterface.php │ └── SurfacePDFLib.php │ └── Tag │ ├── AbstractTag.php │ ├── Anchor.php │ ├── Circle.php │ ├── ClipPath.php │ ├── Ellipse.php │ ├── Group.php │ ├── Image.php │ ├── Line.php │ ├── LinearGradient.php │ ├── Path.php │ ├── Polygon.php │ ├── Polyline.php │ ├── RadialGradient.php │ ├── Rect.php │ ├── Shape.php │ ├── Stop.php │ ├── StyleTag.php │ ├── Text.php │ └── UseTag.php └── sabberworm └── php-css-parser ├── CHANGELOG.md ├── LICENSE ├── README.md ├── composer.json └── src ├── CSSList ├── AtRuleBlockList.php ├── CSSBlockList.php ├── CSSList.php ├── Document.php └── KeyFrame.php ├── Comment ├── Comment.php └── Commentable.php ├── OutputFormat.php ├── OutputFormatter.php ├── Parser.php ├── Parsing ├── OutputException.php ├── ParserState.php ├── SourceException.php ├── UnexpectedEOFException.php └── UnexpectedTokenException.php ├── Property ├── AtRule.php ├── CSSNamespace.php ├── Charset.php ├── Import.php ├── KeyframeSelector.php └── Selector.php ├── Renderable.php ├── Rule └── Rule.php ├── RuleSet ├── AtRuleSet.php ├── DeclarationBlock.php └── RuleSet.php ├── Settings.php └── Value ├── CSSFunction.php ├── CSSString.php ├── CalcFunction.php ├── CalcRuleValueList.php ├── Color.php ├── LineName.php ├── PrimitiveValue.php ├── RuleValueList.php ├── Size.php ├── URL.php ├── Value.php └── ValueList.php /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Craig Crosby 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Locale/pt_BR/translations.php: -------------------------------------------------------------------------------- 1 | 'Gerar PDF', 5 | 'Print Open Tasks' => 'Imprimir Tarefas Abertas', 6 | 'Created at' => 'Criado em', 7 | 'Updated at' => 'Atualizado em', 8 | 'Font Options' => 'Opções de Fontes', 9 | 'Embed Task Files Options' => 'Opções de incorporação de arquivos de tarefas', 10 | 'Download de PDF ou Inline' => 'Download de PDF ou exibição no navegador', 11 | 'Normal Font set when creating PDFs' => 'Fonte normal definida ao criar PDFs', 12 | 'CJK Font set when creating PDFs' => 'Fonte CJK definida ao criar PDFs', 13 | 'Embed Files when creating a PDF for a Task' => 'Incorporar arquivos ao criar um PDF para uma tarefa', 14 | 'Do not embed Files when creating a PDF for a Task' => 'Não incorpore arquivos ao criar um PDF para uma tarefa', 15 | 'Embed Files when creating a PDF for all Open Tasks in a Project' => 'Incorporar arquivos ao criar um PDF para todas as tarefas abertas em um projeto', 16 | 'Do Not Embed Files when creating a PDF for all Open Tasks in a Project' => 'Não incorpore arquivos ao criar um PDF para todas as tarefas abertas em um projeto', 17 | 'Show PDF inline Browser' => 'Mostrar pdf no navegador', 18 | 'Download pdf' => 'Baixar pdf' 19 | ); 20 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | extract = $(shell grep -A2 $(1) Plugin.php | tail -n1 | tr -d " ;'" | sed "s/return//") 2 | 3 | plugin = $(call extract, getPluginName) 4 | version = $(call extract, getPluginVersion) 5 | 6 | all: 7 | @echo "Build archive for plugin ${plugin} version=${version}" 8 | @git archive HEAD --prefix=${plugin}/ --format=zip -o ${plugin}-${version}.zip -------------------------------------------------------------------------------- /Misc/1_Test Task.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/Misc/1_Test Task.pdf -------------------------------------------------------------------------------- /Model/PrintModel.php: -------------------------------------------------------------------------------- 1 | loadHTML($toFix); 28 | 29 | // Selecting all image i.e. img tag object 30 | $anchors = $dom -> getElementsByTagName('img'); 31 | // Extracting attribute from each object 32 | foreach ($anchors as $element) { 33 | // Extracting value of src attribute of 34 | // the current image object 35 | $src = $element -> getAttribute('src'); 36 | if (str_contains($src, 'FileViewerController')) { 37 | $file_id = substr($src, strpos($src, 'file_id=')+8); 38 | $file_id = intval($file_id); 39 | 40 | $file = $this->taskFileModel->getById($file_id); 41 | if (!is_null($file)) { 42 | $file_data = base64_encode(file_get_contents(FILES_DIR.DIRECTORY_SEPARATOR.$file['path'])); 43 | } 44 | if (!is_null($file)) { 45 | $toFix = str_replace($src, 'data:image/png;base64,'.$file_data, $toFix); 46 | } 47 | } 48 | 49 | // Extracting value of height attribute 50 | // of the current image object 51 | $height = $element -> getAttribute('height'); 52 | 53 | // Extracting value of width attribute of 54 | // the current image object 55 | $width = $element -> getAttribute('width'); 56 | } 57 | } 58 | return $toFix; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Plugin.php: -------------------------------------------------------------------------------- 1 | template->hook->attach('template:task:sidebar:information', 'task2pdf:print'); 13 | $this->template->hook->attach('template:project:dropdown', 'task2pdf:project_header/print_project'); 14 | $this->template->hook->attach('template:config:application', 'task2pdf:config/font_toggle'); 15 | } 16 | 17 | public function getClasses() 18 | { 19 | return array( 20 | 'Plugin\Task2pdf\Model' => array( 21 | 'PrintModel', 22 | ) 23 | ); 24 | } 25 | 26 | // Translation 27 | public function onStartup() 28 | { 29 | Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale'); 30 | } 31 | 32 | public function getPluginName() 33 | { 34 | return 'Task2pdf'; 35 | } 36 | 37 | public function getPluginAuthor() 38 | { 39 | return 'Craig Crosby'; 40 | } 41 | 42 | public function getPluginVersion() 43 | { 44 | return '1.8.0'; 45 | } 46 | 47 | public function getPluginDescription() 48 | { 49 | return 'Create a printer friendly PDF of a task.'; 50 | } 51 | 52 | public function getPluginHomepage() 53 | { 54 | return 'https://github.com/creecros/Task2pdf'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Template/config/font_toggle.php: -------------------------------------------------------------------------------- 1 |
= t('Filename') ?> | 5 |= t('Creator') ?> | 6 |= t('Date') ?> | 7 |= t('Size') ?> | 8 |
---|---|---|---|
12 | = $this->text->e($file['name']) ?> 13 | | 14 |15 | = $this->text->e($file['username'] ?: $file['username']) ?> 16 | | 17 |18 | = $this->dt->date($file['date']) ?> 19 | | 20 |21 | = $this->text->bytes($file['size']) ?> 22 | | 23 |
38 | = $this->text->e($image['name'] ?: $image['name']) ?> 41 | = $this->dt->date($image['date']) ?> 42 | = $this->text->bytes($image['size']) ?> 43 | |
44 |
45 |
46 |
9 | = t('This task') ?> 10 | = t($label) ?> 11 | (= count($grouped_links) ?>) 12 | | 13 |= t('Assignee') ?> | 14 |= t('Time tracking') ?> | 15 |
---|---|---|
20 |
21 | = $this->text->e('#'.$link['task_id'].' '.$link['title']) ?>
22 |
23 | |
30 | 31 | 32 | 33 | = $this->url->link($this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']), 'UserViewController', 'show', array('user_id' => $link['task_assignee_id'])) ?> 34 | 35 | = $this->text->e($link['task_assignee_name'] ?: $link['task_assignee_username']) ?> 36 | 37 | 38 | | 39 |40 | 41 | = t('%sh spent', n($link['task_time_spent'])) ?> 42 | 43 | / 44 | 45 | = t('%sh estimated', n($link['task_time_estimated'])) ?> 46 | 47 | | 48 |
= t('Title') ?> | 6 |= t('Assignee') ?> | 7 | = $this->hook->render('template:subtask:table:header:before-timetracking') ?> 8 |= t('Time tracking') ?> | 9 |
---|---|---|
13 | 1): ?> 14 | = t('[x] ') ?> 15 | = $this->subtask->renderTitle($subtask) ?> 16 | 17 | = t('[ ] ') ?> 18 | = $this->subtask->renderTitle($subtask) ?> 19 | 20 | | 21 |22 | 23 | = $this->text->e($subtask['name'] ?: $subtask['username']) ?> 24 | 25 | | 26 | = $this->hook->render('template:subtask:table:rows', array('subtask' => $subtask)) ?> 27 |28 | 29 | 30 | = t('%sh spent', n($subtask['time_spent'])) ?> 31 | 32 | 33 | / 34 | 35 | 36 | = t('%sh estimated', n($subtask['time_estimated'])) ?> 37 | 38 | 39 | | 40 |
12 | | This file and the 14 PostScript(R) AFM files it accompanies may be used, copied, and distributed for any purpose and without charge, with or without modification, provided that all copyright notices are retained; that the AFM files are not distributed without this file; that all modifications to this file or any of the AFM files are prominently noted in the modified file(s); and that this paragraph is not modified. Adobe Systems has no responsibility or obligation to support the use of the AFM files. Col | 13 |
Source http://www.adobe.com/devnet/font/#pcfi
16 | 17 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/res/broken_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/creecros/Task2pdf/5c3c022055b929ad936c58648b0a1a2befdb243f/vendor/dompdf/dompdf/lib/res/broken_image.png -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/lib/res/broken_image.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/CanvasFactory.php: -------------------------------------------------------------------------------- 1 | getOptions()->getPdfBackend()); 37 | 38 | if (isset($class) && class_exists($class, false)) { 39 | $class .= "_Adapter"; 40 | } else { 41 | if (($backend === "auto" || $backend === "pdflib") && 42 | class_exists("PDFLib", false) 43 | ) { 44 | $class = "Dompdf\\Adapter\\PDFLib"; 45 | } 46 | 47 | else { 48 | if ($backend === "gd" && extension_loaded('gd')) { 49 | $class = "Dompdf\\Adapter\\GD"; 50 | } else { 51 | $class = "Dompdf\\Adapter\\CPDF"; 52 | } 53 | } 54 | } 55 | 56 | return new $class($paper, $orientation, $dompdf); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Exception.php: -------------------------------------------------------------------------------- 1 | parent = $frame; 48 | $this->rewind(); 49 | } 50 | 51 | public function rewind(): void 52 | { 53 | $this->cur = $this->parent->get_first_child(); 54 | $this->prev = null; 55 | $this->num = 0; 56 | } 57 | 58 | /** 59 | * @return bool 60 | */ 61 | public function valid(): bool 62 | { 63 | return $this->cur !== null; 64 | } 65 | 66 | /** 67 | * @return int 68 | */ 69 | public function key(): int 70 | { 71 | return $this->num; 72 | } 73 | 74 | /** 75 | * @return Frame|null 76 | */ 77 | public function current(): ?Frame 78 | { 79 | return $this->cur; 80 | } 81 | 82 | public function next(): void 83 | { 84 | if ($this->cur === null) { 85 | return; 86 | } 87 | 88 | if ($this->cur->get_parent() === $this->parent) { 89 | $this->prev = $this->cur; 90 | $this->cur = $this->cur->get_next_sibling(); 91 | $this->num++; 92 | } else { 93 | // Continue from the previous child if the current frame has been 94 | // moved to another parent 95 | $this->cur = $this->prev !== null 96 | ? $this->prev->get_next_sibling() 97 | : $this->parent->get_first_child(); 98 | } 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Frame/FrameTreeIterator.php: -------------------------------------------------------------------------------- 1 | _stack[] = $this->_root = $root; 42 | $this->_num = 0; 43 | } 44 | 45 | public function rewind(): void 46 | { 47 | $this->_stack = [$this->_root]; 48 | $this->_num = 0; 49 | } 50 | 51 | /** 52 | * @return bool 53 | */ 54 | public function valid(): bool 55 | { 56 | return count($this->_stack) > 0; 57 | } 58 | 59 | /** 60 | * @return int 61 | */ 62 | public function key(): int 63 | { 64 | return $this->_num; 65 | } 66 | 67 | /** 68 | * @return Frame 69 | */ 70 | public function current(): Frame 71 | { 72 | return end($this->_stack); 73 | } 74 | 75 | public function next(): void 76 | { 77 | $b = array_pop($this->_stack); 78 | $this->_num++; 79 | 80 | // Push all children onto the stack in reverse order 81 | if ($c = $b->get_last_child()) { 82 | $this->_stack[] = $c; 83 | while ($c = $c->get_prev_sibling()) { 84 | $this->_stack[] = $c; 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameDecorator/NullFrameDecorator.php: -------------------------------------------------------------------------------- 1 | _frame->get_style(); 28 | $style->width = 0; 29 | $style->height = 0; 30 | $style->margin = 0; 31 | $style->padding = 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameDecorator/TableRow.php: -------------------------------------------------------------------------------- 1 | get_parent(); 47 | $cellmap = $parent->get_cellmap(); 48 | $iter = $child; 49 | 50 | while ($iter) { 51 | $cellmap->remove_row($iter); 52 | $iter = $iter->get_next_sibling(); 53 | } 54 | 55 | // Remove all subsequent row groups from the cellmap 56 | $iter = $this->get_next_sibling(); 57 | 58 | while ($iter) { 59 | $cellmap->remove_row_group($iter); 60 | $iter = $iter->get_next_sibling(); 61 | } 62 | 63 | // If we are splitting at the first child remove the 64 | // table-row-group from the cellmap as well 65 | if ($child === $this->get_first_child()) { 66 | $cellmap->remove_row_group($this); 67 | parent::split(null, $page_break, $forced); 68 | return; 69 | } 70 | 71 | $cellmap->update_row_group($this, $child->get_prev_sibling()); 72 | parent::split($child, $page_break, $forced); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/ListBullet.php: -------------------------------------------------------------------------------- 1 | _frame; 40 | $style = $frame->get_style(); 41 | 42 | $style->set_used("width", $frame->get_width()); 43 | $frame->position(); 44 | 45 | if ($style->list_style_position === "inside") { 46 | $block->add_frame_to_line($frame); 47 | } else { 48 | $block->add_dangling_marker($frame); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/NullFrameReflower.php: -------------------------------------------------------------------------------- 1 | _frame; 37 | 38 | // Check if a page break is forced 39 | $page = $frame->get_root(); 40 | $page->check_forced_page_break($frame); 41 | 42 | // Bail if the page is full 43 | if ($page->is_full()) { 44 | return; 45 | } 46 | 47 | // Counters and generated content 48 | $this->_set_content(); 49 | 50 | $this->_frame->position(); 51 | $style = $this->_frame->get_style(); 52 | $cb = $this->_frame->get_containing_block(); 53 | 54 | foreach ($this->_frame->get_children() as $child) { 55 | $child->set_containing_block($cb); 56 | $child->reflow(); 57 | 58 | if ($page->is_full()) { 59 | break; 60 | } 61 | } 62 | 63 | if ($page->is_full()) { 64 | return; 65 | } 66 | 67 | $table = TableFrameDecorator::find_parent_table($this->_frame); 68 | $cellmap = $table->get_cellmap(); 69 | $style->set_used("width", $cellmap->get_frame_width($this->_frame)); 70 | $style->set_used("height", $cellmap->get_frame_height($this->_frame)); 71 | 72 | $this->_frame->set_position($cellmap->get_frame_position($this->_frame)); 73 | } 74 | 75 | /** 76 | * @throws Exception 77 | */ 78 | public function get_min_max_width(): array 79 | { 80 | throw new Exception("Min/max width is undefined for table rows"); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/FrameReflower/TableRowGroup.php: -------------------------------------------------------------------------------- 1 | _frame; 37 | $page = $frame->get_root(); 38 | 39 | // Counters and generated content 40 | $this->_set_content(); 41 | 42 | $style = $frame->get_style(); 43 | $cb = $frame->get_containing_block(); 44 | 45 | foreach ($frame->get_children() as $child) { 46 | $child->set_containing_block($cb["x"], $cb["y"], $cb["w"], $cb["h"]); 47 | $child->reflow(); 48 | 49 | // Check if a split has occurred 50 | $page->check_page_break($child); 51 | 52 | if ($page->is_full()) { 53 | break; 54 | } 55 | } 56 | 57 | $table = TableFrameDecorator::find_parent_table($frame); 58 | $cellmap = $table->get_cellmap(); 59 | 60 | // Stop reflow if a page break has occurred before the frame, in which 61 | // case it is not part of its parent table's cell map yet 62 | if ($page->is_full() && !$cellmap->frame_exists_in_cellmap($frame)) { 63 | return; 64 | } 65 | 66 | $style->set_used("width", $cellmap->get_frame_width($frame)); 67 | $style->set_used("height", $cellmap->get_frame_height($frame)); 68 | 69 | $frame->set_position($cellmap->get_frame_position($frame)); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/JavascriptEmbedder.php: -------------------------------------------------------------------------------- 1 | _dompdf = $dompdf; 30 | } 31 | 32 | /** 33 | * @param $script 34 | */ 35 | public function insert($script) 36 | { 37 | $this->_dompdf->getCanvas()->javascript($script); 38 | } 39 | 40 | /** 41 | * @param Frame $frame 42 | */ 43 | public function render(Frame $frame) 44 | { 45 | if (!$this->_dompdf->getOptions()->getIsJavascriptEnabled()) { 46 | return; 47 | } 48 | 49 | $this->insert($frame->get_node()->nodeValue); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/PhpEvaluator.php: -------------------------------------------------------------------------------- 1 | _canvas = $canvas; 29 | } 30 | 31 | /** 32 | * @param $code 33 | * @param array $vars 34 | */ 35 | public function evaluate($code, $vars = []) 36 | { 37 | if (!$this->_canvas->get_dompdf()->getOptions()->getIsPhpEnabled()) { 38 | return; 39 | } 40 | 41 | // Set up some variables for the inline code 42 | $pdf = $this->_canvas; 43 | $fontMetrics = $pdf->get_dompdf()->getFontMetrics(); 44 | $PAGE_NUM = $pdf->get_page_number(); 45 | $PAGE_COUNT = $pdf->get_page_count(); 46 | 47 | // Override those variables if passed in 48 | foreach ($vars as $k => $v) { 49 | $$k = $v; 50 | } 51 | 52 | eval($code); 53 | } 54 | 55 | /** 56 | * @param Frame $frame 57 | */ 58 | public function render(Frame $frame) 59 | { 60 | $this->evaluate($frame->get_node()->nodeValue); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/AbstractPositioner.php: -------------------------------------------------------------------------------- 1 | get_position(); 39 | 40 | if (!$ignore_self) { 41 | $frame->set_position($x + $offset_x, $y + $offset_y); 42 | } 43 | 44 | foreach ($frame->get_children() as $child) { 45 | $child->move($offset_x, $offset_y); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/Block.php: -------------------------------------------------------------------------------- 1 | get_style(); 22 | $cb = $frame->get_containing_block(); 23 | $p = $frame->find_block_parent(); 24 | 25 | if ($p) { 26 | $float = $style->float; 27 | 28 | if (!$float || $float === "none") { 29 | $p->add_line(true); 30 | } 31 | $y = $p->get_current_line_box()->y; 32 | } else { 33 | $y = $cb["y"]; 34 | } 35 | 36 | $x = $cb["x"]; 37 | 38 | $frame->set_position($x, $y); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/Inline.php: -------------------------------------------------------------------------------- 1 | find_block_parent(); 30 | 31 | if (!$block) { 32 | throw new Exception("No block-level parent found. Not good."); 33 | } 34 | 35 | $cb = $frame->get_containing_block(); 36 | $line = $block->get_current_line_box(); 37 | 38 | if (!$frame->is_text_node() && !($frame instanceof InlineFrameDecorator)) { 39 | // Atomic inline boxes and replaced inline elements 40 | // (inline-block, inline-table, img etc.) 41 | $width = $frame->get_margin_width(); 42 | $available_width = $cb["w"] - $line->left - $line->w - $line->right; 43 | 44 | if (Helpers::lengthGreater($width, $available_width)) { 45 | $block->add_line(); 46 | $line = $block->get_current_line_box(); 47 | } 48 | } 49 | 50 | $frame->set_position($cb["x"] + $line->w, $line->y); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/ListBullet.php: -------------------------------------------------------------------------------- 1 | get_parent(); 27 | $style = $parent->get_style(); 28 | $cbw = $parent->get_containing_block("w"); 29 | $margin_left = (float) $style->length_in_pt($style->margin_left, $cbw); 30 | $border_edge = $parent->get_position("x") + $margin_left; 31 | 32 | // This includes the marker indentation 33 | $x = $border_edge - $frame->get_margin_width(); 34 | 35 | // The marker is later vertically aligned with the corresponding line 36 | // box and its vertical position is fine-tuned in the renderer 37 | $p = $frame->find_block_parent(); 38 | $y = $p->get_current_line_box()->y; 39 | 40 | $frame->set_position($x, $y); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/NullPositioner.php: -------------------------------------------------------------------------------- 1 | get_cellmap(); 27 | $frame->set_position($cellmap->get_frame_position($frame)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Positioner/TableRow.php: -------------------------------------------------------------------------------- 1 | get_containing_block(); 25 | $p = $frame->get_prev_sibling(); 26 | 27 | if ($p) { 28 | $y = $p->get_position("y") + $p->get_margin_height(); 29 | } else { 30 | $y = $cb["y"]; 31 | } 32 | $frame->set_position($cb["x"], $y); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/Block.php: -------------------------------------------------------------------------------- 1 | get_style(); 27 | $node = $frame->get_node(); 28 | $dompdf = $this->_dompdf; 29 | 30 | $this->_set_opacity($frame->get_opacity($style->opacity)); 31 | 32 | [$x, $y, $w, $h] = $frame->get_border_box(); 33 | 34 | if ($node->nodeName === "body") { 35 | // Margins should be fully resolved at this point 36 | $mt = $style->margin_top; 37 | $mb = $style->margin_bottom; 38 | $h = $frame->get_containing_block("h") - $mt - $mb; 39 | } 40 | 41 | $border_box = [$x, $y, $w, $h]; 42 | 43 | // Draw our background, border and content 44 | $this->_render_background($frame, $border_box); 45 | $this->_render_border($frame, $border_box); 46 | $this->_render_outline($frame, $border_box); 47 | 48 | // Handle anchors & links 49 | if ($node->nodeName === "a" && $href = $node->getAttribute("href")) { 50 | $href = Helpers::build_url($dompdf->getProtocol(), $dompdf->getBaseHost(), $dompdf->getBasePath(), $href) ?? $href; 51 | $this->_canvas->add_link($href, $x, $y, $w, $h); 52 | } 53 | 54 | $id = $frame->get_node()->getAttribute("id"); 55 | if (strlen($id) > 0) { 56 | $this->_canvas->add_named_dest($id); 57 | } 58 | 59 | $this->debugBlockLayout($frame, "red", false); 60 | } 61 | 62 | protected function debugBlockLayout(Frame $frame, ?string $color, bool $lines = false): void 63 | { 64 | $options = $this->_dompdf->getOptions(); 65 | $debugLayout = $options->getDebugLayout(); 66 | 67 | if (!$debugLayout) { 68 | return; 69 | } 70 | 71 | if ($color && $options->getDebugLayoutBlocks()) { 72 | $this->_debug_layout($frame->get_border_box(), $color); 73 | 74 | if ($options->getDebugLayoutPaddingBox()) { 75 | $this->_debug_layout($frame->get_padding_box(), $color, [0.5, 0.5]); 76 | } 77 | } 78 | 79 | if ($lines && $options->getDebugLayoutLines() && $frame instanceof BlockFrameDecorator) { 80 | [$cx, , $cw] = $frame->get_content_box(); 81 | 82 | foreach ($frame->get_line_boxes() as $line) { 83 | $lw = $cw - $line->left - $line->right; 84 | $this->_debug_layout([$cx + $line->left, $line->y, $lw, $line->h], "orange"); 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/Image.php: -------------------------------------------------------------------------------- 1 | get_style(); 26 | $border_box = $frame->get_border_box(); 27 | 28 | $this->_set_opacity($frame->get_opacity($style->opacity)); 29 | 30 | // Render background & borders 31 | $this->_render_background($frame, $border_box); 32 | $this->_render_border($frame, $border_box); 33 | $this->_render_outline($frame, $border_box); 34 | 35 | $content_box = $frame->get_content_box(); 36 | [$x, $y, $w, $h] = $content_box; 37 | 38 | $src = $frame->get_image_url(); 39 | $alt = null; 40 | 41 | if (Cache::is_broken($src) && 42 | $alt = $frame->get_node()->getAttribute("alt") 43 | ) { 44 | $font = $style->font_family; 45 | $size = $style->font_size; 46 | $word_spacing = $style->word_spacing; 47 | $letter_spacing = $style->letter_spacing; 48 | 49 | $this->_canvas->text( 50 | $x, 51 | $y, 52 | $alt, 53 | $font, 54 | $size, 55 | $style->color, 56 | $word_spacing, 57 | $letter_spacing 58 | ); 59 | } elseif ($w > 0 && $h > 0) { 60 | if ($style->has_border_radius()) { 61 | [$tl, $tr, $br, $bl] = $style->resolve_border_radius($border_box, $content_box); 62 | $this->_canvas->clipping_roundrectangle($x, $y, $w, $h, $tl, $tr, $br, $bl); 63 | } 64 | 65 | $this->_canvas->image($src, $x, $y, $w, $h, $style->image_resolution); 66 | 67 | if ($style->has_border_radius()) { 68 | $this->_canvas->clipping_end(); 69 | } 70 | } 71 | 72 | if ($msg = $frame->get_image_msg()) { 73 | $parts = preg_split("/\s*\n\s*/", $msg); 74 | $font = $style->font_family; 75 | $height = 10; 76 | $_y = $alt ? $y + $h - count($parts) * $height : $y; 77 | 78 | foreach ($parts as $i => $_part) { 79 | $this->_canvas->text($x, $_y + $i * $height, $_part, $font, $height * 0.8, [0.5, 0.5, 0.5]); 80 | } 81 | } 82 | 83 | $id = $frame->get_node()->getAttribute("id"); 84 | if (strlen($id) > 0) { 85 | $this->_canvas->add_named_dest($id); 86 | } 87 | 88 | $this->debugBlockLayout($frame, "blue"); 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/dompdf/dompdf/src/Renderer/TableRowGroup.php: -------------------------------------------------------------------------------- 1 | get_style(); 25 | 26 | $this->_set_opacity($frame->get_opacity($style->opacity)); 27 | 28 | $border_box = $frame->get_border_box(); 29 | 30 | $this->_render_border($frame, $border_box); 31 | $this->_render_outline($frame, $border_box); 32 | 33 | $id = $frame->get_node()->getAttribute("id"); 34 | if (strlen($id) > 0) { 35 | $this->_canvas->add_named_dest($id); 36 | } 37 | 38 | $this->debugBlockLayout($frame, "red"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/masterminds/html5/CREDITS: -------------------------------------------------------------------------------- 1 | Matt Butcher [technosophos]" . var_export($this->data, true) . ""; 64 | } 65 | 66 | final public function encode() { 67 | $this->entry->startWrite(); 68 | 69 | if (false && empty($this->def)) { 70 | $length = $this->_encodeRaw(); 71 | } 72 | else { 73 | $length = $this->_encode(); 74 | } 75 | 76 | $this->entry->endWrite(); 77 | 78 | return $length; 79 | } 80 | 81 | final public function parse() { 82 | $this->entry->startRead(); 83 | 84 | if (false && empty($this->def)) { 85 | $this->_parseRaw(); 86 | } 87 | else { 88 | $this->_parse(); 89 | } 90 | 91 | $this->entry->endRead(); 92 | } 93 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/head.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | use Exception; 12 | 13 | /** 14 | * `head` font table. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class head extends Table { 19 | protected $def = array( 20 | "tableVersion" => self::Fixed, 21 | "fontRevision" => self::Fixed, 22 | "checkSumAdjustment" => self::uint32, 23 | "magicNumber" => self::uint32, 24 | "flags" => self::uint16, 25 | "unitsPerEm" => self::uint16, 26 | "created" => self::longDateTime, 27 | "modified" => self::longDateTime, 28 | "xMin" => self::FWord, 29 | "yMin" => self::FWord, 30 | "xMax" => self::FWord, 31 | "yMax" => self::FWord, 32 | "macStyle" => self::uint16, 33 | "lowestRecPPEM" => self::uint16, 34 | "fontDirectionHint" => self::int16, 35 | "indexToLocFormat" => self::int16, 36 | "glyphDataFormat" => self::int16, 37 | ); 38 | 39 | protected function _parse() { 40 | parent::_parse(); 41 | 42 | if ($this->data["magicNumber"] != 0x5F0F3CF5) { 43 | throw new Exception("Incorrect magic number (" . dechex($this->data["magicNumber"]) . ")"); 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/hhea.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `hhea` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class hhea extends Table { 18 | protected $def = array( 19 | "version" => self::Fixed, 20 | "ascent" => self::FWord, 21 | "descent" => self::FWord, 22 | "lineGap" => self::FWord, 23 | "advanceWidthMax" => self::uFWord, 24 | "minLeftSideBearing" => self::FWord, 25 | "minRightSideBearing" => self::FWord, 26 | "xMaxExtent" => self::FWord, 27 | "caretSlopeRise" => self::int16, 28 | "caretSlopeRun" => self::int16, 29 | "caretOffset" => self::FWord, 30 | self::int16, 31 | self::int16, 32 | self::int16, 33 | self::int16, 34 | "metricDataFormat" => self::int16, 35 | "numOfLongHorMetrics" => self::uint16, 36 | ); 37 | 38 | function _encode() { 39 | $font = $this->getFont(); 40 | $this->data["numOfLongHorMetrics"] = count($font->getSubset()); 41 | 42 | return parent::_encode(); 43 | } 44 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/hmtx.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `hmtx` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class hmtx extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | $offset = $font->pos(); 21 | 22 | $numOfLongHorMetrics = $font->getData("hhea", "numOfLongHorMetrics"); 23 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 24 | 25 | $font->seek($offset); 26 | 27 | $data = array(); 28 | $metrics = $font->readUInt16Many($numOfLongHorMetrics * 2); 29 | for ($gid = 0, $mid = 0; $gid < $numOfLongHorMetrics; $gid++) { 30 | $advanceWidth = isset($metrics[$mid]) ? $metrics[$mid] : 0; 31 | $mid += 1; 32 | $leftSideBearing = isset($metrics[$mid]) ? $metrics[$mid] : 0; 33 | $mid += 1; 34 | $data[$gid] = array($advanceWidth, $leftSideBearing); 35 | } 36 | 37 | if ($numOfLongHorMetrics < $numGlyphs) { 38 | $lastWidth = end($data); 39 | $data = array_pad($data, $numGlyphs, $lastWidth); 40 | } 41 | 42 | $this->data = $data; 43 | } 44 | 45 | protected function _encode() { 46 | $font = $this->getFont(); 47 | $subset = $font->getSubset(); 48 | $data = $this->data; 49 | 50 | $length = 0; 51 | 52 | foreach ($subset as $gid) { 53 | $length += $font->writeUInt16($data[$gid][0]); 54 | $length += $font->writeUInt16($data[$gid][1]); 55 | } 56 | 57 | return $length; 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/kern.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `kern` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class kern extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | 21 | $data = $font->unpack(array( 22 | "version" => self::uint16, 23 | "nTables" => self::uint16, 24 | 25 | // only the first subtable will be parsed 26 | "subtableVersion" => self::uint16, 27 | "length" => self::uint16, 28 | "coverage" => self::uint16, 29 | )); 30 | 31 | $data["format"] = ($data["coverage"] >> 8); 32 | 33 | $subtable = array(); 34 | 35 | switch ($data["format"]) { 36 | case 0: 37 | $subtable = $font->unpack(array( 38 | "nPairs" => self::uint16, 39 | "searchRange" => self::uint16, 40 | "entrySelector" => self::uint16, 41 | "rangeShift" => self::uint16, 42 | )); 43 | 44 | $pairs = array(); 45 | $tree = array(); 46 | 47 | $values = $font->readUInt16Many($subtable["nPairs"] * 3); 48 | for ($i = 0, $idx = 0; $i < $subtable["nPairs"]; $i++) { 49 | $left = $values[$idx++]; 50 | $right = $values[$idx++]; 51 | $value = $values[$idx++]; 52 | 53 | if ($value >= 0x8000) { 54 | $value -= 0x10000; 55 | } 56 | 57 | $pairs[] = array( 58 | "left" => $left, 59 | "right" => $right, 60 | "value" => $value, 61 | ); 62 | 63 | $tree[$left][$right] = $value; 64 | } 65 | 66 | //$subtable["pairs"] = $pairs; 67 | $subtable["tree"] = $tree; 68 | break; 69 | 70 | case 1: 71 | case 2: 72 | case 3: 73 | break; 74 | } 75 | 76 | $data["subtable"] = $subtable; 77 | 78 | $this->data = $data; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/loca.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `loca` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class loca extends Table { 18 | protected function _parse() { 19 | $font = $this->getFont(); 20 | $offset = $font->pos(); 21 | 22 | $indexToLocFormat = $font->getData("head", "indexToLocFormat"); 23 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 24 | 25 | $font->seek($offset); 26 | 27 | $data = array(); 28 | 29 | // 2 bytes 30 | if ($indexToLocFormat == 0) { 31 | $d = $font->read(($numGlyphs + 1) * 2); 32 | $loc = unpack("n*", $d); 33 | 34 | for ($i = 0; $i <= $numGlyphs; $i++) { 35 | $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] * 2 : 0; 36 | } 37 | } 38 | 39 | // 4 bytes 40 | else { 41 | if ($indexToLocFormat == 1) { 42 | $d = $font->read(($numGlyphs + 1) * 4); 43 | $loc = unpack("N*", $d); 44 | 45 | for ($i = 0; $i <= $numGlyphs; $i++) { 46 | $data[] = isset($loc[$i + 1]) ? $loc[$i + 1] : 0; 47 | } 48 | } 49 | } 50 | 51 | $this->data = $data; 52 | } 53 | 54 | function _encode() { 55 | $font = $this->getFont(); 56 | $data = $this->data; 57 | 58 | $indexToLocFormat = $font->getData("head", "indexToLocFormat"); 59 | $numGlyphs = $font->getData("maxp", "numGlyphs"); 60 | $length = 0; 61 | 62 | // 2 bytes 63 | if ($indexToLocFormat == 0) { 64 | for ($i = 0; $i <= $numGlyphs; $i++) { 65 | $length += $font->writeUInt16($data[$i] / 2); 66 | } 67 | } 68 | 69 | // 4 bytes 70 | else { 71 | if ($indexToLocFormat == 1) { 72 | for ($i = 0; $i <= $numGlyphs; $i++) { 73 | $length += $font->writeUInt32($data[$i]); 74 | } 75 | } 76 | } 77 | 78 | return $length; 79 | } 80 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/maxp.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `maxp` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class maxp extends Table { 18 | protected $def = array( 19 | "version" => self::Fixed, 20 | "numGlyphs" => self::uint16, 21 | "maxPoints" => self::uint16, 22 | "maxContours" => self::uint16, 23 | "maxComponentPoints" => self::uint16, 24 | "maxComponentContours" => self::uint16, 25 | "maxZones" => self::uint16, 26 | "maxTwilightPoints" => self::uint16, 27 | "maxStorage" => self::uint16, 28 | "maxFunctionDefs" => self::uint16, 29 | "maxInstructionDefs" => self::uint16, 30 | "maxStackElements" => self::uint16, 31 | "maxSizeOfInstructions" => self::uint16, 32 | "maxComponentElements" => self::uint16, 33 | "maxComponentDepth" => self::uint16, 34 | ); 35 | 36 | function _encode() { 37 | $font = $this->getFont(); 38 | $this->data["numGlyphs"] = count($font->getSubset()); 39 | 40 | return parent::_encode(); 41 | } 42 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/nameRecord.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | namespace FontLib\Table\Type; 9 | 10 | use FontLib\Font; 11 | use FontLib\BinaryStream; 12 | 13 | /** 14 | * Font table name record. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class nameRecord extends BinaryStream { 19 | public $platformID; 20 | public $platformSpecificID; 21 | public $languageID; 22 | public $nameID; 23 | public $length; 24 | public $offset; 25 | public $string; 26 | 27 | public static $format = array( 28 | "platformID" => self::uint16, 29 | "platformSpecificID" => self::uint16, 30 | "languageID" => self::uint16, 31 | "nameID" => self::uint16, 32 | "length" => self::uint16, 33 | "offset" => self::uint16, 34 | ); 35 | 36 | public function map($data) { 37 | foreach ($data as $key => $value) { 38 | $this->$key = $value; 39 | } 40 | } 41 | 42 | public function getUTF8() { 43 | return $this->string; 44 | } 45 | 46 | public function getUTF16() { 47 | return Font::UTF8ToUTF16($this->string); 48 | } 49 | 50 | function __toString() { 51 | return $this->string; 52 | } 53 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/Table/Type/os2.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\Table\Type; 10 | use FontLib\Table\Table; 11 | 12 | /** 13 | * `OS/2` font table. 14 | * 15 | * @package php-font-lib 16 | */ 17 | class os2 extends Table { 18 | protected $def = array( 19 | "version" => self::uint16, 20 | "xAvgCharWidth" => self::int16, 21 | "usWeightClass" => self::uint16, 22 | "usWidthClass" => self::uint16, 23 | "fsType" => self::int16, 24 | "ySubscriptXSize" => self::int16, 25 | "ySubscriptYSize" => self::int16, 26 | "ySubscriptXOffset" => self::int16, 27 | "ySubscriptYOffset" => self::int16, 28 | "ySuperscriptXSize" => self::int16, 29 | "ySuperscriptYSize" => self::int16, 30 | "ySuperscriptXOffset" => self::int16, 31 | "ySuperscriptYOffset" => self::int16, 32 | "yStrikeoutSize" => self::int16, 33 | "yStrikeoutPosition" => self::int16, 34 | "sFamilyClass" => self::int16, 35 | "panose" => array(self::uint8, 10), 36 | "ulCharRange" => array(self::uint32, 4), 37 | "achVendID" => array(self::char, 4), 38 | "fsSelection" => self::uint16, 39 | "fsFirstCharIndex" => self::uint16, 40 | "fsLastCharIndex" => self::uint16, 41 | "typoAscender" => self::int16, 42 | "typoDescender" => self::int16, 43 | "typoLineGap" => self::int16, 44 | "winAscent" => self::int16, 45 | "winDescent" => self::int16, 46 | ); 47 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/Collection.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | use Countable; 12 | use FontLib\BinaryStream; 13 | use Iterator; 14 | use OutOfBoundsException; 15 | 16 | /** 17 | * TrueType collection font file. 18 | * 19 | * @package php-font-lib 20 | */ 21 | class Collection extends BinaryStream implements Iterator, Countable { 22 | /** 23 | * Current iterator position. 24 | * 25 | * @var integer 26 | */ 27 | private $position = 0; 28 | 29 | protected $collectionOffsets = array(); 30 | protected $collection = array(); 31 | protected $version; 32 | protected $numFonts; 33 | 34 | function parse() { 35 | if (isset($this->numFonts)) { 36 | return; 37 | } 38 | 39 | $this->read(4); // tag name 40 | 41 | $this->version = $this->readFixed(); 42 | $this->numFonts = $this->readUInt32(); 43 | 44 | for ($i = 0; $i < $this->numFonts; $i++) { 45 | $this->collectionOffsets[] = $this->readUInt32(); 46 | } 47 | } 48 | 49 | /** 50 | * @param int $fontId 51 | * 52 | * @throws OutOfBoundsException 53 | * @return File 54 | */ 55 | function getFont($fontId) { 56 | $this->parse(); 57 | 58 | if (!isset($this->collectionOffsets[$fontId])) { 59 | throw new OutOfBoundsException(); 60 | } 61 | 62 | if (isset($this->collection[$fontId])) { 63 | return $this->collection[$fontId]; 64 | } 65 | 66 | $font = new File(); 67 | $font->f = $this->f; 68 | $font->setTableOffset($this->collectionOffsets[$fontId]); 69 | 70 | return $this->collection[$fontId] = $font; 71 | } 72 | 73 | function current() { 74 | return $this->getFont($this->position); 75 | } 76 | 77 | function key() { 78 | return $this->position; 79 | } 80 | 81 | function next() { 82 | return ++$this->position; 83 | } 84 | 85 | function rewind() { 86 | $this->position = 0; 87 | } 88 | 89 | function valid() { 90 | $this->parse(); 91 | 92 | return isset($this->collectionOffsets[$this->position]); 93 | } 94 | 95 | function count() { 96 | $this->parse(); 97 | 98 | return $this->numFonts; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/Header.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | /** 12 | * TrueType font file header. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class Header extends \FontLib\Header { 17 | protected $def = array( 18 | "format" => self::uint32, 19 | "numTables" => self::uint16, 20 | "searchRange" => self::uint16, 21 | "entrySelector" => self::uint16, 22 | "rangeShift" => self::uint16, 23 | ); 24 | 25 | public function parse() { 26 | parent::parse(); 27 | 28 | $format = $this->data["format"]; 29 | $this->data["formatText"] = $this->convertUInt32ToStr($format); 30 | } 31 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/TrueType/TableDirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\TrueType; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * TrueType table directory entry. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class TableDirectoryEntry extends DirectoryEntry { 19 | function __construct(File $font) { 20 | parent::__construct($font); 21 | } 22 | 23 | function parse() { 24 | parent::parse(); 25 | 26 | $font = $this->font; 27 | $this->checksum = $font->readUInt32(); 28 | $this->offset = $font->readUInt32(); 29 | $this->length = $font->readUInt32(); 30 | $this->entryLength += 12; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/File.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * WOFF font file. 15 | * 16 | * @package php-font-lib 17 | * 18 | * @property TableDirectoryEntry[] $directory 19 | */ 20 | class File extends \FontLib\TrueType\File { 21 | function parseHeader() { 22 | if (!empty($this->header)) { 23 | return; 24 | } 25 | 26 | $this->header = new Header($this); 27 | $this->header->parse(); 28 | } 29 | 30 | public function load($file) { 31 | parent::load($file); 32 | 33 | $this->parseTableEntries(); 34 | $dataOffset = $this->pos() + count($this->directory) * 20; 35 | 36 | $fw = $this->getTempFile(false); 37 | $fr = $this->f; 38 | 39 | $this->f = $fw; 40 | $offset = $this->header->encode(); 41 | 42 | foreach ($this->directory as $entry) { 43 | // Read ... 44 | $this->f = $fr; 45 | $this->seek($entry->offset); 46 | $data = $this->read($entry->length); 47 | 48 | if ($entry->length < $entry->origLength) { 49 | $data = (string) gzuncompress($data); 50 | } 51 | 52 | // Prepare data ... 53 | $length = mb_strlen($data, '8bit'); 54 | $entry->length = $entry->origLength = $length; 55 | $entry->offset = $dataOffset; 56 | 57 | // Write ... 58 | $this->f = $fw; 59 | 60 | // Woff Entry 61 | $this->seek($offset); 62 | $offset += $this->write($entry->tag, 4); // tag 63 | $offset += $this->writeUInt32($dataOffset); // offset 64 | $offset += $this->writeUInt32($length); // length 65 | $offset += $this->writeUInt32($length); // origLength 66 | $offset += $this->writeUInt32(DirectoryEntry::computeChecksum($data)); // checksum 67 | 68 | // Data 69 | $this->seek($dataOffset); 70 | $dataOffset += $this->write($data, $length); 71 | } 72 | 73 | $this->f = $fw; 74 | $this->seek(0); 75 | 76 | // Need to re-parse this, don't know why 77 | $this->header = null; 78 | $this->directory = array(); 79 | $this->parseTableEntries(); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/Header.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | /** 12 | * WOFF font file header. 13 | * 14 | * @package php-font-lib 15 | */ 16 | class Header extends \FontLib\TrueType\Header { 17 | protected $def = array( 18 | "format" => self::uint32, 19 | "flavor" => self::uint32, 20 | "length" => self::uint32, 21 | "numTables" => self::uint16, 22 | self::uint16, 23 | "totalSfntSize" => self::uint32, 24 | "majorVersion" => self::uint16, 25 | "minorVersion" => self::uint16, 26 | "metaOffset" => self::uint32, 27 | "metaLength" => self::uint32, 28 | "metaOrigLength" => self::uint32, 29 | "privOffset" => self::uint32, 30 | "privLength" => self::uint32, 31 | ); 32 | } -------------------------------------------------------------------------------- /vendor/phenx/php-font-lib/src/FontLib/WOFF/TableDirectoryEntry.php: -------------------------------------------------------------------------------- 1 | 6 | * @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License 7 | */ 8 | 9 | namespace FontLib\WOFF; 10 | 11 | use FontLib\Table\DirectoryEntry; 12 | 13 | /** 14 | * WOFF font file table directory entry. 15 | * 16 | * @package php-font-lib 17 | */ 18 | class TableDirectoryEntry extends DirectoryEntry { 19 | public $origLength; 20 | 21 | function __construct(File $font) { 22 | parent::__construct($font); 23 | } 24 | 25 | function parse() { 26 | parent::parse(); 27 | 28 | $font = $this->font; 29 | $this->offset = $font->readUInt32(); 30 | $this->length = $font->readUInt32(); 31 | $this->origLength = $font->readUInt32(); 32 | $this->checksum = $font->readUInt32(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/README.md: -------------------------------------------------------------------------------- 1 | # SVG file parsing / rendering library 2 | 3 | [](https://github.com/phenx/php-svg-lib/actions) 4 | 5 | 6 | [](https://packagist.org/packages/phenx/php-svg-lib) 7 | [](https://packagist.org/packages/phenx/php-svg-lib) 8 | [](https://packagist.org/packages/phenx/php-svg-lib) 9 | [](https://packagist.org/packages/phenx/php-svg-lib) 10 | 11 | The main purpose of this lib is to rasterize SVG to a surface which can be an image or a PDF for example, through a `\Svg\Surface` PHP interface. 12 | 13 | This project was initialized by the need to render SVG documents inside PDF files for the [DomPdf](http://dompdf.github.io) project. 14 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phenx/php-svg-lib", 3 | "type": "library", 4 | "description": "A library to read, parse and export to PDF SVG files.", 5 | "homepage": "https://github.com/PhenX/php-svg-lib", 6 | "license": "LGPL-3.0", 7 | "authors": [ 8 | { 9 | "name": "Fabien Ménager", 10 | "email": "fabien.menager@gmail.com" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "Svg\\": "src/Svg" 16 | } 17 | }, 18 | "autoload-dev": { 19 | "psr-4": { 20 | "Svg\\Tests\\": "tests/Svg" 21 | } 22 | }, 23 | "require": { 24 | "php": "^7.1 || ^8.0", 25 | "ext-mbstring": "*", 26 | "sabberworm/php-css-parser": "^8.4" 27 | }, 28 | "require-dev": { 29 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/DefaultStyle.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg; 10 | 11 | class DefaultStyle extends Style 12 | { 13 | public $color = [0, 0, 0, 1]; 14 | public $opacity = 1.0; 15 | public $display = 'inline'; 16 | 17 | public $fill = [0, 0, 0, 1]; 18 | public $fillOpacity = 1.0; 19 | public $fillRule = 'nonzero'; 20 | 21 | public $stroke = 'none'; 22 | public $strokeOpacity = 1.0; 23 | public $strokeLinecap = 'butt'; 24 | public $strokeLinejoin = 'miter'; 25 | public $strokeMiterlimit = 4; 26 | public $strokeWidth = 1.0; 27 | public $strokeDasharray = 0; 28 | public $strokeDashoffset = 0; 29 | } 30 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Gradient/Stop.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Gradient; 10 | 11 | class Stop 12 | { 13 | public $offset; 14 | public $color; 15 | public $opacity = 1.0; 16 | } 17 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Surface/SurfaceInterface.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Surface; 10 | 11 | use Svg\Style; 12 | 13 | /** 14 | * Interface Surface, like CanvasRenderingContext2D 15 | * 16 | * @package Svg 17 | */ 18 | interface SurfaceInterface 19 | { 20 | public function save(); 21 | 22 | public function restore(); 23 | 24 | // transformations (default transform is the identity matrix) 25 | public function scale($x, $y); 26 | 27 | public function rotate($angle); 28 | 29 | public function translate($x, $y); 30 | 31 | public function transform($a, $b, $c, $d, $e, $f); 32 | 33 | // path ends 34 | public function beginPath(); 35 | 36 | public function closePath(); 37 | 38 | public function fill(); 39 | 40 | public function stroke(bool $close = false); 41 | 42 | public function endPath(); 43 | 44 | public function fillStroke(bool $close = false); 45 | 46 | public function clip(); 47 | 48 | // text (see also the CanvasDrawingStyles interface) 49 | public function fillText($text, $x, $y, $maxWidth = null); 50 | 51 | public function strokeText($text, $x, $y, $maxWidth = null); 52 | 53 | public function measureText($text); 54 | 55 | // drawing images 56 | public function drawImage($image, $sx, $sy, $sw = null, $sh = null, $dx = null, $dy = null, $dw = null, $dh = null); 57 | 58 | // paths 59 | public function lineTo($x, $y); 60 | 61 | public function moveTo($x, $y); 62 | 63 | public function quadraticCurveTo($cpx, $cpy, $x, $y); 64 | 65 | public function bezierCurveTo($cp1x, $cp1y, $cp2x, $cp2y, $x, $y); 66 | 67 | public function arcTo($x1, $y1, $x2, $y2, $radius); 68 | 69 | public function circle($x, $y, $radius); 70 | 71 | public function arc($x, $y, $radius, $startAngle, $endAngle, $anticlockwise = false); 72 | 73 | public function ellipse($x, $y, $radiusX, $radiusY, $rotation, $startAngle, $endAngle, $anticlockwise); 74 | 75 | // Rectangle 76 | public function rect($x, $y, $w, $h, $rx = 0, $ry = 0); 77 | 78 | public function fillRect($x, $y, $w, $h); 79 | 80 | public function strokeRect($x, $y, $w, $h); 81 | 82 | public function setStyle(Style $style); 83 | 84 | /** 85 | * @return Style 86 | */ 87 | public function getStyle(); 88 | 89 | public function setFont($family, $style, $weight); 90 | } 91 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Anchor.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Anchor extends Group 12 | { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Circle.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Circle extends Shape 14 | { 15 | protected $cx = 0; 16 | protected $cy = 0; 17 | protected $r; 18 | 19 | public function start($attributes) 20 | { 21 | if (isset($attributes['cx'])) { 22 | $width = $this->document->getWidth(); 23 | $this->cx = $this->convertSize($attributes['cx'], $width); 24 | } 25 | if (isset($attributes['cy'])) { 26 | $height = $this->document->getHeight(); 27 | $this->cy = $this->convertSize($attributes['cy'], $height); 28 | } 29 | if (isset($attributes['r'])) { 30 | $diagonal = $this->document->getDiagonal(); 31 | $this->r = $this->convertSize($attributes['r'], $diagonal); 32 | } 33 | 34 | $this->document->getSurface()->circle($this->cx, $this->cy, $this->r); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/ClipPath.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class ClipPath extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $this->document->getSurface()->restore(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Ellipse.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Ellipse extends Shape 14 | { 15 | protected $cx = 0; 16 | protected $cy = 0; 17 | protected $rx = 0; 18 | protected $ry = 0; 19 | 20 | public function start($attributes) 21 | { 22 | parent::start($attributes); 23 | 24 | $width = $this->document->getWidth(); 25 | $height = $this->document->getHeight(); 26 | 27 | if (isset($attributes['cx'])) { 28 | $this->cx = $this->convertSize($attributes['cx'], $width); 29 | } 30 | if (isset($attributes['cy'])) { 31 | $this->cy = $this->convertSize($attributes['cy'], $height); 32 | } 33 | if (isset($attributes['rx'])) { 34 | $this->rx = $this->convertSize($attributes['rx'], $width); 35 | } 36 | if (isset($attributes['ry'])) { 37 | $this->ry = $this->convertSize($attributes['ry'], $height); 38 | } 39 | 40 | $this->document->getSurface()->ellipse($this->cx, $this->cy, $this->rx, $this->ry, 0, 0, 360, false); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Group.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Group extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $this->document->getSurface()->restore(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Image.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Image extends AbstractTag 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $width = 0; 18 | protected $height = 0; 19 | protected $href = null; 20 | 21 | protected function before($attributes) 22 | { 23 | parent::before($attributes); 24 | 25 | $surface = $this->document->getSurface(); 26 | $surface->save(); 27 | 28 | $this->applyTransform($attributes); 29 | } 30 | 31 | public function start($attributes) 32 | { 33 | $height = $this->document->getHeight(); 34 | $width = $this->document->getWidth(); 35 | $this->y = $height; 36 | 37 | if (isset($attributes['x'])) { 38 | $this->x = $this->convertSize($attributes['x'], $width); 39 | } 40 | if (isset($attributes['y'])) { 41 | $this->y = $height - $this->convertSize($attributes['y'], $height); 42 | } 43 | 44 | if (isset($attributes['width'])) { 45 | $this->width = $this->convertSize($attributes['width'], $width); 46 | } 47 | if (isset($attributes['height'])) { 48 | $this->height = $this->convertSize($attributes['height'], $height); 49 | } 50 | 51 | if (isset($attributes['xlink:href'])) { 52 | $this->href = $attributes['xlink:href']; 53 | } 54 | 55 | if (isset($attributes['href'])) { 56 | $this->href = $attributes['href']; 57 | } 58 | 59 | $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height); 60 | 61 | $this->document->getSurface()->drawImage($this->href, $this->x, $this->y, $this->width, $this->height); 62 | } 63 | 64 | protected function after() 65 | { 66 | $this->document->getSurface()->restore(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Line.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Line extends Shape 14 | { 15 | protected $x1 = 0; 16 | protected $y1 = 0; 17 | 18 | protected $x2 = 0; 19 | protected $y2 = 0; 20 | 21 | public function start($attributes) 22 | { 23 | $height = $this->document->getHeight(); 24 | $width = $this->document->getWidth(); 25 | 26 | if (isset($attributes['x1'])) { 27 | $this->x1 = $this->convertSize($attributes['x1'], $width); 28 | } 29 | if (isset($attributes['y1'])) { 30 | $this->y1 = $this->convertSize($attributes['y1'], $height); 31 | } 32 | if (isset($attributes['x2'])) { 33 | $this->x2 = $this->convertSize($attributes['x2'], $width); 34 | } 35 | if (isset($attributes['y2'])) { 36 | $this->y2 = $this->convertSize($attributes['y2'], $height); 37 | } 38 | 39 | $surface = $this->document->getSurface(); 40 | $surface->moveTo($this->x1, $this->y1); 41 | $surface->lineTo($this->x2, $this->y2); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/LinearGradient.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | 12 | use Svg\Gradient; 13 | use Svg\Style; 14 | 15 | class LinearGradient extends AbstractTag 16 | { 17 | protected $x1; 18 | protected $y1; 19 | protected $x2; 20 | protected $y2; 21 | 22 | /** @var Gradient\Stop[] */ 23 | protected $stops = array(); 24 | 25 | public function start($attributes) 26 | { 27 | parent::start($attributes); 28 | 29 | if (isset($attributes['x1'])) { 30 | $this->x1 = $attributes['x1']; 31 | } 32 | if (isset($attributes['y1'])) { 33 | $this->y1 = $attributes['y1']; 34 | } 35 | if (isset($attributes['x2'])) { 36 | $this->x2 = $attributes['x2']; 37 | } 38 | if (isset($attributes['y2'])) { 39 | $this->y2 = $attributes['y2']; 40 | } 41 | } 42 | 43 | public function getStops() { 44 | if (empty($this->stops)) { 45 | foreach ($this->children as $_child) { 46 | if ($_child->tagName != "stop") { 47 | continue; 48 | } 49 | 50 | $_stop = new Gradient\Stop(); 51 | $_attributes = $_child->attributes; 52 | 53 | // Style 54 | if (isset($_attributes["style"])) { 55 | $_style = Style::parseCssStyle($_attributes["style"]); 56 | 57 | if (isset($_style["stop-color"])) { 58 | $_stop->color = Style::parseColor($_style["stop-color"]); 59 | } 60 | 61 | if (isset($_style["stop-opacity"])) { 62 | $_stop->opacity = max(0, min(1.0, $_style["stop-opacity"])); 63 | } 64 | } 65 | 66 | // Attributes 67 | if (isset($_attributes["offset"])) { 68 | $_stop->offset = $_attributes["offset"]; 69 | } 70 | if (isset($_attributes["stop-color"])) { 71 | $_stop->color = Style::parseColor($_attributes["stop-color"]); 72 | } 73 | if (isset($_attributes["stop-opacity"])) { 74 | $_stop->opacity = max(0, min(1.0, $_attributes["stop-opacity"])); 75 | } 76 | 77 | $this->stops[] = $_stop; 78 | } 79 | } 80 | 81 | return $this->stops; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Polygon.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Polygon extends Shape 12 | { 13 | public function start($attributes) 14 | { 15 | $tmp = array(); 16 | preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER); 17 | 18 | $points = $tmp[0]; 19 | $count = count($points); 20 | 21 | if ($count < 4) { 22 | // nothing to draw 23 | return; 24 | } 25 | 26 | $surface = $this->document->getSurface(); 27 | list($x, $y) = $points; 28 | $surface->moveTo($x, $y); 29 | 30 | for ($i = 2; $i < $count; $i += 2) { 31 | if ($i + 1 === $count) { 32 | // invalid trailing point 33 | continue; 34 | } 35 | $x = $points[$i]; 36 | $y = $points[$i + 1]; 37 | $surface->lineTo($x, $y); 38 | } 39 | 40 | $surface->closePath(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Polyline.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Polyline extends Shape 12 | { 13 | public function start($attributes) 14 | { 15 | $tmp = array(); 16 | preg_match_all('/([\-]*[0-9\.]+)/', $attributes['points'], $tmp, PREG_PATTERN_ORDER); 17 | 18 | $points = $tmp[0]; 19 | $count = count($points); 20 | 21 | if ($count < 4) { 22 | // nothing to draw 23 | return; 24 | } 25 | 26 | $surface = $this->document->getSurface(); 27 | list($x, $y) = $points; 28 | $surface->moveTo($x, $y); 29 | 30 | for ($i = 2; $i < $count; $i += 2) { 31 | if ($i + 1 === $count) { 32 | // invalid trailing point 33 | continue; 34 | } 35 | $x = $points[$i]; 36 | $y = $points[$i + 1]; 37 | $surface->lineTo($x, $y); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/RadialGradient.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class RadialGradient extends AbstractTag 12 | { 13 | public function start($attributes) 14 | { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Rect.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Rect extends Shape 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $width = 0; 18 | protected $height = 0; 19 | protected $rx = 0; 20 | protected $ry = 0; 21 | 22 | public function start($attributes) 23 | { 24 | $width = $this->document->getWidth(); 25 | $height = $this->document->getHeight(); 26 | 27 | if (isset($attributes['x'])) { 28 | $this->x = $this->convertSize($attributes['x'], $width); 29 | } 30 | if (isset($attributes['y'])) { 31 | $this->y = $this->convertSize($attributes['y'], $height); 32 | } 33 | 34 | if (isset($attributes['width'])) { 35 | $this->width = $this->convertSize($attributes['width'], $width); 36 | } 37 | if (isset($attributes['height'])) { 38 | $this->height = $this->convertSize($attributes['height'], $height); 39 | } 40 | 41 | if (isset($attributes['rx'])) { 42 | $this->rx = $attributes['rx']; 43 | } 44 | if (isset($attributes['ry'])) { 45 | $this->ry = $attributes['ry']; 46 | } 47 | 48 | $this->document->getSurface()->rect($this->x, $this->y, $this->width, $this->height, $this->rx, $this->ry); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Shape.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Shape extends AbstractTag 14 | { 15 | protected function before($attributes) 16 | { 17 | $surface = $this->document->getSurface(); 18 | 19 | $surface->save(); 20 | 21 | $style = $this->makeStyle($attributes); 22 | 23 | $this->setStyle($style); 24 | $surface->setStyle($style); 25 | 26 | $this->applyTransform($attributes); 27 | } 28 | 29 | protected function after() 30 | { 31 | $surface = $this->document->getSurface(); 32 | 33 | if ($this->hasShape) { 34 | $style = $surface->getStyle(); 35 | 36 | $fill = $style->fill && is_array($style->fill); 37 | $stroke = $style->stroke && is_array($style->stroke); 38 | 39 | if ($fill) { 40 | if ($stroke) { 41 | $surface->fillStroke(false); 42 | } else { 43 | // if (is_string($style->fill)) { 44 | // /** @var LinearGradient|RadialGradient $gradient */ 45 | // $gradient = $this->getDocument()->getDef($style->fill); 46 | // 47 | // var_dump($gradient->getStops()); 48 | // } 49 | 50 | $surface->fill(); 51 | } 52 | } 53 | elseif ($stroke) { 54 | $surface->stroke(false); 55 | } 56 | else { 57 | $surface->endPath(); 58 | } 59 | } 60 | 61 | $surface->restore(); 62 | } 63 | } -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Stop.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class Stop extends AbstractTag 12 | { 13 | public function start($attributes) 14 | { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/StyleTag.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Sabberworm\CSS; 12 | 13 | class StyleTag extends AbstractTag 14 | { 15 | protected $text = ""; 16 | 17 | public function end() 18 | { 19 | $parser = new CSS\Parser($this->text); 20 | $this->document->appendStyleSheet($parser->parse()); 21 | } 22 | 23 | public function appendText($text) 24 | { 25 | $this->text .= $text; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/Text.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | use Svg\Style; 12 | 13 | class Text extends Shape 14 | { 15 | protected $x = 0; 16 | protected $y = 0; 17 | protected $text = ""; 18 | 19 | public function start($attributes) 20 | { 21 | $height = $this->document->getHeight(); 22 | $this->y = $height; 23 | 24 | if (isset($attributes['x'])) { 25 | $width = $this->document->getWidth(); 26 | $this->x = $this->convertSize($attributes['x'], $width); 27 | } 28 | if (isset($attributes['y'])) { 29 | $this->y = $height - $this->convertSize($attributes['y'], $height); 30 | } 31 | 32 | $this->document->getSurface()->transform(1, 0, 0, -1, 0, $height); 33 | } 34 | 35 | public function end() 36 | { 37 | $surface = $this->document->getSurface(); 38 | $x = $this->x; 39 | $y = $this->y; 40 | $style = $surface->getStyle(); 41 | $surface->setFont($style->fontFamily, $style->fontStyle, $style->fontWeight); 42 | 43 | switch ($style->textAnchor) { 44 | case "middle": 45 | $width = $surface->measureText($this->text); 46 | $x -= $width / 2; 47 | break; 48 | 49 | case "end": 50 | $width = $surface->measureText($this->text); 51 | $x -= $width; 52 | break; 53 | } 54 | 55 | $surface->fillText($this->getText(), $x, $y); 56 | } 57 | 58 | protected function after() 59 | { 60 | $this->document->getSurface()->restore(); 61 | } 62 | 63 | public function appendText($text) 64 | { 65 | $this->text .= $text; 66 | } 67 | 68 | public function getText() 69 | { 70 | return trim($this->text); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/phenx/php-svg-lib/src/Svg/Tag/UseTag.php: -------------------------------------------------------------------------------- 1 | 6 | * @license GNU LGPLv3+ http://www.gnu.org/copyleft/lesser.html 7 | */ 8 | 9 | namespace Svg\Tag; 10 | 11 | class UseTag extends AbstractTag 12 | { 13 | protected $x = 0; 14 | protected $y = 0; 15 | protected $width; 16 | protected $height; 17 | 18 | /** @var AbstractTag */ 19 | protected $reference; 20 | 21 | protected function before($attributes) 22 | { 23 | if (isset($attributes['x'])) { 24 | $this->x = $attributes['x']; 25 | } 26 | if (isset($attributes['y'])) { 27 | $this->y = $attributes['y']; 28 | } 29 | 30 | if (isset($attributes['width'])) { 31 | $this->width = $attributes['width']; 32 | } 33 | if (isset($attributes['height'])) { 34 | $this->height = $attributes['height']; 35 | } 36 | 37 | parent::before($attributes); 38 | 39 | $document = $this->getDocument(); 40 | 41 | $link = $attributes["href"] ?? $attributes["xlink:href"]; 42 | $this->reference = $document->getDef($link); 43 | 44 | if ($this->reference) { 45 | $this->reference->before($attributes); 46 | } 47 | 48 | $surface = $document->getSurface(); 49 | $surface->save(); 50 | 51 | $surface->translate($this->x, $this->y); 52 | } 53 | 54 | protected function after() { 55 | parent::after(); 56 | 57 | if ($this->reference) { 58 | $this->reference->after(); 59 | } 60 | 61 | $this->getDocument()->getSurface()->restore(); 62 | } 63 | 64 | public function handle($attributes) 65 | { 66 | parent::handle($attributes); 67 | 68 | if (!$this->reference) { 69 | return; 70 | } 71 | 72 | $mergedAttributes = $this->reference->attributes; 73 | $attributesToNotMerge = ['x', 'y', 'width', 'height']; 74 | foreach ($attributes as $attrKey => $attrVal) { 75 | if (!in_array($attrKey, $attributesToNotMerge) && !isset($mergedAttributes[$attrKey])) { 76 | $mergedAttributes[$attrKey] = $attrVal; 77 | } 78 | } 79 | 80 | $this->reference->handle($mergedAttributes); 81 | 82 | foreach ($this->reference->children as $_child) { 83 | $_attributes = array_merge($_child->attributes, $mergedAttributes); 84 | $_child->handle($_attributes); 85 | } 86 | } 87 | 88 | public function handleEnd() 89 | { 90 | parent::handleEnd(); 91 | 92 | if (!$this->reference) { 93 | return; 94 | } 95 | 96 | $this->reference->handleEnd(); 97 | 98 | foreach ($this->reference->children as $_child) { 99 | $_child->handleEnd(); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2011 Raphael Schweikert, https://www.sabberworm.com/ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sabberworm/php-css-parser", 3 | "type": "library", 4 | "description": "Parser for CSS Files written in PHP", 5 | "keywords": [ 6 | "parser", 7 | "css", 8 | "stylesheet" 9 | ], 10 | "homepage": "https://www.sabberworm.com/blog/2010/6/10/php-css-parser", 11 | "license": "MIT", 12 | "authors": [ 13 | { 14 | "name": "Raphael Schweikert" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.6.20", 19 | "ext-iconv": "*" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "^4.8.36", 23 | "codacy/coverage": "^1.4" 24 | }, 25 | "suggest": { 26 | "ext-mbstring": "for parsing UTF-8 CSS" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Sabberworm\\CSS\\": "src/" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "Sabberworm\\CSS\\Tests\\": "tests/" 36 | } 37 | }, 38 | "scripts": { 39 | "ci": [ 40 | "@ci:static" 41 | ], 42 | "ci:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix --dry-run -v --show-progress=dots bin src tests", 43 | "ci:php:sniffer": "@php ./.phive/phpcs.phar --standard=config/phpcs.xml bin src tests", 44 | "ci:php:stan": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon", 45 | "ci:static": [ 46 | "@ci:php:fixer", 47 | "@ci:php:sniffer", 48 | "@ci:php:stan" 49 | ], 50 | "fix:php": [ 51 | "@fix:php:fixer", 52 | "@fix:php:sniffer" 53 | ], 54 | "fix:php:fixer": "@php ./.phive/php-cs-fixer.phar --config=config/php-cs-fixer.php fix bin src tests", 55 | "fix:php:sniffer": "@php ./.phive/phpcbf.phar --standard=config/phpcs.xml bin src tests", 56 | "phpstan:baseline": "@php ./.phive/phpstan.phar --configuration=config/phpstan.neon --generate-baseline=config/phpstan-baseline.neon" 57 | }, 58 | "scripts-descriptions": { 59 | "ci": "Runs all dynamic and static code checks (i.e. currently, only the static checks).", 60 | "ci:php:fixer": "Checks the code style with PHP CS Fixer.", 61 | "ci:php:sniffer": "Checks the code style with PHP_CodeSniffer.", 62 | "ci:php:stan": "Checks the types with PHPStan.", 63 | "ci:static": "Runs all static code analysis checks for the code.", 64 | "fix:php": "Autofixes all autofixable issues in the PHP code.", 65 | "fix:php:fixer": "Fixes autofixable issues found by PHP CS Fixer.", 66 | "fix:php:sniffer": "Fixes autofixable issues found by PHP_CodeSniffer.", 67 | "phpstand:baseline": "Updates the PHPStan baseline file to match the code." 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/CSSList/AtRuleBlockList.php: -------------------------------------------------------------------------------- 1 | sType = $sType; 32 | $this->sArgs = $sArgs; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function atRuleName() 39 | { 40 | return $this->sType; 41 | } 42 | 43 | /** 44 | * @return string 45 | */ 46 | public function atRuleArgs() 47 | { 48 | return $this->sArgs; 49 | } 50 | 51 | /** 52 | * @return string 53 | */ 54 | public function __toString() 55 | { 56 | return $this->render(new OutputFormat()); 57 | } 58 | 59 | /** 60 | * @return string 61 | */ 62 | public function render(OutputFormat $oOutputFormat) 63 | { 64 | $sArgs = $this->sArgs; 65 | if ($sArgs) { 66 | $sArgs = ' ' . $sArgs; 67 | } 68 | $sResult = $oOutputFormat->sBeforeAtRuleBlock; 69 | $sResult .= "@{$this->sType}$sArgs{$oOutputFormat->spaceBeforeOpeningBrace()}{"; 70 | $sResult .= parent::render($oOutputFormat); 71 | $sResult .= '}'; 72 | $sResult .= $oOutputFormat->sAfterAtRuleBlock; 73 | return $sResult; 74 | } 75 | 76 | /** 77 | * @return bool 78 | */ 79 | public function isRootList() 80 | { 81 | return false; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/CSSList/KeyFrame.php: -------------------------------------------------------------------------------- 1 | vendorKeyFrame = null; 27 | $this->animationName = null; 28 | } 29 | 30 | /** 31 | * @param string $vendorKeyFrame 32 | */ 33 | public function setVendorKeyFrame($vendorKeyFrame) 34 | { 35 | $this->vendorKeyFrame = $vendorKeyFrame; 36 | } 37 | 38 | /** 39 | * @return string|null 40 | */ 41 | public function getVendorKeyFrame() 42 | { 43 | return $this->vendorKeyFrame; 44 | } 45 | 46 | /** 47 | * @param string $animationName 48 | */ 49 | public function setAnimationName($animationName) 50 | { 51 | $this->animationName = $animationName; 52 | } 53 | 54 | /** 55 | * @return string|null 56 | */ 57 | public function getAnimationName() 58 | { 59 | return $this->animationName; 60 | } 61 | 62 | /** 63 | * @return string 64 | */ 65 | public function __toString() 66 | { 67 | return $this->render(new OutputFormat()); 68 | } 69 | 70 | /** 71 | * @return string 72 | */ 73 | public function render(OutputFormat $oOutputFormat) 74 | { 75 | $sResult = "@{$this->vendorKeyFrame} {$this->animationName}{$oOutputFormat->spaceBeforeOpeningBrace()}{"; 76 | $sResult .= parent::render($oOutputFormat); 77 | $sResult .= '}'; 78 | return $sResult; 79 | } 80 | 81 | /** 82 | * @return bool 83 | */ 84 | public function isRootList() 85 | { 86 | return false; 87 | } 88 | 89 | /** 90 | * @return string|null 91 | */ 92 | public function atRuleName() 93 | { 94 | return $this->vendorKeyFrame; 95 | } 96 | 97 | /** 98 | * @return string|null 99 | */ 100 | public function atRuleArgs() 101 | { 102 | return $this->animationName; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Comment/Comment.php: -------------------------------------------------------------------------------- 1 | sComment = $sComment; 27 | $this->iLineNo = $iLineNo; 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | public function getComment() 34 | { 35 | return $this->sComment; 36 | } 37 | 38 | /** 39 | * @return int 40 | */ 41 | public function getLineNo() 42 | { 43 | return $this->iLineNo; 44 | } 45 | 46 | /** 47 | * @param string $sComment 48 | * 49 | * @return void 50 | */ 51 | public function setComment($sComment) 52 | { 53 | $this->sComment = $sComment; 54 | } 55 | 56 | /** 57 | * @return string 58 | */ 59 | public function __toString() 60 | { 61 | return $this->render(new OutputFormat()); 62 | } 63 | 64 | /** 65 | * @return string 66 | */ 67 | public function render(OutputFormat $oOutputFormat) 68 | { 69 | return '/*' . $this->sComment . '*/'; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/sabberworm/php-css-parser/src/Comment/Commentable.php: -------------------------------------------------------------------------------- 1 | $aComments 9 | * 10 | * @return void 11 | */ 12 | public function addComments(array $aComments); 13 | 14 | /** 15 | * @return array
= t('Comments') ?>
4 |