123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- --TEST--
- PHP 7.2 test.
- --RULESET--
- {
- "@Symfony": true,
- "single_import_per_statement": true
- }
- --REQUIREMENTS--
- {"php": 70200}
- --EXPECT--
- <?php
- namespace Foo;
- class C
- {
- public function A($a, object $b): object
- {
- unset($a);
- return $b;
- }
- }
- // Allow abstract function override
- abstract class XA
- {
- abstract public function bar(stdClass $x);
- }
- abstract class XB extends XA
- {
- abstract public function bar($x): stdClass;
- }
- class XC extends XB
- {
- public function bar($x): stdClass
- {
- }
- }
- // Parameter Type Widening
- class ArrayClass
- {
- public function foo(array $foo)
- { /* ... */
- }
- }
- class EverythingClass extends ArrayClass
- {
- public function foo($foo)
- { /* ... */
- }
- }
- --INPUT--
- <?php
- namespace Foo;
- use Bar\{
- A,
- B,
- };
- class C
- {
- public function A($a, object $b): object {
- unset($a);
- return $b;
- }
- }
- // Allow abstract function override
- abstract class XA { abstract function bar(stdClass $x); }
- abstract class XB extends XA { abstract function bar($x): stdClass; }
- class XC extends XB { function bar($x): stdClass{} }
- // Parameter Type Widening
- class ArrayClass {
- public function foo(array $foo) { /* ... */ }
- }
- class EverythingClass extends ArrayClass {
- public function foo($foo) { /* ... */ }
- }
|