Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Deprecate Zend\Stdlib\DateTime and use \DateTime constructor internally instead #3951

Closed
wants to merge 1 commit into from
Closed

Deprecate Zend\Stdlib\DateTime and use \DateTime constructor internally instead #3951

wants to merge 1 commit into from

Conversation

DASPRiD
Copy link
Member

@DASPRiD DASPRiD commented Mar 4, 2013

Zend\Stdlib\DateTime was introduced for no real reason; at least not without looking more deeply into how the native DateTime object works. The main reason was to be able to parse fractional seconds in ISO8601 dates, which was not possible with DateTime::createFromFormat(), but is actually possible with the DateTime constructor itself.

This PR deprecates that unnecessary class again and puts the DateTime constructor in place where needed.

@Freeaqingme
Copy link
Member

Imho we can't do this for ZF2 as this effectively is a BC Break. Time to get a version3 branch up & running ;)

@iquabius
Copy link
Contributor

iquabius commented Mar 5, 2013

👍 for a version3 branch. :)

@DASPRiD
Copy link
Member Author

DASPRiD commented Mar 5, 2013

In case we can't make the Zend\Stdlib\DateTime removal anymore, we can at least incorporate the Zend\Feed changes.

@DASPRiD
Copy link
Member Author

DASPRiD commented Mar 5, 2013

Just for the record: I highly doubt that anyone has really used this class yet apart from our internal usage. It has been documented nowhere and is only in for this single version.

@DASPRiD
Copy link
Member Author

DASPRiD commented Mar 6, 2013

Also, I talked with Derick; He actually stated that the constants were not meant to be used with the createFromFormat() method, but only for formatting dates for output:

[Derick] using the constants for createfromformat is kinda ... odd

So eventually, Zend\Feed was already doing it "wrong". He also approved that the DateTime constructor is perfectly fine for parsing such dates.

@ghost ghost assigned weierophinney Mar 8, 2013
@weierophinney
Copy link
Member

I'll accept this on the conditions that:

  • Zend\Stdlib\DateTime and related tests remain in the repository (removing them is a BC break)
  • Change the title to reflect that you're replacing Zend\Stdlib\DateTime usage with DateTime in Zend\Feed.

If that's done, we can merge this for 2.2.0.

@DASPRiD
Copy link
Member Author

DASPRiD commented Mar 11, 2013

@weierophinney Is it fine to mark Zend\Stdlib\DateTime as deprecated as we did with the Query route?

@weierophinney
Copy link
Member

@DASPRiD Yes.

On Monday, March 11, 2013, Ben Scholzen wrote:

@weierophinney https://github.com/weierophinney Is it fine to mark
Zend\Stdlib\DateTime as deprecated as we did with the Query route?


Reply to this email directly or view it on GitHubhttps://github.com//pull/3951#issuecomment-14746883
.

Matthew Weier O'Phinney
[email protected]
http://mwop.net/

weierophinney added a commit that referenced this pull request Mar 12, 2013
Deprecate Zend\Stdlib\DateTime and use \DateTime constructor internally instead
weierophinney added a commit that referenced this pull request Mar 12, 2013
- Added an error handler to catch the deprecation warning now emitted by
  Zend\Stdlib\DateTime
weierophinney added a commit that referenced this pull request Mar 12, 2013
@weierophinney
Copy link
Member

Merged to develop for release with 2.2.0

weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…val/stdlib-datetime

Deprecate Zend\Stdlib\DateTime and use \DateTime constructor internally instead
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
…warning

- Added an error handler to catch the deprecation warning now emitted by
  Zend\Stdlib\DateTime
weierophinney added a commit to zendframework/zend-stdlib that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
…val/stdlib-datetime

Deprecate Zend\Stdlib\DateTime and use \DateTime constructor internally instead
weierophinney added a commit to zendframework/zend-feed that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants