Skip to content

Commit

Permalink
[TASK] use namespaces, part2
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenJuergens committed May 16, 2017
1 parent 7c0dcf8 commit 3895280
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Classes/Generator/WebkitPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
* Public License for more details. *
* */

use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\PageRepository;

/**
* PDF generator class for Formhandler using the extension "webkitpdf"
Expand Down Expand Up @@ -63,14 +65,14 @@ public function process()
*/
protected function readWebkitPdfConf()
{
$sysPageObj = GeneralUtility::makeInstance('\TYPO3\CMS\Frontend\Page\PageRepository');
$sysPageObj = GeneralUtility::makeInstance(PageRepository::class);

if (!$GLOBALS['TSFE']->sys_page) {
$GLOBALS['TSFE']->sys_page = $sysPageObj;
}

$rootLine = $sysPageObj->getRootLine($GLOBALS['TSFE']->id);
$TSObj = GeneralUtility::makeInstance('\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService');
$TSObj = GeneralUtility::makeInstance(ExtendedTemplateService::class);
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
Expand Down
5 changes: 3 additions & 2 deletions Classes/Mailer/TYPO3Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
* Public License for more details. *
* */
use TYPO3\CMS\Core\Mail\MailMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use Typoheads\Formhandler\Component\Manager;
use Typoheads\Formhandler\Controller\Configuration;
Expand All @@ -30,7 +31,7 @@ class TYPO3Mailer extends AbstractMailer implements MailerInterface
/**
* The TYPO3 mail message object
*
* @var \TYPO3\CMS\Core\Mail\MailMessage
* @var MailMessage
*/
protected $emailObj;

Expand Down Expand Up @@ -63,7 +64,7 @@ public function __construct(Manager $componentManager,
{

parent::__construct($componentManager, $configuration, $globals, $utilityFuncs);
$this->emailObj = GeneralUtility::makeInstance('TYPO3\CMS\Core\Mail\MailMessage');
$this->emailObj = GeneralUtility::makeInstance(MailMessage::class);
}

/* (non-PHPdoc)
Expand Down
6 changes: 4 additions & 2 deletions Classes/Utility/GeneralUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
* Public License for more details. *
* */
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility as CoreGeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Utility\EidUtility;
use Typoheads\Formhandler\Utility\Globals;

Expand Down Expand Up @@ -841,8 +843,8 @@ static public function generateRandomID()
static public function initializeTSFE($pid)
{
// create object instances:
$GLOBALS['TSFE'] = CoreGeneralUtility::makeInstance('TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController', $GLOBALS['TYPO3_CONF_VARS'], $pid, 0, TRUE);
$GLOBALS['TSFE']->tmpl = CoreGeneralUtility::makeInstance('TYPO3\CMS\Core\TypoScript\TemplateService');
$GLOBALS['TSFE'] = CoreGeneralUtility::makeInstance(TypoScriptFrontendController::class, $GLOBALS['TYPO3_CONF_VARS'], $pid, 0, TRUE);
$GLOBALS['TSFE']->tmpl = CoreGeneralUtility::makeInstance(TemplateService::class);
$GLOBALS['TSFE']->tmpl->init();

// then initialize fe user
Expand Down
6 changes: 4 additions & 2 deletions Classes/Utility/TcaUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Core\TypoScript\ExtendedTemplateService;
use TYPO3\CMS\Core\Utility\DebugUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\Page\PageRepository;


/**
Expand Down Expand Up @@ -174,9 +176,9 @@ public function addFields_predefined($config)
*/
public function loadTS($pageUid)
{
$sysPageObj = GeneralUtility::makeInstance('TYPO3\CMS\Frontend\Page\PageRepository');
$sysPageObj = GeneralUtility::makeInstance(PageRepository::class);
$rootLine = $sysPageObj->getRootLine($pageUid);
$TSObj = GeneralUtility::makeInstance('TYPO3\CMS\Core\TypoScript\ExtendedTemplateService');
$TSObj = GeneralUtility::makeInstance(ExtendedTemplateService::class);
$TSObj->tt_track = 0;
$TSObj->init();
$TSObj->runThroughTemplates($rootLine);
Expand Down

0 comments on commit 3895280

Please sign in to comment.