Page MenuHomeGitPull.it

No OneTemporary

Authored By
Unknown
Size
15 KB
Referenced Files
None
Subscribers
None
diff --git a/includes/class-CategoryYear.php b/includes/class-CategoryYear.php
index 42d7f18..51ddf62 100644
--- a/includes/class-CategoryYear.php
+++ b/includes/class-CategoryYear.php
@@ -1,75 +1,48 @@
<?php
# it.wiki deletion bot in PHP
# Copyright (C) 2013 Mauro742, MauroBot
# https://it.wikipedia.org/wiki/Utente:Mauro742
# https://it.wikipedia.org/wiki/Utente:MauroBot
# Originally under Creative Commons BY SA 3.0 International
# Utente:MauroBot/BotCancellazioni/category.js
# https://creativecommons.org/licenses/by-sa/3.0/
# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
* Handle a yearly category
*
* e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_-_2017
*/
-class CategoryYear extends PageTemplated {
+class CategoryYear extends PageYear {
/**
* Template name of this category
*
* @override CategoryTemplated::TEMPLATE_NAME
*/
const TEMPLATE_NAME = 'CATEGORY_YEAR';
- /**
- * Year
- *
- * @var int
- */
- private $year;
-
- /**
- * Constructor
- *
- * @param $year int
- * @see CategoryTemplated::__construct()
- */
- public function __construct( $year ) {
- $this->year = $year;
- parent::__construct();
- }
-
- /**
- * Get the year
- *
- * @return int
- */
- public function getYear() {
- return $this->year;
- }
-
/**
* Template arguments
*
* @override CategoryTemplated::getTemplateArguments()
*/
public function getTemplateArguments() {
return [ $this->getYear() ];
}
}
diff --git a/includes/class-CategoryYearMonth.php b/includes/class-CategoryYearMonth.php
index f55989b..c898840 100644
--- a/includes/class-CategoryYearMonth.php
+++ b/includes/class-CategoryYearMonth.php
@@ -1,82 +1,54 @@
<?php
# it.wiki deletion bot in PHP
# Copyright (C) 2013 Mauro742, MauroBot
# https://it.wikipedia.org/wiki/Utente:Mauro742
# https://it.wikipedia.org/wiki/Utente:MauroBot
# Originally under Creative Commons BY SA 3.0 International
# Utente:MauroBot/BotCancellazioni/category.js
# https://creativecommons.org/licenses/by-sa/3.0/
# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
* Handle a monthly category
*
* e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_-_aprile_2018
*/
-class CategoryYearMonth extends CategoryYear {
+class CategoryYearMonth extends PageYearMonth {
/**
* Template name of this category
*
* @override CategoryTemplated::TEMPLATE_NAME
*/
const TEMPLATE_NAME = 'CATEGORY_MONTH';
- /**
- * Month
- *
- * @var int 1-12
- */
- private $month;
-
- /**
- * Constructor
- *
- * @param $year int
- * @param $month int 1-12
- * @see CategoryYear::__construct()
- */
- public function __construct( $year, $month ) {
- $this->month = $month;
- parent::__construct( $year );
- }
-
- /**
- * Get the month
- *
- * @return int 1-12
- */
- public function getMonth() {
- return $this->month;
- }
-
/**
* Template arguments
*
* @override CategoryTemplated::getTemplateArguments()
*/
public function getTemplateArguments() {
return [
- ( new parent( $this->getYear() ) )
+ ( new CategoryYear( $this->getYear() ) )
->getTemplatedTitle(),
$this->getYear(),
$this->getMonth(),
Months::number2name( $this->getMonth() - 1 ),
];
}
}
diff --git a/includes/class-CategoryYearMonthDay.php b/includes/class-CategoryYearMonthDay.php
index de1e260..b518d89 100644
--- a/includes/class-CategoryYearMonthDay.php
+++ b/includes/class-CategoryYearMonthDay.php
@@ -1,85 +1,56 @@
<?php
# it.wiki deletion bot in PHP
# Copyright (C) 2013 Mauro742, MauroBot
# https://it.wikipedia.org/wiki/Utente:Mauro742
# https://it.wikipedia.org/wiki/Utente:MauroBot
# Originally under Creative Commons BY SA 3.0 International
# Utente:MauroBot/BotCancellazioni/category.js
# https://creativecommons.org/licenses/by-sa/3.0/
# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
- * Handle a daily category
+ * Handle a daily category that contains semplified PDC pages
*
* e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_del_19_febbraio_2018
*/
-class CategoryYearMonthDay extends CategoryYearMonth {
+class CategoryYearMonthDay extends PageYearMonthDay {
/**
* Template name
*
* @override CategoryTemplated::TEMPLATE_NAME
*/
const TEMPLATE_NAME = 'CATEGORY_DAY';
- /**
- * Day
- *
- * @var int 1-31
- */
- private $day;
-
- /**
- * Constructor
- *
- * @param $year int
- * @param $month int 1-12
- * @param $day int 1-31
- * @see CategoryYearMonth::__construct()
- */
- public function __construct( $year, $month, $day ) {
- $this->day = $day;
- parent::__construct( $year, $month );
- }
-
- /**
- * Get the day
- *
- * @return int 1-13
- */
- public function getDay() {
- return $this->day;
- }
-
-
/**
* Template arguments
*
* @override CategoryTemplated::getTemplateArguments()
*/
public function getTemplateArguments() {
return [
- ( new parent( $this->getYear(), $this->getMonth() ) )
+ ( new CategoryYearMonth( $this->getYear(), $this->getMonth() ) )
->getTemplatedTitle(),
$this->getYear(),
$this->getMonth(),
Months::number2name( $this->getMonth() - 1 ),
$this->getDay(),
];
}
+
}
diff --git a/includes/class-CategoryYear.php b/includes/class-PageYear.php
similarity index 55%
copy from includes/class-CategoryYear.php
copy to includes/class-PageYear.php
index 42d7f18..af40aa5 100644
--- a/includes/class-CategoryYear.php
+++ b/includes/class-PageYear.php
@@ -1,75 +1,51 @@
<?php
# it.wiki deletion bot in PHP
-# Copyright (C) 2013 Mauro742, MauroBot
-# https://it.wikipedia.org/wiki/Utente:Mauro742
-# https://it.wikipedia.org/wiki/Utente:MauroBot
-# Originally under Creative Commons BY SA 3.0 International
-# Utente:MauroBot/BotCancellazioni/category.js
-# https://creativecommons.org/licenses/by-sa/3.0/
-# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
- * Handle a yearly category
- *
- * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_-_2017
+ * Abstraction of a page related to a year
*/
-class CategoryYear extends PageTemplated {
-
- /**
- * Template name of this category
- *
- * @override CategoryTemplated::TEMPLATE_NAME
- */
- const TEMPLATE_NAME = 'CATEGORY_YEAR';
+abstract class PageYear extends PageTemplated {
/**
* Year
*
* @var int
*/
private $year;
/**
* Constructor
*
* @param $year int
- * @see CategoryTemplated::__construct()
+ * @see PageTemplated::__construct()
*/
public function __construct( $year ) {
$this->year = $year;
parent::__construct();
}
/**
* Get the year
*
* @return int
*/
public function getYear() {
return $this->year;
}
- /**
- * Template arguments
- *
- * @override CategoryTemplated::getTemplateArguments()
- */
- public function getTemplateArguments() {
- return [ $this->getYear() ];
- }
}
diff --git a/includes/class-CategoryYearMonth.php b/includes/class-PageYearMonth.php
similarity index 52%
copy from includes/class-CategoryYearMonth.php
copy to includes/class-PageYearMonth.php
index f55989b..d7cc889 100644
--- a/includes/class-CategoryYearMonth.php
+++ b/includes/class-PageYearMonth.php
@@ -1,82 +1,52 @@
<?php
# it.wiki deletion bot in PHP
-# Copyright (C) 2013 Mauro742, MauroBot
-# https://it.wikipedia.org/wiki/Utente:Mauro742
-# https://it.wikipedia.org/wiki/Utente:MauroBot
-# Originally under Creative Commons BY SA 3.0 International
-# Utente:MauroBot/BotCancellazioni/category.js
-# https://creativecommons.org/licenses/by-sa/3.0/
-# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
- * Handle a monthly category
- *
- * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_-_aprile_2018
+ * Abstraction of a page related to a month (in a certain year)
*/
-class CategoryYearMonth extends CategoryYear {
-
- /**
- * Template name of this category
- *
- * @override CategoryTemplated::TEMPLATE_NAME
- */
- const TEMPLATE_NAME = 'CATEGORY_MONTH';
+abstract class PageYearMonth extends PageYear {
/**
* Month
*
* @var int 1-12
*/
private $month;
/**
* Constructor
*
* @param $year int
* @param $month int 1-12
- * @see CategoryYear::__construct()
+ * @see PageYear::__construct()
*/
public function __construct( $year, $month ) {
$this->month = $month;
parent::__construct( $year );
}
/**
* Get the month
*
* @return int 1-12
*/
public function getMonth() {
return $this->month;
}
- /**
- * Template arguments
- *
- * @override CategoryTemplated::getTemplateArguments()
- */
- public function getTemplateArguments() {
- return [
- ( new parent( $this->getYear() ) )
- ->getTemplatedTitle(),
- $this->getYear(),
- $this->getMonth(),
- Months::number2name( $this->getMonth() - 1 ),
- ];
- }
}
diff --git a/includes/class-CategoryYearMonthDay.php b/includes/class-PageYearMonthDay.php
similarity index 51%
copy from includes/class-CategoryYearMonthDay.php
copy to includes/class-PageYearMonthDay.php
index de1e260..738e1ae 100644
--- a/includes/class-CategoryYearMonthDay.php
+++ b/includes/class-PageYearMonthDay.php
@@ -1,85 +1,53 @@
<?php
# it.wiki deletion bot in PHP
-# Copyright (C) 2013 Mauro742, MauroBot
-# https://it.wikipedia.org/wiki/Utente:Mauro742
-# https://it.wikipedia.org/wiki/Utente:MauroBot
-# Originally under Creative Commons BY SA 3.0 International
-# Utente:MauroBot/BotCancellazioni/category.js
-# https://creativecommons.org/licenses/by-sa/3.0/
-# https://wikimediafoundation.org/wiki/Special:MyLanguage/Terms_of_Use/it
# Copyright (C) 2018 Valerio Bozzolan
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
namespace itwikidelbot;
/**
- * Handle a daily category
- *
- * e.g. https://it.wikipedia.org/wiki/Categoria:Cancellazioni_del_19_febbraio_2018
+ * Abstraction of a page related to a day (in a certain month of a certain year)
*/
-class CategoryYearMonthDay extends CategoryYearMonth {
-
- /**
- * Template name
- *
- * @override CategoryTemplated::TEMPLATE_NAME
- */
- const TEMPLATE_NAME = 'CATEGORY_DAY';
+abstract class PageYearMonthDay extends PageYearMonth {
/**
* Day
*
* @var int 1-31
*/
private $day;
/**
* Constructor
*
* @param $year int
* @param $month int 1-12
* @param $day int 1-31
- * @see CategoryYearMonth::__construct()
+ * @see PageYearMonth::__construct()
*/
public function __construct( $year, $month, $day ) {
- $this->day = $day;
+ $this->day = $day;
parent::__construct( $year, $month );
}
/**
* Get the day
*
* @return int 1-13
*/
public function getDay() {
return $this->day;
}
-
- /**
- * Template arguments
- *
- * @override CategoryTemplated::getTemplateArguments()
- */
- public function getTemplateArguments() {
- return [
- ( new parent( $this->getYear(), $this->getMonth() ) )
- ->getTemplatedTitle(),
- $this->getYear(),
- $this->getMonth(),
- Months::number2name( $this->getMonth() - 1 ),
- $this->getDay(),
- ];
- }
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Nov 19, 07:21 (2 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265313
Default Alt Text
(15 KB)

Event Timeline