Completed
Push — master ( ad447f...f2215d )
by Fabien
03:37 queued 48s
created
Classes/Thumbnail/ThumbnailInterface.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -21,29 +21,29 @@
 block discarded – undo
21 21
 interface ThumbnailInterface
22 22
 {
23 23
 
24
-    /**
25
-     * The thumbnail of the asset (default value).
26
-     */
27
-    const OUTPUT_IMAGE = 'image';
28
-
29
-    /**
30
-     * The thumbnail will be wrapped with an anchor.
31
-     */
32
-    const OUTPUT_IMAGE_WRAPPED = 'imageWrapped';
33
-
34
-    /**
35
-     * Output the URI of the thumbnail.
36
-     */
37
-    const OUTPUT_URI = 'uri';
38
-
39
-    /**
40
-     * Open thumbnail in a new window.
41
-     */
42
-    const TARGET_BLANK = '_blank';
43
-
44
-    /**
45
-     * Open thumbnail in the same window.
46
-     */
47
-    const TARGET_SELF = '_self';
24
+	/**
25
+	 * The thumbnail of the asset (default value).
26
+	 */
27
+	const OUTPUT_IMAGE = 'image';
28
+
29
+	/**
30
+	 * The thumbnail will be wrapped with an anchor.
31
+	 */
32
+	const OUTPUT_IMAGE_WRAPPED = 'imageWrapped';
33
+
34
+	/**
35
+	 * Output the URI of the thumbnail.
36
+	 */
37
+	const OUTPUT_URI = 'uri';
38
+
39
+	/**
40
+	 * Open thumbnail in a new window.
41
+	 */
42
+	const TARGET_BLANK = '_blank';
43
+
44
+	/**
45
+	 * Open thumbnail in the same window.
46
+	 */
47
+	const TARGET_SELF = '_self';
48 48
 
49 49
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Uri/MoveViewHelper.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,35 +24,35 @@
 block discarded – undo
24 24
 class MoveViewHelper extends AbstractViewHelper
25 25
 {
26 26
 
27
-    /**
28
-     * Render a move storage URI.
29
-     *
30
-     * @return string
31
-     */
32
-    public function render()
33
-    {
34
-
35
-        $urlParameters = array(
36
-            VidiModule::getParameterPrefix() => array(
37
-                'controller' => 'Content',
38
-                'action' => 'move',
39
-                'fieldNameAndPath' => $this->templateVariableContainer->get('fieldNameAndPath'),
40
-                'matches' => $this->templateVariableContainer->get('matches'),
41
-            ),
42
-        );
43
-
44
-        $moduleUrl = BackendUtility::getModuleUrl(
45
-            VidiModule::getSignature(),
46
-            $urlParameters
47
-        );
48
-
49
-        // Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter.
50
-        $matches = $this->templateVariableContainer->get('matches');
51
-        if (empty($matches)) {
52
-            $moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]=');
53
-        }
54
-
55
-        return $moduleUrl;
56
-    }
27
+	/**
28
+	 * Render a move storage URI.
29
+	 *
30
+	 * @return string
31
+	 */
32
+	public function render()
33
+	{
34
+
35
+		$urlParameters = array(
36
+			VidiModule::getParameterPrefix() => array(
37
+				'controller' => 'Content',
38
+				'action' => 'move',
39
+				'fieldNameAndPath' => $this->templateVariableContainer->get('fieldNameAndPath'),
40
+				'matches' => $this->templateVariableContainer->get('matches'),
41
+			),
42
+		);
43
+
44
+		$moduleUrl = BackendUtility::getModuleUrl(
45
+			VidiModule::getSignature(),
46
+			$urlParameters
47
+		);
48
+
49
+		// Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter.
50
+		$matches = $this->templateVariableContainer->get('matches');
51
+		if (empty($matches)) {
52
+			$moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]=');
53
+		}
54
+
55
+		return $moduleUrl;
56
+	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         // Work around a bug in BackendUtility::getModuleUrl if matches is empty getModuleUrl() will not return the parameter.
50 50
         $matches = $this->templateVariableContainer->get('matches');
51 51
         if (empty($matches)) {
52
-            $moduleUrl .= '&' . urlencode(VidiModule::getParameterPrefix() . '[matches]=');
52
+            $moduleUrl .= '&'.urlencode(VidiModule::getParameterPrefix().'[matches]=');
53 53
         }
54 54
 
55 55
         return $moduleUrl;
Please login to merge, or discard this patch.
Classes/ViewHelpers/ModuleSignatureViewHelper.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@
 block discarded – undo
23 23
 class ModuleSignatureViewHelper extends AbstractViewHelper
24 24
 {
25 25
 
26
-    /**
27
-     * Returns the BE module signature.
28
-     *
29
-     * @return string
30
-     */
31
-    public function render()
32
-    {
33
-        return VidiModule::getSignature();
34
-    }
26
+	/**
27
+	 * Returns the BE module signature.
28
+	 *
29
+	 * @return string
30
+	 */
31
+	public function render()
32
+	{
33
+		return VidiModule::getSignature();
34
+	}
35 35
 }
Please login to merge, or discard this patch.
Classes/Utility/Path.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -23,78 +23,78 @@
 block discarded – undo
23 23
 class Path
24 24
 {
25 25
 
26
-    /**
27
-     * @var string
28
-     */
29
-    static protected $extensionName = 'media';
26
+	/**
27
+	 * @var string
28
+	 */
29
+	static protected $extensionName = 'media';
30 30
 
31
-    /**
32
-     * Return a public path pointing to a resource.
33
-     *
34
-     * @param string $resource
35
-     * @return string
36
-     */
37
-    static public function getRelativePath($resource)
38
-    {
31
+	/**
32
+	 * Return a public path pointing to a resource.
33
+	 *
34
+	 * @param string $resource
35
+	 * @return string
36
+	 */
37
+	static public function getRelativePath($resource)
38
+	{
39 39
 
40
-        // If file is not found, resolve the path
41
-        if (!is_file(PATH_site . $resource)) {
42
-            $resource = substr(self::resolvePath($resource), strlen(PATH_site));
43
-        }
40
+		// If file is not found, resolve the path
41
+		if (!is_file(PATH_site . $resource)) {
42
+			$resource = substr(self::resolvePath($resource), strlen(PATH_site));
43
+		}
44 44
 
45
-        return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $resource)) . PathUtility::basename($resource);
46
-    }
45
+		return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $resource)) . PathUtility::basename($resource);
46
+	}
47 47
 
