Browse Source

Whitespace fixes

master
J. King 4 years ago
parent
commit
fea772fa83
  1. 2
      lib/Parser/Construct.php
  2. 2
      lib/Parser/XML/Construct.php
  3. 4
      lib/Parser/XML/Feed.php

2
lib/Parser/Construct.php

@ -98,7 +98,7 @@ trait Construct {
}
protected function empty($o, array $ignore = []): bool {
return !array_filter((array) $o, function($v, $k) use($ignore) {
return !array_filter((array) $o, function($v, $k) use ($ignore) {
return !in_array($k, $ignore) && !is_null($v) && (!$v instanceof Collection || sizeof($v) > 0);
}, \ARRAY_FILTER_USE_BOTH);
}

2
lib/Parser/XML/Construct.php

@ -86,7 +86,7 @@ abstract class Construct {
$out = [];
$tz = new \DateTimeZone("UTC");
assert(in_array($mode, [self::DATE_ANY, self::DATE_ALL, self::DATE_EARLIEST, self::DATE_LATEST]));
foreach((array) $this->fetchString($query, null, true, $context) as $d) {
foreach ((array) $this->fetchString($query, null, true, $context) as $d) {
if ($d = $this->parseDate($d ?? "")) {
if ($mode === self::DATE_ANY) {
return $d;

4
lib/Parser/XML/Feed.php

@ -277,7 +277,7 @@ class Feed extends Construct implements \MensBeam\Lax\Parser\Feed {
/** Computes the "skip-schedule" of an RSS feed, the set of days and hours during which a feed should not be fetched */
protected function getSchedSkipRss2(): ?int {
$out = 0;
foreach($this->fetchString("rss2:skipHours/rss2:hour", "\d+", true) ?? [] as $h) {
foreach ($this->fetchString("rss2:skipHours/rss2:hour", "\d+", true) ?? [] as $h) {
$out |= [
Schedule::HOUR_0,
Schedule::HOUR_1,
@ -306,7 +306,7 @@ class Feed extends Construct implements \MensBeam\Lax\Parser\Feed {
Schedule::HOUR_0,
][(int) $h] ?? 0;
}
foreach($this->fetchString("rss2:skipDays/rss2:day", null, true) ?? [] as $d) {
foreach ($this->fetchString("rss2:skipDays/rss2:day", null, true) ?? [] as $d) {
$out |= [
"monday" => Schedule::DAY_MON,
"tuesday" => Schedule::DAY_TUE,

Loading…
Cancel
Save