Skip to content

Commit

Permalink
add form, json and multipart body
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Sep 15, 2024
1 parent 671f84e commit 155ef6e
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 2 deletions.
36 changes: 36 additions & 0 deletions src/Body/Form.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* PSX is a open source PHP framework to develop RESTful APIs.
* For the current version and informations visit <http://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Data\Body;

use PSX\Record\Record;

/**
* Form
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*
* @extends Record<string>
*/
class Form extends Record
{
}
36 changes: 36 additions & 0 deletions src/Body/Json.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* PSX is a open source PHP framework to develop RESTful APIs.
* For the current version and informations visit <http://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Data\Body;

use PSX\Record\Record;

/**
* Json
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*
* @extends Record<mixed>
*/
class Json extends Record
{
}
34 changes: 34 additions & 0 deletions src/Body/Multipart.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/*
* PSX is a open source PHP framework to develop RESTful APIs.
* For the current version and informations visit <http://phpsx.org>
*
* Copyright 2010-2023 Christoph Kappestein <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

namespace PSX\Data\Body;

use PSX\Data\Multipart\Body;

/**
* Multipart
*
* @author Christoph Kappestein <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0
* @link https://phpsx.org
*/
class Multipart extends Body
{
}
4 changes: 2 additions & 2 deletions src/Reader/Multipart.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

namespace PSX\Data\Reader;

use PSX\Data\Multipart\Body;
use PSX\Data\Body;
use PSX\Data\Multipart\File;
use PSX\Data\ReaderAbstract;
use PSX\Data\Util\CurveArray;
Expand All @@ -46,7 +46,7 @@ public function __construct(?array $files = null, ?array $post = null)

public function read(string $data): mixed
{
$multipart = new Body();
$multipart = new Body\Multipart();

foreach ($this->files as $name => $file) {
if (isset($file['error'])) {
Expand Down

0 comments on commit 155ef6e

Please sign in to comment.