Completed
Push — master ( 5d201a...080764 )
by Fabien
50:50
created
Classes/Resolver/ContentObjectResolver.php 1 patch
Indentation   +83 added lines, -83 removed lines patch added patch discarded remove patch
@@ -20,87 +20,87 @@
 block discarded – undo
20 20
 class ContentObjectResolver implements SingletonInterface
21 21
 {
22 22
 
23
-    /**
24
-     * @param Content $object
25
-     * @param string $fieldNameAndPath
26
-     * @return string
27
-     */
28
-    public function getDataType(Content $object, $fieldNameAndPath)
29
-    {
30
-
31
-        // Important to notice the field name can contains a path, e.g. metadata.title and must be sanitized.
32
-        $relationalFieldName = $this->getFieldPathResolver()->stripFieldName($fieldNameAndPath); // ex: metadata.title -> metadata
33
-
34
-        // Handle case when field name leads to a relation.
35
-        if ($object[$relationalFieldName] instanceof Content) {
36
-            $resolvedDataType = $object[$relationalFieldName]->getDataType();
37
-        } else {
38
-            $resolvedDataType = $object->getDataType();
39
-        }
40
-
41
-        return $resolvedDataType;
42
-    }
43
-
44
-    /**
45
-     * Fetch the value of an object according to a field path.
46
-     * The returned value can be a string, int or array of Content objects.
47
-     *
48
-     * @param Content $object
49
-     * @param string $fieldNameAndPath
50
-     * @param string $fieldName
51
-     * @param int $language
52
-     * @return mixed
53
-     */
54
-    public function getValue(Content $object, $fieldNameAndPath, $fieldName, $language = 0)
55
-    {
56
-
57
-        $resolvedContentObject = $this->getObject($object, $fieldNameAndPath);
58
-        $resolvedValue = $resolvedContentObject[$fieldName];
59
-
60
-        if (is_scalar($resolvedValue) && $language > 0) {
61
-            $resolvedValue = $this->getLanguageService()->getLocalizedFieldName($resolvedContentObject, $language, $fieldName);
62
-        }
63
-
64
-        return $resolvedValue;
65
-    }
66
-
67
-    /**
68
-     * Fetch the value of an object according to a field name and path.
69
-     * The returned value is a Content object.
70
-     *
71
-     * @param Content $object
72
-     * @param string $fieldNameAndPath
73
-     * @return Content
74
-     */
75
-    public function getObject(Content $object, $fieldNameAndPath)
76
-    {
77
-
78
-        // Important to notice the field name can contains a path, e.g. metadata.title and must be sanitized.
79
-        $fieldPath = $this->getFieldPathResolver()->stripFieldName($fieldNameAndPath); // ex: metadata.title -> metadata
80
-
81
-        // Handle case when field name leads to a relation.
82
-        if ($object[$fieldPath] instanceof Content) {
83
-            $resolvedObject = $object[$fieldPath];
84
-        } else {
85
-            $resolvedObject = $object;
86
-        }
87
-
88
-        return $resolvedObject;
89
-    }
90
-
91
-    /**
92
-     * @return \Fab\Vidi\Resolver\FieldPathResolver|object
93
-     */
94
-    protected function getFieldPathResolver()
95
-    {
96
-        return GeneralUtility::makeInstance(\Fab\Vidi\Resolver\FieldPathResolver::class);
97
-    }
98
-
99
-    /**
100
-     * @return \Fab\Vidi\Language\LanguageService|object
101
-     */
102
-    protected function getLanguageService()
103
-    {
104
-        return GeneralUtility::makeInstance(\Fab\Vidi\Language\LanguageService::class);
105
-    }
23
+	/**
24
+	 * @param Content $object
25
+	 * @param string $fieldNameAndPath
26
+	 * @return string
27
+	 */
28
+	public function getDataType(Content $object, $fieldNameAndPath)
29
+	{
30
+
31
+		// Important to notice the field name can contains a path, e.g. metadata.title and must be sanitized.
32
+		$relationalFieldName = $this->getFieldPathResolver()->stripFieldName($fieldNameAndPath); // ex: metadata.title -> metadata
33
+
34
+		// Handle case when field name leads to a relation.
35
+		if ($object[$relationalFieldName] instanceof Content) {
36
+			$resolvedDataType = $object[$relationalFieldName]->getDataType();
37
+		} else {
38
+			$resolvedDataType = $object->getDataType();
39
+		}
40
+
41
+		return $resolvedDataType;
42
+	}
43
+
44
+	/**
45
+	 * Fetch the value of an object according to a field path.
46
+	 * The returned value can be a string, int or array of Content objects.
47
+	 *
48
+	 * @param Content $object
49
+	 * @param string $fieldNameAndPath
50
+	 * @param string $fieldName
51
+	 * @param int $language
52
+	 * @return mixed
53
+	 */
54
+	public function getValue(Content $object, $fieldNameAndPath, $fieldName, $language = 0)
55
+	{
56
+
57
+		$resolvedContentObject = $this->getObject($object, $fieldNameAndPath);
58
+		$resolvedValue = $resolvedContentObject[$fieldName];
59
+
60
+		if (is_scalar($resolvedValue) && $language > 0) {
61
+			$resolvedValue = $this->getLanguageService()->getLocalizedFieldName($resolvedContentObject, $language, $fieldName);
62
+		}
63
+
64
+		return $resolvedValue;
65
+	}
66
+
67
+	/**
68
+	 * Fetch the value of an object according to a field name and path.
69
+	 * The returned value is a Content object.
70
+	 *
71
+	 * @param Content $object
72
+	 * @param string $fieldNameAndPath
73
+	 * @return Content
74
+	 */
75
+	public function getObject(Content $object, $fieldNameAndPath)
76
+	{
77
+
78
+		// Important to notice the field name can contains a path, e.g. metadata.title and must be sanitized.
79
+		$fieldPath = $this->getFieldPathResolver()->stripFieldName($fieldNameAndPath); // ex: metadata.title -> metadata
80
+
81
+		// Handle case when field name leads to a relation.
82
+		if ($object[$fieldPath] instanceof Content) {
83
+			$resolvedObject = $object[$fieldPath];
84
+		} else {
85
+			$resolvedObject = $object;
86
+		}
87
+
88
+		return $resolvedObject;
89
+	}
90
+
91
+	/**
92
+	 * @return \Fab\Vidi\Resolver\FieldPathResolver|object
93
+	 */
94
+	protected function getFieldPathResolver()
95
+	{
96
+		return GeneralUtility::makeInstance(\Fab\Vidi\Resolver\FieldPathResolver::class);
97
+	}
98
+
99
+	/**
100
+	 * @return \Fab\Vidi\Language\LanguageService|object
101
+	 */
102
+	protected function getLanguageService()
103
+	{
104
+		return GeneralUtility::makeInstance(\Fab\Vidi\Language\LanguageService::class);
105
+	}
106 106
 }
