From 4000d5e869e9bb4d31ac109f14e1aee4f8d1ed02 Mon Sep 17 00:00:00 2001 From: Jonathan Goode Date: Tue, 1 Aug 2017 18:36:10 +0100 Subject: [PATCH] Improve wording Indentation Spacing --- .github/CONTRIBUTING.md | 6 +++--- src/ICal/ICal.php | 30 +++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index aacfccc..b227ef6 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -6,10 +6,10 @@ We appreciate pull requests, here are our guidelines: 1. Firstly, check if your issue is present within the latest version (`dev-master`) as the problem may already have been fixed. 1. Log a bug in our [issue tracker](https://github.com/u01jmg3/ics-parser/issues) (if there isn't one already). - If your patch is going to be large it might be a good idea to get the discussion started early. - - We are happy to discuss it in a new issue beforehand. + - We are happy to discuss it in an issue beforehand. - If you could provide an iCal snippet causing the parser to behave incorrectly it is extremely useful for debugging - - Please remove any irrelevant events -1. Please follow the coding standard already present in the file you're editing _before_ committing + - Please remove all irrelevant events +1. Please follow the coding standard already present in the file you are editing _before_ committing - Adhere to the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard - Use *4 spaces* instead of tabs for indentation - Trim all trailing whitespace and blank lines diff --git a/src/ICal/ICal.php b/src/ICal/ICal.php index 904b6d1..17f1673 100644 --- a/src/ICal/ICal.php +++ b/src/ICal/ICal.php @@ -326,7 +326,7 @@ protected function initLines(array $lines) $this->todoCount++; } $component = 'VTODO'; - break; + break; // http://www.kanzaki.com/docs/ical/vevent.html case 'BEGIN:VEVENT': @@ -334,7 +334,7 @@ protected function initLines(array $lines) $this->eventCount++; } $component = 'VEVENT'; - break; + break; // http://www.kanzaki.com/docs/ical/vfreebusy.html case 'BEGIN:VFREEBUSY': @@ -342,7 +342,7 @@ protected function initLines(array $lines) $this->freeBusyIndex++; } $component = 'VFREEBUSY'; - break; + break; case 'BEGIN:DAYLIGHT': case 'BEGIN:STANDARD': @@ -350,7 +350,7 @@ protected function initLines(array $lines) case 'BEGIN:VCALENDAR': case 'BEGIN:VTIMEZONE': $component = $value; - break; + break; case 'END:DAYLIGHT': case 'END:STANDARD': @@ -361,11 +361,11 @@ protected function initLines(array $lines) case 'END:VTIMEZONE': case 'END:VTODO': $component = 'VCALENDAR'; - break; + break; default: $this->addCalendarComponentWithKeyAndValue($component, $keyword, $value); - break; + break; } } } @@ -413,7 +413,7 @@ protected function addCalendarComponentWithKeyAndValue($component, $keyword, $va switch ($component) { case 'VTODO': $this->cal[$component][$this->todoCount - 1][$keyword] = $value; - break; + break; case 'VEVENT': if (!isset($this->cal[$component][$this->eventCount - 1][$keyword . '_array'])) { @@ -449,7 +449,7 @@ protected function addCalendarComponentWithKeyAndValue($component, $keyword, $va $this->cal[$component][$this->eventCount - 1][$keyword] .= ',' . $value; } } - break; + break; case 'VFREEBUSY': if ($keyword === 'FREEBUSY') { @@ -467,11 +467,11 @@ protected function addCalendarComponentWithKeyAndValue($component, $keyword, $va } else { $this->cal[$component][$this->freeBusyIndex - 1][$keyword][] = $value; } - break; + break; default: $this->cal[$component][$keyword] = $value; - break; + break; } $this->lastKeyword = $keyword; @@ -958,7 +958,7 @@ protected function processRecurrences() $allRecurrenceEvents = array_merge($allRecurrenceEvents, $recurrenceEvents); $recurrenceEvents = array(); // Reset - break; + break; case 'WEEKLY': // Create offset @@ -1062,7 +1062,7 @@ protected function processRecurrences() $allRecurrenceEvents = array_merge($allRecurrenceEvents, $recurrenceEvents); $recurrenceEvents = array(); // Reset - break; + break; case 'MONTHLY': // Create offset @@ -1272,7 +1272,7 @@ protected function processRecurrences() $allRecurrenceEvents = array_merge($allRecurrenceEvents, $recurrenceEvents); $recurrenceEvents = array(); // Reset - break; + break; case 'YEARLY': // Create offset @@ -1459,7 +1459,7 @@ protected function processRecurrences() $allRecurrenceEvents = array_merge($allRecurrenceEvents, $recurrenceEvents); $recurrenceEvents = array(); // Reset - break; + break; } } } @@ -1860,7 +1860,7 @@ protected function convertDayOrdinalToPositive($dayNumber, $weekday, $timestamp) $timestamp = (is_object($timestamp)) ? $timestamp : \DateTime::createFromFormat(self::UNIX_FORMAT, $timestamp); $start = strtotime('first day of ' . $timestamp->format(self::DATE_TIME_FORMAT_PRETTY)); - $end = strtotime('last day of ' . $timestamp->format(self::DATE_TIME_FORMAT_PRETTY)); + $end = strtotime('last day of ' . $timestamp->format(self::DATE_TIME_FORMAT_PRETTY)); // Used with pow(2, X) so pow(2, 4) is THURSDAY $weekdays = array_flip(array_keys($this->weekdays));