48
-    /**
49
-     * Resolves path e.g. EXT:media/Resources/Public/foo.png or ../../foo and returns an absolute path to the given resource.
50
-     *
51
-     * @param string $resource
52
-     * @return string
53
-     */
54
-    static public function resolvePath($resource)
55
-    {
56
-        $resource = self::canonicalPath($resource);
57
-        if (!is_file(PATH_site . $resource)) {
58
-            $resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource;
59
-        }
60
-        return GeneralUtility::getFileAbsFileName($resource);
61
-    }
48
+	/**
49
+	 * Resolves path e.g. EXT:media/Resources/Public/foo.png or ../../foo and returns an absolute path to the given resource.
50
+	 *
51
+	 * @param string $resource
52
+	 * @return string
53
+	 */
54
+	static public function resolvePath($resource)
55
+	{
56
+		$resource = self::canonicalPath($resource);
57
+		if (!is_file(PATH_site . $resource)) {
58
+			$resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource;
59
+		}
60
+		return GeneralUtility::getFileAbsFileName($resource);
61
+	}
62 62
 
63
-    /**
64
-     * Tell whether a resource exist.
65
-     *
66
-     * @param string $resource
67
-     * @return string
68
-     */
69
-    static public function exists($resource)
70
-    {
71
-        return is_file(self::resolvePath($resource));
72
-    }
63
+	/**
64
+	 * Tell whether a resource exist.
65
+	 *
66
+	 * @param string $resource
67
+	 * @return string
68
+	 */
69
+	static public function exists($resource)
70
+	{
71
+		return is_file(self::resolvePath($resource));
72
+	}
73 73
 
74
-    /**
75
-     * Tell whether a resource does not exist.
76
-     *
77
-     * @param string $resource
78
-     * @return string
79
-     */
80
-    static public function notExists($resource)
81
-    {
82
-        return !self::exists($resource);
83
-    }
74
+	/**
75
+	 * Tell whether a resource does not exist.
76
+	 *
77
+	 * @param string $resource
78
+	 * @return string
79
+	 */
80
+	static public function notExists($resource)
81
+	{
82
+		return !self::exists($resource);
83
+	}
84 84
 
85
-    /**
86
-     * Returns a canonical path by stripping relative segment ../foo/../bar will become foo/bar
87
-     *
88
-     * @param $resource
89
-     * @return string
90
-     */
91
-    static public function canonicalPath($resource)
92
-    {
93
-        $segments = explode('/', $resource);
94
-        $keys = array_keys($segments, '..');
95
-        foreach ($keys as $key) {
96
-            unset($segments[$key]);
97
-        }
98
-        return implode('/', $segments);
99
-    }
85
+	/**
86
+	 * Returns a canonical path by stripping relative segment ../foo/../bar will become foo/bar
87
+	 *
88
+	 * @param $resource
89
+	 * @return string
90
+	 */
91
+	static public function canonicalPath($resource)
92
+	{
93
+		$segments = explode('/', $resource);
94
+		$keys = array_keys($segments, '..');
95
+		foreach ($keys as $key) {
96
+			unset($segments[$key]);
97
+		}
98
+		return implode('/', $segments);
99
+	}
100 100
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,11 +38,11 @@  discard block
 block discarded – undo
38 38
     {
39 39
 
40 40
         // If file is not found, resolve the path
41
-        if (!is_file(PATH_site . $resource)) {
41
+        if (!is_file(PATH_site.$resource)) {
42 42
             $resource = substr(self::resolvePath($resource), strlen(PATH_site));
43 43
         }
44 44
 
45
-        return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site . $resource)) . PathUtility::basename($resource);
45
+        return PathUtility::getRelativePathTo(PathUtility::dirname(PATH_site.$resource)).PathUtility::basename($resource);
46 46
     }
47 47
 
48 48
     /**
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
     static public function resolvePath($resource)
55 55
     {
56 56
         $resource = self::canonicalPath($resource);
57
-        if (!is_file(PATH_site . $resource)) {
58
-            $resource = 'EXT:' . GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName) . '/Resources/Public/' . $resource;
57
+        if (!is_file(PATH_site.$resource)) {
58
+            $resource = 'EXT:'.GeneralUtility::camelCaseToLowerCaseUnderscored(self::$extensionName).'/Resources/Public/'.$resource;
59 59
         }
60 60
         return GeneralUtility::getFileAbsFileName($resource);
61 61
     }
Please login to merge, or discard this patch.
Classes/FileUpload/ImageOptimizerInterface.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
 interface ImageOptimizerInterface
21 21
 {
22 22
 
23
-    /**
24
-     * Optimize the given uploaded image
25
-     *
26
-     * @param \Fab\Media\FileUpload\UploadedFileInterface $uploadedFile
27
-     * @return \Fab\Media\FileUpload\UploadedFileInterface
28
-     */
29
-    public function optimize($uploadedFile);
23
+	/**
24
+	 * Optimize the given uploaded image
25
+	 *
26
+	 * @param \Fab\Media\FileUpload\UploadedFileInterface $uploadedFile
27
+	 * @return \Fab\Media\FileUpload\UploadedFileInterface
28
+	 */
29
+	public function optimize($uploadedFile);
30 30
 }
Please login to merge, or discard this patch.
Configuration/TCA/Overrides/sys_file_metadata.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if (!defined('TYPO3_MODE')) die ('Access denied.');
2
+if (!defined('TYPO3_MODE')) {
3
+	die ('Access denied.');
4
+}
3 5
 
4 6
 // We only want to have file relations if extension File advanced metadata is loaded.
