Skip to content

Commit

Permalink
phpdoc update; Request get alias
Browse files Browse the repository at this point in the history
  • Loading branch information
donwilson committed Nov 7, 2023
1 parent f11ba92 commit 90bb520
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 17 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vendor/

# phpDocumentor
/phpdoc.phar
.phpdoc/
docs/

# database files
Expand All @@ -23,7 +24,7 @@ docs/
*.log

# tmp files
tmp/*
tmp/

# ideas
.idea/*
.idea/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"php-server": "cd ./dev/public/ && php -S localhost:8001",
"docker-compose": "docker-compose up",
"generate-docs": "docker run --rm -v \"$(pwd):/data\" \"phpdoc/phpdoc:3\"",
"preview-docs": "php -S localhost:8000 -t ./docs/.output/"
"preview-docs": "php -S localhost:8000 -t ./docs/.output/",
"host-docs": "docker run --rm -v \"${PWD}/docs/:/usr/local/apache2/htdocs/\" --network=\"gateway\" --label traefik.enable=true --label traefik.http.routers.magnetar-docs.rule=Host\\(\\`magnetar-docs.lan\\`\\) \"httpd:2.4-alpine\""
}
}
44 changes: 30 additions & 14 deletions phpdoc.dist.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
<?xml version="1.0" encoding="UTF-8" ?>
<phpdocumentor
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://www.phpdoc.org"
configVersion="3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://www.phpdoc.org"
>
<title>phpDocumentor</title>
<paths>
<output>docs/.output/</output>
<cache>docs/.buildcache</cache>
</paths>
<title>Magnetar Framework</title>
<paths>
<output>docs/</output>
</paths>
<version number="3.0.0">
<api>
<source dsn=".">
<path>src</path>
</source>
</api>
</version>
<api>
<source dsn=".">
<path>src</path>
</source>
<markers>
<marker>TODO</marker>
<marker>NOTE</marker>
<marker>NOTES</marker>
<marker>FIX</marker>
</markers>
</api>
</version>
<setting name="title" value="Magnetar Framework" />
<setting name="template" value="responsive-twig" />
<setting name="target" value="docs" />
<setting name="source.code" value="src" />
<setting name="source.code.ignore" value="vendor" />
<setting name="source.code.ignoreTags" value="access" />
<setting name="source.code.ignoreNotInheritDoc" value="true" />
<setting name="source.code.ignoreDeprecated" value="true" />
<setting name="source.code.ignoreInternal" value="true" />
<setting name="source.code.ignoreDocBlocks" value="true" />
<setting name="template.color" value="deep-purple" />
</phpdocumentor>
1 change: 1 addition & 0 deletions src/Magnetar/Helpers/Facades/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* @method method(): ?Magnetar\Router\Enums\HTTPMethodEnum
* @method assignOverrideParameters(array $parameters): void
* @method parameter(string $name, mixed $default=null): mixed
* @method get(string $name, mixed $default=null): mixed
* @method parameters(): array
* @method body(): string
* @method file(string $input_name): Magnetar\Http\UploadedFile|array|null
Expand Down
10 changes: 10 additions & 0 deletions src/Magnetar/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,16 @@ public function parameter(string $name, mixed $default=null): mixed {
return $this->parameters[ $name ] ?? $default;
}

/**
* Alias of Request::parameter()
* @param string $name The name of the parameter to get
* @param mixed $default Optional. Return this if requested parameter isn't set
* @return mixed The parameter value
*/
public function get(string $name, mixed $default=null): mixed {
return $this->parameter($name, $default);
}

/**
* Get all parameters from the request
* @return array
Expand Down

0 comments on commit 90bb520

Please sign in to comment.