Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite22671f

Browse files
Remove some unneeded checks/tests
1 parent2fb303b commite22671f

File tree

7 files changed

+0
-72
lines changed

7 files changed

+0
-72
lines changed

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/BaseDateTimeTransformer.php‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
useSymfony\Component\Form\DataTransformerInterface;
1515
useSymfony\Component\Form\Exception\InvalidArgumentException;
16-
useSymfony\Component\Form\Exception\UnexpectedTypeException;
1716

1817
abstractclass BaseDateTimeTransformerimplements DataTransformerInterface
1918
{
@@ -33,19 +32,10 @@ abstract class BaseDateTimeTransformer implements DataTransformerInterface
3332
* @param string $inputTimezone The name of the input timezone
3433
* @param string $outputTimezone The name of the output timezone
3534
*
36-
* @throws UnexpectedTypeException if a timezone is not a string
3735
* @throws InvalidArgumentException if a timezone is not valid
3836
*/
3937
publicfunction__construct(string$inputTimezone =null,string$outputTimezone =null)
4038
{
41-
if (null !==$inputTimezone && !is_string($inputTimezone)) {
42-
thrownewUnexpectedTypeException($inputTimezone,'string');
43-
}
44-
45-
if (null !==$outputTimezone && !is_string($outputTimezone)) {
46-
thrownewUnexpectedTypeException($outputTimezone,'string');
47-
}
48-
4939
$this->inputTimezone =$inputTimezone ?:date_default_timezone_get();
5040
$this->outputTimezone =$outputTimezone ?:date_default_timezone_get();
5141

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Form\Extension\Core\DataTransformer;
1313

1414
useSymfony\Component\Form\Exception\TransformationFailedException;
15-
useSymfony\Component\Form\Exception\UnexpectedTypeException;
1615

1716
/**
1817
* Transforms between a normalized time and a localized time string/array.
@@ -31,8 +30,6 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer
3130
* @param string $outputTimezone The output timezone
3231
* @param array $fields The date fields
3332
* @param bool $pad Whether to use padding
34-
*
35-
* @throws UnexpectedTypeException if a timezone is not a string
3633
*/
3734
publicfunction__construct(string$inputTimezone =null,string$outputTimezone =null,array$fields =null,bool$pad =false)
3835
{

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespaceSymfony\Component\Form\Extension\Core\DataTransformer;
1313

1414
useSymfony\Component\Form\Exception\TransformationFailedException;
15-
useSymfony\Component\Form\Exception\UnexpectedTypeException;
1615

1716
/**
1817
* Transforms between a date string and a DateTime object.
@@ -48,8 +47,6 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer
4847
* @param string $inputTimezone The name of the input timezone
4948
* @param string $outputTimezone The name of the output timezone
5049
* @param string $format The date format
51-
*
52-
* @throws UnexpectedTypeException if a timezone is not a string
5350
*/
5451
publicfunction__construct(string$inputTimezone =null,string$outputTimezone =null,string$format ='Y-m-d H:i:s')
5552
{

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformerTest.php‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -306,22 +306,6 @@ public function testReverseTransformWrapsIntlErrors()
306306
$transformer->reverseTransform('12345');
307307
}
308308

309-
/**
310-
* @expectedException \TypeError
311-
*/
312-
publicfunctiontestValidateDateFormatOption()
313-
{
314-
newDateTimeToLocalizedStringTransformer(null,null,'foobar');
315-
}
316-
317-
/**
318-
* @expectedException \TypeError
319-
*/
320-
publicfunctiontestValidateTimeFormatOption()
321-
{
322-
newDateTimeToLocalizedStringTransformer(null,null,null,'foobar');
323-
}
324-
325309
/**
326310
* @expectedException \Symfony\Component\Form\Exception\TransformationFailedException
327311
*/

‎src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -634,24 +634,4 @@ public function setFoo($foo)
634634

635635
return$obj;
636636
}
637-
638-
/**
639-
* @expectedException \TypeError
640-
*/
641-
publicfunctiontestThrowTypeErrorInsideSetterCall()
642-
{
643-
$object =newTestClassTypeErrorInsideCall();
644-
645-
$this->propertyAccessor->setValue($object,'property','foo');
646-
}
647-
648-
/**
649-
* @expectedException \TypeError
650-
*/
651-
publicfunctiontestDoNotDiscardReturnTypeError()
652-
{
653-
$object =newReturnTyped();
654-
655-
$this->propertyAccessor->setValue($object,'foos',array(new \DateTime()));
656-
}
657637
}

‎src/Symfony/Component/Security/Core/Tests/Authentication/Token/RememberMeTokenTest.php‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ public function testConstructor()
2929
$this->assertTrue($token->isAuthenticated());
3030
}
3131

32-
/**
33-
* @expectedException \TypeError
34-
*/
35-
publicfunctiontestConstructorSecretCannotBeNull()
36-
{
37-
newRememberMeToken(
38-
$this->getUser(),
39-
null,
40-
null
41-
);
42-
}
43-
4432
/**
4533
* @expectedException \InvalidArgumentException
4634
*/

‎src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,6 @@ public function testStartTime()
154154
$this->assertEquals(0,$event->getStartTime(),null,self::DELTA);
155155
}
156156

157-
/**
158-
* @expectedException \TypeError
159-
*/
160-
publicfunctiontestInvalidOriginThrowsAnException()
161-
{
162-
newStopwatchEvent('abc');
163-
}
164-
165157
publicfunctiontestHumanRepresentation()
166158
{
167159
$event =newStopwatchEvent(microtime(true) *1000);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp