Skip to content

Commit

Permalink
slip
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 18, 2024
1 parent 7832a44 commit c8bc4cc
Show file tree
Hide file tree
Showing 41 changed files with 93 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.0
php-version: 8.1

- name: Validate composer
run: composer validate
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
composer.lock

# tests
.phpunit.result
.phpunit.result.cache
1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"classmap": [
"stubs",
"tests/Feature/classes"
"tests/Source"
]
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public static function dataFileAsserts(): Iterator
{
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_component_component.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/invalid_component_property.php');

yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_controller_component.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_controller_component_from_parent_controller.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_controller_component_with_same_method_name_as_model.php');
}

public static function getAdditionalConfigFiles(): array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\Component\BasicComponent;
use function PHPStan\Testing\assertType;

/** @var BasicComponent $parentComponent */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\BasicController;
use function PHPStan\Testing\assertType;

/** @var BasicController $controller */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\SameAsModelController;
use function PHPStan\Testing\assertType;

/** @var SameAsModelController $controller */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\SameAsModelController;
use function PHPStan\Testing\assertType;

/** @var SameAsModelController $controller */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\Component\BasicComponent;
use function PHPStan\Testing\assertType;

/** @var BasicComponent $component */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public static function dataFileAsserts(): \Iterator
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/custom_model_behavior.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/invalid_model_property.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_model_model.php');

yield from self::gatherAssertTypes(__DIR__ . '/Fixture/existing_controller_model.php');
yield from self::gatherAssertTypes(__DIR__ . '/Fixture/invalid_controller_property.php');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Model\BasicModel;
use function PHPStan\Testing\assertType;

/** @var BasicModel $model */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Model\BasicModel;
use function PHPStan\Testing\assertType;

/** @var BasicModel $model */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\BasicController;
use function PHPStan\Testing\assertType;

/** @var BasicController $controller */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Model\BasicModel;
use function PHPStan\Testing\assertType;

/** @var BasicModel $model */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Controller\BasicController;
use function PHPStan\Testing\assertType;

/** @var BasicController $controller */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Model\BasicModel;
use function PHPStan\Testing\assertType;

/** @var BasicModel $model */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Console\Command\BasicShell;
use function PHPStan\Testing\assertType;

$assign = function (BasicShell $shell) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Console\Command\BasicShell;
use function PHPStan\Testing\assertType;

/** @var BasicShell $shell */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types = 1);

use PHPStanCakePHP2\Tests\Source\Console\Command\BasicShell;
use function PHPStan\Testing\assertType;

/** @var BasicShell $shell */
Expand Down
34 changes: 0 additions & 34 deletions tests/Feature/ControllerExtensionsTest.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/Feature/classes/Console/Command/BasicShell.php

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Feature/classes/Console/Command/Task/BasicTask.php

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Feature/classes/Model/BasicModel.php

This file was deleted.

3 changes: 0 additions & 3 deletions tests/Feature/classes/Model/SecondModel.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use PHPStanCakePHP2\Tests\Source\Model\BasicModel;
use function PHPStan\Testing\assertType;

$class = ClassRegistry::init(BasicModel::class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Config\Schema;
use CakeSchema;

class AppSchema extends CakeSchema
{
/**
Expand Down
8 changes: 8 additions & 0 deletions tests/Source/Console/Command/BasicShell.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Console\Command;
use Shell;

class BasicShell extends Shell
{
}
8 changes: 8 additions & 0 deletions tests/Source/Console/Command/Task/BasicTask.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Console\Command\Task;
use Shell;

class BasicTask extends Shell
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

declare(strict_types=1);

namespace PHPStanCakePHP2\Tests\Source\Controller;
use Controller;

class BaseController extends Controller
{
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Controller;
use Controller;

class BasicController extends Controller
{
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Controller\Component;
use Component;

class BasicComponent extends Component
{
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Controller\Component;
use Component;

class SameAsModelComponent extends Component
{
public function sameMethod(): int
Expand Down
8 changes: 8 additions & 0 deletions tests/Source/Controller/Component/SecondComponent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Controller\Component;
use Component;

class SecondComponent extends Component
{
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Controller;

use PHPStanCakePHP2\Tests\Source\Controller\Component\BasicComponent;

class SameAsModelController extends BaseController
{
/**
Expand Down
8 changes: 8 additions & 0 deletions tests/Source/Model/BasicModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Model;
use Model;

class BasicModel extends Model
{
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Model\Behavior;
use Model;
use ModelBehavior;

class BasicBehavior extends ModelBehavior
{
public function behaviorMethod(Model $model, string $string): string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Model;
use Model;

class SameAsModel extends Model
{
public function sameMethod(): string
Expand Down
8 changes: 8 additions & 0 deletions tests/Source/Model/SecondModel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

namespace PHPStanCakePHP2\Tests\Source\Model;
use Model;

class SecondModel extends Model
{
}
4 changes: 2 additions & 2 deletions tests/config/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
parameters:
behaviorPaths:
- tests/Feature/classes/Model/Behavior/*.php
- tests/Source/Model/Behavior/*.php

# @todo add exists validatoin to avoid misspaths
schemaPaths:
- tests/Feature/classes/Config/Schema/*.php
- tests/Source/Config/Schema/*.php

includes:
- ../../config/extension.neon

0 comments on commit c8bc4cc

Please sign in to comment.