Completed
Push — master ( 5c161a...b70884 )
by Fabien
52:39
created
Classes/Persistence/ConstraintContainer.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -15,27 +15,27 @@
 block discarded – undo
15 15
  */
16 16
 class ConstraintContainer
17 17
 {
18
-    /**
19
-     * @var ConstraintInterface
20
-     */
21
-    protected $constraint;
18
+	/**
19
+	 * @var ConstraintInterface
20
+	 */
21
+	protected $constraint;
22 22
 
23
-    /**
24
-     * @return ConstraintInterface
25
-     */
26
-    public function getConstraint()
27
-    {
28
-        return $this->constraint;
29
-    }
23
+	/**
24
+	 * @return ConstraintInterface
25
+	 */
26
+	public function getConstraint()
27
+	{
28
+		return $this->constraint;
29
+	}
30 30
 
31
-    /**
32
-     * @param ConstraintInterface $constraint
33
-     * @return $this
34
-     */
35
-    public function setConstraint($constraint)
36
-    {
37
-        $this->constraint = $constraint;
38
-        return $this;
39
-    }
31
+	/**
32
+	 * @param ConstraintInterface $constraint
33
+	 * @return $this
34
+	 */
35
+	public function setConstraint($constraint)
36
+	{
37
+		$this->constraint = $constraint;
38
+		return $this;
39
+	}
40 40
 
41 41
 }
Please login to merge, or discard this patch.
Classes/ViewHelpers/Grid/Column/CanBeHiddenViewHelper.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -16,22 +16,22 @@
 block discarded – undo
16 16
  */
17 17
 class CanBeHiddenViewHelper extends AbstractViewHelper
18 18
 {
19
-    /**
20
-     * @return void
21
-     */
22
-    public function initializeArguments()
23
-    {
24
-        $this->registerArgument('name', 'string', 'The column name', true);
25
-    }
19
+	/**
20
+	 * @return void
21
+	 */
22
+	public function initializeArguments()
23
+	{
24
+		$this->registerArgument('name', 'string', 'The column name', true);
25
+	}
26 26
 
27
-    /**
28
-     * Returns whether the column can be hidden or not.
29
-     *
30
-     * @return boolean
31
-     */
32
-    public function render()
33
-    {
34
-        return Tca::grid()->canBeHidden($this->arguments['name']);
35
-    }
27
+	/**
28
+	 * Returns whether the column can be hidden or not.
29
+	 *
30
+	 * @return boolean
31
+	 */
32
+	public function render()
33
+	{
34
+		return Tca::grid()->canBeHidden($this->arguments['name']);
35
+	}
36 36
 
37 37
 }
Please login to merge, or discard this patch.
Classes/Utility/ExtensionManagementUtility.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -18,29 +18,29 @@
 block discarded – undo
18 18
  */
19 19
 class ExtensionManagementUtility
20 20
 {
21
-    /**
22
-     * Returns the relative path to the extension as measured from the public web path
23
-     * If the extension is not loaded the function will die with an error message
24
-     * Useful for images and links from the frontend
25
-     *
26
-     * @param string $key Extension key
27
-     * @return string
28
-     */
29
-    public static function siteRelPath($key)
30
-    {
31
-        return self::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($key));
32
-    }
21
+	/**
22
+	 * Returns the relative path to the extension as measured from the public web path
23
+	 * If the extension is not loaded the function will die with an error message
24
+	 * Useful for images and links from the frontend
25
+	 *
26
+	 * @param string $key Extension key
27
+	 * @return string
28
+	 */
29
+	public static function siteRelPath($key)
30
+	{
31
+		return self::stripPathSitePrefix(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($key));
32
+	}
33 33
 
34
-    /**
35
-     * Strip first part of a path, equal to the length of public web path including trailing slash
36
-     *
37
-     * @param string $path
38
-     * @return string
39
-     * @internal
40
-     */
41
-    public static function stripPathSitePrefix($path)
42
-    {
43
-        return substr($path, strlen(Environment::getPublicPath() . '/'));
44
-    }
34
+	/**
35
+	 * Strip first part of a path, equal to the length of public web path including trailing slash
36
+	 *
37
+	 * @param string $path
38
+	 * @return string
39
+	 * @internal
40
+	 */
41
+	public static function stripPathSitePrefix($path)
42
+	{
43
+		return substr($path, strlen(Environment::getPublicPath() . '/'));
44
+	}
45 45
 
