Commit 963e2228 authored by Markus Poerschke's avatar Markus Poerschke

Fix code style.

parent 7fad7987
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create();
$finder->in(__DIR__ . '/src');
return Symfony\CS\Config\Config::create()
->fixers(array(
'concat_with_spaces',
'align_equals',
'align_double_arrow',
'unused_use',
))
->finder($finder)
;
......@@ -47,6 +47,7 @@ abstract class Component
* Building the PropertyBag.
*
* @abstract
*
* @return PropertyBag
*/
abstract public function buildPropertyBag();
......@@ -57,7 +58,7 @@ abstract class Component
* If $key is given, the component at $key will be replaced else the component will be append.
*
* @param Component $component The Component that will be added
* @param null $key The key of the Component
* @param null $key The key of the Component
*/
public function addComponent(Component $component, $key = null)
{
......@@ -123,6 +124,7 @@ abstract class Component
/**
* @param $lines
*
* @return array
*/
private function buildComponents(array &$lines)
......@@ -158,7 +160,7 @@ abstract class Component
}
/**
* @param array $lines
* @param array $lines
* @param Component $component
*/
private function addComponentLines(array &$lines, Component $component)
......
......@@ -40,7 +40,7 @@ class Alarm extends Component
public function getType()
{
return "VALARM";
return 'VALARM';
}
public function getAction()
......
......@@ -55,11 +55,11 @@ class Calendar extends Component
*
* @var string
*/
protected $prodId = null;
protected $method = null;
protected $name = null;
protected $prodId = null;
protected $method = null;
protected $name = null;
protected $description = null;
protected $timezone = null;
protected $timezone = null;
/**
* This property defines the calendar scale used for the
......@@ -77,7 +77,7 @@ class Calendar extends Component
/**
* Specifies whether or not the iCalendar file only contains one appointment.
*
* @var boolean
* @var bool
*
* @see http://msdn.microsoft.com/en-us/library/ee203486(v=exchg.80).aspx
*/
......@@ -201,7 +201,7 @@ class Calendar extends Component
}
/**
* @param boolean $forceInspectOrOpen
* @param bool $forceInspectOrOpen
*
* @return $this
*/
......
......@@ -67,7 +67,7 @@ class Event extends Component
protected $duration;
/**
* @var boolean
* @var bool
*/
protected $noTime = false;
......@@ -189,19 +189,19 @@ class Event extends Component
protected $categories;
/**
* https://tools.ietf.org/html/rfc5545#section-3.8.1.3
* https://tools.ietf.org/html/rfc5545#section-3.8.1.3.
*
* @var bool
*/
protected $isPrivate = false;
/**
* Dates to be excluded from a series of events
* Dates to be excluded from a series of events.
*
* @var \DateTime[]
*/
protected $exDates = array();
/**
* @var RecurrenceId
*/
......@@ -294,7 +294,7 @@ class Event extends Component
'X-ALT-DESC',
$this->descriptionHTML,
array(
'FMTTYPE' => 'text/html',
'FMTTYPE' => 'text/html',
)
)
);
......@@ -303,12 +303,12 @@ class Event extends Component
if (null != $this->recurrenceRule) {
$propertyBag->set('RRULE', $this->recurrenceRule);
}
if (null != $this->recurrenceId) {
$this->recurrenceId->applyTimeSettings($this->noTime, $this->useTimezone, $this->useUtc);
$propertyBag->add($this->recurrenceId);
}
if (!empty($this->exDates)) {
$propertyBag->add(new DateTimesProperty('EXDATE', $this->exDates, $this->noTime, $this->useTimezone, $this->useUtc));
}
......@@ -442,6 +442,7 @@ class Event extends Component
/**
* @param Organizer $organizer
*
* @return $this
*/
public function setOrganizer(Organizer $organizer)
......@@ -715,9 +716,10 @@ class Event extends Component
}
/**
* Sets the event privacy
* Sets the event privacy.
*
* @param bool $flag
*
* @return $this
*/
public function setIsPrivate($flag)
......@@ -729,14 +731,16 @@ class Event extends Component
/**
* @param \DateTime $dateTime
*
* @return \Eluceo\iCal\Component\Event
*/
public function addExDate(\DateTime $dateTime)
{
$this->exDates[] = $dateTime;
return $this;
}
/**
* @return \DateTime[]
*/
......@@ -747,11 +751,13 @@ class Event extends Component
/**
* @param \DateTime[]
*
* @return \Eluceo\iCal\Component\Event
*/
public function setExDates(Array $exDates)
public function setExDates(array $exDates)
{
$this->exDates = $exDates;
return $this;
}
......@@ -765,12 +771,13 @@ class Event extends Component
/**
* @param RecurrenceId $recurrenceId
*
* @return \Eluceo\iCal\Component\Event
*/
public function setRecurrenceId(RecurrenceId $recurrenceId)
{
$this->recurrenceId = $recurrenceId;
return $this;
}
}
......@@ -210,6 +210,6 @@ class TimezoneRule extends Component
return $this->dtStart->format('Ymd\THis');
}
return null;
return;
}
}
......@@ -52,7 +52,7 @@ class Property
$this->setValue($value);
$this->parameterBag = new ParameterBag($params);
}
/**
* Renders an unfolded line.
*
......@@ -121,7 +121,7 @@ class Property
$this->value = new ArrayValue($value);
} else {
if (!$value instanceof ValueInterface) {
throw new \Exception("The value must implement the ValueInterface.");
throw new \Exception('The value must implement the ValueInterface.');
} else {
$this->value = $value;
}
......
......@@ -22,7 +22,7 @@ class DateTimeProperty extends Property
$useUtc = false
) {
$dateString = DateUtil::getDateString($dateTime, $noTime, $useTimezone, $useUtc);
$params = DateUtil::getDefaultParams($dateTime, $noTime, $useTimezone);
$params = DateUtil::getDefaultParams($dateTime, $noTime, $useTimezone);
parent::__construct($name, $dateString, $params);
}
......
......@@ -9,7 +9,7 @@ class Attendees extends Property
/** @var Property[] */
protected $attendees = array();
const PROPERTY_NAME = "ATTENDEES";
const PROPERTY_NAME = 'ATTENDEES';
public function __construct()
{
......@@ -50,7 +50,7 @@ class Attendees extends Property
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function toLines()
{
......@@ -84,7 +84,7 @@ class Attendees extends Property
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getName()
{
......
......@@ -7,9 +7,7 @@ use Eluceo\iCal\Util\PropertyValueUtil;
/**
* Class Description
* Alows new line charectars to be in the description
*
* @package Eluceo\iCal\Property
* Alows new line charectars to be in the description.
*/
class Description implements ValueInterface
{
......
<?php
namespace Eluceo\iCal\Property\Event;
use Eluceo\iCal\Property;
/**
* Class Organizer
* @package Eluceo\iCal\Property\Event
* Class Organizer.
*/
class Organizer extends Property
{
......@@ -13,7 +13,7 @@ class Organizer extends Property
/**
* @param string $value
* @param array $params
* @param array $params
*/
public function __construct($value, $params = array())
{
......@@ -21,7 +21,7 @@ class Organizer extends Property
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getName()
{
......
......@@ -20,7 +20,7 @@ class RecurrenceId extends Property
* The effective range of recurrence instances from the instance
* specified by the recurrence identifier specified by the property.
*/
const RANGE_THISANDPRIOR = 'THISANDPRIOR';
const RANGE_THISANDPRIOR = 'THISANDPRIOR';
const RANGE_THISANDFUTURE = 'THISANDFUTURE';
/**
......@@ -112,7 +112,7 @@ class RecurrenceId extends Property
}
/**
* @inheritdoc
* {@inheritdoc}
*/
public function getName()
{
......
......@@ -3,7 +3,6 @@
namespace Eluceo\iCal\Property\Event;
use Eluceo\iCal\Property\ValueInterface;
use Eluceo\iCal\Property\DateTimeProperty;
use Eluceo\iCal\ParameterBag;
use InvalidArgumentException;
......@@ -19,13 +18,13 @@ class RecurrenceRule implements ValueInterface
const FREQ_WEEKLY = 'WEEKLY';
const FREQ_DAILY = 'DAILY';
const WEEKDAY_SUNDAY = "SU";
const WEEKDAY_MONDAY = "MO";
const WEEKDAY_TUESDAY = "TU";
const WEEKDAY_WEDNESDAY = "WE";
const WEEKDAY_THURSDAY = "TH";
const WEEKDAY_FRIDAY = "FR";
const WEEKDAY_SATURDAY = "SA";
const WEEKDAY_SUNDAY = 'SU';
const WEEKDAY_MONDAY = 'MO';
const WEEKDAY_TUESDAY = 'TU';
const WEEKDAY_WEDNESDAY = 'WE';
const WEEKDAY_THURSDAY = 'TH';
const WEEKDAY_FRIDAY = 'FR';
const WEEKDAY_SATURDAY = 'SA';
/**
* The frequency of an Event.
......@@ -289,7 +288,7 @@ class RecurrenceRule implements ValueInterface
* The BYMONTH rule part specifies a COMMA-separated list of months of the year.
* Valid values are 1 to 12.
*
* @param integer $month
* @param int $month
*
* @throws InvalidArgumentException
*
......@@ -310,7 +309,7 @@ class RecurrenceRule implements ValueInterface
* The BYWEEKNO rule part specifies a COMMA-separated list of ordinals specifying weeks of the year.
* Valid values are 1 to 53 or -53 to -1.
*
* @param integer $value
* @param int $value
*
* @return $this
*/
......@@ -325,7 +324,7 @@ class RecurrenceRule implements ValueInterface
* The BYYEARDAY rule part specifies a COMMA-separated list of days of the year.
* Valid values are 1 to 366 or -366 to -1.
*
* @param integer $day
* @param int $day
*
* @return $this
*/
......@@ -340,7 +339,7 @@ class RecurrenceRule implements ValueInterface
* The BYMONTHDAY rule part specifies a COMMA-separated list of days of the month.
* Valid values are 1 to 31 or -31 to -1.
*
* @param integer $day
* @param int $day
*
* @return $this
*/
......@@ -375,7 +374,7 @@ class RecurrenceRule implements ValueInterface
* The BYHOUR rule part specifies a COMMA-separated list of hours of the day.
* Valid values are 0 to 23.
*
* @param integer $value
* @param int $value
*
* @return $this
*
......@@ -396,7 +395,7 @@ class RecurrenceRule implements ValueInterface
* The BYMINUTE rule part specifies a COMMA-separated list of minutes within an hour.
* Valid values are 0 to 59.
*
* @param integer $value
* @param int $value
*
* @return $this
*
......@@ -417,7 +416,7 @@ class RecurrenceRule implements ValueInterface
* The BYSECOND rule part specifies a COMMA-separated list of seconds within a minute.
* Valid values are 0 to 60.
*
* @param integer $value
* @param int $value
*
* @return $this
*
......
......@@ -11,7 +11,6 @@
namespace Eluceo\iCal;
class PropertyBag implements \IteratorAggregate
{
/**
......
......@@ -4,7 +4,6 @@ namespace Eluceo\iCal\Util;
class ComponentUtil
{
/**
* Folds a single line.
*
......
......@@ -9,7 +9,7 @@ class DateUtil
$params = array();
if ($useTimezone) {
$timeZone = $dateTime->getTimezone()->getName();
$timeZone = $dateTime->getTimezone()->getName();
$params['TZID'] = $timeZone;
}
......
......@@ -18,14 +18,13 @@ class PropertyValueUtil
$value = str_replace('"', '\\"', $value);
$value = str_replace(',', '\\,', $value);
$value = str_replace(';', '\\;', $value);
$value = str_replace(
array(
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", /* \n*/ "\x0B", "\x0C", "\x0D", "\x0E", "\x0F",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F",
"\x7F"), '', $value
);
$value = str_replace(array(
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
"\x08", "\x09", /* \n*/ "\x0B", "\x0C", "\x0D", "\x0E", "\x0F",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1A", "\x1B", "\x1C", "\x1D", "\x1E", "\x1F",
"\x7F",
), '', $value);
return $value;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment