Skip to content

Commit 9fed1c4

Browse files
committed
Fix phpstan level 0
1 parent 4eb3d2d commit 9fed1c4

File tree

10 files changed

+21
-16
lines changed

10 files changed

+21
-16
lines changed

lib/Document.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,16 @@ abstract class Document extends Component
9595
public function __construct()
9696
{
9797
$args = func_get_args();
98+
$name = static::$defaultName;
9899
if (0 === count($args) || is_array($args[0])) {
99-
array_unshift($args, $this, static::$defaultName);
100-
call_user_func_array(['parent', '__construct'], $args);
100+
$children = isset($args[0]) ? $args[0] : [];
101+
$defaults = isset($args[1]) ? $args[1] : true;
101102
} else {
102-
array_unshift($args, $this);
103-
call_user_func_array(['parent', '__construct'], $args);
103+
$name = $args[0];
104+
$children = isset($args[1]) ? $args[1] : [];
105+
$defaults = isset($args[2]) ? $args[2] : true;
104106
}
107+
parent::__construct($this, $name, $children, $defaults);
105108
}
106109

107110
/**

lib/Parser/Json.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Sabre\VObject\Component\VCalendar;
66
use Sabre\VObject\Component\VCard;
7+
use Sabre\VObject\Document;
78
use Sabre\VObject\EofException;
89
use Sabre\VObject\ParseException;
910

@@ -43,7 +44,7 @@ class Json extends Parser
4344
* @param resource|string|array|null $input
4445
* @param int $options
4546
*
46-
* @return Sabre\VObject\Document
47+
* @return \Sabre\VObject\Document
4748
*/
4849
public function parse($input = null, $options = 0)
4950
{

lib/Parser/MimeDir.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Sabre\VObject\Component\VCard;
88
use Sabre\VObject\Document;
99
use Sabre\VObject\EofException;
10+
use Sabre\VObject\Node;
1011
use Sabre\VObject\ParseException;
1112

1213
/**
@@ -72,7 +73,7 @@ class MimeDir extends Parser
7273
* @param string|resource|null $input
7374
* @param int $options
7475
*
75-
* @return Sabre\VObject\Document
76+
* @return \Sabre\VObject\Document
7677
*/
7778
public function parse($input = null, $options = 0)
7879
{

lib/Parser/XML.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class XML extends Parser
4040
/**
4141
* Document, root component.
4242
*
43-
* @var Sabre\VObject\Document
43+
* @var \Sabre\VObject\Document
4444
*/
4545
protected $root;
4646

@@ -69,7 +69,7 @@ public function __construct($input = null, $options = 0)
6969
*
7070
* @throws \Exception
7171
*
72-
* @return Sabre\VObject\Document
72+
* @return \Sabre\VObject\Document
7373
*/
7474
public function parse($input = null, $options = 0)
7575
{

lib/Property/ICalendar/DateTime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function isFloating()
131131
*
132132
* @param DateTimeZone $timeZone
133133
*
134-
* @return DateTimeImmutable
134+
* @return \DateTimeImmutable
135135
*/
136136
public function getDateTime(DateTimeZone $timeZone = null)
137137
{
@@ -152,7 +152,7 @@ public function getDateTime(DateTimeZone $timeZone = null)
152152
*
153153
* @param DateTimeZone $timeZone
154154
*
155-
* @return DateTimeImmutable[]
155+
* @return \DateTimeImmutable[]
156156
* @return \DateTime[]
157157
*/
158158
public function getDateTimes(DateTimeZone $timeZone = null)

lib/Splitter/ICalendar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public function __construct($input, $options = 0)
8383
*
8484
* When the end is reached, null will be returned.
8585
*
86-
* @return Sabre\VObject\Component|null
86+
* @return \Sabre\VObject\Component|null
8787
*/
8888
public function getNext()
8989
{

lib/Splitter/SplitterInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function __construct($input);
3232
*
3333
* When the end is reached, null will be returned.
3434
*
35-
* @return Sabre\VObject\Component|null
35+
* @return \Sabre\VObject\Component|null
3636
*/
3737
public function getNext();
3838
}

lib/Splitter/VCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct($input, $options = 0)
5555
*
5656
* When the end is reached, null will be returned.
5757
*
58-
* @return Sabre\VObject\Component|null
58+
* @return \Sabre\VObject\Component|null
5959
*/
6060
public function getNext()
6161
{

lib/TimeZoneUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class TimeZoneUtil
120120
* @param string $tzid
121121
* @param Sabre\VObject\Component $vcalendar
122122
*
123-
* @return DateTimeZone
123+
* @return \DateTimeZone
124124
*/
125125
public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false)
126126
{

lib/Writer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ public static function writeXml(Component $component)
5858

5959
if ($component instanceof Component\VCalendar) {
6060
$writer->startElement('icalendar');
61-
$writer->writeAttribute('xmlns', Parser\Xml::XCAL_NAMESPACE);
61+
$writer->writeAttribute('xmlns', Parser\XML::XCAL_NAMESPACE);
6262
} else {
6363
$writer->startElement('vcards');
64-
$writer->writeAttribute('xmlns', Parser\Xml::XCARD_NAMESPACE);
64+
$writer->writeAttribute('xmlns', Parser\XML::XCARD_NAMESPACE);
6565
}
6666

6767
$component->xmlSerialize($writer);

0 commit comments

Comments
 (0)