Skip to content

Commit

Permalink
use class-leak
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Aug 12, 2023
1 parent 4f6d6bb commit bd8c20d
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 63 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
.gitignore export-ignore
*.md export-ignore
/tests export-ignore
/easy-ci.php export-ignore
/ecs.php export-ignore
/phpstan.neon export-ignore
/rector.php export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:

-
name: 'Check Active Classes'
run: vendor/bin/easy-ci check-active-class src --ansi
run: vendor/bin/class-leak check src --ansi --skip-type="\Symplify\PhpConfigPrinter\Contract\Converter\ServiceOptionsKeyYamlToPhpFactoryInterface" --skip-type="\Symplify\PhpConfigPrinter\Contract\RoutingCaseConverterInterface" --skip-type="\Symplify\PhpConfigPrinter\Contract\CaseConverterInterface"

name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"symplify/phpstan-extensions": "^11.2",
"symplify/phpstan-rules": "^12.0",
"symplify/symplify-kernel": "^11.0",
"tomasvotruba/class-leak": "0.1.1.72",
"tomasvotruba/unused-public": "^0.2.0"
},
"autoload": {
Expand Down
56 changes: 0 additions & 56 deletions easy-ci.php

This file was deleted.

1 change: 0 additions & 1 deletion ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
$ecsConfig->paths([
__DIR__ . '/ecs.php',
__DIR__ . '/rector.php',
__DIR__ . '/easy-ci.php',
__DIR__ . '/src',
__DIR__ . '/tests',
]);
Expand Down
4 changes: 2 additions & 2 deletions src/CaseConverter/AliasCaseConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ private function createAliasNode(string $key, string $fullClassName, mixed $serv

private function createFromClassLike(string $key, mixed $values, Variable $servicesVariable): Expression
{
$classReference = $this->commonNodeFactory->createClassReference($key);
$classConstFetch = $this->commonNodeFactory->createClassReference($key);

$argValues = [];
$argValues[] = $classReference;
$argValues[] = $classConstFetch;
$argValues[] = $values[MethodName::ALIAS] ?? $values;

$args = $this->argsNodeFactory->createFromValues($argValues, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private function resolveExpressionWhenAtEnv(
$args = $expr->getArgs();

if (! isset($args[1]) || ! $args[1]->value instanceof Array_ || ! isset($args[1]->value->items[0])
|| ! $args[1]->value->items[0] instanceof ArrayItem || $args[1]->value->items[0]->key === null) {
|| ! $args[1]->value->items[0] instanceof ArrayItem || ! $args[1]->value->items[0]->key instanceof Expr) {
throw new ShouldNotHappenException();
}

Expand Down
2 changes: 1 addition & 1 deletion src/NodeFactory/Service/SingleServicePhpNodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private function createCallMethodCall(mixed $call, MethodCall $methodCall): Meth
$args[] = new Arg($argumentsExpr);

$returnCloneExpr = $this->resolveCallReturnClone($call);
if ($returnCloneExpr !== null) {
if ($returnCloneExpr instanceof Expr) {
$args[] = new Arg($returnCloneExpr);
}

Expand Down

0 comments on commit bd8c20d

Please sign in to comment.