Skip to content
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

Ensure compatibility with PSR-4 autoloading standard #61

Merged
merged 6 commits into from
Apr 5, 2020
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
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": "[email protected]"
}
],
"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.
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.