FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17524&edit=1

ID: 17524
Comment by: nahuel@ahtna.org
Reported By: bindzus at gmail dot com
Summary: Use static keyword for static methods
Status: Open
Type: Feature/Change Request
Package: Calendar
Operating System: Windows Vista
Package Version: 0.5.5
PHP Version: 5.3.2
Roadmap Versions:
New Comment:

The patch seems to work correctly, please publish a new release of
PEAR::Calendar with this one.


Previous Comments:
------------------------------------------------------------------------

[2010-06-26 19:42:21] bindzus

Description:
------------
Running the first example given in the documentation
generates a lot of Strict Standards errors:

Strict Standards: Non-static method
Calendar_Engine_Factory::getEngine() should not be
called statically, assuming $this from incompatible
context in C:\src\web
applications\php\common\libs\pear\PEAR\Calendar\Calen
dar.php on line 211


Test script:
---------------
<?php
require_once 'Calendar/Month.php';
require_once 'Calendar/Month/Weekdays.php';
$Month = new Calendar_Month(2003, 10); // October 2003
$Month->build(); // Build the days in the month
// Loop through the days...
while ($Day = $Month->fetch()) {
echo $Day->thisDay().'<br />';
}
$Month = new Calendar_Month_Weekdays(date('Y'), date('n'));
$Month->build();
?>

Expected result:
----------------
When running the script above I expect to see the dates for
October 2003 listed one date per line.

Actual result:
--------------
I do see the dates but I also get a lot of Strict Standards
errors because of my error report settings in php.ini:

error_reporting = E_ALL | E_STRICT

So I have added static to the method getEngine declared
in the class Calendar_Engine_Factory.

I hope that future versions of the Calendar package will
include the keyword static on static methods, so I can
keep my php.ini and also so I do not have to modify the
package after upgrading.

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 27, '11 at 8:56a
activeOct 27, '11 at 8:56a
posts1
users1
websitepear.php.net

1 user in discussion

Nahuel: 1 post

People

Translate

site design / logo © 2022 Grokbase