Please login to merge, or discard this patch.
Classes/Controller/UserPreferencesController.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -18,69 +18,69 @@
 block discarded – undo
18 18
 class UserPreferencesController extends ActionController
19 19
 {
20 20
 
21
-    /**
22
-     * @param string $key
23
-     * @param string $value
24
-     * @param string $preferenceSignature
25
-     * @return string
26
-     */
27
-    public function saveAction($key, $value, $preferenceSignature)
28
-    {
21
+	/**
22
+	 * @param string $key
23
+	 * @param string $value
24
+	 * @param string $preferenceSignature
25
+	 * @return string
26
+	 */
27
+	public function saveAction($key, $value, $preferenceSignature)
28
+	{
29 29
 
30
-        $dataType = $this->getModuleLoader()->getDataType();
30
+		$dataType = $this->getModuleLoader()->getDataType();
31 31
 
32
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_' . $key;
33
-        $this->getCacheInstance()->set($key, $value, [], 0);
32
+		$key = $dataType . '_' . $this->getBackendUserIdentifier() . '_' . $key;
33
+		$this->getCacheInstance()->set($key, $value, [], 0);
34 34
 
35
-        $key = $dataType . '_' . $this->getBackendUserIdentifier() . '_signature';
36
-        $this->getCacheInstance()->set($key, $preferenceSignature, [], 0);
35
+		$key = $dataType . '_' . $this->getBackendUserIdentifier() . '_signature';
36
+		$this->getCacheInstance()->set($key, $preferenceSignature, [], 0);
37 37
 
38
-        return 'OK';
39
-    }
38
+		return 'OK';
39
+	}
40 40
 
41
-    /**
42
-     * @return int
43
-     */
44
-    protected function getBackendUserIdentifier()
45
-    {
46
-        return $this->getBackendUser()->user['uid'];
47
-    }
41
+	/**
42
+	 * @return int
43
+	 */
44
+	protected function getBackendUserIdentifier()
45
+	{
46
+		return $this->getBackendUser()->user['uid'];
47
+	}
48 48
 
49
-    /**
50
-     * Returns an instance of the current Backend User.
51
-     *
52
-     * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
53
-     */
54
-    protected function getBackendUser()
55
-    {
56
-        return $GLOBALS['BE_USER'];
57
-    }
49
+	/**
50
+	 * Returns an instance of the current Backend User.
51
+	 *
52
+	 * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
53
+	 */
54
+	protected function getBackendUser()
55
+	{
56
+		return $GLOBALS['BE_USER'];
57
+	}
58 58
 
59
-    /**
60
-     * Get the Vidi Module Loader.
61
-     *
62
-     * @return ModuleLoader
63
-     */
64
-    protected function getModuleLoader()
65
-    {
66
-        return GeneralUtility::makeInstance(ModuleLoader::class);
67
-    }
59
+	/**
60
+	 * Get the Vidi Module Loader.
61
+	 *
62
+	 * @return ModuleLoader
63
+	 */
64
+	protected function getModuleLoader()
65
+	{
66
+		return GeneralUtility::makeInstance(ModuleLoader::class);
67
+	}
68 68
 
69
-    /**
70
-     * @return \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
71
-     */
72
-    protected function getCacheInstance()
73
-    {
74
-        return $this->getCacheManager()->getCache('vidi');
75
-    }
69
+	/**
70
+	 * @return \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend
71
+	 */
72
+	protected function getCacheInstance()
73
+	{
74
+		return $this->getCacheManager()->getCache('vidi');
75
+	}
76 76
 
77
-    /**
78
-     * Return the Cache Manager
79
-     *
80
-     * @return \TYPO3\CMS\Core\Cache\CacheManager
81
-     */
82
-    protected function getCacheManager()
83
-    {
84
-        return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class);
85
-    }
77
+	/**
78
+	 * Return the Cache Manager
79
+	 *
80
+	 * @return \TYPO3\CMS\Core\Cache\CacheManager
81
+	 */
82
+	protected function getCacheManager()
83
+	{
84
+		return GeneralUtility::makeInstance(\TYPO3\CMS\Core\Cache\CacheManager::class);
85
+	}
86 86
 }
Please login to merge, or discard this patch.
Classes/Command/VidiCommandController.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -23,59 +23,59 @@
 block discarded – undo
23 23
 class VidiCommandController extends Command
24 24
 {
25 25
 
26
-    /**
27
-     * Configure the command by defining the name, options and arguments
28
-     */
29
-    protected function configure()
30
-    {
31
-        $this->setDescription('Check TCA configuration for relations used in grid.')
32
-        ->addOption(
33
-        'table',
34
-        'c',
35
-        InputOption::VALUE_NONE,
36
-        'The table name. If not defined check for every table.'
37
-    );
38
-    }
26
+	/**
27
+	 * Configure the command by defining the name, options and arguments
28
+	 */
29
+	protected function configure()
30
+	{
31
+		$this->setDescription('Check TCA configuration for relations used in grid.')
32
+		->addOption(
33
+		'table',
34
+		'c',
35
+		InputOption::VALUE_NONE,
36
+		'The table name. If not defined check for every table.'
37
+	);
38
+	}
39 39
 
40
-    /**
41
-     * Executes the command for removing the lock file
42
-     *
43
-     * @param InputInterface $input
44
-     * @param OutputInterface $output
45
-     */
46
-    protected function execute(InputInterface $input, OutputInterface $output)
47
-    {
48
-        $io = new SymfonyStyle($input, $output);
49
-        foreach ($GLOBALS['TCA'] as $tableName => $TCA) {
50
-            $table = $input->getOption('table');
51
-            if ($table !== '' && $table !== $tableName) {
52
-                continue;
53
-            }
40
+	/**
41
+	 * Executes the command for removing the lock file
42
+	 *
43
+	 * @param InputInterface $input
44
+	 * @param OutputInterface $output
45
+	 */
46
+	protected function execute(InputInterface $input, OutputInterface $output)
47
+	{
48
+		$io = new SymfonyStyle($input, $output);
49
+		foreach ($GLOBALS['TCA'] as $tableName => $TCA) {
50
+			$table = $input->getOption('table');
51
+			if ($table !== '' && $table !== $tableName) {
52
+				continue;
53
+			}
54 54
 
55
-            $fields = Tca::grid($tableName)->getFields();
56
-            if (!empty($fields)) {
55
+			$fields = Tca::grid($tableName)->getFields();
56
+			if (!empty($fields)) {
57 57
 
58
-                $relations = $this->getGridAnalyserService()->checkRelationForTable($tableName);
59
-                if (!empty($relations)) {
58
+				$relations = $this->getGridAnalyserService()->checkRelationForTable($tableName);
59
+				if (!empty($relations)) {
60 60
 
61
-                    $io->text('');
62
-                    $io->text('--------------------------------------------------------------------');
63
-                    $io->text('');
64
-                    $io->text(sprintf('Relations for "%s"', $tableName));
65
-                    $io->text('');
66
-                    $io->text(implode("\n", $relations));
67
-                }
68
-            }
69
-        }
70
-    }
61
+					$io->text('');
62
+					$io->text('--------------------------------------------------------------------');
63
+					$io->text('');
64
+					$io->text(sprintf('Relations for "%s"', $tableName));
65
+					$io->text('');
66
+					$io->text(implode("\n", $relations));
67
+				}
68
+			}
69
+		}
70
+	}
71 71
 
72
-    /**
73
-     * Get the Vidi Module Loader.
74
-     *
75
-     * @return \Fab\Vidi\Grid\GridAnalyserService|object
76
-     */
77
-    protected function getGridAnalyserService()
78
-    {
79
-        return GeneralUtility::makeInstance(\Fab\Vidi\Grid\GridAnalyserService::class);
80
-    }
72
+	/**
73
+	 * Get the Vidi Module Loader.
74
+	 *
75
+	 * @return \Fab\Vidi\Grid\GridAnalyserService|object
76
+	 */
77
+	protected function getGridAnalyserService()
78
+	{
79
+		return GeneralUtility::makeInstance(\Fab\Vidi\Grid\GridAnalyserService::class);
80
+	}
81 81
 }
Please login to merge, or discard this patch.
Classes/Service/ClipboardService.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -18,83 +18,83 @@
 block discarded – undo
18 18
 class ClipboardService implements SingletonInterface
19 19
 {
20 20
 
21
-    /**
22
-     * Get the Matcher object of the clipboard.
23
-     *
24
-     * @return Matcher
25
-     */
26
-    public function getMatcher()
27
-    {
28
-        $matcher = $this->getBackendUser()->getModuleData($this->getDataKey());
29
-        if (!$matcher) {
30
-            /** @var $matcher Matcher */
31
-            $matcher = GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Matcher::class);
32
-        }
33
-        return $matcher;
34
-    }
21
+	/**
22
+	 * Get the Matcher object of the clipboard.
23
+	 *
24
+	 * @return Matcher
25
+	 */
26
+	public function getMatcher()
27
+	{
28
+		$matcher = $this->getBackendUser()->getModuleData($this->getDataKey());
29
+		if (!$matcher) {
30
+			/** @var $matcher Matcher */
31
+			$matcher = GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Matcher::class);
32
+		}
33
+		return $matcher;
34
+	}
35 35
 
36
-    /**
37
-     * Tell whether the clipboard has items or not.
38
-     *
39
-     * @return bool
40
-     */
41
-    public function hasItems()
42
-    {
43
-        $matcher = $this->getMatcher();
36
+	/**
37
+	 * Tell whether the clipboard has items or not.
38
+	 *
39
+	 * @return bool
40
+	 */
41
+	public function hasItems()
42
+	{
43
+		$matcher = $this->getMatcher();
44 44
 
45
-        $inCriteria = $matcher->getIn();
46
-        $likeCriteria = $matcher->getLike();
47
-        $searchTerm = $matcher->getSearchTerm();
45
+		$inCriteria = $matcher->getIn();
46
+		$likeCriteria = $matcher->getLike();
47
+		$searchTerm = $matcher->getSearchTerm();
48 48
 
49
-        $hasItems = !empty($inCriteria) || !empty($likeCriteria) || !empty($searchTerm);
50
-        return $hasItems;
51
-    }
49
+		$hasItems = !empty($inCriteria) || !empty($likeCriteria) || !empty($searchTerm);
50
+		return $hasItems;
51
+	}
52 52
 
53
-    /**
54
-     * Save data into the clipboard.
55
-     *
56
-     * @param Matcher $matches
57
-     */
58
-    public function save(Matcher $matches)
59
-    {
60
-        $this->getBackendUser()->pushModuleData($this->getDataKey(), $matches);
61
-    }
53
+	/**
54
+	 * Save data into the clipboard.
55
+	 *
56
+	 * @param Matcher $matches
57
+	 */
58
+	public function save(Matcher $matches)
59
+	{
60
+		$this->getBackendUser()->pushModuleData($this->getDataKey(), $matches);
61
+	}
62 62
 
63
-    /**
64
-     * Completely empty the clipboard for a data type.
65
-     *
66
-     * @return void
67
-     */
68
-    public function flush()
69
-    {
70
-        $this->getBackendUser()->pushModuleData($this->getDataKey(), null);
71
-    }
63
+	/**
64
+	 * Completely empty the clipboard for a data type.
65
+	 *
66
+	 * @return void
67
+	 */
68
+	public function flush()
69
+	{
70
+		$this->getBackendUser()->pushModuleData($this->getDataKey(), null);
71
+	}
72 72
 
73
-    /**
74
-     * @return string
75
-     */
76
-    protected function getDataKey()
77
-    {
78
-        return 'vidi_clipboard_' . $this->getModuleLoader()->getDataType();
79
-    }
73
+	/**
74
+	 * @return string
75
+	 */
76
+	protected function getDataKey()
77
+	{
78
+		return 'vidi_clipboard_' . $this->getModuleLoader()->getDataType();
79
+	}
80 80
 
81
-    /**
82
-     * Get the Vidi Module Loader.
83
-     *
84
-     * @return \Fab\Vidi\Module\ModuleLoader|object
85
-     */
86
-    protected function getModuleLoader()
87
-    {
88
-        return GeneralUtility::makeInstance(\Fab\Vidi\Module\ModuleLoader::class);
89
-    }
81
+	/**
82
+	 * Get the Vidi Module Loader.
83
+	 *
84
+	 * @return \Fab\Vidi\Module\ModuleLoader|object
85
+	 */
86
+	protected function getModuleLoader()
87
+	{
88
+		return GeneralUtility::makeInstance(\Fab\Vidi\Module\ModuleLoader::class);
89
+	}
90 90
 
