Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1430373
DatePeriodFilter.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
DatePeriodFilter.php
View Options
<?php
namespace
DeepCopy\TypeFilter\Date
;
use
DatePeriod
;
use
DeepCopy\TypeFilter\TypeFilter
;
/**
* @final
*/
class
DatePeriodFilter
implements
TypeFilter
{
/**
* {@inheritdoc}
*
* @param DatePeriod $element
*
* @see http://news.php.net/php.bugs/205076
*/
public
function
apply
(
$element
)
{
$options
=
0
;
if
(
PHP_VERSION_ID
>=
80200
&&
$element
->
include_end_date
)
{
$options
|=
DatePeriod
::
INCLUDE_END_DATE
;
}
if
(!
$element
->
include_start_date
)
{
$options
|=
DatePeriod
::
EXCLUDE_START_DATE
;
}
if
(
$element
->
getEndDate
())
{
return
new
DatePeriod
(
$element
->
getStartDate
(),
$element
->
getDateInterval
(),
$element
->
getEndDate
(),
$options
);
}
if
(
PHP_VERSION_ID
>=
70217
)
{
$recurrences
=
$element
->
getRecurrences
();
}
else
{
$recurrences
=
$element
->
recurrences
-
$element
->
include_start_date
;
}
return
new
DatePeriod
(
$element
->
getStartDate
(),
$element
->
getDateInterval
(),
$recurrences
,
$options
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 18:41 (5 h, 49 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
71/13/55fd52af19b459bb30c9a47e97d8
Default Alt Text
DatePeriodFilter.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment