[RSS Feed/News] Developer feature: Improve entity creation process

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
Creating various entities is a fairly common task, and requires manual fixing of type hinting.

Code like this is very common.
PHP:

Code:
/** @var \XF\Entity\Phrase $phrase */
$phrase = $this->_em->create('XF:Phrase');
or
PHP:

Code:
$phrase = $this->_em->create('XF:Phrase');
assert($phrase instanceof \XF\Entity\Phrase );
In either case, a stringy identifier is being used and the full type is repeated again before/after. phpstorm's metadata can sometimes help, but not in all cases.

There is however a...

Read more

ادامه مطلب...
 
Status
Not open for further replies.
Back
Top Bottom