91
-    /**
92
-     * Returns an instance of the current Backend User.
93
-     *
94
-     * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
95
-     */
96
-    protected function getBackendUser()
97
-    {
98
-        return $GLOBALS['BE_USER'];
99
-    }
91
+	/**
92
+	 * Returns an instance of the current Backend User.
93
+	 *
94
+	 * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
95
+	 */
96
+	protected function getBackendUser()
97
+	{
98
+		return $GLOBALS['BE_USER'];
99
+	}
100 100
 }
Please login to merge, or discard this patch.
Classes/Service/BackendUserPreferenceService.php 1 patch
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -16,54 +16,54 @@
 block discarded – undo
16 16
 class BackendUserPreferenceService
17 17
 {
18 18
 
19
-    /**
20
-     * Returns a class instance
21
-     *
22
-     * @return \Fab\Vidi\Service\BackendUserPreferenceService|object
23
-     */
24
-    static public function getInstance()
25
-    {
26
-        return GeneralUtility::makeInstance(\Fab\Vidi\Service\BackendUserPreferenceService::class);
27
-    }
19
+	/**
20
+	 * Returns a class instance
21
+	 *
22
+	 * @return \Fab\Vidi\Service\BackendUserPreferenceService|object
23
+	 */
24
+	static public function getInstance()
25
+	{
26
+		return GeneralUtility::makeInstance(\Fab\Vidi\Service\BackendUserPreferenceService::class);
27
+	}
28 28
 
29
-    /**
30
-     * Returns a configuration key for the current BE User.
31
-     *
32
-     * @param string $key
33
-     * @return mixed
34
-     */
35
-    public function get($key)
36
-    {
37
-        $result = '';
38
-        if ($this->getBackendUser() && !empty($this->getBackendUser()->uc[$key])) {
39
-            $result = $this->getBackendUser()->uc[$key];
29
+	/**
30
+	 * Returns a configuration key for the current BE User.
31
+	 *
32
+	 * @param string $key
33
+	 * @return mixed
34
+	 */
35
+	public function get($key)
36
+	{
37
+		$result = '';
38
+		if ($this->getBackendUser() && !empty($this->getBackendUser()->uc[$key])) {
39
+			$result = $this->getBackendUser()->uc[$key];
40 40
 
41
-        }
42
-        return $result;
43
-    }
41
+		}
42
+		return $result;
43
+	}
44 44
 
45
-    /**
46
-     * Set a configuration for the current BE User.
47
-     *
48
-     * @param string $key
49
-     * @param mixed $value
50
-     * @return void
51
-     */
52
-    public function set($key, $value)
53
-    {
54
-        if ($this->getBackendUser()) {
55
-            $this->getBackendUser()->uc[$key] = $value;
56
-            $this->getBackendUser()->writeUC();
57
-        }
58
-    }
45
+	/**
46
+	 * Set a configuration for the current BE User.
47
+	 *
48
+	 * @param string $key
49
+	 * @param mixed $value
50
+	 * @return void
51
+	 */
52
+	public function set($key, $value)
53
+	{
54
+		if ($this->getBackendUser()) {
55
+			$this->getBackendUser()->uc[$key] = $value;
56
+			$this->getBackendUser()->writeUC();
57
+		}
58
+	}
59 59
 
60
-    /**
61
-     * Returns an instance of the current Backend User.
62
-     *
63
-     * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
64
-     */
65
-    protected function getBackendUser()
66
-    {
67
-        return $GLOBALS['BE_USER'];
68
-    }
60
+	/**
61
+	 * Returns an instance of the current Backend User.
62
+	 *
63
+	 * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
64
+	 */
65
+	protected function getBackendUser()
66
+	{
67
+		return $GLOBALS['BE_USER'];
68
+	}
69 69
 }
Please login to merge, or discard this patch.
Classes/Persistence/PagerObjectFactory.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -17,48 +17,48 @@
 block discarded – undo
17 17
 class PagerObjectFactory implements SingletonInterface
18 18
 {
19 19
 
20
-    /**
21
-     * Gets a singleton instance of this class.
22
-     *
23
-     * @return \Fab\Vidi\Persistence\PagerObjectFactory|object
24
-     */
25
-    static public function getInstance()
26
-    {
27
-        return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\PagerObjectFactory::class);
28
-    }
20
+	/**
21
+	 * Gets a singleton instance of this class.
22
+	 *
23
+	 * @return \Fab\Vidi\Persistence\PagerObjectFactory|object
24
+	 */
25
+	static public function getInstance()
26
+	{
27
+		return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\PagerObjectFactory::class);
28
+	}
29 29
 
30
-    /**
31
-     * Returns a pager object.
32
-     *
33
-     * @return \Fab\Vidi\Persistence\Pager
34
-     */
35
-    public function getPager()
36
-    {
30
+	/**
31
+	 * Returns a pager object.
32
+	 *
33
+	 * @return \Fab\Vidi\Persistence\Pager
34
+	 */
35
+	public function getPager()
36
+	{
37 37
 
38
-        /** @var $pager \Fab\Vidi\Persistence\Pager */
39
-        $pager = GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Pager::class);
38
+		/** @var $pager \Fab\Vidi\Persistence\Pager */
39
+		$pager = GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Pager::class);
40 40
 
