Skip to content

Commit

Permalink
Merge pull request #61 from radarlog/psr-4
Browse files Browse the repository at this point in the history
Ensure compatibility with PSR-4 autoloading standard
  • Loading branch information
weirdan authored Apr 5, 2020
2 parents ebfae6c + 47958c5 commit e997675
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ paths:
tests: tests
output: tests/_output
data: tests/_data
support: tests/_support
support: tests
envs: tests/_envs
actor_suffix: Tester
extensions:
Expand Down
22 changes: 13 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,21 @@
"email": "github@muglug.com"
}
],
"config": {
"optimize-autoloader": true,
"sort-packages": true
},
"require": {
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"vimeo/psalm": "^3.6.2 || dev-master",
"php": "^7.1.3",
"ext-simplexml": "*",
"composer/semver": "^1.4",
"ocramius/package-versions": "^1.3"
"ocramius/package-versions": "^1.3",
"phpunit/phpunit": "^6.0 || ^7.0 || ^8.0 || ^9.0",
"vimeo/psalm": "^3.6.2 || dev-master"
},
"require-dev": {
"squizlabs/php_codesniffer": "^3.3.1",
"codeception/base": "^2.5",
"squizlabs/php_codesniffer": "^3.3.1",
"weirdan/codeception-psalm-module": "^0.4.0"
},
"extra": {
Expand All @@ -27,17 +33,15 @@
},
"autoload": {
"psr-4": {
"Psalm\\PhpUnitPlugin\\": ["."],
"Psalm\\PhpUnitPlugin\\Hooks\\": ["hooks"],
"Psalm\\PhpUnitPlugin\\Exception\\" : ["Exception"]
"Psalm\\PhpUnitPlugin\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Psalm\\PhpUnitPlugin\\Tests\\": ["tests/_support"]
"Psalm\\PhpUnitPlugin\\Tests\\": "tests"
}
},
"scripts" : {
"scripts": {
"check": [
"@cs-check",
"@analyze",
Expand Down
8 changes: 3 additions & 5 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
<arg name="colors"/>

<!-- Paths to check -->
<file>Plugin.php</file>
<file>tests/_support/Helper</file>
<file>tests/_support/AcceptanceTester.php</file>
<file>hooks</file>
<file>Exception</file>
<file>src</file>
<file>tests/Helper</file>
<file>tests/AcceptanceTester.php</file>


<!-- inherit rules from: -->
Expand Down
7 changes: 1 addition & 6 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="." />
<ignoreFiles>
<directory name="vendor" />
<directory name="stubs" />
<directory name="tests/_support" />
</ignoreFiles>
<directory name="src" />
</projectFiles>

<issueHandlers>
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions Plugin.php → src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class Plugin implements PluginEntryPointInterface
/** @return void */
public function __invoke(RegistrationInterface $psalm, SimpleXMLElement $config = null)
{
$psalm->addStubFile(__DIR__ . '/stubs/Assert.php');
$psalm->addStubFile(__DIR__ . '/../stubs/Assert.php');
if ($this->packageVersionIs('phpunit/phpunit', '>=', '7.5')) {
$psalm->addStubFile(__DIR__ . '/stubs/Assert_75.php');
$psalm->addStubFile(__DIR__ . '/../stubs/Assert_75.php');
}
$psalm->addStubFile(__DIR__ . '/stubs/TestCase.php');
$psalm->addStubFile(__DIR__ . '/stubs/MockBuilder.php');
$psalm->addStubFile(__DIR__ . '/stubs/InvocationMocker.php');
$psalm->addStubFile(__DIR__ . '/stubs/Prophecy.php');
$psalm->addStubFile(__DIR__ . '/../stubs/TestCase.php');
$psalm->addStubFile(__DIR__ . '/../stubs/MockBuilder.php');
$psalm->addStubFile(__DIR__ . '/../stubs/InvocationMocker.php');
$psalm->addStubFile(__DIR__ . '/../stubs/Prophecy.php');

class_exists(Hooks\TestCaseHandler::class, true);
$psalm->registerHooksFromClass(Hooks\TestCaseHandler::class);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e997675

Please sign in to comment.