-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Component: Framework/DataFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
Preconditions (*)
- 2.3-develop
Steps to reproduce (*)
- Start with a class similar to this:
<?php
class MyDate
{
/**
* @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface
*/
private $timeZone;
/**
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
*/
public function __construct(
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $timezone
) {
$this->timeZone = $timezone;
$scopedDate = $this->timeZone->scopeDate(1, new \DateTime, true);
}
}
- Run the code
Expected result (*)
scopeDate()
returns a DateTime scoped to the store 1 locale.- The method should work according to signature in the interface - support all types
Actual result (*)
- PHP Fatal error is thrown
PHP Fatal error: Uncaught TypeError: DateTime::__construct() expects parameter 1 to be string, object given
The scopeDate()
method is not implementing its interface (or at least the docBlock of the interface, which indicates this method can take a DateTime as $date
).
Nazar65
Metadata
Metadata
Assignees
Labels
Component: Framework/DataFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release