Skip to content

Commit

Permalink
project-base/app folder is now included in coding standards checks (#…
Browse files Browse the repository at this point in the history
…1306)

- fixed all the violations
- router.php is skipped for ValidVariableNameSniff and ForbiddenSuperGlobalSniff as it needs to use superglobals
  • Loading branch information
vitek-rostislav authored Sep 9, 2019
1 parent fe47c32 commit 3126182
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/AppCache.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;

class AppCache extends HttpCache
Expand Down
2 changes: 2 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Shopsys\FrameworkBundle\Component\Environment\EnvironmentType;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;
Expand Down
4 changes: 3 additions & 1 deletion app/Bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Shopsys;

use AppKernel;
Expand Down Expand Up @@ -79,7 +81,7 @@ public function run()
private function configurePhp()
{
error_reporting(E_ALL);
ini_set('display_errors', 0);
ini_set('display_errors', '0');
}

private function initDoctrine()
Expand Down
2 changes: 2 additions & 0 deletions app/Environment.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace Shopsys;

use Composer\IO\IOInterface;
Expand Down
2 changes: 2 additions & 0 deletions app/autoload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Doctrine\Common\Annotations\AnnotationRegistry;

$loader = file_exists(__DIR__ . '/../vendor/autoload.php') ? require __DIR__ . '/../vendor/autoload.php' : require __DIR__ . '/../../vendor/autoload.php';
Expand Down
3 changes: 3 additions & 0 deletions app/maintenance.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

header('HTTP/1.1 503 Service Temporarily Unavailable');
header('Status: 503 Service Temporarily Unavailable');
header('Retry-after: 300');
Expand Down
2 changes: 2 additions & 0 deletions app/router.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* This file implements rewrite rules for PHP built-in web server.
*
Expand Down
4 changes: 4 additions & 0 deletions easy-coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ parameters:
Shopsys\CodingStandards\Sniffs\ValidVariableNameSniff:
- '*/tests/ShopBundle/Functional/EntityExtension/EntityExtensionTest.php'
- '*/tests/ShopBundle/Test/Codeception/_generated/AcceptanceTesterActions.php'
- '*/app/router.php'

Shopsys\CodingStandards\Sniffs\ObjectIsCreatedByFactorySniff:
- '*/tests/*'
Expand All @@ -44,3 +45,6 @@ parameters:
Shopsys\CodingStandards\Sniffs\ForbiddenDoctrineInheritanceSniff:
- '*/src/Shopsys/ShopBundle/*'
- '*/tests/ShopBundle/*'

Shopsys\CodingStandards\Sniffs\ForbiddenSuperGlobalSniff:
- '*/app/router.php'

0 comments on commit 3126182

Please sign in to comment.