Skip to content

🔧 Allow symfony 5 #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,42 @@ version: 2.1
executors:
php:
docker:
- image: circleci/php:7.1
- image: circleci/php:7.2
environment:
TZ: '/usr/share/zoneinfo/Europe/Paris'
working_directory: ~/Symfony-custom-coding-standard

commands:
start:
steps:
- checkout
- run: sudo apt-get update
- run: sudo apt-get install -y ant

jobs:
test:
executor: php
steps:
- checkout
- start
- restore_cache:
keys:
- v1-dependencies-{{ checksum "composer.lock" }}
- v1-dependencies-
- run: sudo apt-get update
- run: sudo apt-get install -y ant
- run: ant test
- save_cache:
paths:
- vendor
key: v1-dependencies-{{ checksum "composer.lock" }}
lowest:
executor: php
steps:
- start
- run: composer update --prefer-lowest
- run: ant phpunit

workflows:
version: 2
check:
jobs:
- test
- lowest
2 changes: 1 addition & 1 deletion SymfonyCustom/Sniffs/Namespaces/UnusedUseSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function process(File $phpcsFile, $stackPtr)
// Handle comment tag as @Route(..) or @ORM\Id
if (preg_match('/^@'.$lowerClassName.'(?![a-zA-Z])/i', $token['content']) === 1) {
return;
};
}
}

// Check for @param Truc or @return Machin
Expand Down
11 changes: 7 additions & 4 deletions TwigCS/Environment/StubbedEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,20 @@ public function __construct()
$this->addTokenParser(new DumpTokenParser());
$this->addTokenParser(new FormThemeTokenParser());
$this->addTokenParser(new StopwatchTokenParser(false));
$this->addTokenParser(new TransChoiceTokenParser());
$this->addTokenParser(new TransDefaultDomainTokenParser());
$this->addTokenParser(new TransTokenParser());

if (class_exists(TransChoiceTokenParser::class)) {
$this->addTokenParser(new TransChoiceTokenParser());
}
}

/**
* @param string $name
*
* @return TwigFilter
*/
public function getFilter($name)
public function getFilter($name): ?TwigFilter
{
if (!isset($this->stubFilters[$name])) {
$this->stubFilters[$name] = new TwigFilter('stub');
Expand All @@ -68,7 +71,7 @@ public function getFilter($name)
*
* @return TwigFunction
*/
public function getFunction($name)
public function getFunction($name): ?TwigFunction
{
if (!isset($this->stubFunctions[$name])) {
$this->stubFunctions[$name] = new TwigFunction('stub');
Expand All @@ -82,7 +85,7 @@ public function getFunction($name)
*
* @return TwigTest
*/
public function getTest($name)
public function getTest($name): ?TwigTest
{
if (!isset($this->stubTests[$name])) {
$this->stubTests[$name] = new TwigTest('stub');
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
],
"bin": ["bin/twigcs"],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"squizlabs/php_codesniffer": "3.5.*",
"symfony/console": "^3.0 || ^4.0",
"symfony/finder": "^3.0 || ^4.0",
"symfony/twig-bridge": "^3.0 || ^4.0",
"twig/twig": "^2.0 || ^3.0"
"symfony/console": "^3.4 || ^4.3 || ^5.0",
"symfony/finder": "^3.4 || ^4.3 || ^5.0",
"symfony/twig-bridge": "^3.4 || ^4.3 || ^5.0",
"twig/twig": "^2.7 || ^3.0"
},
"require-dev": {
"phpunit/phpunit": "^7.0"
Expand Down
Loading