Project

General

Profile

Actions

Task #61788

closed

Use fully class name resolution in PHP 5.5

Added by Xavier Perseguers over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Code Cleanup
Target version:
-
Start date:
2014-09-22
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7.0
PHP Version:
5.5
Tags:
Complexity:
Sprint Focus:

Description

Since PHP 5.5 is a requirement, calls to GeneralUtility::makeInstance should use the ::class construct instead of a string.

rewrite.php

<?php
$fileName = $argv[1];
$contents = file_get_contents($fileName);

$contents = preg_replace_callback(
    "/::makeInstance\\('([^']+)'/",
    function ($matches) {
        return '::makeInstance(\\' . str_replace('\\\\', '\\', $matches[1]) . '::class';
    },
    $contents
);

file_put_contents($fileName, $contents);

Command

$ for f in $(grep -sr "::makeInstance(" * | cut -d: -f1 | egrep ".php$" | grep -v "rewrite.php" | sort -u); do php rewrite.php $f; done

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #61969: Adjust TRAVIS settings to new requirements for version 7ClosedMarkus Klein2014-09-30

Actions
Actions #1

Updated by Xavier Perseguers over 9 years ago

  • Description updated (diff)
Actions #2

Updated by Gerrit Code Review over 9 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #3

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #4

Updated by Gerrit Code Review over 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #5

Updated by Gerrit Code Review over 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #6

Updated by Gerrit Code Review over 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #7

Updated by Gerrit Code Review over 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32913

Actions #8

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #9

Updated by Gerrit Code Review over 9 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34089

Actions #10

Updated by Gerrit Code Review over 9 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34089

Actions #11

Updated by Xavier Perseguers over 9 years ago

  • Status changed from Under Review to Resolved
Actions #12

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF