Browse Source

Fix PHPCS errors.

Mark Story 7 years ago
parent
commit
2ad89459d3

+ 22 - 22
src/Http/Middleware/SecurityHeadersMiddleware.php

@@ -25,70 +25,70 @@ use Psr\Http\Message\ServerRequestInterface;
 class SecurityHeadersMiddleware
 {
     /** @var string X-Content-Type-Option nosniff */
-    const NOSNIFF = 'nosniff';
+    public const NOSNIFF = 'nosniff';
 
     /** @var string X-Download-Option noopen */
-    const NOOPEN = 'noopen';
+    public const NOOPEN = 'noopen';
 
     /** @var string Referrer-Policy no-referrer */
-    const NO_REFERRER = 'no-referrer';
+    public const NO_REFERRER = 'no-referrer';
 
     /** @var string Referrer-Policy no-referrer-when-downgrade */
-    const NO_REFERRER_WHEN_DOWNGRADE = 'no-referrer-when-downgrade';
+    public const NO_REFERRER_WHEN_DOWNGRADE = 'no-referrer-when-downgrade';
 
     /** @var string Referrer-Policy origin */
-    const ORIGIN = 'origin';
+    public const ORIGIN = 'origin';
 
     /** @var string Referrer-Policy origin-when-cross-origin */
-    const ORIGIN_WHEN_CROSS_ORIGIN = 'origin-when-cross-origin';
+    public const ORIGIN_WHEN_CROSS_ORIGIN = 'origin-when-cross-origin';
 
     /** @var string Referrer-Policy same-origin */
-    const SAME_ORIGIN = 'same-origin';
+    public const SAME_ORIGIN = 'same-origin';
 
     /** @var string Referrer-Policy strict-origin */
-    const STRICT_ORIGIN = 'strict-origin';
+    public const STRICT_ORIGIN = 'strict-origin';
 
     /** @var string Referrer-Policy strict-origin-when-cross-origin */
-    const STRICT_ORIGIN_WHEN_CROSS_ORIGIN = 'strict-origin-when-cross-origin';
+    public const STRICT_ORIGIN_WHEN_CROSS_ORIGIN = 'strict-origin-when-cross-origin';
 
     /** @var string Referrer-Policy unsafe-url */
-    const UNSAFE_URL = 'unsafe-url';
+    public const UNSAFE_URL = 'unsafe-url';
 
     /** @var string X-Frame-Option deny */
-    const DENY = 'deny';
+    public const DENY = 'deny';
 
     /** @var string X-Frame-Option sameorigin */
-    const SAMEORIGIN = 'sameorigin';
+    public const SAMEORIGIN = 'sameorigin';
 
     /** @var string X-Frame-Option allow-from */
-    const ALLOW_FROM = 'allow-from';
+    public const ALLOW_FROM = 'allow-from';
 
     /** @var string X-XSS-Protection block, sets enabled with block */
-    const XSS_BLOCK = 'block';
+    public const XSS_BLOCK = 'block';
 
     /** @var string X-XSS-Protection enabled with block */
-    const XSS_ENABLED_BLOCK = '1; mode=block';
+    public const XSS_ENABLED_BLOCK = '1; mode=block';
 
     /** @var string X-XSS-Protection enabled */
-    const XSS_ENABLED = '1';
+    public const XSS_ENABLED = '1';
 
     /** @var string X-XSS-Protection disabled */
-    const XSS_DISABLED = '0';
+    public const XSS_DISABLED = '0';
 
     /** @var string X-Permitted-Cross-Domain-Policy all */
-    const ALL = 'all';
+    public const ALL = 'all';
 
     /** @var string X-Permitted-Cross-Domain-Policy none */
-    const NONE = 'none';
+    public const NONE = 'none';
 
     /** @var string X-Permitted-Cross-Domain-Policy master-only */
-    const MASTER_ONLY = 'master-only';
+    public const MASTER_ONLY = 'master-only';
 
     /** @var string X-Permitted-Cross-Domain-Policy by-content-type */
-    const BY_CONTENT_TYPE = 'by-content-type';
+    public const BY_CONTENT_TYPE = 'by-content-type';
 
     /** @var string X-Permitted-Cross-Domain-Policy by-ftp-filename */
-    const BY_FTP_FILENAME = 'by-ftp-filename';
+    public const BY_FTP_FILENAME = 'by-ftp-filename';
 
     /**
      * Security related headers to set

+ 2 - 2
src/ORM/Table.php

@@ -151,14 +151,14 @@ class Table implements RepositoryInterface, EventListenerInterface, EventDispatc
      *
      * @var string
      */
-    const RULES_CLASS = RulesChecker::class;
+    public const RULES_CLASS = RulesChecker::class;
 
     /**
      * The IsUnique class name that is used.
      *
      * @var string
      */
-    const IS_UNIQUE_CLASS = IsUnique::class;
+    public const IS_UNIQUE_CLASS = IsUnique::class;
 
     /**
      * Name of the table as it can be found in the database

+ 2 - 3
tests/TestCase/Collection/CollectionTest.php

@@ -21,7 +21,6 @@ use Cake\Collection\Collection;
 use Cake\Collection\CollectionInterface;
 use Cake\Collection\CollectionTrait;
 use Cake\ORM\Entity;
-use Cake\ORM\ResultSet;
 use Cake\TestSuite\TestCase;
 use NoRewindIterator;
 
@@ -715,7 +714,7 @@ class CollectionTest extends TestCase
             new Entity(['id' => 2, 'count' => 9]),
             new Entity(['id' => 3, 'count' => 42]),
             new Entity(['id' => 4, 'count' => 4]),
-            new Entity(['id' => 5, 'count' => 22])
+            new Entity(['id' => 5, 'count' => 22]),
         ]);
 
         $expected = new Entity(['id' => 3, 'count' => 42]);
@@ -747,7 +746,7 @@ class CollectionTest extends TestCase
             new Entity(['id' => 2, 'count' => 9]),
             new Entity(['id' => 3, 'count' => 42]),
             new Entity(['id' => 4, 'count' => 4]),
-            new Entity(['id' => 5, 'count' => 22])
+            new Entity(['id' => 5, 'count' => 22]),
         ]);
 
         $expected = new Entity(['id' => 4, 'count' => 4]);

+ 1 - 1
tests/TestCase/Error/Middleware/ErrorHandlerMiddlewareTest.php

@@ -243,7 +243,7 @@ class ErrorHandlerMiddlewareTest extends TestCase
 
         $request = ServerRequestFactory::fromGlobals([
             'REQUEST_URI' => '/target/url',
-            'HTTP_REFERER' => '/other/path'
+            'HTTP_REFERER' => '/other/path',
         ]);
         $response = new Response();
         $middleware = new ErrorHandlerMiddleware(null, ['log' => true, 'trace' => true]);

+ 1 - 2
tests/TestCase/ORM/ResultSetTest.php

@@ -22,7 +22,6 @@ use Cake\ORM\Entity;
 use Cake\ORM\ResultSet;
 use Cake\ORM\Table;
 use Cake\TestSuite\TestCase;
-use TestApp\Model\Entity\Article;
 
 /**
  * ResultSet test case.
@@ -447,7 +446,7 @@ class ResultSetTest extends TestCase
     {
         $query = $this->table->find();
         $query->select([
-            'counter' => 'COUNT(*)'
+            'counter' => 'COUNT(*)',
         ])->group('author_id');
 
         $min = $query->min('counter');