Skip to content

Commit 2ec6b29

Browse files
authored
Move examples into docs (zircote#1719)
1 parent ae2bd35 commit 2ec6b29

File tree

149 files changed

+51
-54
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+51
-54
lines changed

.github/workflows/gh-pages.yml

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ jobs:
2727
- name: Install vitepress and deps
2828
run: cd docs && npm install
2929

30-
- name: Add examples
31-
run: |
32-
cp -r examples docs
33-
rm docs/examples/Readme.md
34-
3530
- name: Build site
3631
run: composer docs:build
3732

docs/.vitepress/config.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ function getReferenceSidebar() {
5757
]
5858
}
5959

60-
6160
module.exports = {
6261
title: "Swagger-PHP",
6362
base: "/swagger-php/",
6463
description: "Generate OpenAPI documentation for your RESTful API.",
64+
srcExclude: [
65+
'examples/Readme.md'
66+
],
6567
themeConfig: {
6668
repo: 'zircote/swagger-php',
6769
docsDir: 'docs',
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/guide/examples.md

+38-38

docs/index.md

+1-1

docs/reference/annotations.md

+1-1

docs/reference/attributes.md

+1-1

docs/snippets/preamble_annotations.md

+1-1

docs/snippets/preamble_attributes.md

+1-1

phpstan-baseline.neon

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ parameters:
44
message: '#^Property OpenApi\\Annotations\\AbstractAnnotation\:\:\$x \(array\<string, mixed\>\) does not accept string\.$#'
55
identifier: assign.propertyType
66
count: 1
7-
path: examples/processors/schema-query-parameter/SchemaQueryParameter.php
7+
path: docs/examples/processors/schema-query-parameter/SchemaQueryParameter.php
88

99
-
1010
message: '#^Attribute class JetBrains\\PhpStorm\\ArrayShape does not exist\.$#'
1111
identifier: attribute.notFound
1212
count: 1
13-
path: examples/specs/using-links/attributes/User.php
13+
path: docs/examples/specs/using-links/attributes/User.php
1414

1515
-
1616
message: '#^Call to function method_exists\(\) with ReflectionProperty and ''isPromoted'' will always evaluate to true\.$#'

phpstan.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
paths:
88
- src
99
- tests
10-
- examples
10+
- docs/examples
1111
parallel:
1212
processTimeout: 300.0
1313
excludePaths:

tests/Concerns/UsesExamples.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait UsesExamples
1313
{
1414
public static function examplePath(string $name): string
1515
{
16-
return sprintf('%s/examples/specs/%s', dirname(__DIR__, 2), $name);
16+
return sprintf('%s/docs/examples/specs/%s', dirname(__DIR__, 2), $name);
1717
}
1818

1919
public function getSpecFilename(string $name, string $implementation = 'annotations', string $version = OpenApi::VERSION_3_0_0): string

tools/src/Docs/ExampleGenerator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function __construct($projectRoot)
1717

1818
public function examplePath(string $relativeName): string
1919
{
20-
return $this->projectRoot . '/examples/' . $relativeName;
20+
return $this->projectRoot . '/docs/examples/' . $relativeName;
2121
}
2222

2323
public function collectFiles(string $folder, string $name): array

0 commit comments

Comments
 (0)