46 46
 }
Please login to merge, or discard this patch.
Classes/View/Check/PidCheck.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -19,33 +19,33 @@  discard block
 block discarded – undo
19 19
  */
20 20
 class PidCheck extends AbstractComponentView
21 21
 {
22
-    /**
23
-     * Renders warnings if storagePid is not properly configured.
24
-     *
25
-     * @return string
26
-     */
27
-    public function render(): string
28
-    {
29
-        $errors = $this->getModulePidService()->validateConfiguredPid();
22
+	/**
23
+	 * Renders warnings if storagePid is not properly configured.
24
+	 *
25
+	 * @return string
26
+	 */
27
+	public function render(): string
28
+	{
29
+		$errors = $this->getModulePidService()->validateConfiguredPid();
30 30
 
31
-        return empty($errors)
32
-            ? ''
33
-            : $this->formatMessagePidIsNotValid($errors);
34
-    }
31
+		return empty($errors)
32
+			? ''
33
+			: $this->formatMessagePidIsNotValid($errors);
34
+	}
35 35
 
36
-    /**
37
-     * Format a message whenever the storage is offline.
38
-     *
39
-     * @param array $errors
40
-     * @return string
41
-     */
42
-    protected function formatMessagePidIsNotValid(array $errors): string
43
-    {
44
-        $configuredPid = $this->getModulePidService()->getConfiguredNewRecordPid();
36
+	/**
37
+	 * Format a message whenever the storage is offline.
38
+	 *
39
+	 * @param array $errors
40
+	 * @return string
41
+	 */
42
+	protected function formatMessagePidIsNotValid(array $errors): string
43
+	{
44
+		$configuredPid = $this->getModulePidService()->getConfiguredNewRecordPid();
45 45
 
46
-        $error = implode('<br />', $errors);
47
-        $dataType = $this->getModuleLoader()->getDataType();
48
-        $result = <<< EOF
46
+		$error = implode('<br />', $errors);
47
+		$dataType = $this->getModuleLoader()->getDataType();
48
+		$result = <<< EOF
49 49
 			<div class="alert alert-warning">
50 50
 				<div class="alert-title">
51 51
 					Page id "{$configuredPid}" has found to be a wrong configuration for "{$dataType}"
@@ -73,16 +73,16 @@  discard block
 block discarded – undo
73 73
 			</div>
74 74
 EOF;
75 75
 
76
-        return $result;
77
-    }
76
+		return $result;
77
+	}
78 78
 
79
-    /**
80
-     * @return ModulePidService|object
81
-     */
82
-    public function getModulePidService()
83
-    {
84
-        /** @var ModulePidService $modulePidService */
85
-        return GeneralUtility::makeInstance(ModulePidService::class);
86
-    }
79
+	/**
80
+	 * @return ModulePidService|object
81
+	 */
82
+	public function getModulePidService()
83
+	{
84
+		/** @var ModulePidService $modulePidService */
85
+		return GeneralUtility::makeInstance(ModulePidService::class);
86
+	}
87 87
 
88 88
 }
Please login to merge, or discard this patch.
Configuration/Extbase/Persistence/Classes.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use Fab\Vidi\Domain\Model\Selection;
5 5
 
6 6
 return [
7
-    Selection::class => [
8
-        'tableName' => 'tx_vidi_selection',
9
-    ],
7
+	Selection::class => [
8
+		'tableName' => 'tx_vidi_selection',
9
+	],
10 10
 ];
Please login to merge, or discard this patch.
Configuration/Commands.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  * example: bin/typo3 vidi:analyseRelations
6 6
  */
7 7
 return [
8
-    'vidi:analyseRelations' => [
9
-        'class' => VidiCommandController::class
10
-    ],
8
+	'vidi:analyseRelations' => [
9
+		'class' => VidiCommandController::class
10
+	],
11 11
 ];
Please login to merge, or discard this patch.
Classes/ViewHelpers/Render/ComponentsViewHelper.php 1 patch
Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -18,57 +18,57 @@
 block discarded – undo
18 18
  */
19 19
 class ComponentsViewHelper extends AbstractViewHelper
20 20
 {
21
-    /**
22
-     * @return void
23
-     */
24
-    public function initializeArguments()
25
-    {
26
-        $this->registerArgument('part', 'string', 'Template part', true);
27
-    }
21
+	/**
22
+	 * @return void
23
+	 */
24
+	public function initializeArguments()
25
+	{
26
+		$this->registerArgument('part', 'string', 'Template part', true);
27
+	}
28 28
 
29
-    /**
30
-     * Escapes special characters with their escaped counterparts as needed using PHPs strip_tags() function.
31
-     *
32
-     * @return mixed
33
-     */
34
-    public function render()
35
-    {
36
-        return static::renderStatic(
37
-            $this->arguments,
38
-            $this->buildRenderChildrenClosure(),
39
-            $this->renderingContext
40
-        );
41
-    }
29
+	/**
30
+	 * Escapes special characters with their escaped counterparts as needed using PHPs strip_tags() function.
31
+	 *
32
+	 * @return mixed
33
+	 */
34
+	public function render()
35
+	{
36
+		return static::renderStatic(
37
+			$this->arguments,
38
+			$this->buildRenderChildrenClosure(),
39
+			$this->renderingContext
40
+		);
41
+	}
42 42
 
43
-    /**
44
-     * Applies strip_tags() on the specified value.
45
-     *
46
-     * @param array $arguments
47
-     * @param \Closure $renderChildrenClosure
48
-     * @param RenderingContextInterface $renderingContext
49
-     * @return string
50
-     */
51
-    public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
52
-    {
53
-        /** @var ModuleLoader $moduleLoader */
54
-        $moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
43
+	/**
44
+	 * Applies strip_tags() on the specified value.
45
+	 *
46
+	 * @param array $arguments
47
+	 * @param \Closure $renderChildrenClosure
48
+	 * @param RenderingContextInterface $renderingContext
49
+	 * @return string
50
+	 */
51
+	public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
52
+	{
53
+		/** @var ModuleLoader $moduleLoader */
54
+		$moduleLoader = GeneralUtility::makeInstance(ModuleLoader::class);
55 55
 
56
-        $part = $arguments['part'];
56
+		$part = $arguments['part'];
57 57
 
58
-        $getComponents = 'get' . ucfirst($part) . 'Components';
59
-        $components = $moduleLoader->$getComponents();
58
+		$getComponents = 'get' . ucfirst($part) . 'Components';
59
+		$components = $moduleLoader->$getComponents();
60 60
 
61
-        $result = '';
62
-        foreach ($components as $component) {
63
-            $viewHelper = GeneralUtility::makeInstance($component);
61
+		$result = '';
62
+		foreach ($components as $component) {
63
+			$viewHelper = GeneralUtility::makeInstance($component);
64 64
 
65
-            // Get possible arguments but remove first one.
66
-            $arguments = func_get_args();
67
-            array_shift($arguments);
68
-            $result .= call_user_func_array(array($viewHelper, 'render'), $arguments);
69
-        }
65
+			// Get possible arguments but remove first one.
66
+			$arguments = func_get_args();
67
+			array_shift($arguments);
68
+			$result .= call_user_func_array(array($viewHelper, 'render'), $arguments);
69
+		}
70 70
 
71
-        return $result;
72
-    }
71
+		return $result;
72
+	}
73 73
 
74 74
 }
Please login to merge, or discard this patch.
ext_emconf.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $EM_CONF[$_EXTKEY] = [
4
-    'title' => 'Versatile and Interactive Display - List Component',
5
-    'description' => 'Generic listing of records with versatile ways of interacting with the data, e.g. advanced filter, inline editing, mass editing, ... Veni, vidi, vici!',
6
-    'author' => 'Fabien Udriot',
7
-    'author_email' => '[email protected]',
8
-    'state' => 'stable',
4
+	'title' => 'Versatile and Interactive Display - List Component',
5
+	'description' => 'Generic listing of records with versatile ways of interacting with the data, e.g. advanced filter, inline editing, mass editing, ... Veni, vidi, vici!',
6
+	'author' => 'Fabien Udriot',
7
+	'author_email' => '[email protected]',
8
+	'state' => 'stable',
9 9
 ];
Please login to merge, or discard this patch.
Classes/Processor/ContentObjectProcessor.php 1 patch
Indentation   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -23,116 +23,116 @@
 block discarded – undo
23 23
  */
24 24
 class ContentObjectProcessor implements SingletonInterface
25 25
 {
26
-    /**
27
-     * @param ProcessContentDataSignalArguments $signalArguments
28
-     * @return array
29
-     */
30
-    public function processRelations(ProcessContentDataSignalArguments $signalArguments)
31
-    {
32
-        $contentObject = $signalArguments->getContentObject();
33
-        $fieldNameAndPath = $signalArguments->getFieldNameAndPath();
34
-        $contentData = $signalArguments->getContentData();
35
-        $savingBehavior = $signalArguments->getSavingBehavior();
36
-
37
-        if ($savingBehavior !== SavingBehavior::REPLACE) {
38
-            $contentData = $this->appendOrRemoveRelations($contentObject, $fieldNameAndPath, $contentData, $savingBehavior);
39
-            $signalArguments->setContentData($contentData);
40
-        }
41
-
42
-        return array($signalArguments);
43
-    }
44
-
45
-    /**
46
-     * @param Content $object
47
-     * @param $fieldNameAndPath
48
-     * @param array $contentData
49
-     * @param string $savingBehavior
50
-     * @return array
51
-     */
52
-    protected function appendOrRemoveRelations(Content $object, $fieldNameAndPath, array $contentData, $savingBehavior)
53
-    {
54
-        foreach ($contentData as $fieldName => $values) {
55
-            $resolvedObject = $this->getContentObjectResolver()->getObject($object, $fieldNameAndPath);
56
-
57
-            if (Tca::table($resolvedObject)->field($fieldName)->hasMany()) {
58
-                // true means CSV values must be converted to array.
59
-                if (!is_array($values)) {
60
-                    $values = GeneralUtility::trimExplode(',', $values);
61
-                }
62
-                $relatedValues = $this->getRelatedValues($object, $fieldNameAndPath, $fieldName);
63
-
64
-                foreach ($values as $value) {
65
-                    $appendOrRemove = $savingBehavior . 'Relations';
66
-                    $relatedValues = $this->$appendOrRemove($value, $relatedValues);
67
-                }
68
-
69
-                $contentData[$fieldName] = $relatedValues;
70
-            }
71
-        }
72
-        return $contentData;
73
-    }
74
-
75
-    /**
76
-     * @param $value
77
-     * @param array $relatedValues
78
-     * @return array
79
-     */
80
-    protected function appendRelations($value, array $relatedValues)
81
-    {
82
-        if (!in_array($value, $relatedValues)) {
83
-            $relatedValues[] = $value;
84
-        }
85
-        return $relatedValues;
86
-    }
87
-
88
-    /**
89
-     * @param $value
90
-     * @param array $relatedValues
91
-     * @return array
92
-     */
93
-    protected function removeRelations($value, array $relatedValues)
94
-    {
95
-        if (in_array($value, $relatedValues)) {
96
-            $key = array_search($value, $relatedValues);
97
-            unset($relatedValues[$key]);
98
-        }
99
-        return $relatedValues;
100
-    }
101
-
102
-    /**
103
-     * @param Content $object
104
-     * @param string $fieldNameAndPath
105
-     * @param string $fieldName
106
-     * @return array
107
-     */
108
-    protected function getRelatedValues(Content $object, $fieldNameAndPath, $fieldName)
109
-    {
110
-        $values = [];
111
-        $relatedContentObjects = $this->getContentObjectResolver()->getValue($object, $fieldNameAndPath, $fieldName);
112
-
113
-        if (is_array($relatedContentObjects)) {
114
-            /** @var Content $relatedContentObject */
115
-            foreach ($relatedContentObjects as $relatedContentObject) {
116
-                $values[] = $relatedContentObject->getUid();
117
-            }
118
-        }
119
-
120
-        return $values;
121
-    }
122
-
123
-    /**
124
-     * @return ContentObjectResolver|object
125
-     */
126
-    protected function getContentObjectResolver()
127
-    {
128
-        return GeneralUtility::makeInstance(ContentObjectResolver::class);
129
-    }
130
-
131
-    /**
132
-     * @return FieldPathResolver|object
133
-     */
134
-    protected function getFieldPathResolver()
135
-    {
136
-        return GeneralUtility::makeInstance(FieldPathResolver::class);
137
-    }
26
+	/**
27
+	 * @param ProcessContentDataSignalArguments $signalArguments
28
+	 * @return array
29
+	 */
30
+	public function processRelations(ProcessContentDataSignalArguments $signalArguments)
31
+	{
32
+		$contentObject = $signalArguments->getContentObject();
33
+		$fieldNameAndPath = $signalArguments->getFieldNameAndPath();
34
+		$contentData = $signalArguments->getContentData();
35
+		$savingBehavior = $signalArguments->getSavingBehavior();
36
+
37
+		if ($savingBehavior !== SavingBehavior::REPLACE) {
38
+			$contentData = $this->appendOrRemoveRelations($contentObject, $fieldNameAndPath, $contentData, $savingBehavior);
39
+			$signalArguments->setContentData($contentData);
40
+		}
41
+
42
+		return array($signalArguments);
43
+	}
44
+
45
+	/**
46
+	 * @param Content $object
47
+	 * @param $fieldNameAndPath
48
+	 * @param array $contentData
49
+	 * @param string $savingBehavior
50
+	 * @return array
51
+	 */
52
+	protected function appendOrRemoveRelations(Content $object, $fieldNameAndPath, array $contentData, $savingBehavior)
53
+	{
54
+		foreach ($contentData as $fieldName => $values) {
55
+			$resolvedObject = $this->getContentObjectResolver()->getObject($object, $fieldNameAndPath);
56
+
57
+			if (Tca::table($resolvedObject)->field($fieldName)->hasMany()) {
58
+				// true means CSV values must be converted to array.
59
+				if (!is_array($values)) {
60
+					$values = GeneralUtility::trimExplode(',', $values);
61
+				}
62
+				$relatedValues = $this->getRelatedValues($object, $fieldNameAndPath, $fieldName);
63
+
64
+				foreach ($values as $value) {
65
+					$appendOrRemove = $savingBehavior . 'Relations';
66
+					$relatedValues = $this->$appendOrRemove($value, $relatedValues);
67
+				}
68
+
69
+				$contentData[$fieldName] = $relatedValues;
70
+			}
71
+		}
72
+		return $contentData;
73
+	}
74
+
75
+	/**
76
+	 * @param $value
77
+	 * @param array $relatedValues
78
+	 * @return array
79
+	 */
80
+	protected function appendRelations($value, array $relatedValues)
81
+	{
82
+		if (!in_array($value, $relatedValues)) {
83
+			$relatedValues[] = $value;
84
+		}
85
+		return $relatedValues;
86
+	}
87
+
88
+	/**
89
+	 * @param $value
90
+	 * @param array $relatedValues
91
+	 * @return array
92
+	 */
93
+	protected function removeRelations($value, array $relatedValues)
94
+	{
95
+		if (in_array($value, $relatedValues)) {
96
+			$key = array_search($value, $relatedValues);
97
+			unset($relatedValues[$key]);
98
+		}
99
+		return $relatedValues;
100
+	}
101
+
102
+	/**
103
+	 * @param Content $object
104
+	 * @param string $fieldNameAndPath
105
+	 * @param string $fieldName
106
+	 * @return array
107
+	 */
108
+	protected function getRelatedValues(Content $object, $fieldNameAndPath, $fieldName)
109
+	{
110
+		$values = [];
111
+		$relatedContentObjects = $this->getContentObjectResolver()->getValue($object, $fieldNameAndPath, $fieldName);
112
+
113
+		if (is_array($relatedContentObjects)) {
114
+			/** @var Content $relatedContentObject */
115
+			foreach ($relatedContentObjects as $relatedContentObject) {
116
+				$values[] = $relatedContentObject->getUid();
117
+			}
118
+		}
119
+
120
+		return $values;
121
+	}
122
+
123
+	/**
124
+	 * @return ContentObjectResolver|object
125
+	 */
126
+	protected function getContentObjectResolver()
127
+	{
128
+		return GeneralUtility::makeInstance(ContentObjectResolver::class);
129
+	}
130
+
131
+	/**
132
+	 * @return FieldPathResolver|object
133
+	 */
134
+	protected function getFieldPathResolver()
135
+	{
136
+		return GeneralUtility::makeInstance(FieldPathResolver::class);
137
+	}
138 138
 }
Please login to merge, or discard this patch.