Skip to content

3.9.0

Choose a tag to compare

@dereuromark dereuromark released this 03 May 07:58
· 11 commits to master since this release
3594d6a

Fixes

  • Database\Type\YearType::toDatabase() and marshal() now actually cast the input to int, matching their ?int return signature. Previously they returned the raw $value (typically a numeric string) under declare(strict_types=1), breaking the declared contract (#124).
  • Model\Table\Table::saveAll() no longer folds per-row save results via bitwise & — that operator coerced the accumulator to int after the first iteration, so callers using strict comparisons (=== true) saw 1 instead of true. Replaced with a proper bool early-out (#124).
  • View\Widget\DateTimeWidget::_deconstructDate() now reads the AM/PM character from the same source it checked ($value['meridian']) instead of the str-padded copy, eliminating a long-standing decoupling between conditional and read paths (#125).
  • Model\Table\Table::delete() restores the parent's typed array $options parameter. The previous override widened it to bare $options plus a runtime is_array() check that was dead under declare(strict_types=1) (#125).
  • LegacyModelAwareTrait::loadModel() now guards _modelFactories with property_exists(). CakePHP 5.x removed ModelAwareTrait, so consumers that don't redeclare the property no longer trip an undeclared-dynamic-property warning under PHP 8.2+ — the lookup falls back cleanly to FactoryLocator::get() (#125).
  • Filesystem\Folder::isAbsolute(), isWindowsPath(), and isRegisteredStreamWrapper() now cast preg_match() results to bool explicitly so the : bool contract holds under stricter PHPStan rules. The Windows-path check also moves to str_starts_with() (#125).
  • Deprecations.php now validates the Shim.deprecationType config value against the levels trigger_error() actually accepts (E_USER_NOTICE / WARNING / DEPRECATED / ERROR), falling back to E_USER_DEPRECATED. A misconfigured value like E_NOTICE previously crashed the shim's own deprecation pathway with a ValueError on PHP 8+ (#125).

Improvements

  • Controller\Component\RequestHandlerComponent::accepts() and prefers() no longer carry the misleading deprecated 4.4.0 doc tag inherited from upstream. The shim's purpose is to keep these methods available for consumers who have not yet migrated to ContentTypeNegotiation::prefersChoice() / Controller::getViewClasses() — flagging them deprecated inside the shim was misleading IDEs and consumers (#125).
  • Model\Table\Table::record() uses PHP 8 capture-omit catch (RecordNotFoundException) instead of an empty catch (RecordNotFoundException $e) {} body that PSR2R / phpcs flagged (#125).
  • TestSuite\TestTrait::invokeMethod() and invokeProperty() drop the redundant & on the object parameter — objects are passed by handle in PHP, so the reference was dead syntax. Subclasses overriding these (e.g. EntityAnnotatorTest) must drop the & from their override signature; updated in this release (#125).
  • Deprecations.php now declares strict_types=1, matching the rest of src/ (#125).

Full Changelog: 3.8.5...3.9.0