5 7
 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('filemetadata')) {
Please login to merge, or discard this patch.
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -3,31 +3,31 @@
 block discarded – undo
3 3
 
4 4
 // We only want to have file relations if extension File advanced metadata is loaded.
5 5
 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('filemetadata')) {
6
-    $configuration = '--div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.relations, related_files';
7
-    \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_file_metadata', $configuration);
6
+	$configuration = '--div--;LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:tab.relations, related_files';
7
+	\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_file_metadata', $configuration);
8 8
 }
9 9
 
10 10
 $tca = [
11
-    'ctrl' => [
12
-        'default_sortby' => 'ORDER BY uid DESC',
13
-        'searchFields' => 'uid,extension,name', // sys_file_metadata.title,sys_file_metadata.keywords,
14
-    ],
15
-    'columns' => [
16
-        'fileinfo' => [
17
-            'config' => [
18
-                'type' => 'user',
19
-                'renderType' => 'findUploader',
20
-            ],
21
-        ],
22
-        'related_files' => [
23
-            'displayCond' => 'FIELD:sys_language_uid:<=:0',
24
-            'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_metadata.relations',
25
-            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
26
-                'related_files',
27
-                [],
28
-                ''
29
-            ),
30
-        ],
31
-    ],
11
+	'ctrl' => [
12
+		'default_sortby' => 'ORDER BY uid DESC',
13
+		'searchFields' => 'uid,extension,name', // sys_file_metadata.title,sys_file_metadata.keywords,
14
+	],
15
+	'columns' => [
16
+		'fileinfo' => [
17
+			'config' => [
18
+				'type' => 'user',
19
+				'renderType' => 'findUploader',
20
+			],
21
+		],
22
+		'related_files' => [
23
+			'displayCond' => 'FIELD:sys_language_uid:<=:0',
24
+			'label' => 'LLL:EXT:media/Resources/Private/Language/locallang_db.xlf:sys_file_metadata.relations',
25
+			'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
26
+				'related_files',
27
+				[],
28
+				''
29
+			),
30
+		],
31
+	],
32 32
 ];
33 33
 \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($GLOBALS['TCA']['sys_file_metadata'], $tca);
34 34
\ No newline at end of file
Please login to merge, or discard this patch.
Tests/Functional/Form/FileUploadTest.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 	public function setUp() {
42 42
 		parent::setUp();
43 43
 
44
-        $this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
44
+		$this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
45 45
 		$this->fakeName = uniqid('name');
46 46
 		$this->fakePrefix= uniqid('prefix');
47 47
 	}
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 
17 17
 use Fab\Media\Tests\Functional\AbstractFunctionalTestCase;
18 18
 
19
-require_once dirname(dirname(__FILE__)) . '/AbstractFunctionalTestCase.php';
19
+require_once dirname(dirname(__FILE__)).'/AbstractFunctionalTestCase.php';
20 20
 
21 21
 /**
22 22
  * Test case for class \Fab\Media\Form\FileUpload.
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $this->fixture = $this->getMock('Fab\Media\Form\FileUpload', array('addLanguage'));
45 45
 		$this->fakeName = uniqid('name');
46
-		$this->fakePrefix= uniqid('prefix');
46
+		$this->fakePrefix = uniqid('prefix');
47 47
 	}
48 48
 
49 49
 	public function tearDown() {
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$method->setAccessible(TRUE);
84 84
 
85 85
 		$basePart = uniqid();
86
-		$fakePrefix = $basePart . '[foo]';
86
+		$fakePrefix = $basePart.'[foo]';
87 87
 		$actual = $method->invokeArgs($this->fixture, array($fakePrefix));
88 88
 		$this->assertSame($basePart, $actual);
89 89
 	}
Please login to merge, or discard this patch.
Tests/Feature/bootstrap/FeatureContext.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,16 +14,16 @@
 block discarded – undo
14 14
  */
15 15
 class FeatureContext extends MinkContext
