Skip to content

fix "final private function" warning that occurs in PHP8 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/CronSchedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ final public static function fromCronString($cronSpec = '* * * * * *', $language
* 'hasInterval' TRUE if a range is specified. FALSE otherwise
* 'interval' The interval if a range is specified.
*/
final private function cronInterpret($specification, $rangeMin, $rangeMax, $namedItems, $errorName)
private function cronInterpret($specification, $rangeMin, $rangeMax, $namedItems, $errorName)
{
if ((!is_string($specification)) && (!(is_int($specification)))) {
throw new Exception('Invalid specification.');
Expand Down Expand Up @@ -260,7 +260,7 @@ final private function cronInterpret($specification, $rangeMin, $rangeMax, $name
// [50] => 1
//

final private function cronCreateItems($cronInterpreted)
private function cronCreateItems($cronInterpreted)
{
$items = [];

Expand Down Expand Up @@ -291,7 +291,7 @@ final private function cronCreateItems($cronInterpreted)
// Result: An array with indices 0-4 holding the actual interpreted values for $minute, $hour, $day, $month and $year.
//

final private function dtFromParameters($time = false)
private function dtFromParameters($time = false)
{
if ($time === false) {
$arrTime = getdate();
Expand All @@ -310,7 +310,7 @@ final private function dtFromParameters($time = false)
}
}

final private function dtAsString($arrDt)
private function dtAsString($arrDt)
{
if ($arrDt === false) {
return false;
Expand Down Expand Up @@ -479,7 +479,7 @@ final public function nextAsTime($time = false)
// Result: FALSE if current did not overflow (reset back to the earliest possible value). TRUE if it did.
//

final private function advanceItem($arrItems, $rangeMin, $rangeMax, &$current)
private function advanceItem($arrItems, $rangeMin, $rangeMax, &$current)
{

// Advance pointer
Expand Down Expand Up @@ -516,7 +516,7 @@ final private function advanceItem($arrItems, $rangeMin, $rangeMax, &$current)
// $afterItem The highest index that is to be skipped.
//

final private function getEarliestItem($arrItems, $afterItem = false, $allowOverflow = true)
private function getEarliestItem($arrItems, $afterItem = false, $allowOverflow = true)
{

// If no filter is specified, return the earliest listed item.
Expand Down Expand Up @@ -655,7 +655,7 @@ final public function previousAsTime($time = false)
// Result: FALSE if current did not overflow (reset back to the highest possible value). TRUE if it did.
//

final private function recedeItem($arrItems, $rangeMin, $rangeMax, &$current)
private function recedeItem($arrItems, $rangeMin, $rangeMax, &$current)
{

// Recede pointer
Expand Down Expand Up @@ -692,7 +692,7 @@ final private function recedeItem($arrItems, $rangeMin, $rangeMax, &$current)
// $beforeItem The lowest index that is to be skipped.
//

final private function getLatestItem($arrItems, $beforeItem = false, $allowOverflow = true)
private function getLatestItem($arrItems, $beforeItem = false, $allowOverflow = true)
{

// If no filter is specified, return the latestlisted item.
Expand Down Expand Up @@ -732,7 +732,7 @@ final private function getLatestItem($arrItems, $beforeItem = false, $allowOverf
// Result:
//

final private function getClass($spec)
private function getClass($spec)
{
if (!$this->classIsSpecified($spec)) {
return '0';
Expand All @@ -755,7 +755,7 @@ final private function getClass($spec)
// Result:
//

final private function classIsSpecified($spec)
private function classIsSpecified($spec)
{
if ($spec['elements'][0]['hasInterval'] == false) {
return true;
Expand Down Expand Up @@ -784,12 +784,12 @@ final private function classIsSpecified($spec)
// Result:
//

final private function classIsSingleFixed($spec)
private function classIsSingleFixed($spec)
{
return (count($spec['elements']) == 1) && (!$spec['elements'][0]['hasInterval']);
}

final private function initLang($language = 'en')
private function initLang($language = 'en')
{
switch ($language) {
case 'en':
Expand Down Expand Up @@ -1032,12 +1032,12 @@ final private function initLang($language = 'en')
}
}

final private function natlangPad2($number)
private function natlangPad2($number)
{
return (strlen($number) == 1 ? '0' : '').$number;
}

final private function natlangApply($id, $p1 = false, $p2 = false, $p3 = false, $p4 = false, $p5 = false, $p6 = false)
private function natlangApply($id, $p1 = false, $p2 = false, $p3 = false, $p4 = false, $p5 = false, $p6 = false)
{
$txt = $this->_lang[$id];

Expand Down Expand Up @@ -1073,7 +1073,7 @@ final private function natlangApply($id, $p1 = false, $p2 = false, $p3 = false,
// Result:
//

final private function natlangRange($spec, $entryFunction, $p1 = false)
private function natlangRange($spec, $entryFunction, $p1 = false)
{
$arrIntervals = [];
foreach ($spec['elements'] as $elem) {
Expand All @@ -1094,7 +1094,7 @@ final private function natlangRange($spec, $entryFunction, $p1 = false)
// Description: Converts an entry from the minute specification to natural language.
//

final private function natlangElementMinute($elem)
private function natlangElementMinute($elem)
{
if (!$elem['hasInterval']) {
if ($elem['number1'] == 0) {
Expand All @@ -1118,7 +1118,7 @@ final private function natlangElementMinute($elem)
// Description: Converts an entry from the hour specification to natural language.
//

final private function natlangElementHour($elem, $asBetween)
private function natlangElementHour($elem, $asBetween)
{
if (!$elem['hasInterval']) {
if ($asBetween) {
Expand Down Expand Up @@ -1147,7 +1147,7 @@ final private function natlangElementHour($elem, $asBetween)
// Description: Converts an entry from the day of month specification to natural language.
//

final private function natlangElementDayOfMonth($elem)
private function natlangElementDayOfMonth($elem)
{
if (!$elem['hasInterval']) {
return $this->natlangApply('elemDOM: the_X', $this->natlangApply('ordinal: '.$elem['number1']));
Expand All @@ -1167,7 +1167,7 @@ final private function natlangElementDayOfMonth($elem)
// Description: Converts an entry from the month specification to natural language.
//

final private function natlangElementMonth($elem)
private function natlangElementMonth($elem)
{
if (!$elem['hasInterval']) {
return $this->natlangApply('elemMonth: every_X', $this->natlangApply('month: '.$elem['number1']));
Expand All @@ -1187,7 +1187,7 @@ final private function natlangElementMonth($elem)
// Description: Converts an entry from the year specification to natural language.
//

final private function natlangElementYear($elem)
private function natlangElementYear($elem)
{
if (!$elem['hasInterval']) {
return $elem['number1'];
Expand Down