41
-        // Set items per page
42
-        if (GeneralUtility::_GET('length') !== null) {
43
-            $limit = (int)GeneralUtility::_GET('length');
44
-            $pager->setLimit($limit);
45
-        }
41
+		// Set items per page
42
+		if (GeneralUtility::_GET('length') !== null) {
43
+			$limit = (int)GeneralUtility::_GET('length');
44
+			$pager->setLimit($limit);
45
+		}
46 46
 
47
-        // Set offset
48
-        $offset = 0;
49
-        if (GeneralUtility::_GET('start') !== null) {
50
-            $offset = (int)GeneralUtility::_GET('start');
51
-        }
52
-        $pager->setOffset($offset);
47
+		// Set offset
48
+		$offset = 0;
49
+		if (GeneralUtility::_GET('start') !== null) {
50
+			$offset = (int)GeneralUtility::_GET('start');
51
+		}
52
+		$pager->setOffset($offset);
53 53
 
54
-        // set page
55
-        $page = 1;
56
-        if ($pager->getLimit() > 0) {
57
-            $page = round($pager->getOffset() / $pager->getLimit());
58
-        }
59
-        $pager->setPage($page);
54
+		// set page
55
+		$page = 1;
56
+		if ($pager->getLimit() > 0) {
57
+			$page = round($pager->getOffset() / $pager->getLimit());
58
+		}
59
+		$pager->setPage($page);
60 60
 
61
-        return $pager;
62
-    }
61
+		return $pager;
62
+	}
63 63
 
64 64
 }
Please login to merge, or discard this patch.
Classes/Persistence/OrderObjectFactory.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -18,43 +18,43 @@
 block discarded – undo
18 18
 class OrderObjectFactory implements SingletonInterface
19 19
 {
20 20
 
21
-    /**
22
-     * Gets a singleton instance of this class.
23
-     *
24
-     * @return \Fab\Vidi\Persistence\OrderObjectFactory|object
25
-     */
26
-    static public function getInstance()
27
-    {
28
-        return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\OrderObjectFactory::class);
29
-    }
30
-
31
-    /**
32
-     * Returns an order object.
33
-     *
34
-     * @param string $dataType
35
-     * @return \Fab\Vidi\Persistence\Order|object
36
-     */
37
-    public function getOrder($dataType = '')
38
-    {
39
-
40
-        // Default ordering
41
-        $order = Tca::table($dataType)->getDefaultOrderings();
42
-
43
-        // Retrieve a possible id of the column from the request
44
-        $orderings = GeneralUtility::_GP('order');
45
-
46
-        if (is_array($orderings) && isset($orderings[0])) {
47
-            $columnPosition = $orderings[0]['column'];
48
-            $direction = $orderings[0]['dir'];
49
-
50
-            if ($columnPosition > 0) {
51
-                $field = Tca::grid()->getFieldNameByPosition($columnPosition);
52
-
53
-                $order = array(
54
-                    $field => strtoupper($direction)
55
-                );
56
-            }
57
-        }
58
-        return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Order::class, $order);
59
-    }
21
+	/**
22
+	 * Gets a singleton instance of this class.
23
+	 *
24
+	 * @return \Fab\Vidi\Persistence\OrderObjectFactory|object
25
+	 */
26
+	static public function getInstance()
27
+	{
28
+		return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\OrderObjectFactory::class);
29
+	}
30
+
31
+	/**
32
+	 * Returns an order object.
33
+	 *
34
+	 * @param string $dataType
35
+	 * @return \Fab\Vidi\Persistence\Order|object
36
+	 */
37
+	public function getOrder($dataType = '')
38
+	{
39
+
40
+		// Default ordering
41
+		$order = Tca::table($dataType)->getDefaultOrderings();
42
+
43
+		// Retrieve a possible id of the column from the request
44
+		$orderings = GeneralUtility::_GP('order');
45
+
46
+		if (is_array($orderings) && isset($orderings[0])) {
47
+			$columnPosition = $orderings[0]['column'];
48
+			$direction = $orderings[0]['dir'];
49
+
50
+			if ($columnPosition > 0) {
51
+				$field = Tca::grid()->getFieldNameByPosition($columnPosition);
52
+
53
+				$order = array(
54
+					$field => strtoupper($direction)
55
+				);
56
+			}
57
+		}
58
+		return GeneralUtility::makeInstance(\Fab\Vidi\Persistence\Order::class, $order);
59
+	}
60 60
 }
Please login to merge, or discard this patch.
Classes/Configuration/ConfigurationUtility.php 1 patch
Indentation   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -18,68 +18,68 @@
 block discarded – undo
18 18
 class ConfigurationUtility implements SingletonInterface
