Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 18, 2024
1 parent cf6a177 commit 7832a44
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 126 deletions.
1 change: 0 additions & 1 deletion .phpunit.cache/test-results

This file was deleted.

9 changes: 0 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,11 @@
]
}
},
<<<<<<< HEAD
<<<<<<< HEAD
=======
=======
>>>>>>> f95775c (fixup! misc)
"scripts": {
"fix-cs": "vendor/bin/ecs check src tests --fix",
"check-cs": "vendor/bin/ecs check src tests",
"phpstan": "vendor/bin/phpstan"
},
<<<<<<< HEAD
>>>>>>> dd66021 (fixup! misc)
=======
>>>>>>> f95775c (fixup! misc)
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
Expand Down
11 changes: 1 addition & 10 deletions config/extension.neon
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ parameters:
- ../stubs/Utility.stub

services:
# checked
-
class: PHPStanCakePHP2\ClassPropertyExtension\ClassComponentPropertyExtension
tags:
Expand All @@ -27,20 +26,18 @@ services:
tags:
- phpstan.broker.propertiesClassReflectionExtension

# checked
-
class: PHPStanCakePHP2\ReturnTypeExtension\ClassRegistryInitExtension
tags:
- phpstan.broker.dynamicStaticMethodReturnTypeExtension

# checked
-
class: PHPStanCakePHP2\ClassPropertyExtension\ShellClassPropertyExtension
tags:
- phpstan.broker.propertiesClassReflectionExtension

-
class: PHPStanCakePHP2\ModelBehaviorsExtension
class: PHPStanCakePHP2\ClassMethodExtension\ModelMethodExtension
arguments:
behaviorPaths: %behaviorPaths%
tags:
Expand All @@ -50,9 +47,3 @@ services:
class: PHPStanCakePHP2\Service\SchemaService
arguments:
schemaPaths: %schemaPaths%

-
class: PHPStanCakePHP2\LoadComponentOnFlyMethodReturnTypeExtension
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension

Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

declare(strict_types=1);

namespace PHPStanCakePHP2;
namespace PHPStanCakePHP2\ClassMethodExtension;

use Exception;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Reflection\MethodReflection;
use PHPStan\Reflection\MethodsClassReflectionExtension;
use PHPStan\Reflection\ReflectionProvider;
use PHPStanCakePHP2\ModelBehaviorMethodExtractor;
use PHPStanCakePHP2\Reflection\ClassReflectionFinder;

/**
* Adds methods to {@link Model}s from {@link ModelBehavior} classes.
*/
final class ModelBehaviorsExtension implements MethodsClassReflectionExtension
final class ModelMethodExtension implements MethodsClassReflectionExtension
{
private ReflectionProvider $reflectionProvider;

Expand Down
55 changes: 0 additions & 55 deletions src/LoadComponentOnFlyMethodReturnTypeExtension.php

This file was deleted.

1 change: 1 addition & 0 deletions src/ModelBehaviorMethodExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use PHPStan\Reflection\ParameterReflection;
use PHPStan\Reflection\ParametersAcceptor;
use PHPStan\Type\ObjectType;
use PHPStanCakePHP2\Reflection\ModelBehaviorMethodWrapper;

final class ModelBehaviorMethodExtractor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace PHPStanCakePHP2;
namespace PHPStanCakePHP2\Reflection;

use PHPStan\Reflection\ClassMemberReflection;
use PHPStan\Reflection\ClassReflection;
Expand Down
20 changes: 9 additions & 11 deletions tests/Feature/ControllerExtensionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

namespace PHPStanCakePHP2\Tests\Feature;

use Iterator;
use PHPStan\Testing\TypeInferenceTestCase;
use PHPUnit\Framework\Attributes\DataProvider;

class ControllerExtensionsTest extends TypeInferenceTestCase
final class ControllerExtensionsTest extends TypeInferenceTestCase
{
/**
* @return mixed[]
*/
public static function dataFileAsserts(): \Iterator
#[DataProvider('dataFileAsserts')]
public function test(string $assertType, string $file, ...$args): void
{
$this->assertFileAsserts($assertType, $file, ...$args);
}

public static function dataFileAsserts(): Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/data/existing_controller_model.php');
yield from self::gatherAssertTypes(__DIR__ . '/data/existing_controller_component.php');
Expand All @@ -21,12 +25,6 @@ public static function dataFileAsserts(): \Iterator
yield from self::gatherAssertTypes(__DIR__ . '/data/existing_controller_component_from_parent_controller.php');
}

#[DataProvider('dataFileAsserts')]
public function test(string $assertType, string $file, ...$args): void
{
$this->assertFileAsserts($assertType, $file, ...$args);
}

public static function getAdditionalConfigFiles(): array
{
return [
Expand Down
27 changes: 0 additions & 27 deletions tests/Feature/LoadComponentOnFlyMethodReturnTypeExtensionTest.php

This file was deleted.

10 changes: 0 additions & 10 deletions tests/Feature/data/loading_component_loaded_on_fly.php

This file was deleted.

0 comments on commit 7832a44

Please sign in to comment.