Skip to content

Commit f17083d

Browse files
committed
Out: Refine display of Request objects
1 parent 39f70c7 commit f17083d

File tree

10 files changed

+34
-11
lines changed

10 files changed

+34
-11
lines changed

build.xml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,14 @@
7373
<include name="**/*.php"/>
7474
</fileset>
7575
</copy>
76+
<copy todir="${basedir}/build/phar/phpdraft/src/Lukasoppermann/Httpstatus">
77+
<fileset dir="vendor/lukasoppermann/http-status/src">
78+
<include name="**/*.php"/>
79+
</fileset>
80+
</copy>
7681
<copy todir="${basedir}/build/phar/phpdraft">
7782
<fileset dir="${basedir}">
78-
<include name="**/index.php"/>
83+
<include name="**/phpdraft"/>
7984
<exclude name="vendor/**"/>
8085
</fileset>
8186
</copy>
@@ -84,7 +89,7 @@
8489
<arg value="-pi"/>
8590
<arg value="-e"/>
8691
<arg value="s/\'vendor\/autoload.php/__DIR__\ .\ \'\/src\/PHPDraft\/Core\/Autoloader.php/g"/>
87-
<arg value="${basedir}/build/phar/phpdraft/index.php"/>
92+
<arg value="${basedir}/build/phar/phpdraft/phpdraft"/>
8893
</exec>
8994

9095
<exec executable="${basedir}/build/phar-version.php" outputproperty="_version">
@@ -153,7 +158,7 @@
153158
<target name="-phar-determine-version">
154159
<exec executable="bash" outputproperty="version">
155160
<arg value="-c"/>
156-
<arg value="php ${basedir}/index.php -v | grep -ohE '([0-9]{1,}\.)+[0-9]{1,}'"/>
161+
<arg value="php ${basedir}/phpdraft -v | grep -ohE '([0-9]{1,}\.)+[0-9]{1,}'"/>
157162
</exec>
158163
</target>
159164
</project>

build/binary-phar-autoload.php.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if ($execute) {
2828
exit;
2929
}
3030

31-
require_once __PHPDRAFT_PHAR_ROOT__.DIRECTORY_SEPARATOR.'phpdraft'.DIRECTORY_SEPARATOR.'index.php';
31+
require_once __PHPDRAFT_PHAR_ROOT__.DIRECTORY_SEPARATOR.'phpdraft'.DIRECTORY_SEPARATOR.'phpdraft';
3232
}
3333

3434
__HALT_COMPILER();

build/phar-version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
}
66

77
file_put_contents(
8-
__DIR__ . '/phar/phpdraft/index.php',
8+
__DIR__ . '/phar/phpdraft/phpdraft',
99
str_replace(
1010
"define('VERSION', '0');",
1111
"define('VERSION', '" . $argv[1] . "');",
12-
file_get_contents(__DIR__ . '/phar/phpdraft/index.php')
12+
file_get_contents(__DIR__ . '/phar/phpdraft/phpdraft')
1313
)
1414
);
1515

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "This is a parser for API Blueprint files in PHP.",
44
"minimum-stability": "stable",
55
"license": "GPL-3.0",
6+
"bin": ["phpdraft"],
67
"authors": [
78
{
89
"name": "Sean Molenaar",

index.php renamed to phpdraft

File renamed without changes.

src/PHPDraft/Out/HTML/default.phtml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ use Enjoy\HttpStatusCode\Statuscodes;
201201
<?php endforeach; ?>
202202
<?php endif; ?>
203203
<?php if (!empty($request->struct)): ?>
204-
205204
<h5>Structure</h5>
206205
<div class="row">
207206
<?= $request->struct ?>
@@ -216,7 +215,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
216215
<?php endif; ?>
217216

218217
<?php if ($transition->data_variables !== null): ?>
219-
<h5>Data object</h5>
218+
<h5>Request object</h5>
220219
<?= $transition->data_variables ?>
221220
<?php endif; ?>
222221
</div>

src/PHPDraft/Out/HTML/material.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ use Enjoy\HttpStatusCode\Statuscodes;
143143
<?= $transition->url_variables; ?>
144144
<?php endif; ?>
145145
<?php if ($transition->data_variables !== null): ?>
146-
<h5>Data object</h5>
146+
<h5>Request object</h5>
147147
<?= $transition->data_variables ?>
148148
<?php endif; ?>
149149
</div>

tests/statics/drafter/html_basic

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
<span class="base-url">https://owner-api.teslamotors.com</span><em>/oauth/token</em>
402402

403403

404-
<h5>Data object</h5>
404+
<h5>Request object</h5>
405405
<table class="table table-striped mdl-data-table mdl-js-data-table "><table class="table table-striped mdl-data-table mdl-js-data-table "><tr><td><span>grant_type</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The type of oAuth grant. Always &quot;password&quot;</p>
406406
</td><td><span class="example-value pull-right">password</span></td></tr><tr><td><span>client_id</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The oAuth client ID</p>
407407
</td><td><span class="example-value pull-right">abc</span></td></tr><tr><td><span>client_secret</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The oAuth client secret</p>

tests/statics/drafter/html_material

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
<div class="mdl-tabs__panel is-active" id="authentication-tokens-get-an-access-token-request-panel">
188188
<h5>Example URI</h5>
189189
<span class="base-url">https://owner-api.teslamotors.com</span><em>/oauth/token</em>
190-
<h5>Data object</h5>
190+
<h5>Request object</h5>
191191
<table class="table table-striped mdl-data-table mdl-js-data-table "><table class="table table-striped mdl-data-table mdl-js-data-table "><tr><td><span>grant_type</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The type of oAuth grant. Always &quot;password&quot;</p>
192192
</td><td><span class="example-value pull-right">password</span></td></tr><tr><td><span>client_id</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The oAuth client ID</p>
193193
</td><td><span class="example-value pull-right">abc</span></td></tr><tr><td><span>client_secret</span></td><td><code>string</code></td><td> <span class="status"></span></td><td><p>The oAuth client secret</p>

tests/statics/full_test.apib

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ their feed. Posts are closely tied to the follow graph...
7373
### Retrieve a Post [GET]
7474
Returns a specific Post.
7575

76+
+ Response 200
77+
78+
[Post][]
79+
80+
### Update a Post [PUT]
81+
Updates a specific Post.
82+
83+
+ Parameters
84+
+ post_id: `2` (string) - The id of the Post.
85+
86+
+ Attributes
87+
+ Key: `key` (string) - Key for the object
88+
+ Object
89+
+ Key1: `key1` (string) - Key1 for the object
90+
+ Key2: `key2` (string) - Key2 for the object
91+
92+
+ Request (application/json)
93+
7694
+ Response 200
7795

7896
[Post][]

0 commit comments

Comments
 (0)