Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Feb 2011 at 22:59 UTC
Updated:
1 Jun 2011 at 16:22 UTC
Jump to comment: Most recent file
Strict warning: Declaration of FeedsDateTime::setTimezone() should be compatible with that of DateTime::setTimezone() in [..].
Apparently PHP doesn't like you to add extra arguments.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1055582-strict-warning-for-feedsdatetime-settimezone-7-D7.patch | 1014 bytes | milesw |
Comments
Comment #1
ickx17 commentedSame error:
Strict warning: Declaration of FeedsDateTime::setTimezone() should be compatible with that of DateTime::setTimezone() in _registry_check_code() (line 2789 of [my_base_path]\includes\bootstrap.inc).
Don't know how to fix, please help!
Comment #2
datorres commentedI have the same error.
Strict warning: Declaration of FeedsDateTime::setTimezone() should be compatible with that of DateTime::setTimezone() en _registry_check_code() (línea 2789 de C:\xampp\htdocs\prueba\includes\bootstrap.inc).
Comment #3
sonar_un commentedSubscribing
Comment #4
casey commentedIt doesn't look like the $force parameter is being used. So maybe it can be dropped.
If not, I reckon an extra method like forceTimeZone() could help out.
Comment #5
softmax commentedSubscribing
Comment #6
steinmb commentedSee the same warning, PHP 5.3.5. So what is the history behind $force? Changing line 600 (plugins/FeedsParser.inc) to
public function setTimezone(DateTimeZone $tz) {remove the warning.
Comment #7
milesw commentedThe solution seems to be removing the type hint from the method signature. This doesn't really make sense, but it's how others are handling the issue.
Date module: #953688: Strict warning: Declaration of DateObject::setTimezone() ...
Joomla issue queue: http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&...
public function setTimezone(DateTimeZone $tz, $force = FALSE)changed to
public function setTimezone($tz, $force = FALSE)Comment #8
dave reidThe problem is that DateTime::setTimezone does not have a $force parameter, and therefore we can't just add an extra one when we want to if we're extending that class.
Comment #9
milesw commented@Dave Reid
But that's the obvious solution, the one that makes sense. :)
On my system, running PHP 5.3.5, removing that $force parameter changes nothing. The only way I can get rid of the warning is to remove the DateTimeZone hint. I have no idea why, but it looks like the folks over at the Date module had to do the same.
Comment #10
lelizondo commentedsubscribing.
Comment #11
glottus commentedSubscribing
Comment #12
dave reidConfirmed. Fix applied to 7.x-2.x and 6.x-2.x.
http://drupalcode.org/project/feeds.git/commit/76a72d0
http://drupalcode.org/project/feeds.git/commit/896d12a