Skip to content

Commit

Permalink
Fix phpstan level 0
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDiver1975 committed Oct 21, 2018
1 parent 4eb3d2d commit 9fed1c4
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 16 deletions.
11 changes: 7 additions & 4 deletions lib/Document.php
Expand Up @@ -95,13 +95,16 @@ abstract class Document extends Component
public function __construct()
{
$args = func_get_args();
$name = static::$defaultName;
if (0 === count($args) || is_array($args[0])) {
array_unshift($args, $this, static::$defaultName);
call_user_func_array(['parent', '__construct'], $args);
$children = isset($args[0]) ? $args[0] : [];
$defaults = isset($args[1]) ? $args[1] : true;
} else {
array_unshift($args, $this);
call_user_func_array(['parent', '__construct'], $args);
$name = $args[0];
$children = isset($args[1]) ? $args[1] : [];
$defaults = isset($args[2]) ? $args[2] : true;
}
parent::__construct($this, $name, $children, $defaults);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion lib/Parser/Json.php
Expand Up @@ -4,6 +4,7 @@

use Sabre\VObject\Component\VCalendar;
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Document;
use Sabre\VObject\EofException;
use Sabre\VObject\ParseException;

Expand Down Expand Up @@ -43,7 +44,7 @@ class Json extends Parser
* @param resource|string|array|null $input
* @param int $options
*
* @return Sabre\VObject\Document
* @return \Sabre\VObject\Document
*/
public function parse($input = null, $options = 0)
{
Expand Down
3 changes: 2 additions & 1 deletion lib/Parser/MimeDir.php
Expand Up @@ -7,6 +7,7 @@
use Sabre\VObject\Component\VCard;
use Sabre\VObject\Document;
use Sabre\VObject\EofException;
use Sabre\VObject\Node;
use Sabre\VObject\ParseException;

/**
Expand Down Expand Up @@ -72,7 +73,7 @@ class MimeDir extends Parser
* @param string|resource|null $input
* @param int $options
*
* @return Sabre\VObject\Document
* @return \Sabre\VObject\Document
*/
public function parse($input = null, $options = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Parser/XML.php
Expand Up @@ -40,7 +40,7 @@ class XML extends Parser
/**
* Document, root component.
*
* @var Sabre\VObject\Document
* @var \Sabre\VObject\Document
*/
protected $root;

Expand Down Expand Up @@ -69,7 +69,7 @@ public function __construct($input = null, $options = 0)
*
* @throws \Exception
*
* @return Sabre\VObject\Document
* @return \Sabre\VObject\Document
*/
public function parse($input = null, $options = 0)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Property/ICalendar/DateTime.php
Expand Up @@ -131,7 +131,7 @@ public function isFloating()
*
* @param DateTimeZone $timeZone
*
* @return DateTimeImmutable
* @return \DateTimeImmutable
*/
public function getDateTime(DateTimeZone $timeZone = null)
{
Expand All @@ -152,7 +152,7 @@ public function getDateTime(DateTimeZone $timeZone = null)
*
* @param DateTimeZone $timeZone
*
* @return DateTimeImmutable[]
* @return \DateTimeImmutable[]
* @return \DateTime[]
*/
public function getDateTimes(DateTimeZone $timeZone = null)
Expand Down
2 changes: 1 addition & 1 deletion lib/Splitter/ICalendar.php
Expand Up @@ -83,7 +83,7 @@ public function __construct($input, $options = 0)
*
* When the end is reached, null will be returned.
*
* @return Sabre\VObject\Component|null
* @return \Sabre\VObject\Component|null
*/
public function getNext()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Splitter/SplitterInterface.php
Expand Up @@ -32,7 +32,7 @@ public function __construct($input);
*
* When the end is reached, null will be returned.
*
* @return Sabre\VObject\Component|null
* @return \Sabre\VObject\Component|null
*/
public function getNext();
}
2 changes: 1 addition & 1 deletion lib/Splitter/VCard.php
Expand Up @@ -55,7 +55,7 @@ public function __construct($input, $options = 0)
*
* When the end is reached, null will be returned.
*
* @return Sabre\VObject\Component|null
* @return \Sabre\VObject\Component|null
*/
public function getNext()
{
Expand Down
2 changes: 1 addition & 1 deletion lib/TimeZoneUtil.php
Expand Up @@ -120,7 +120,7 @@ class TimeZoneUtil
* @param string $tzid
* @param Sabre\VObject\Component $vcalendar
*
* @return DateTimeZone
* @return \DateTimeZone
*/
public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false)
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Writer.php
Expand Up @@ -58,10 +58,10 @@ public static function writeXml(Component $component)

if ($component instanceof Component\VCalendar) {
$writer->startElement('icalendar');
$writer->writeAttribute('xmlns', Parser\Xml::XCAL_NAMESPACE);
$writer->writeAttribute('xmlns', Parser\XML::XCAL_NAMESPACE);
} else {
$writer->startElement('vcards');
$writer->writeAttribute('xmlns', Parser\Xml::XCARD_NAMESPACE);
$writer->writeAttribute('xmlns', Parser\XML::XCARD_NAMESPACE);
}

$component->xmlSerialize($writer);
Expand Down

0 comments on commit 9fed1c4

Please sign in to comment.