Skip to content

Commit 1797356

Browse files
Merge pull request #5 from kirtangajjar/add_example_docs
Add examples in doc comments
2 parents a6b2e9f + 1c17c59 commit 1797356

1 file changed

Lines changed: 46 additions & 4 deletions

File tree

src/PHP.php

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace EE\Site\Type;
66

7-
use \Symfony\Component\Filesystem\Filesystem;
8-
use \EE\Model\Site;
9-
use function \EE\Site\Utils\auto_site_name;
10-
use function \EE\Site\Utils\get_site_info;
7+
use EE\Model\Site;
8+
use Symfony\Component\Filesystem\Filesystem;
9+
use function EE\Site\Utils\auto_site_name;
10+
use function EE\Site\Utils\get_site_info;
1111

1212
/**
1313
* Creates a simple PHP Website.
@@ -121,6 +121,24 @@ public function __construct() {
121121
*
122122
* [--force]
123123
* : Resets the remote database if it is not empty.
124+
*
125+
* ## EXAMPLES
126+
*
127+
* # Create php site (without db)
128+
* $ ee site create example.com --type=php
129+
*
130+
* # Create php site with db
131+
* $ ee site create example.com --type=php --with-db
132+
*
133+
* # Create php site with ssl from letsencrypt
134+
* $ ee site create example.com --type=php --ssl=le
135+
*
136+
* # Create php site with wildcard ssl
137+
* $ ee site create example.com --type=php --ssl=le --wildcard
138+
*
139+
* # Create php site with remote database
140+
* $ ee site create example.com --type=php --with-db --dbhost=localhost --dbuser=username --dbpass=password
141+
*
124142
*/
125143
public function create( $args, $assoc_args ) {
126144

@@ -190,6 +208,12 @@ private function create_site_db_user( string $site_url ): string {
190208
*
191209
* [<site-name>]
192210
* : Name of the website whose info is required.
211+
*
212+
* ## EXAMPLES
213+
*
214+
* # Display site info
215+
* $ ee site info example.com
216+
*
193217
*/
194218
public function info( $args, $assoc_args ) {
195219

@@ -456,6 +480,15 @@ private function create_site_db_entry() {
456480
*
457481
* [--db]
458482
* : Restart db container of site.
483+
*
484+
* ## EXAMPLES
485+
*
486+
* # Restart all containers of site
487+
* $ ee site restart example.com
488+
*
489+
* # Restart single container of site
490+
* $ ee site restart example.com --nginx
491+
*
459492
*/
460493
public function restart( $args, $assoc_args, $whitelisted_containers = [] ) {
461494

@@ -485,6 +518,15 @@ public function restart( $args, $assoc_args, $whitelisted_containers = [] ) {
485518
*
486519
* [--php]
487520
* : Reload php container of site.
521+
*
522+
* ## EXAMPLES
523+
*
524+
* # Reload all containers of site
525+
* $ ee site reload example.com
526+
*
527+
* # Reload single containers of site
528+
* $ ee site reload example.com --nginx
529+
*
488530
*/
489531
public function reload( $args, $assoc_args, $whitelisted_containers = [], $reload_commands = [] ) {
490532
$whitelisted_containers = [ 'nginx', 'php' ];

0 commit comments

Comments
 (0)