16 16
 {
17
-    /**
18
-     * Initializes context.
19
-     * Every scenario gets it's own context object.
20
-     *
21
-     * @param array $parameters context parameters (set them up through behat.yml)
22
-     */
23
-    public function __construct(array $parameters)
24
-    {
25
-        // Initialize your context here
26
-    }
17
+	/**
18
+	 * Initializes context.
19
+	 * Every scenario gets it's own context object.
20
+	 *
21
+	 * @param array $parameters context parameters (set them up through behat.yml)
22
+	 */
23
+	public function __construct(array $parameters)
24
+	{
25
+		// Initialize your context here
26
+	}
27 27
 
28 28
 	/**
29 29
 	 * @Given /^I wait "([^"]*)" seconds$/
Please login to merge, or discard this patch.
Classes/View/Plugin/LinkCreatorPlugin.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -27,50 +27,50 @@
 block discarded – undo
27 27
 class LinkCreatorPlugin extends AbstractComponentView
28 28
 {
29 29
 
30
-    /**
31
-     * Renders a hidden link for link creator.
32
-     *
33
-     * @return string
34
-     */
35
-    public function render()
36
-    {
37
-        $result = '';
38
-        if ($this->getModuleLoader()->hasPlugin('linkCreator')) {
30
+	/**
31
+	 * Renders a hidden link for link creator.
32
+	 *
33
+	 * @return string
34
+	 */
35
+	public function render()
36
+	{
37
+		$result = '';
38
+		if ($this->getModuleLoader()->hasPlugin('linkCreator')) {
39 39
 
40
-            // Load Require JS code
41
-            $this->loadRequireJsCode();
40
+			// Load Require JS code
41
+			$this->loadRequireJsCode();
42 42
 
43
-            $result = sprintf('<a href="%s" id="btn-linkCreator-current" class="btn btn-linkCreator" style="display: none"></a>',
44
-                $this->getLinkCreatorUri()
45
-            );
46
-        };
47
-        return $result;
48
-    }
43
+			$result = sprintf('<a href="%s" id="btn-linkCreator-current" class="btn btn-linkCreator" style="display: none"></a>',
44
+				$this->getLinkCreatorUri()
45
+			);
46
+		};
47
+		return $result;
48
+	}
49 49
 
50
-    /**
51
-     * @return string
52
-     */
53
-    protected function getLinkCreatorUri()
54
-    {
55
-        $urlParameters = array(
56
-            MediaModule::getParameterPrefix() => array(
57
-                'controller' => 'LinkCreator',
58
-                'action' => 'show',
59
-            ),
60
-        );
61
-        return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
62
-    }
50
+	/**
51
+	 * @return string
52
+	 */
53
+	protected function getLinkCreatorUri()
54
+	{
55
+		$urlParameters = array(
56
+			MediaModule::getParameterPrefix() => array(
57
+				'controller' => 'LinkCreator',
58
+				'action' => 'show',
59
+			),
60
+		);
61
+		return BackendUtility::getModuleUrl(MediaModule::getSignature(), $urlParameters);
62
+	}
63 63
 
64
-    /**
65
-     * @return void
66
-     */
67
-    protected function loadRequireJsCode()
68
-    {
69
-        $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
64
+	/**
65
+	 * @return void
66
+	 */
67
+	protected function loadRequireJsCode()
68
+	{
69
+		$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
70 70
 
71
-        $configuration['paths']['Fab/Media'] = '../typo3conf/ext/media/Resources/Public/JavaScript';
72
-        $pageRenderer->addRequireJsConfiguration($configuration);
73
-        $pageRenderer->loadRequireJsModule('Fab/Media/PluginLinkCreator');
74
-    }
71
+		$configuration['paths']['Fab/Media'] = '../typo3conf/ext/media/Resources/Public/JavaScript';
72
+		$pageRenderer->addRequireJsConfiguration($configuration);
73
+		$pageRenderer->loadRequireJsModule('Fab/Media/PluginLinkCreator');
74
+	}
75 75
 
76 76
 }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,6 @@
 block discarded – undo
11 11
 use Fab\Media\Module\MediaModule;
12 12
 use Fab\Vidi\Utility\BackendUtility;
13 13
 use Fab\Vidi\View\AbstractComponentView;
14
-use Fab\Media\Utility\Path;
15 14
 use TYPO3\CMS\Core\Page\PageRenderer;
16 15
 use TYPO3\CMS\Core\Utility\GeneralUtility;
17 16
 
Please login to merge, or discard this patch.