Skip to content

Commit

Permalink
Merge branch '14'
Browse files Browse the repository at this point in the history
  • Loading branch information
b13-michaelsemle committed Nov 3, 2023
2 parents 0e978a2 + 9ef7930 commit ebda33b
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 16 deletions.
57 changes: 57 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# TS/JS-Files
[*.{ts,js,vue}]
indent_size = 4
indent_style = tab

# JSON-Files
[*.json]
indent_style = tab

# ReST-Files
[*.rst]
indent_size = 4
max_line_length = 80

# YAML-Files
[*.{yaml,yml}]
indent_size = 2

# NEON-Files
[*.neon]
indent_size = 2
indent_style = tab

# package.json
[package.json]
indent_size = 2

# TypoScript
[*.{typoscript,tsconfig}]
indent_size = 2

# XLF-Files
[*.xlf]
indent_style = tab

# SQL-Files
[*.sql]
indent_style = tab
indent_size = 2

# .htaccess
[{_.htaccess,.htaccess}]
indent_style = tab
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.editorconfig export-ignore
/.gitignore export-ignore
/.gitattributes export-ignore
/.php-cs-fixer.php export-ignore
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor
composer.lock
/composer.lock
/vendor/
/public/
10 changes: 10 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in('Classes')
->in('Configuration');

$config = \TYPO3\CodingStandards\CsFixerConfig::create();
return $config
->setUsingCache(false)
->setFinder($finder);
14 changes: 8 additions & 6 deletions Classes/Resource/Rendering/VimeoRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

class VimeoRenderer extends \TYPO3\CMS\Core\Resource\Rendering\VimeoRenderer
{
const templateName = 'Vimeo';
const type = 'vimeo';
public const templateName = 'Vimeo';
public const type = 'vimeo';

/**
* @var ConfigurationManager
Expand All @@ -47,7 +47,6 @@ public function getPriority()
* @param int|string $height
* @param array $options
* @param bool $usedPathsRelativeToCurrentScript
* @param array $variables
* @return string
*/
public function render(
Expand All @@ -72,12 +71,12 @@ public function render(
'src' => $src,
'type' => self::type,
'isReference' => $file instanceof FileReference,
'attributes' => empty($attributes) ? '' : ' ' . $this->implodeAttributes($attributes)
'attributes' => empty($attributes) ? '' : ' ' . $this->implodeAttributes($attributes),
];

// calculate the padding for the item
if (!empty($file->getProperty('height')) && !empty($file->getProperty('width'))) {
$paddingTop = ($file->getProperty('height') / $file->getProperty('width')) * 100;
$paddingTop = ((int)$file->getProperty('height') / (int)$file->getProperty('width')) * 100;
$variables['paddingTop'] = $paddingTop;
}

Expand All @@ -87,7 +86,10 @@ public function render(
$view->setTemplateRootPaths($extensionConfiguration['view']['templateRootPaths']);
$view->setTemplate(self::templateName);
$view->assignMultiple($variables);
$view->setRequest($GLOBALS['TYPO3_REQUEST']);

if (method_exists($view, 'setRequest')) {
$view->setRequest($GLOBALS['TYPO3_REQUEST']);
}

return $view->render();
}
Expand Down
14 changes: 8 additions & 6 deletions Classes/Resource/Rendering/YouTubeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

class YouTubeRenderer extends \TYPO3\CMS\Core\Resource\Rendering\YouTubeRenderer
{
const templateName = 'YouTube';
const type = 'youtube';
public const templateName = 'YouTube';
public const type = 'youtube';

/**
* @var ConfigurationManager
Expand All @@ -47,7 +47,6 @@ public function getPriority()
* @param int|string $height
* @param array $options
* @param bool $usedPathsRelativeToCurrentScript
* @param array $variables
* @return string
*/
public function render(
Expand All @@ -72,12 +71,12 @@ public function render(
'src' => $src,
'type' => self::type,
'isReference' => $file instanceof FileReference,
'attributes' => empty($attributes) ? '' : ' ' . $this->implodeAttributes($attributes)
'attributes' => empty($attributes) ? '' : ' ' . $this->implodeAttributes($attributes),
];

// calculate the padding for the item
if (!empty($file->getProperty('height')) && !empty($file->getProperty('width'))) {
$paddingTop = ($file->getProperty('height') / $file->getProperty('width')) * 100;
$paddingTop = ((int)$file->getProperty('height') / (int)$file->getProperty('width')) * 100;
$variables['paddingTop'] = $paddingTop;
}

Expand All @@ -87,7 +86,10 @@ public function render(
$view->setTemplateRootPaths($extensionConfiguration['view']['templateRootPaths']);
$view->setTemplate(self::templateName);
$view->assignMultiple($variables);
$view->setRequest($GLOBALS['TYPO3_REQUEST']);

if (method_exists($view, 'setRequest')) {
$view->setRequest($GLOBALS['TYPO3_REQUEST']);
}

return $view->render();
}
Expand Down
14 changes: 12 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,19 @@
}
},
"require": {
"typo3/cms-core": "^10.4 || ^11.5 || ^12.4"
"typo3/cms-core": "^10.4 || ^11.5 || ^12.4",
"typo3/cms-fluid": "^10.4 || ^11.5 || ^12.4"
},
"require-dev": {
"typo3/tailor": "^1.3"
"typo3/tailor": "^1.3",
"typo3/coding-standards": "^0.7.1",
"phpstan/phpstan": "^1.10",
"saschaegerer/phpstan-typo3": "^1.9"
},
"config": {
"allow-plugins": {
"typo3/cms-composer-installers": true,
"typo3/class-alias-loader": true
}
}
}
17 changes: 17 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- vendor/saschaegerer/phpstan-typo3/extension.neon

parameters:
level: 5

paths:
- %currentWorkingDirectory%/

excludePaths:
analyseAndScan:
- */node_modules/*
- vendor/*
- public/*
- ./.php-cs-fixer.php
- ./ext_emconf.php

0 comments on commit ebda33b

Please sign in to comment.