1

We use scrutinizer to inspect our code. Here is one "bug" related to phpdoc:

<?php
 *
 * @method \Cake\Database\Type\DateTimeType[] useImmutable()
 */
Type::build('time')->useImmutable();

Error message:

The method useImmutable() does not exist on Cake\Database\Type. It seems like you code against a sub-type of Cake\Database\Type such as Cake\Database\Type\DateTimeType.

Salines
  • 5,674
  • 3
  • 25
  • 50

1 Answers1

1

Create a variable and typehint it:

/** @var \Cake\Database\Type\DateTimeType $time */
$time = Type::build('time');
$time->useImmutable();
ndm
  • 59,784
  • 9
  • 71
  • 110