19 19
 {
20 20
 
21
-    /**
22
-     * @var string
23
-     */
24
-    protected $extensionKey = 'vidi';
21
+	/**
22
+	 * @var string
23
+	 */
24
+	protected $extensionKey = 'vidi';
25 25
 
26
-    /**
27
-     * @var array
28
-     */
29
-    protected $configuration = [];
26
+	/**
27
+	 * @var array
28
+	 */
29
+	protected $configuration = [];
30 30
 
31
-    /**
32
-     * Returns a class instance.
33
-     *
34
-     * @return ConfigurationUtility|object
35
-     * @throws \InvalidArgumentException
36
-     */
37
-    static public function getInstance()
38
-    {
39
-        return GeneralUtility::makeInstance(self::class);
40
-    }
31
+	/**
32
+	 * Returns a class instance.
33
+	 *
34
+	 * @return ConfigurationUtility|object
35
+	 * @throws \InvalidArgumentException
36
+	 */
37
+	static public function getInstance()
38
+	{
39
+		return GeneralUtility::makeInstance(self::class);
40
+	}
41 41
 
42
-    /**
43
-     * Constructor
44
-     */
45
-    public function __construct()
46
-    {
47
-        $configuration = $configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extensionKey);
42
+	/**
43
+	 * Constructor
44
+	 */
45
+	public function __construct()
46
+	{
47
+		$configuration = $configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get($this->extensionKey);
48 48
 
49
-        // Fill up configuration array with relevant values.
50
-        foreach ($configuration as $key => $value) {
51
-            $this->configuration[$key] = $value;
52
-        }
53
-    }
49
+		// Fill up configuration array with relevant values.
50
+		foreach ($configuration as $key => $value) {
51
+			$this->configuration[$key] = $value;
52
+		}
53
+	}
54 54
 
55
-    /**
56
-     * Returns a setting key.
57
-     *
58
-     * @param string $key
59
-     * @return array
60
-     */
61
-    public function get($key)
62
-    {
63
-        return isset($this->configuration[$key]) ? $this->configuration[$key] : null;
64
-    }
55
+	/**
56
+	 * Returns a setting key.
57
+	 *
58
+	 * @param string $key
59
+	 * @return array
60
+	 */
61
+	public function get($key)
62
+	{
63
+		return isset($this->configuration[$key]) ? $this->configuration[$key] : null;
64
+	}
65 65
 
66
-    /**
67
-     * Set a setting key.
68
-     *
69
-     * @param string $key
70
-     * @param mixed $value
71
-     * @return void
72
-     */
73
-    public function set($key, $value)
74
-    {
75
-        $this->configuration[$key] = $value;
76
-    }
66
+	/**
67
+	 * Set a setting key.
68
+	 *
69
+	 * @param string $key
70
+	 * @param mixed $value
71
+	 * @return void
72
+	 */
73
+	public function set($key, $value)
74
+	{
75
+		$this->configuration[$key] = $value;
76
+	}
77 77
 
78
-    /**
79
-     * @return array
80
-     */
81
-    public function getConfiguration()
82
-    {
83
-        return $this->configuration;
84
-    }
78
+	/**
79
+	 * @return array
80
+	 */
81
+	public function getConfiguration()
82
+	{
83
+		return $this->configuration;
84
+	}
85 85
 }
Please login to merge, or discard this patch.
Classes/Configuration/TcaGridAspect.php 1 patch
Indentation   +92 added lines, -92 removed lines patch added patch discarded remove patch
@@ -21,97 +21,97 @@
 block discarded – undo
21 21
 class TcaGridAspect implements TableConfigurationPostProcessingHookInterface
