This repository was archived by the owner on Nov 21, 2019. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 7 files changed +92
-3
lines changed Expand file tree Collapse file tree 7 files changed +92
-3
lines changed Original file line number Diff line number Diff line change 1616    "require" : {
1717        "php" : " ^7.2"  ,
1818        "dealerdirect/phpcodesniffer-composer-installer" : " ^0.4"  ,
19-         "slevomat/coding-standard" : " ^4.6.1 "  ,
19+         "slevomat/coding-standard" : " ^4.8 "  ,
2020        "squizlabs/php_codesniffer" : " ^3.3.2" 
2121    },
2222    "require-dev" : {
Original file line number Diff line number Diff line change 2626            <property  name =" psr12Compatible"   value =" true"  />
2727        </properties >
2828    </rule >
29+     <rule  ref =" SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly"  >
30+         <properties >
31+             <property  name =" allowFallbackGlobalConstants"   value =" false"  />
32+             <property  name =" allowFallbackGlobalFunctions"   value =" false"  />
33+         </properties >
34+     </rule >
2935    <rule  ref =" SlevomatCodingStandard.Namespaces.UnusedUses"  />
3036    <rule  ref =" SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash"  />
37+     <rule  ref =" SlevomatCodingStandard.Namespaces.UseFromSameNamespace"  />
3138    <rule  ref =" SlevomatCodingStandard.Namespaces.UseSpacing"  />
3239    <rule  ref =" SlevomatCodingStandard.TypeHints.DeclareStrictTypes"  >
3340        <properties >
Original file line number Diff line number Diff line change 2121use  function  implode ;
2222use  function  ini_get ;
2323use  function  mb_convert_encoding ;
24+ use  function  mb_detect_encoding ;
2425use  function  preg_match_all ;
2526use  function  preg_replace ;
2627use  function  sort ;
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ No global fallbacks
3+ ---CONTENTS---
4+ <?php
5+ 
6+ declare(strict_types=1);
7+ 
8+ namespace Vendor;
9+ 
10+ date(DATE_ATOM);
11+ 
12+ ---FIXED---
13+ <?php
14+ 
15+ declare(strict_types=1);
16+ 
17+ namespace Vendor;
18+ 
19+ use function date;
20+ use const DATE_ATOM;
21+ 
22+ date(DATE_ATOM);
23+ 
24+ ---
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ Use statements must be used
3+ ---CONTENTS---
4+ <?php
5+ 
6+ declare(strict_types=1);
7+ 
8+ namespace Vendor;
9+ 
10+ new \Foo(\bar(\BAZ));
11+ new \Qux\Quux(\Qux\quuz(\Qux\CORGE));
12+ new \Vendor\Grault(\Vendor\garply(\Vendor\WALDO));
13+ 
14+ ---FIXED---
15+ <?php
16+ 
17+ declare(strict_types=1);
18+ 
19+ namespace Vendor;
20+ 
21+ use Foo;
22+ use Qux\Quux;
23+ use function bar;
24+ use function Qux\quuz;
25+ use const BAZ;
26+ use const Qux\CORGE;
27+ 
28+ new Foo(bar(BAZ));
29+ new Quux(quuz(CORGE));
30+ new Grault(garply(WALDO));
31+ 
32+ ---
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ Use statements must not be from the same namespace
3+ ---CONTENTS---
4+ <?php
5+ 
6+ declare(strict_types=1);
7+ 
8+ namespace Foo;
9+ 
10+ use Foo\Bar;
11+ use function Foo\baz;
12+ use const Foo\QUX;
13+ 
14+ new Bar(baz(QUX));
15+ 
16+ ---FIXED---
17+ <?php
18+ 
19+ declare(strict_types=1);
20+ 
21+ namespace Foo;
22+ 
23+ new Bar(baz(QUX));
24+ 
25+ ---
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ Use declarations must go after the namespace declaration
55
66declare(strict_types=1);
77
8- use Foo;
8+ use Foo\Bar ;
99
1010namespace Vendor;
1111
12- new Foo ();
12+ new Bar ();
1313
1414---MESSAGES---
15155:1 PSR2.Namespaces.UseDeclaration.UseBeforeNamespace
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments