-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from gsteel/psalm-gha
Initial migration to github ci workflows and psalm integration
- Loading branch information
Showing
15 changed files
with
333 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- '[0-9]+.[0-9]+.x' | ||
- 'refs/pull/*' | ||
|
||
jobs: | ||
matrix: | ||
name: Generate job matrix | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.matrix.outputs.matrix }} | ||
steps: | ||
- name: Gather CI configuration | ||
id: matrix | ||
uses: laminas/laminas-ci-matrix-action@v1 | ||
|
||
qa: | ||
name: QA Checks | ||
needs: [matrix] | ||
runs-on: ${{ matrix.operatingSystem }} | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} | ||
steps: | ||
- name: ${{ matrix.name }} | ||
uses: laminas/laminas-continuous-integration-action@v1 | ||
with: | ||
job: ${{ matrix.job }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,228 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<files psalm-version="4.6.2@bca09d74adc704c4eaee36a3c3e9d379e290fc3b"> | ||
<file src="src/Emitter/EmitterStack.php"> | ||
<MixedArgument occurrences="1"> | ||
<code>$index</code> | ||
</MixedArgument> | ||
<MixedAssignment occurrences="1"> | ||
<code>$emitter</code> | ||
</MixedAssignment> | ||
<MixedMethodCall occurrences="1"> | ||
<code>emit</code> | ||
</MixedMethodCall> | ||
<UndefinedDocblockClass occurrences="3"> | ||
<code>InvalidArgumentException</code> | ||
<code>InvalidArgumentException</code> | ||
<code>InvalidArgumentException</code> | ||
</UndefinedDocblockClass> | ||
</file> | ||
<file src="src/Emitter/SapiEmitterTrait.php"> | ||
<DocblockTypeContradiction occurrences="1"> | ||
<code>headers_sent()</code> | ||
</DocblockTypeContradiction> | ||
<MissingReturnType occurrences="1"> | ||
<code>assertNoPreviousOutput</code> | ||
</MissingReturnType> | ||
<MixedArgumentTypeCoercion occurrences="1"> | ||
<code>$header</code> | ||
</MixedArgumentTypeCoercion> | ||
</file> | ||
<file src="src/Emitter/SapiStreamEmitter.php"> | ||
<MixedArgument occurrences="4"> | ||
<code>$first</code> | ||
<code>$first</code> | ||
<code>$length</code> | ||
<code>$remaining</code> | ||
</MixedArgument> | ||
<MixedAssignment occurrences="2"> | ||
<code>$length</code> | ||
<code>$remaining</code> | ||
</MixedAssignment> | ||
<MixedOperand occurrences="2"> | ||
<code>$last</code> | ||
<code>$remaining</code> | ||
</MixedOperand> | ||
</file> | ||
<file src="src/Exception/InvalidEmitterException.php"> | ||
<MissingParamType occurrences="1"> | ||
<code>$emitter</code> | ||
</MissingParamType> | ||
</file> | ||
<file src="src/RequestHandlerRunner.php"> | ||
<MixedArgument occurrences="2"> | ||
<code>$request</code> | ||
<code>$response</code> | ||
</MixedArgument> | ||
<MixedAssignment occurrences="2"> | ||
<code>$request</code> | ||
<code>$response</code> | ||
</MixedAssignment> | ||
<MixedInferredReturnType occurrences="2"> | ||
<code>ResponseInterface</code> | ||
<code>ServerRequestInterface</code> | ||
</MixedInferredReturnType> | ||
<MixedReturnStatement occurrences="2"> | ||
<code>$serverRequestErrorResponseGenerator($exception)</code> | ||
<code>$serverRequestFactory()</code> | ||
</MixedReturnStatement> | ||
</file> | ||
<file src="test/ConfigProviderTest.php"> | ||
<MissingReturnType occurrences="2"> | ||
<code>testInvocationReturnsArray</code> | ||
<code>testReturnedArrayContainsDependencies</code> | ||
</MissingReturnType> | ||
<MixedFunctionCall occurrences="1"> | ||
<code>($this->provider)()</code> | ||
</MixedFunctionCall> | ||
<UndefinedThisPropertyAssignment occurrences="1"> | ||
<code>$this->provider</code> | ||
</UndefinedThisPropertyAssignment> | ||
<UndefinedThisPropertyFetch occurrences="1"> | ||
<code>$this->provider</code> | ||
</UndefinedThisPropertyFetch> | ||
</file> | ||
<file src="test/Emitter/AbstractEmitterTest.php"> | ||
<MissingReturnType occurrences="5"> | ||
<code>testDoesNotInjectContentLengthHeaderIfStreamSizeIsUnknown</code> | ||
<code>testDoesNotLetResponseCodeBeOverriddenByPHP</code> | ||
<code>testEmitsMessageBody</code> | ||
<code>testEmitsResponseHeaders</code> | ||
<code>testMultipleSetCookieHeadersAreNotReplaced</code> | ||
</MissingReturnType> | ||
</file> | ||
<file src="test/Emitter/EmitterStackTest.php"> | ||
<MissingReturnType occurrences="11"> | ||
<code>nonEmitterValues</code> | ||
<code>testCannotPushNonEmitterToStack</code> | ||
<code>testCannotSetNonEmitterToSpecificIndex</code> | ||
<code>testCannotUnshiftNonEmitterToStack</code> | ||
<code>testEmitLoopsThroughEmittersUntilOneReturnsTrueValue</code> | ||
<code>testEmitReturnsFalseIfLastEmmitterReturnsFalse</code> | ||
<code>testEmitReturnsFalseIfNoEmittersAreComposed</code> | ||
<code>testIsAnEmitterImplementation</code> | ||
<code>testIsAnSplStack</code> | ||
<code>testOffsetSetReplacesExistingValue</code> | ||
<code>testUnshiftAddsNewEmitter</code> | ||
</MissingReturnType> | ||
<MixedArgument occurrences="3"> | ||
<code>$value</code> | ||
<code>$value</code> | ||
<code>$value</code> | ||
</MixedArgument> | ||
</file> | ||
<file src="test/Emitter/SapiStreamEmitterTest.php"> | ||
<InvalidPropertyAssignmentValue occurrences="1"> | ||
<code>new SapiStreamEmitter()</code> | ||
</InvalidPropertyAssignmentValue> | ||
<MissingClosureParamType occurrences="5"> | ||
<code>$bufferLength</code> | ||
<code>$bufferLength</code> | ||
<code>$bufferLength</code> | ||
<code>$length</code> | ||
<code>$position</code> | ||
</MissingClosureParamType> | ||
<MissingClosureReturnType occurrences="4"> | ||
<code>function ($bufferLength) use (& $peakBufferLength) {</code> | ||
<code>function ($bufferLength) use (& $peakBufferLength) {</code> | ||
<code>function ($position, $length = null) use (& $sizeBytes) {</code> | ||
<code>function () use (& $peakMemoryUsage) {</code> | ||
</MissingClosureReturnType> | ||
<MixedArgument occurrences="6"> | ||
<code>$first</code> | ||
<code>$last - $first + 1</code> | ||
<code>$length</code> | ||
<code>$position</code> | ||
<code>$sizeBytes</code> | ||
<code>$startPosition</code> | ||
</MixedArgument> | ||
<MixedAssignment occurrences="9"> | ||
<code>$first</code> | ||
<code>$last</code> | ||
<code>$length</code> | ||
<code>$peakBufferLength</code> | ||
<code>$peakBufferLength</code> | ||
<code>$peakBufferLength</code> | ||
<code>$peakMemoryUsage</code> | ||
<code>$position</code> | ||
<code>$startPosition</code> | ||
</MixedAssignment> | ||
<MixedFunctionCall occurrences="1"> | ||
<code>$closureTrackMemoryUsage()</code> | ||
</MixedFunctionCall> | ||
<MixedOperand occurrences="11"> | ||
<code>$first</code> | ||
<code>$first</code> | ||
<code>$last</code> | ||
<code>$last</code> | ||
<code>$last</code> | ||
<code>$maxBufferLength * $rangeBlocks[1]</code> | ||
<code>$peakMemoryUsage</code> | ||
<code>$rangeBlocks[0]</code> | ||
<code>$rangeBlocks[1]</code> | ||
<code>$sizeBytes</code> | ||
<code>($maxBufferLength * $rangeBlocks[1]) + $maxBufferLength</code> | ||
</MixedOperand> | ||
<PossiblyUndefinedVariable occurrences="2"> | ||
<code>$first</code> | ||
<code>$last</code> | ||
</PossiblyUndefinedVariable> | ||
</file> | ||
<file src="test/RequestHandlerRunnerTest.php"> | ||
<MissingClosureParamType occurrences="2"> | ||
<code>$e</code> | ||
<code>$e</code> | ||
</MissingClosureParamType> | ||
<MissingClosureReturnType occurrences="8"> | ||
<code>function ($e) use ($exception, $response) {</code> | ||
<code>function ($e) {</code> | ||
<code>function () use ($exception) {</code> | ||
<code>function () use ($request) {</code> | ||
<code>function () {</code> | ||
<code>function () {</code> | ||
<code>function (Throwable $e) use ($response) {</code> | ||
<code>function (Throwable $e) {</code> | ||
</MissingClosureReturnType> | ||
<MissingReturnType occurrences="4"> | ||
<code>testRaisesTypeErrorIfServerErrorResponseGeneratorFactoryDoesNotReturnAResponse</code> | ||
<code>testRaisesTypeErrorIfServerRequestFactoryDoesNotReturnARequestInstance</code> | ||
<code>testRunPassesRequestGeneratedByRequestFactoryToHandleWhenNoRequestPassedToRun</code> | ||
<code>testUsesErrorResponseGeneratorToGenerateResponseWhenRequestFactoryRaisesException</code> | ||
</MissingReturnType> | ||
</file> | ||
<file src="test/TestAsset/HeaderStack.php"> | ||
<MissingReturnType occurrences="2"> | ||
<code>push</code> | ||
<code>reset</code> | ||
</MissingReturnType> | ||
</file> | ||
<file src="test/TestAsset/MockStreamHelper.php"> | ||
<MissingParamType occurrences="1"> | ||
<code>$contents</code> | ||
</MissingParamType> | ||
<MixedArgument occurrences="2"> | ||
<code>$data</code> | ||
<code>$remainingContents</code> | ||
</MixedArgument> | ||
<MixedAssignment occurrences="3"> | ||
<code>$data</code> | ||
<code>$remainingContents</code> | ||
<code>$this->contents</code> | ||
</MixedAssignment> | ||
<MixedInferredReturnType occurrences="3"> | ||
<code>string</code> | ||
<code>string</code> | ||
<code>string</code> | ||
</MixedInferredReturnType> | ||
<MixedReturnStatement occurrences="3"> | ||
<code>$data</code> | ||
<code>$remainingContents</code> | ||
<code>is_callable($this->contents) ? ($this->contents)(0) : $this->contents</code> | ||
</MixedReturnStatement> | ||
</file> | ||
<file src="test/TestAsset/SapiResponse.php"> | ||
<InvalidScalarArgument occurrences="1"/> | ||
<MissingReturnType occurrences="1"> | ||
<code>header</code> | ||
</MissingReturnType> | ||
</file> | ||
</files> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
totallyTyped="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
errorBaseline="psalm-baseline.xml" | ||
> | ||
<projectFiles> | ||
<directory name="src"/> | ||
<directory name="test"/> | ||
<ignoreFiles> | ||
<directory name="vendor"/> | ||
</ignoreFiles> | ||
</projectFiles> | ||
|
||
<issueHandlers> | ||
<InternalMethod> | ||
<errorLevel type="suppress"> | ||
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::method"/> | ||
</errorLevel> | ||
<errorLevel type="suppress"> | ||
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::willReturn"/> | ||
</errorLevel> | ||
<errorLevel type="suppress"> | ||
<referencedMethod name="PHPUnit\Framework\MockObject\Builder\InvocationMocker::with"/> | ||
</errorLevel> | ||
</InternalMethod> | ||
</issueHandlers> | ||
<plugins> | ||
<pluginClass class="Psalm\PhpUnitPlugin\Plugin"/> | ||
</plugins> | ||
</psalm> |
Oops, something went wrong.