Skip to content

Commit

Permalink
Merge c6baa9b into 0a4cc6b
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Oct 5, 2021
2 parents 0a4cc6b + c6baa9b commit 2778472
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
@@ -1,8 +1,12 @@
* text=auto
/.github/ export-ignore
/.phpstan/ export-ignore
/Tests/ export-ignore
/.gitattributes export-ignore
/.github_changelog_generator export-ignore
/.php_cs.dist export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.phpstan.neon.dist export-ignore
/.phpunit.xml.dist export-ignore
24 changes: 24 additions & 0 deletions .github/workflows/phpstan.yml
@@ -0,0 +1,24 @@
name: PHPStan

on:
pull_request:
push:

jobs:
phpstan:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none

- name: Update project dependencies
uses: ramsey/composer-install@v1

- name: Run PHPStan
run: vendor/bin/phpstan analyze
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@
/bin/
/composer.lock
/composer.phar
/phpstan.neon
/phpunit.xml
/Tests/Functional/app/public/media/cache
/Tests/Functional/app/web/media/cache
Expand Down
9 changes: 9 additions & 0 deletions .phpstan/baseline.neon
@@ -0,0 +1,9 @@
parameters:
ignoreErrors:
- message: '#^Access to undefined constant Liip\\ImagineBundle\\Config\\Filter\\Type\\FilterAbstract::NAME\.$#'
paths:
- ../Config/Filter/Type/FilterAbstract.php
- message: '#^Unsafe usage of new static\(\)\.$#'
paths:
- ../Async/CacheResolved.php
- ../Async/ResolveCache.php
38 changes: 38 additions & 0 deletions .phpstan/stubs/Event.stub
@@ -0,0 +1,38 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\EventDispatcher;

/**
* @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
class Event
{
private $propagationStopped = false;

/**
* @return bool Whether propagation was already stopped for this event
*
* @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
public function isPropagationStopped()
{
return $this->propagationStopped;
}

/**
* @deprecated since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead
*/
public function stopPropagation()
{
$this->propagationStopped = true;
}
}
31 changes: 31 additions & 0 deletions .phpstan/stubs/ExtensionGuesserInterface.stub
@@ -0,0 +1,31 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\HttpFoundation\File\MimeType;

use Symfony\Component\Mime\MimeTypesInterface;

/**
* Guesses the file extension corresponding to a given mime type.
*
* @deprecated since Symfony 4.3, use {@link MimeTypesInterface} instead
*/
interface ExtensionGuesserInterface
{
/**
* Makes a best guess for a file extension, given a mime type.
*
* @param string $mimeType The mime type
*
* @return string The guessed extension or NULL, if none could be guessed
*/
public function guess($mimeType);
}
38 changes: 38 additions & 0 deletions .phpstan/stubs/MimeTypeGuesserInterface.stub
@@ -0,0 +1,38 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\HttpFoundation\File\MimeType;

use Symfony\Component\HttpFoundation\File\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
use Symfony\Component\Mime\MimeTypesInterface;

/**
* Guesses the mime type of a file.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated since Symfony 4.3, use {@link MimeTypesInterface} instead
*/
interface MimeTypeGuesserInterface
{
/**
* Guesses the mime type of the file with the given path.
*
* @param string $path The path to the file
*
* @return string|null The mime type or NULL, if none could be guessed
*
* @throws FileNotFoundException If the file does not exist
* @throws AccessDeniedException If the file could not be read
*/
public function guess($path);
}
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -36,6 +36,7 @@
"doctrine/persistence": "^1.3|^2.0",
"enqueue/enqueue-bundle": "^0.9|^0.10",
"league/flysystem": "^1.0|^2.0",
"phpstan/phpstan": "^0.12.64",
"psr/log": "^1.0",
"symfony/browser-kit": "^3.4|^4.3|^5.0",
"symfony/console": "^3.4|^4.3|^5.0",
Expand Down
27 changes: 27 additions & 0 deletions phpstan.neon.dist
@@ -0,0 +1,27 @@
includes:
- .phpstan/baseline.neon
parameters:
level: 1
paths:
- Async
- Binary
- Command
- Component
- Config
- Controller
- DependencyInjection
- Events
- Exception
- Factory
- Form
- Imagine
- Model
- Resources
- Service
- Templating
- Utility
- LiipImagineBundle.php
scanFiles:
- .phpstan/stubs/Event.stub
- .phpstan/stubs/ExtensionGuesserInterface.stub
- .phpstan/stubs/MimeTypeGuesserInterface.stub

0 comments on commit 2778472

Please sign in to comment.