diff --git a/typo3/sysext/backend/Classes/Module/AbstractModule.php b/typo3/sysext/backend/Classes/Module/AbstractModule.php index 1af0d0bee139b0997204e103e1ec549233ab28be..aeae8ab72db3e5d639f22895051dd3b52f928f9a 100644 --- a/typo3/sysext/backend/Classes/Module/AbstractModule.php +++ b/typo3/sysext/backend/Classes/Module/AbstractModule.php @@ -65,7 +65,7 @@ class AbstractModule $methodName = $request->getQueryParams()['action'] ?: 'index'; if (!is_callable([$this, $methodName])) { throw new \InvalidArgumentException( - 'The method "' . $methodName . '" is not callable within "' . get_class($this) . '".', + 'The method "' . $methodName . '" is not callable within "' . static::class . '".', 1442736343 ); } diff --git a/typo3/sysext/backend/Classes/Template/Components/Buttons/AbstractButton.php b/typo3/sysext/backend/Classes/Template/Components/Buttons/AbstractButton.php index 5a06230dd0a6401a46667a0c7424349f6dde58e4..44609424fda69bee4b5e7ad5db316ef934a1637c 100644 --- a/typo3/sysext/backend/Classes/Template/Components/Buttons/AbstractButton.php +++ b/typo3/sysext/backend/Classes/Template/Components/Buttons/AbstractButton.php @@ -83,7 +83,7 @@ class AbstractButton extends AbstractControl implements ButtonInterface */ public function getType() { - return get_class($this); + return static::class; } /** diff --git a/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/HelpButton.php b/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/HelpButton.php index cb964832026e6bfa5332a7d0b67207bd3c132d83..6ee8e4bde04bd151173b8cfbbfd9e5965e953636 100644 --- a/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/HelpButton.php +++ b/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/HelpButton.php @@ -116,7 +116,7 @@ class HelpButton implements ButtonInterface, PositionInterface */ public function getType() { - return get_class($this); + return static::class; } /** diff --git a/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php b/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php index b3b815041ad59c8dae8d7e6862dcd8fe11868363..f5f7e9d99266846b75c7a3420e67710b32d2e7e4 100644 --- a/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php +++ b/typo3/sysext/backend/Classes/Template/Components/Buttons/Action/ShortcutButton.php @@ -177,7 +177,7 @@ class ShortcutButton implements ButtonInterface, PositionInterface */ public function getType() { - return get_class($this); + return static::class; } /** diff --git a/typo3/sysext/backend/Classes/Template/Components/Buttons/FullyRenderedButton.php b/typo3/sysext/backend/Classes/Template/Components/Buttons/FullyRenderedButton.php index 99ebfbfd58f4b3145efed0cab03ab05c8418a7e3..5cc3d62dd783e3b2f3ef900548b6f9fd442c1f01 100644 --- a/typo3/sysext/backend/Classes/Template/Components/Buttons/FullyRenderedButton.php +++ b/typo3/sysext/backend/Classes/Template/Components/Buttons/FullyRenderedButton.php @@ -70,7 +70,7 @@ class FullyRenderedButton implements ButtonInterface */ public function getType() { - return get_class($this); + return static::class; } /** diff --git a/typo3/sysext/backend/Classes/Tree/ExtDirectNode.php b/typo3/sysext/backend/Classes/Tree/ExtDirectNode.php index fe1d51316a46a49977e8ecd288b16deae33ca582..dff863037bdfe354f63fa6cf67b79346c45aaf7a 100644 --- a/typo3/sysext/backend/Classes/Tree/ExtDirectNode.php +++ b/typo3/sysext/backend/Classes/Tree/ExtDirectNode.php @@ -560,7 +560,7 @@ class ExtDirectNode extends \TYPO3\CMS\Backend\Tree\TreeNode public function toArray($addChildNodes = true) { $arrayRepresentation = [ - 'serializeClassName' => get_class($this), + 'serializeClassName' => static::class, 'id' => $this->getId(), 'type' => $this->getType(), 'editableText' => $this->getEditableText(), diff --git a/typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php b/typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php index c6ed33c7b8496765aa5e7b6128f5e7b13acd3ac4..71abfbe45886378674f497b79938aea5f3a71373 100644 --- a/typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php +++ b/typo3/sysext/backend/Classes/Tree/Pagetree/PagetreeNode.php @@ -425,7 +425,7 @@ class PagetreeNode extends \TYPO3\CMS\Backend\Tree\ExtDirectNode $arrayRepresentation['nodeData']['isMountPoint'] = $this->isMountPoint(); $arrayRepresentation['nodeData']['backgroundColor'] = htmlspecialchars($this->getBackgroundColor()); $arrayRepresentation['nodeData']['stopPageTree'] = $this->getStopPageTree(); - $arrayRepresentation['nodeData']['serializeClassName'] = get_class($this); + $arrayRepresentation['nodeData']['serializeClassName'] = static::class; return $arrayRepresentation; } diff --git a/typo3/sysext/backend/Classes/Tree/TreeNode.php b/typo3/sysext/backend/Classes/Tree/TreeNode.php index c46e38e12651a90c191a700c2d0dbf2af8e37db2..12e20128426cd13b3b38a963a5b1e6cb9ba7afdc 100644 --- a/typo3/sysext/backend/Classes/Tree/TreeNode.php +++ b/typo3/sysext/backend/Classes/Tree/TreeNode.php @@ -180,7 +180,7 @@ class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Seri public function toArray($addChildNodes = true) { $arrayRepresentation = [ - 'serializeClassName' => get_class($this), + 'serializeClassName' => static::class, 'id' => $this->id ]; if ($this->parentNode !== null) { @@ -231,7 +231,7 @@ class TreeNode implements \TYPO3\CMS\Backend\Tree\ComparableNodeInterface, \Seri public function unserialize($serializedString) { $arrayRepresentation = unserialize($serializedString); - if ($arrayRepresentation['serializeClassName'] !== get_class($this)) { + if ($arrayRepresentation['serializeClassName'] !== static::class) { throw new \TYPO3\CMS\Core\Exception('Deserialized object type is not identical!', 1294586646); } $this->dataFromArray($arrayRepresentation); diff --git a/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php b/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php index 1dc338a5fa5bcfaf6b7622118f2eda54173a741d..b1247dd78a53e12579734a602c3e0ff5f247db9c 100644 --- a/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php +++ b/typo3/sysext/backend/Classes/Tree/TreeNodeCollection.php @@ -73,7 +73,7 @@ class TreeNodeCollection extends \ArrayObject public function unserialize($serializedString) { $arrayRepresentation = unserialize($serializedString); - if ($arrayRepresentation['serializeClassName'] !== get_class($this)) { + if ($arrayRepresentation['serializeClassName'] !== static::class) { throw new \TYPO3\CMS\Core\Exception('Deserialized object type is not identical!', 1294586647); } $this->dataFromArray($arrayRepresentation); @@ -87,7 +87,7 @@ class TreeNodeCollection extends \ArrayObject public function toArray() { $arrayRepresentation = [ - 'serializeClassName' => get_class($this) + 'serializeClassName' => static::class ]; $iterator = $this->getIterator(); while ($iterator->valid()) { diff --git a/typo3/sysext/backend/Classes/Tree/View/ElementBrowserFolderTreeView.php b/typo3/sysext/backend/Classes/Tree/View/ElementBrowserFolderTreeView.php index 15392f6346565f286277e37f9ec6985c7d9732f1..3912258caf1c5b74ed8278be4c1069e4c30839e2 100644 --- a/typo3/sysext/backend/Classes/Tree/View/ElementBrowserFolderTreeView.php +++ b/typo3/sysext/backend/Classes/Tree/View/ElementBrowserFolderTreeView.php @@ -107,7 +107,7 @@ class ElementBrowserFolderTreeView extends FolderTreeView */ protected function renderPMIconAndLink($cmd, $isOpen) { - if (get_class($this) === __CLASS__) { + if (static::class === __CLASS__) { return $this->PMiconATagWrap('', $cmd, !$isOpen); } return parent::renderPMIconAndLink($cmd, $isOpen); @@ -146,7 +146,7 @@ class ElementBrowserFolderTreeView extends FolderTreeView { if (empty($this->scope)) { $this->scope = [ - 'class' => get_class($this), + 'class' => static::class, 'script' => $this->thisScript, 'ext_noTempRecyclerDirs' => $this->ext_noTempRecyclerDirs, 'browser' => $this->linkParameterProvider->getUrlParameters([]), diff --git a/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php b/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php index b0875677ab0a5b638364f5aff61ba47a28b3b7d1..24b754584f972d3a8973bb0e59ee213d74dee02c 100644 --- a/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php +++ b/typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php @@ -134,7 +134,7 @@ class FolderTreeView extends AbstractTreeView { if (empty($this->scope)) { $this->scope = [ - 'class' => get_class($this), + 'class' => static::class, 'script' => $this->thisScript, 'ext_noTempRecyclerDirs' => $this->ext_noTempRecyclerDirs ]; diff --git a/typo3/sysext/belog/Classes/Controller/AbstractController.php b/typo3/sysext/belog/Classes/Controller/AbstractController.php index 8e21899e60e4683701150a0c1dbec3c707731ed7..a00b6e90c8ec4bf3b10038d14f8f5a17244beff9 100644 --- a/typo3/sysext/belog/Classes/Controller/AbstractController.php +++ b/typo3/sysext/belog/Classes/Controller/AbstractController.php @@ -173,7 +173,7 @@ abstract class AbstractController extends ActionController */ protected function getConstraintFromBeUserData() { - $serializedConstraint = $GLOBALS['BE_USER']->getModuleData(get_class($this)); + $serializedConstraint = $GLOBALS['BE_USER']->getModuleData(static::class); if (!is_string($serializedConstraint) || empty($serializedConstraint)) { return null; } @@ -187,7 +187,7 @@ abstract class AbstractController extends ActionController */ protected function persistConstraintInBeUserData(\TYPO3\CMS\Belog\Domain\Model\Constraint $constraint) { - $GLOBALS['BE_USER']->pushModuleData(get_class($this), serialize($constraint)); + $GLOBALS['BE_USER']->pushModuleData(static::class, serialize($constraint)); } /** diff --git a/typo3/sysext/core/Classes/Cache/Backend/AbstractBackend.php b/typo3/sysext/core/Classes/Cache/Backend/AbstractBackend.php index 0540cf3338f2c9ef37ce1df7c291246e42f86c92..6ef1d0225766196dce5aa03de630f952d2bc0833 100644 --- a/typo3/sysext/core/Classes/Cache/Backend/AbstractBackend.php +++ b/typo3/sysext/core/Classes/Cache/Backend/AbstractBackend.php @@ -71,7 +71,7 @@ abstract class AbstractBackend implements \TYPO3\CMS\Core\Cache\Backend\BackendI if (method_exists($this, $methodName)) { $this->{$methodName}($optionValue); } else { - throw new \InvalidArgumentException('Invalid cache backend option "' . $optionKey . '" for backend of type "' . get_class($this) . '"', 1231267498); + throw new \InvalidArgumentException('Invalid cache backend option "' . $optionKey . '" for backend of type "' . static::class . '"', 1231267498); } } } diff --git a/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php b/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php index 8a12d240b45e2985ab49ee8bf9370dd9a8d26251..b3ed3dce8ddf1261b054694b385598c4be3d02a3 100644 --- a/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php +++ b/typo3/sysext/core/Classes/Database/SoftReferenceIndex.php @@ -710,7 +710,7 @@ class SoftReferenceIndex */ protected function emitGetTypoLinkParts($linkHandlerFound, $finalTagParts, $linkHandlerKeyword, $linkHandlerValue) { - return $this->getSignalSlotDispatcher()->dispatch(get_class($this), 'getTypoLinkParts', [$linkHandlerFound, $finalTagParts, $linkHandlerKeyword, $linkHandlerValue]); + return $this->getSignalSlotDispatcher()->dispatch(static::class, 'getTypoLinkParts', [$linkHandlerFound, $finalTagParts, $linkHandlerKeyword, $linkHandlerValue]); } /** @@ -724,6 +724,6 @@ class SoftReferenceIndex */ protected function emitSetTypoLinkPartsElement($linkHandlerFound, $tLP, $content, $elements, $idx, $tokenID) { - return $this->getSignalSlotDispatcher()->dispatch(get_class($this), 'setTypoLinkPartsElement', [$linkHandlerFound, $tLP, $content, $elements, $idx, $tokenID, $this]); + return $this->getSignalSlotDispatcher()->dispatch(static::class, 'setTypoLinkPartsElement', [$linkHandlerFound, $tLP, $content, $elements, $idx, $tokenID, $this]); } } diff --git a/typo3/sysext/core/Classes/Html/RteHtmlParser.php b/typo3/sysext/core/Classes/Html/RteHtmlParser.php index 9c30b85c9d2e41751217890838d9c488c32f87dc..05201f80c26de7f9e1c7d66a077e3a118d2c6926 100644 --- a/typo3/sysext/core/Classes/Html/RteHtmlParser.php +++ b/typo3/sysext/core/Classes/Html/RteHtmlParser.php @@ -1321,6 +1321,6 @@ class RteHtmlParser extends HtmlParser { /** @var $logManager LogManager */ $logManager = GeneralUtility::makeInstance(LogManager::class); - return $logManager->getLogger(get_class($this)); + return $logManager->getLogger(static::class); } } diff --git a/typo3/sysext/core/Classes/Log/Processor/AbstractProcessor.php b/typo3/sysext/core/Classes/Log/Processor/AbstractProcessor.php index 1e7143f64625ae9b711cb0bd2ff48b95f741ca16..56b7a9dd5a8bfabe87fe0d51a49fe98e655ca64b 100644 --- a/typo3/sysext/core/Classes/Log/Processor/AbstractProcessor.php +++ b/typo3/sysext/core/Classes/Log/Processor/AbstractProcessor.php @@ -34,7 +34,7 @@ abstract class AbstractProcessor implements ProcessorInterface if (method_exists($this, $methodName)) { $this->{$methodName}($optionValue); } else { - throw new InvalidLogProcessorConfigurationException('Invalid LogProcessor configuration option "' . $optionKey . '" for log processor of type "' . get_class($this) . '"', 1321696151); + throw new InvalidLogProcessorConfigurationException('Invalid LogProcessor configuration option "' . $optionKey . '" for log processor of type "' . static::class . '"', 1321696151); } } } diff --git a/typo3/sysext/core/Classes/Log/Writer/AbstractWriter.php b/typo3/sysext/core/Classes/Log/Writer/AbstractWriter.php index 77adfa2a5ac247aa6476f94fa7bdd5f1678b5411..50f851a96ec8e9ee1a39981b151103b12418ba65 100644 --- a/typo3/sysext/core/Classes/Log/Writer/AbstractWriter.php +++ b/typo3/sysext/core/Classes/Log/Writer/AbstractWriter.php @@ -34,7 +34,7 @@ abstract class AbstractWriter implements WriterInterface if (method_exists($this, $methodName)) { $this->{$methodName}($optionValue); } else { - throw new InvalidLogWriterConfigurationException('Invalid LogWriter configuration option "' . $optionKey . '" for log writer of type "' . get_class($this) . '"', 1321696152); + throw new InvalidLogWriterConfigurationException('Invalid LogWriter configuration option "' . $optionKey . '" for log writer of type "' . static::class . '"', 1321696152); } } } diff --git a/typo3/sysext/core/Classes/Package/Package.php b/typo3/sysext/core/Classes/Package/Package.php index 3450a57030e44498c793302b4ed6302cd95a1ad5..e810a2956f83c70c09df98bbe90819fa1e8e7208 100644 --- a/typo3/sysext/core/Classes/Package/Package.php +++ b/typo3/sysext/core/Classes/Package/Package.php @@ -264,7 +264,7 @@ class Package implements PackageInterface */ public function __sleep() { - $properties = get_class_vars(get_class($this)); + $properties = get_class_vars(static::class); unset($properties['packageManager']); return array_keys($properties); } diff --git a/typo3/sysext/core/Classes/Resource/ResourceStorage.php b/typo3/sysext/core/Classes/Resource/ResourceStorage.php index 4107be4b746627eb6deb5906aae92319edc29ea4..d08ac765f5fbc405c161126e4795a8db6259c422 100644 --- a/typo3/sysext/core/Classes/Resource/ResourceStorage.php +++ b/typo3/sysext/core/Classes/Resource/ResourceStorage.php @@ -3021,6 +3021,6 @@ class ResourceStorage implements ResourceStorageInterface $logManager = GeneralUtility::makeInstance( \TYPO3\CMS\Core\Log\LogManager::class ); - return $logManager->getLogger(get_class($this)); + return $logManager->getLogger(static::class); } } diff --git a/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php b/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php index 58a4a8b15f6a29fdf7c6a3df3b0abf9729e4327f..ca733092c6a4786875a79fac4d05249faa1e0b1c 100644 --- a/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php +++ b/typo3/sysext/core/Classes/Session/Backend/DatabaseSessionBackend.php @@ -66,7 +66,7 @@ class DatabaseSessionBackend implements SessionBackendInterface { if (empty($this->configuration['table'])) { throw new \InvalidArgumentException( - 'The session backend "' . get_class($this) . '" needs a "table" configuration.', + 'The session backend "' . static::class . '" needs a "table" configuration.', 1442996707 ); } diff --git a/typo3/sysext/core/Classes/Type/Bitmask/JsConfirmation.php b/typo3/sysext/core/Classes/Type/Bitmask/JsConfirmation.php index 2308f04de664dbfbae43b5d32842cef03d23bf6b..bfc6ab20148a06bc8273a569e84c4cd442193b62 100644 --- a/typo3/sysext/core/Classes/Type/Bitmask/JsConfirmation.php +++ b/typo3/sysext/core/Classes/Type/Bitmask/JsConfirmation.php @@ -110,7 +110,7 @@ class JsConfirmation extends Enumeration } $value = (string)$value; - foreach (static::$enumConstants[get_class($this)] as $constantValue) { + foreach (static::$enumConstants[static::class] as $constantValue) { if ($value === (string)$constantValue) { return true; } diff --git a/typo3/sysext/core/Classes/Type/Enumeration.php b/typo3/sysext/core/Classes/Type/Enumeration.php index 2bd65e8ce5212b0600c5a43ee6b3770d31b68b7e..22167ee92e4ab8b62993819650e11cbc91fa2ad4 100644 --- a/typo3/sysext/core/Classes/Type/Enumeration.php +++ b/typo3/sysext/core/Classes/Type/Enumeration.php @@ -41,7 +41,7 @@ abstract class Enumeration implements TypeInterface { if ($value === null && !defined('static::__default')) { throw new Exception\InvalidEnumerationValueException( - sprintf('A value for enumeration "%s" is required if no __default is defined.', get_class($this)), + sprintf('A value for enumeration "%s" is required if no __default is defined.', static::class), 1381512753 ); } @@ -51,7 +51,7 @@ abstract class Enumeration implements TypeInterface static::loadValues(); if (!$this->isValid($value)) { throw new Exception\InvalidEnumerationValueException( - sprintf('Invalid value "%s" for enumeration "%s"', $value, get_class($this)), + sprintf('Invalid value "%s" for enumeration "%s"', $value, static::class), 1381512761 ); } @@ -130,14 +130,14 @@ abstract class Enumeration implements TypeInterface */ protected function setValue($value) { - $enumKey = array_search($value, static::$enumConstants[get_class($this)]); + $enumKey = array_search($value, static::$enumConstants[static::class]); if ($enumKey === false) { throw new Exception\InvalidEnumerationValueException( sprintf('Invalid value "%s" for enumeration "%s"', $value, __CLASS__), 1381615295 ); } - $this->value = static::$enumConstants[get_class($this)][$enumKey]; + $this->value = static::$enumConstants[static::class][$enumKey]; } /** @@ -149,7 +149,7 @@ abstract class Enumeration implements TypeInterface protected function isValid($value) { $value = (string)$value; - foreach (static::$enumConstants[get_class($this)] as $constantValue) { + foreach (static::$enumConstants[static::class] as $constantValue) { if ($value === (string)$constantValue) { return true; } diff --git a/typo3/sysext/core/Classes/Type/File/ImageInfo.php b/typo3/sysext/core/Classes/Type/File/ImageInfo.php index c9de84dd4f560c8a309df54618d2c1b34d731d08..7c6e5e63adabf8d69fc2ebd3cb766acad7bf5107 100644 --- a/typo3/sysext/core/Classes/Type/File/ImageInfo.php +++ b/typo3/sysext/core/Classes/Type/File/ImageInfo.php @@ -113,7 +113,7 @@ class ImageInfo extends FileInfo /** @var $loggerManager LogManager */ $loggerManager = GeneralUtility::makeInstance(LogManager::class); - return $loggerManager->getLogger(get_class($this)); + return $loggerManager->getLogger(static::class); } /** diff --git a/typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php b/typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php index 24481d5d53dbf90700e8565866a456014a6d2faf..f671d31883793657f7a536c0dc23a380be074f1f 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Driver/LocalDriverTest.php @@ -741,7 +741,7 @@ class LocalDriverTest extends \TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase // register static callback to self $callback = [ [ - get_class($this), + static::class, 'callbackStaticTestFunction' ] ]; diff --git a/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php b/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php index 2ff8abfd1c682ac895b3a19c7b115a255277c5f0..8990f12924da6b73a836512d5ba48f3776613256 100644 --- a/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php +++ b/typo3/sysext/extbase/Classes/DomainObject/AbstractDomainObject.php @@ -323,6 +323,6 @@ abstract class AbstractDomainObject implements DomainObjectInterface, \TYPO3\CMS */ public function __toString() { - return get_class($this) . ':' . (string)$this->uid; + return static::class . ':' . (string)$this->uid; } } diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php index 441ec5a10fa61e746b542487e4aac32b545b0902..1a6e9de921f50fbf43b23c72c3595cdcd66c422d 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/AbstractController.php @@ -130,7 +130,7 @@ abstract class AbstractController implements ControllerInterface */ public function __construct() { - $className = get_class($this); + $className = static::class; if (strpos($className, '\\') !== false) { $classNameParts = explode('\\', $className, 4); // Skip vendor and product name for core classes @@ -223,7 +223,7 @@ abstract class AbstractController implements ControllerInterface public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { if (!$this->canProcessRequest($request)) { - throw new UnsupportedRequestTypeException(get_class($this) . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701132); + throw new UnsupportedRequestTypeException(static::class . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701132); } if ($response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response && $request instanceof WebRequest) { $response->setRequest($request); diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php index a3ff0745b1331e37b0c3e67fdc97c9d4996727c1..c97960da0bcbc72617cd43a712a2f5862d7a5219 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php @@ -147,7 +147,7 @@ class ActionController extends AbstractController public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) { if (!$this->canProcessRequest($request)) { - throw new \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException(get_class($this) . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701131); + throw new \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException(static::class . ' does not support requests of type "' . get_class($request) . '". Supported types are: ' . implode(' ', $this->supportedRequestTypes), 1187701131); } if ($response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response && $request instanceof WebRequest) { @@ -224,7 +224,7 @@ class ActionController extends AbstractController */ protected function initializeActionMethodArguments() { - $methodParameters = $this->reflectionService->getMethodParameters(get_class($this), $this->actionMethodName); + $methodParameters = $this->reflectionService->getMethodParameters(static::class, $this->actionMethodName); foreach ($methodParameters as $parameterName => $parameterInfo) { $dataType = null; if (isset($parameterInfo['type'])) { @@ -233,7 +233,7 @@ class ActionController extends AbstractController $dataType = 'array'; } if ($dataType === null) { - throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException('The argument type for parameter $' . $parameterName . ' of method ' . get_class($this) . '->' . $this->actionMethodName . '() could not be detected.', 1253175643); + throw new \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException('The argument type for parameter $' . $parameterName . ' of method ' . static::class . '->' . $this->actionMethodName . '() could not be detected.', 1253175643); } $defaultValue = isset($parameterInfo['defaultValue']) ? $parameterInfo['defaultValue'] : null; $this->arguments->addNewArgument($parameterName, $dataType, $parameterInfo['optional'] === false, $defaultValue); @@ -266,7 +266,7 @@ class ActionController extends AbstractController * @todo: add resolving of $actionValidateAnnotations and pass them to * buildMethodArgumentsValidatorConjunctions as in TYPO3.Flow */ - $parameterValidators = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($this), $this->actionMethodName, $methodParameters); + $parameterValidators = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(static::class, $this->actionMethodName, $methodParameters); /** @var \TYPO3\CMS\Extbase\Mvc\Controller\Argument $argument */ foreach ($this->arguments as $argument) { $validator = $parameterValidators[$argument->getName()]; @@ -289,7 +289,7 @@ class ActionController extends AbstractController { $actionMethodName = $this->request->getControllerActionName() . 'Action'; if (!method_exists($this, $actionMethodName)) { - throw new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchActionException('An action "' . $actionMethodName . '" does not exist in controller "' . get_class($this) . '".', 1186669086); + throw new \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchActionException('An action "' . $actionMethodName . '" does not exist in controller "' . static::class . '".', 1186669086); } return $actionMethodName; } @@ -315,7 +315,7 @@ class ActionController extends AbstractController $this->emitBeforeCallActionMethodSignal($preparedArguments); $actionResult = call_user_func_array([$this, $this->actionMethodName], $preparedArguments); } else { - $methodTagsValues = $this->reflectionService->getMethodTagsValues(get_class($this), $this->actionMethodName); + $methodTagsValues = $this->reflectionService->getMethodTagsValues(static::class, $this->actionMethodName); $ignoreValidationAnnotations = []; if (isset($methodTagsValues['ignorevalidation'])) { $ignoreValidationAnnotations = $methodTagsValues['ignorevalidation']; @@ -357,7 +357,7 @@ class ActionController extends AbstractController */ protected function emitBeforeCallActionMethodSignal(array $preparedArguments) { - $this->signalSlotDispatcher->dispatch(__CLASS__, 'beforeCallActionMethod', [get_class($this), $this->actionMethodName, $preparedArguments]); + $this->signalSlotDispatcher->dispatch(__CLASS__, 'beforeCallActionMethod', [static::class, $this->actionMethodName, $preparedArguments]); } /** @@ -593,7 +593,7 @@ class ActionController extends AbstractController */ protected function getErrorFlashMessage() { - return 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '()'; + return 'An error occurred while trying to call ' . static::class . '->' . $this->actionMethodName . '()'; } /** @@ -628,7 +628,7 @@ class ActionController extends AbstractController */ protected function getFlattenedValidationErrorMessage() { - $outputMessage = 'Validation failed while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL; + $outputMessage = 'Validation failed while trying to call ' . static::class . '->' . $this->actionMethodName . '().' . PHP_EOL; return $outputMessage; } diff --git a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php index 377d2ab8ee207d345e580c7b39aaaab9c50344af..ee0678458aa12b01c1bce55ba9507e0930aa4830 100644 --- a/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php +++ b/typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php @@ -118,7 +118,7 @@ class CommandController implements CommandControllerInterface public function processRequest(RequestInterface $request, ResponseInterface $response) { if (!$this->canProcessRequest($request)) { - throw new UnsupportedRequestTypeException(sprintf('%s only supports command line requests – requests of type "%s" given.', get_class($this), get_class($request)), 1300787096); + throw new UnsupportedRequestTypeException(sprintf('%s only supports command line requests – requests of type "%s" given.', static::class, get_class($request)), 1300787096); } $this->request = $request; @@ -147,7 +147,7 @@ class CommandController implements CommandControllerInterface { $commandMethodName = $this->request->getControllerCommandName() . 'Command'; if (!is_callable([$this, $commandMethodName])) { - throw new NoSuchCommandException(sprintf('A command method "%s()" does not exist in controller "%s".', $commandMethodName, get_class($this)), 1300902143); + throw new NoSuchCommandException(sprintf('A command method "%s()" does not exist in controller "%s".', $commandMethodName, static::class), 1300902143); } return $commandMethodName; } @@ -161,7 +161,7 @@ class CommandController implements CommandControllerInterface */ protected function initializeCommandMethodArguments() { - $methodParameters = $this->reflectionService->getMethodParameters(get_class($this), $this->commandMethodName); + $methodParameters = $this->reflectionService->getMethodParameters(static::class, $this->commandMethodName); foreach ($methodParameters as $parameterName => $parameterInfo) { $dataType = null; @@ -171,7 +171,7 @@ class CommandController implements CommandControllerInterface $dataType = 'array'; } if ($dataType === null) { - throw new InvalidArgumentTypeException(sprintf('The argument type for parameter $%s of method %s->%s() could not be detected.', $parameterName, get_class($this), $this->commandMethodName), 1306755296); + throw new InvalidArgumentTypeException(sprintf('The argument type for parameter $%s of method %s->%s() could not be detected.', $parameterName, static::class, $this->commandMethodName), 1306755296); } $defaultValue = (isset($parameterInfo['defaultValue']) ? $parameterInfo['defaultValue'] : null); $this->arguments->addNewArgument($parameterName, $dataType, ($parameterInfo['optional'] === false), $defaultValue); diff --git a/typo3/sysext/extbase/Classes/Persistence/Repository.php b/typo3/sysext/extbase/Classes/Persistence/Repository.php index d3830d4e93cf44a6bb26c99d793924855883d3c3..60c002788e9f42173ee0bbd7bdef3c476b66bb03 100644 --- a/typo3/sysext/extbase/Classes/Persistence/Repository.php +++ b/typo3/sysext/extbase/Classes/Persistence/Repository.php @@ -261,6 +261,6 @@ class Repository implements RepositoryInterface, \TYPO3\CMS\Core\SingletonInterf */ protected function getRepositoryClassName() { - return get_class($this); + return static::class; } } diff --git a/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php b/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php index 3ef22d5a740e402a7b1a0ca71123c7a81acf7d70..42a17d6e2b4ffffc13440e5d3bd9c2f8531ee029 100644 --- a/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php +++ b/typo3/sysext/extbase/Classes/Property/PropertyMappingConfiguration.php @@ -378,7 +378,7 @@ class PropertyMappingConfiguration implements PropertyMappingConfigurationInterf $currentProperty = array_shift($splittedPropertyPath); if (!isset($this->subConfigurationForProperty[$currentProperty])) { - $type = get_class($this); + $type = static::class; if (isset($this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER])) { $this->subConfigurationForProperty[$currentProperty] = clone $this->subConfigurationForProperty[self::PROPERTY_PATH_PLACEHOLDER]; } else { diff --git a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php index 3c1b93abfa8e8f89a20b046f90f538261e12fcc6..830700eaa5db43c3e8b0f6cf063b0595f1013cbb 100644 --- a/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Reflection/ReflectionServiceTest.php @@ -46,7 +46,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function getClassTagsValues() { $service = new ReflectionService(); - $classValues = $service->getClassTagsValues(get_class($this)); + $classValues = $service->getClassTagsValues(static::class); $this->assertEquals([ 'firsttest' => ['test for reflection'], 'anothertest' => ['second test for reflection', 'second test for reflection with second value'] @@ -59,7 +59,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function getClassTagValues() { $service = new ReflectionService(); - $classValues = $service->getClassTagValues(get_class($this), 'firsttest'); + $classValues = $service->getClassTagValues(static::class, 'firsttest'); $this->assertEquals([ 'test for reflection', ], $classValues); @@ -71,8 +71,8 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function hasMethod() { $service = new ReflectionService(); - $this->assertTrue($service->hasMethod(get_class($this), 'fixtureMethodForMethodTagsValues')); - $this->assertFalse($service->hasMethod(get_class($this), 'notExistentMethod')); + $this->assertTrue($service->hasMethod(static::class, 'fixtureMethodForMethodTagsValues')); + $this->assertFalse($service->hasMethod(static::class, 'notExistentMethod')); } /** @@ -81,7 +81,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function getMethodTagsValues() { $service = new ReflectionService(); - $tagsValues = $service->getMethodTagsValues(get_class($this), 'fixtureMethodForMethodTagsValues'); + $tagsValues = $service->getMethodTagsValues(static::class, 'fixtureMethodForMethodTagsValues'); $this->assertEquals([ 'param' => ['array $foo The foo parameter'], 'return' => ['string'] @@ -94,7 +94,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function getMethodParameters() { $service = new ReflectionService(); - $parameters = $service->getMethodParameters(get_class($this), 'fixtureMethodForMethodTagsValues'); + $parameters = $service->getMethodParameters(static::class, 'fixtureMethodForMethodTagsValues'); $this->assertSame([ 'foo' => [ 'position' => 0, @@ -114,7 +114,7 @@ class ReflectionServiceTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa public function getMethodParametersWithShortTypeNames() { $service = new ReflectionService(); - $parameters = $service->getMethodParameters(get_class($this), 'fixtureMethodForMethodTagsValuesWithShortTypes'); + $parameters = $service->getMethodParameters(static::class, 'fixtureMethodForMethodTagsValuesWithShortTypes'); $this->assertSame([ 'dummy' => [ 'position' => 0, diff --git a/typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php index 988fd916c59b63bbd5fce611da52233aff216866..05976c39be9ff37bf2d4fc150c0e631d83f3ce2c 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php @@ -121,7 +121,7 @@ class ExtensionListUtility implements \SplObserver $this->parser->attach($this); } else { throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException( - get_class($this) . ': No XML parser available.', + static::class . ': No XML parser available.', 1476108717 ); } diff --git a/typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php index 20a41388b7f0c2e437d26c7459500c121adff981..d13bf43506240edfb8d7a907610cd7badc54aef0 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/Importer/MirrorListUtility.php @@ -47,7 +47,7 @@ class MirrorListUtility implements \SplObserver $this->parser->attach($this); } else { throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException( - get_class($this) . ': No XML parser available.', + static::class . ': No XML parser available.', 1476108687 ); } diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php index 64d0403eb5b9e37bf5706c99cf1bf796945e528d..fcc976df810429ac3943d9273e3ccd046c2d65be 100644 --- a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php +++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractTagBasedViewHelper.php @@ -92,8 +92,8 @@ abstract class AbstractTagBasedViewHelper extends AbstractViewHelper } } - if (isset(self::$tagAttributes[get_class($this)])) { - foreach (self::$tagAttributes[get_class($this)] as $attributeName) { + if (isset(self::$tagAttributes[static::class])) { + foreach (self::$tagAttributes[static::class] as $attributeName) { if ($this->hasArgument($attributeName) && $this->arguments[$attributeName] !== '') { $this->tag->addAttribute($attributeName, $this->arguments[$attributeName]); } @@ -114,7 +114,7 @@ abstract class AbstractTagBasedViewHelper extends AbstractViewHelper protected function registerTagAttribute($name, $type, $description, $required = false, $default = null) { $this->registerArgument($name, $type, $description, $required, $default); - self::$tagAttributes[get_class($this)][$name] = $name; + self::$tagAttributes[static::class][$name] = $name; } /** diff --git a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php index 3dba9f82634fe94193c7ae4eec00967472e2ee48..ca5b1ce567a1d97152eb832da913ed46836656e3 100644 --- a/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php +++ b/typo3/sysext/fluid/Classes/Core/ViewHelper/AbstractViewHelper.php @@ -111,11 +111,11 @@ abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\Abst */ protected function registerRenderMethodArguments() { - GeneralUtility::deprecationLog(sprintf('Render method argument support is deprecated (used on class "%s"), switch to initializeArguments and registerArgument.', get_class($this))); + GeneralUtility::deprecationLog(sprintf('Render method argument support is deprecated (used on class "%s"), switch to initializeArguments and registerArgument.', static::class)); $reflectionService = $this->getReflectionService(); - $methodParameters = $reflectionService->getMethodParameters(get_class($this), 'render'); - $methodTags = $reflectionService->getMethodTagsValues(get_class($this), 'render'); + $methodParameters = $reflectionService->getMethodParameters(static::class, 'render'); + $methodTags = $reflectionService->getMethodTagsValues(static::class, 'render'); $paramAnnotations = []; if (isset($methodTags['param'])) { @@ -128,7 +128,7 @@ abstract class AbstractViewHelper extends \TYPO3Fluid\Fluid\Core\ViewHelper\Abst if (isset($parameterInfo['type'])) { $dataType = isset($parameterInfo['array']) && (bool)$parameterInfo['array'] ? 'array' : $parameterInfo['type']; } else { - throw new \TYPO3\CMS\Fluid\Core\Exception('Could not determine type of argument "' . $parameterName . '" of the render-method in ViewHelper "' . get_class($this) . '". Either the methods docComment is invalid or some PHP optimizer strips off comments.', 1242292003); + throw new \TYPO3\CMS\Fluid\Core\Exception('Could not determine type of argument "' . $parameterName . '" of the render-method in ViewHelper "' . static::class . '". Either the methods docComment is invalid or some PHP optimizer strips off comments.', 1242292003); } $description = ''; diff --git a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php index d5db37a77bc708c9d6844ff9df509ca5b141c04b..65c27a9fcaff6f57d23bdd210154e949de2f06b9 100644 --- a/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php +++ b/typo3/sysext/fluid/Classes/Core/Widget/AbstractWidgetViewHelper.php @@ -130,7 +130,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper $this->widgetContext->setParentPluginName($pluginName); $pluginNamespace = $this->extensionService->getPluginNamespace($extensionName, $pluginName); $this->widgetContext->setParentPluginNamespace($pluginNamespace); - $this->widgetContext->setWidgetViewHelperClassName(get_class($this)); + $this->widgetContext->setWidgetViewHelperClassName(static::class); if ($this->ajaxWidget === true) { $this->ajaxWidgetContextHolder->store($this->widgetContext); } @@ -177,7 +177,7 @@ abstract class AbstractWidgetViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper 'initiateSubRequest() can not be called if there is no valid controller extending ' . 'TYPO3\\CMS\\Fluid\\Core\\Widget\\AbstractWidgetController' . ' Got "' . ($this->controller ? get_class($this->controller) : gettype($this->controller)) . - '" in class "' . get_class($this) . '".', + '" in class "' . static::class . '".', 1289422564 ); } diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php index 878a60e742c710a13fc04b35a3b0c5560778205e..4410caec3381d933b151ac8ef3e06e56ac72acbf 100644 --- a/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php +++ b/typo3/sysext/fluid/Classes/ViewHelpers/Widget/Controller/PaginateController.php @@ -192,7 +192,7 @@ class PaginateController extends AbstractWidgetController return $modifiedObjects; } throw new \InvalidArgumentException( - 'The view helper "' . get_class($this) + 'The view helper "' . static::class . '" accepts as argument "QueryResultInterface", "\SplObjectStorage", "ObjectStorage" or an array. ' . 'given: ' . get_class($this->objects), 1385547291 diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentDataProcessorTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentDataProcessorTest.php index c14b6001e9d8a1d5dfbcaa2f5818b5da89d16095..864b1432f52596765e055c9342b35f9a884e9685 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentDataProcessorTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentDataProcessorTest.php @@ -62,7 +62,7 @@ class ContentDataProcessorTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes $contentObjectRendererStub = new ContentObjectRenderer(); $config = [ 'dataProcessing.' => [ - '10' => get_class($this) + '10' => static::class ] ]; $variables = []; diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php index 142d9a981340bd138568f66978f12978b8bd7570..f4270bfd596db1985e45a10fc92aa07b9e411789 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/MenuContentObjectFactoryTest.php @@ -57,7 +57,7 @@ class MenuContentObjectFactoryTest extends \TYPO3\TestingFramework\Core\Unit\Uni public function getMenuObjectByTypeReturnsInstanceOfOwnRegisteredTypeInsteadOfInternalType() { $factory = new MenuContentObjectFactory; - $selfClassName = get_class($this); + $selfClassName = static::class; $factory->registerMenuType('GMENU', $selfClassName); $this->assertInstanceOf($selfClassName, $factory->getMenuObjectByType('GMENU')); } @@ -68,7 +68,7 @@ class MenuContentObjectFactoryTest extends \TYPO3\TestingFramework\Core\Unit\Uni public function getMenuObjectByTypeReturnsInstanceOfNewRegisteredType() { $factory = new MenuContentObjectFactory; - $selfClassName = get_class($this); + $selfClassName = static::class; $uniqueMenuType = $this->getUniqueId('foo_'); $factory->registerMenuType($uniqueMenuType, $selfClassName); $this->assertInstanceOf($selfClassName, $factory->getMenuObjectByType($uniqueMenuType)); diff --git a/typo3/sysext/install/Classes/SystemEnvironment/Check.php b/typo3/sysext/install/Classes/SystemEnvironment/Check.php index dfbe9f5b1832c2a742c0e6f50fd23a66a796a299..12889dbea9a856d3a7ee69d3d2ed2f7a23248f23 100644 --- a/typo3/sysext/install/Classes/SystemEnvironment/Check.php +++ b/typo3/sysext/install/Classes/SystemEnvironment/Check.php @@ -579,7 +579,7 @@ class Check implements CheckInterface */ protected function checkReflectionDocComment() { - $testReflection = new \ReflectionMethod(get_class($this), __FUNCTION__); + $testReflection = new \ReflectionMethod(static::class, __FUNCTION__); if ($testReflection->getDocComment() === false) { $this->messageQueue->enqueue(new FlashMessage( 'TYPO3 CMS core extensions like extbase and fluid heavily rely on method' diff --git a/typo3/sysext/install/Classes/Updates/AbstractUpdate.php b/typo3/sysext/install/Classes/Updates/AbstractUpdate.php index 1cac4c4e5b97fb0f0da40167521d20e26996c553..8bcdb50bb8eed86fce7eda9260d4fa17c2359598 100644 --- a/typo3/sysext/install/Classes/Updates/AbstractUpdate.php +++ b/typo3/sysext/install/Classes/Updates/AbstractUpdate.php @@ -162,7 +162,7 @@ abstract class AbstractUpdate */ protected function markWizardAsDone($confValue = 1) { - GeneralUtility::makeInstance(Registry::class)->set('installUpdate', get_class($this), $confValue); + GeneralUtility::makeInstance(Registry::class)->set('installUpdate', static::class, $confValue); } /** @@ -172,7 +172,7 @@ abstract class AbstractUpdate */ protected function isWizardDone() { - $wizardClassName = get_class($this); + $wizardClassName = static::class; return GeneralUtility::makeInstance(Registry::class)->get('installUpdate', $wizardClassName, false); } } diff --git a/typo3/sysext/scheduler/Classes/Task/AbstractTask.php b/typo3/sysext/scheduler/Classes/Task/AbstractTask.php index 3fc1bb7cdfdbb40d508c10add72f574b1d2dde4c..7a6fa94b1b5305e09f3c8931490e28d6a5295ddc 100644 --- a/typo3/sysext/scheduler/Classes/Task/AbstractTask.php +++ b/typo3/sysext/scheduler/Classes/Task/AbstractTask.php @@ -145,7 +145,7 @@ abstract class AbstractTask */ public function getTaskTitle() { - return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['title']); + return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][static::class]['title']); } /** @@ -155,7 +155,7 @@ abstract class AbstractTask */ public function getTaskDescription() { - return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][get_class($this)]['description']); + return $GLOBALS['LANG']->sL($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['scheduler']['tasks'][static::class]['description']); } /** @@ -165,7 +165,7 @@ abstract class AbstractTask */ public function getTaskClassName() { - return get_class($this); + return static::class; } /** @@ -490,7 +490,7 @@ abstract class AbstractTask } if ($failure instanceof \Exception) { // Log failed execution - $logMessage = 'Task failed to execute successfully. Class: ' . get_class($this) + $logMessage = 'Task failed to execute successfully. Class: ' . static::class . ', UID: ' . $this->taskUid . ', Code: ' . $failure->getCode() . ', ' . $failure->getMessage(); $this->scheduler->log($logMessage, 1); // Do not serialize the complete exception or the trace, this can lead to huge strings > 50MB @@ -608,6 +608,6 @@ abstract class AbstractTask protected function getLogger() { $logManager = GeneralUtility::makeInstance(LogManager::class); - return $logManager->getLogger(get_class($this)); + return $logManager->getLogger(static::class); } }