Browse Source

Update phpcs rules.

ADmad 7 years ago
parent
commit
bcdea3a571
26 changed files with 31 additions and 33 deletions
  1. 6 8
      phpcs.xml.dist
  2. 1 1
      src/Controller/Component.php
  3. 1 1
      src/Controller/Component/AuthComponent.php
  4. 1 1
      src/Controller/Component/FlashComponent.php
  5. 1 1
      src/Controller/Component/PaginatorComponent.php
  6. 1 1
      src/Controller/Component/RequestHandlerComponent.php
  7. 1 1
      src/Controller/Component/SecurityComponent.php
  8. 1 1
      src/Controller/ComponentRegistry.php
  9. 1 1
      src/Controller/Controller.php
  10. 1 1
      src/Controller/ErrorController.php
  11. 1 1
      src/Controller/Exception/AuthSecurityException.php
  12. 1 1
      src/Controller/Exception/MissingActionException.php
  13. 1 1
      src/Controller/Exception/MissingComponentException.php
  14. 1 1
      src/Controller/Exception/SecurityException.php
  15. 1 1
      tests/PHPStan/AssociationTableMixinClassReflectionExtension.php
  16. 1 1
      tests/PHPStan/TableFindByPropertyMethodReflection.php
  17. 1 1
      tests/TestCase/Controller/Component/AuthComponentTest.php
  18. 1 1
      tests/TestCase/Controller/Component/FlashComponentTest.php
  19. 1 1
      tests/TestCase/Controller/Component/PaginatorComponentTest.php
  20. 1 1
      tests/TestCase/Controller/Component/RequestHandlerComponentTest.php
  21. 1 1
      tests/TestCase/Controller/Component/SecurityComponentTest.php
  22. 1 1
      tests/TestCase/Controller/ComponentRegistryTest.php
  23. 1 1
      tests/TestCase/Controller/ComponentTest.php
  24. 1 1
      tests/TestCase/Controller/ControllerTest.php
  25. 1 1
      tests/TestCase/Controller/Exception/AuthSecurityExceptionTest.php
  26. 1 1
      tests/TestCase/Controller/Exception/SecurityExceptionTest.php

+ 6 - 8
phpcs.xml.dist

@@ -2,10 +2,7 @@
 <ruleset name="CakePHP Core">
     <config name="installed_paths" value="../../cakephp/cakephp-codesniffer,../../slevomat/coding-standard" />
 
-    <rule ref="PSR12" >
-        <!-- This exclude can be removed once phcs 3.3.1 is released -->
-        <exclude name="PSR12.Classes.ClassInstantiation.MissingParenthesis" />
-    </rule>
+    <rule ref="PSR12" />
 
     <rule ref="CakePHP" >
         <exclude name="CakePHP.Formatting.UseInAlphabeticalOrder.UseInAlphabeticalOrder" />
@@ -34,14 +31,15 @@
     <rule ref="SlevomatCodingStandard.Namespaces.UseDoesNotStartWithBackslash" />
     <rule ref="SlevomatCodingStandard.Namespaces.UseFromSameNamespace" />
     <rule ref="SlevomatCodingStandard.PHP.TypeCast" />
-    <!-- Enable after proper type hints have been added to all classes. -->
-    <!-- <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" >
+    <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes" >
         <properties>
+            <property name="newlinesCountAfterDeclare" value="1" />
             <property name="spacesCountAroundEqualsSign" value="0" />
             <property name="newlinesCountBetweenOpenTagAndDeclare" value="1" />
         </properties>
-        <exclude-pattern>*/tests/*</exclude-pattern>
-    </rule> -->
+        <exclude-pattern>*/Templates/*</exclude-pattern>
+        <exclude-pattern>*/tests/Fixture/*</exclude-pattern>
+    </rule>
     <rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints" />
     <rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing" />
     <rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />

+ 1 - 1
src/Controller/Component.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Component/AuthComponent.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Component/FlashComponent.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Component/PaginatorComponent.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Component/RequestHandlerComponent.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Component/SecurityComponent.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/ComponentRegistry.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Controller.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/ErrorController.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Exception/AuthSecurityException.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Exception/MissingActionException.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Exception/MissingComponentException.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
src/Controller/Exception/SecurityException.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/PHPStan/AssociationTableMixinClassReflectionExtension.php

@@ -1,4 +1,4 @@
-<?php declare(strict_types = 1);
+<?php declare(strict_types=1);
 
 namespace Cake\PHPStan;
 

+ 1 - 1
tests/PHPStan/TableFindByPropertyMethodReflection.php

@@ -1,4 +1,4 @@
-<?php declare(strict_types = 1);
+<?php declare(strict_types=1);
 
 namespace Cake\PHPStan;
 

+ 1 - 1
tests/TestCase/Controller/Component/AuthComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Component/FlashComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Component/PaginatorComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Component/RequestHandlerComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Component/SecurityComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/ComponentRegistryTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/ComponentTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) Tests <https://book.cakephp.org/view/1196/Testing>
  * Copyright 2005-2011, Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/ControllerTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Exception/AuthSecurityExceptionTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)

+ 1 - 1
tests/TestCase/Controller/Exception/SecurityExceptionTest.php

@@ -1,5 +1,5 @@
 <?php
-declare(strict_types = 1);
+declare(strict_types=1);
 /**
  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)