-
Notifications
You must be signed in to change notification settings - Fork 1
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 #1 from Basster/feature/http-stuff
support status code and headers for JsonSerializeResponse as well.
- Loading branch information
Showing
13 changed files
with
172 additions
and
35 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
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,55 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
totallyTyped="false" | ||
resolveFromConfigFile="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" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
<ignoreFiles> | ||
<directory name="vendor" /> | ||
</ignoreFiles> | ||
</projectFiles> | ||
|
||
<issueHandlers> | ||
<LessSpecificReturnType errorLevel="info" /> | ||
|
||
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives --> | ||
|
||
<DeprecatedMethod errorLevel="info" /> | ||
<DeprecatedProperty errorLevel="info" /> | ||
<DeprecatedClass errorLevel="info" /> | ||
<DeprecatedConstant errorLevel="info" /> | ||
<DeprecatedFunction errorLevel="info" /> | ||
<DeprecatedInterface errorLevel="info" /> | ||
<DeprecatedTrait errorLevel="info" /> | ||
|
||
<InternalMethod errorLevel="info" /> | ||
<InternalProperty errorLevel="info" /> | ||
<InternalClass errorLevel="info" /> | ||
|
||
<MissingClosureReturnType errorLevel="info" /> | ||
<MissingReturnType errorLevel="info" /> | ||
<MissingPropertyType errorLevel="info" /> | ||
<InvalidDocblock errorLevel="info" /> | ||
<MisplacedRequiredParam errorLevel="info" /> | ||
|
||
<PropertyNotSetInConstructor errorLevel="info" /> | ||
<MissingConstructor errorLevel="info" /> | ||
<MissingClosureParamType errorLevel="info" /> | ||
<MissingParamType errorLevel="info" /> | ||
|
||
<RedundantCondition errorLevel="info" /> | ||
|
||
<DocblockTypeContradiction errorLevel="info" /> | ||
<RedundantConditionGivenDocblockType errorLevel="info" /> | ||
|
||
<UnresolvableInclude errorLevel="info" /> | ||
|
||
<RawObjectIteration errorLevel="info" /> | ||
|
||
<InvalidStringClass errorLevel="info" /> | ||
</issueHandlers> | ||
</psalm> |
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,41 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace Basster\LazyResponseBundle\Response; | ||
|
||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
/** | ||
* Class AbstractHttpResponse. | ||
*/ | ||
abstract class AbstractLazyHttpResponse implements LazyResponseInterface | ||
{ | ||
/** | ||
* @var int | ||
*/ | ||
protected $status; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
protected $headers; | ||
|
||
/** | ||
* AbstractLazyHttpResponse constructor. | ||
*/ | ||
public function __construct(int $status = Response::HTTP_OK, array $headers = []) | ||
{ | ||
$this->status = $status; | ||
$this->headers = $headers; | ||
} | ||
|
||
public function getStatus(): int | ||
{ | ||
return $this->status; | ||
} | ||
|
||
public function getHeaders(): array | ||
{ | ||
return $this->headers; | ||
} | ||
} |
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
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
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