22 22
 {
23 23
 
24
-    /**
25
-     * Scans each data type of the TCA and add a Grid TCA if missing.
26
-     *
27
-     * @return array
28
-     */
29
-    public function processData()
30
-    {
31
-        $configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('vidi');
32
-
33
-        $dataTypes = GeneralUtility::trimExplode(',', $configuration['data_types'], true);
34
-
35
-        if (ExtensionManagementUtility::isLoaded('vidi_frontend')) {
36
-
37
-            $extendedConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('vidi_frontend');
38
-            $vidiFrontendContentTypes = GeneralUtility::trimExplode(',', $extendedConfiguration['content_types'], true);
39
-            $extendedDataTypes = array_merge($dataTypes, $vidiFrontendContentTypes);
40
-            $dataTypes = array_unique($extendedDataTypes);
41
-        }
42
-
43
-        foreach ($dataTypes as $dataType) {
44
-            $this->ensureMinimumTcaForGrid($dataType);
45
-        }
46
-
47
-        return array($GLOBALS['TCA']);
48
-    }
49
-
50
-    /**
51
-     * @param string $dataType
52
-     */
53
-    protected function ensureMinimumTcaForGrid($dataType)
54
-    {
55
-        $labelField = $this->getLabelField($dataType);
56
-        if (empty($GLOBALS['TCA'][$dataType]['grid'])) {
57
-            $GLOBALS['TCA'][$dataType]['grid'] = [];
58
-        }
59
-
60
-        if (empty($GLOBALS['TCA'][$dataType]['grid']['facets'])) {
61
-            $GLOBALS['TCA'][$dataType]['grid']['facets'] = [
62
-                'uid',
63
-                $labelField,
64
-            ];
65
-        }
66
-
67
-        if (empty($GLOBALS['TCA'][$dataType]['grid']['columns'])) {
68
-            $GLOBALS['TCA'][$dataType]['grid']['columns'] = [
69
-                '__checkbox' => [
70
-                    'renderer' => CheckBoxRenderer::class,
71
-                ],
72
-                'uid' => [
73
-                    'visible' => false,
74
-                    'label' => '',
75
-                    'width' => '5px',
76
-                ],
77
-                $labelField => [
78
-                    'editable' => true,
79
-                ],
80
-                '__buttons' => [
81
-                    'renderer' => ButtonGroupRenderer::class,
82
-                ],
83
-            ];
84
-        }
85
-    }
86
-
87
-    /**
88
-     * Get the label name of table name.
89
-     *
90
-     * @param string $dataType
91
-     * @return bool
92
-     */
93
-    protected function getLabelField($dataType)
94
-    {
95
-        return $GLOBALS['TCA'][$dataType]['ctrl']['label'];
96
-    }
97
-
98
-    /**
99
-     * Tell whether the table has a label field.
100
-     *
101
-     * @param string $dataType
102
-     * @return bool
103
-     */
104
-    protected function hasLabelField($dataType)
105
-    {
106
-        return isset($GLOBALS['TCA'][$dataType]['ctrl']['label']);
107
-    }
108
-
109
-    /**
110
-     * @return \TYPO3\CMS\Extbase\Object\ObjectManager
111
-     */
112
-    protected function getObjectManager()
113
-    {
114
-        return GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
115
-    }
24
+	/**
25
+	 * Scans each data type of the TCA and add a Grid TCA if missing.
26
+	 *
27
+	 * @return array
28
+	 */
29
+	public function processData()
30
+	{
31
+		$configuration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('vidi');
32
+
33
+		$dataTypes = GeneralUtility::trimExplode(',', $configuration['data_types'], true);
34
+
35
+		if (ExtensionManagementUtility::isLoaded('vidi_frontend')) {
36
+
37
+			$extendedConfiguration = GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('vidi_frontend');
38
+			$vidiFrontendContentTypes = GeneralUtility::trimExplode(',', $extendedConfiguration['content_types'], true);
39
+			$extendedDataTypes = array_merge($dataTypes, $vidiFrontendContentTypes);
40
+			$dataTypes = array_unique($extendedDataTypes);
41
+		}
42
+
43
+		foreach ($dataTypes as $dataType) {
44
+			$this->ensureMinimumTcaForGrid($dataType);
45
+		}
46
+
47
+		return array($GLOBALS['TCA']);
48
+	}
49
+
50
+	/**
51
+	 * @param string $dataType
52
+	 */
53
+	protected function ensureMinimumTcaForGrid($dataType)
54
+	{
55
+		$labelField = $this->getLabelField($dataType);
56
+		if (empty($GLOBALS['TCA'][$dataType]['grid'])) {
57
+			$GLOBALS['TCA'][$dataType]['grid'] = [];
58
+		}
59
+
60
+		if (empty($GLOBALS['TCA'][$dataType]['grid']['facets'])) {
61
+			$GLOBALS['TCA'][$dataType]['grid']['facets'] = [
62
+				'uid',
63
+				$labelField,
64
+			];
65
+		}
66
+
67
+		if (empty($GLOBALS['TCA'][$dataType]['grid']['columns'])) {
68
+			$GLOBALS['TCA'][$dataType]['grid']['columns'] = [
69
+				'__checkbox' => [
70
+					'renderer' => CheckBoxRenderer::class,
71
+				],
72
+				'uid' => [
73
+					'visible' => false,
74
+					'label' => '',
75
+					'width' => '5px',
76
+				],
77
+				$labelField => [
78
+					'editable' => true,
79
+				],
80
+				'__buttons' => [
81
+					'renderer' => ButtonGroupRenderer::class,
82
+				],
83
+			];
84
+		}
85
+	}
86
+
87
+	/**
88
+	 * Get the label name of table name.
89
+	 *
90
+	 * @param string $dataType
91
+	 * @return bool
92
+	 */
93
+	protected function getLabelField($dataType)
94
+	{
95
+		return $GLOBALS['TCA'][$dataType]['ctrl']['label'];
96
+	}
97
+
98
+	/**
99
+	 * Tell whether the table has a label field.
100
+	 *
101
+	 * @param string $dataType
102
+	 * @return bool
103
+	 */
104
+	protected function hasLabelField($dataType)
105
+	{
106
+		return isset($GLOBALS['TCA'][$dataType]['ctrl']['label']);
107
+	}
108
+
109
+	/**
110
+	 * @return \TYPO3\CMS\Extbase\Object\ObjectManager
111
+	 */
112
+	protected function getObjectManager()
113
+	{
114
+		return GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
115
+	}
116 116
 
117 117
 }
Please login to merge, or discard this patch.