Skip to content

Commit a3ca66c

Browse files
committed
update docs
1 parent 1b67f2d commit a3ca66c

File tree

215 files changed

+3947
-3816
lines changed

Some content is hidden

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

215 files changed

+3947
-3816
lines changed

app/Console/Commands/GenerateSitemapCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace App\Console\Commands;
44

5+
use App\Http\Services\DocService;
56
use Illuminate\Console\Command;
67
use Spatie\Sitemap\Sitemap;
78
use Spatie\Sitemap\Tags\Url;
8-
use App\Http\Services\DocService;
99

1010
class GenerateSitemapCommand extends Command
1111
{

app/Console/Kernel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class Kernel extends ConsoleKernel
1919
/**
2020
* Define the application's command schedule.
2121
*
22-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
2322
* @return void
2423
*/
2524
protected function schedule(Schedule $schedule)

app/Exceptions/Handler.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class Handler extends ExceptionHandler
2929
/**
3030
* Report or log an exception.
3131
*
32-
* @param \Throwable $exception
3332
* @return void
3433
*
3534
* @throws \Exception
@@ -43,7 +42,6 @@ public function report(Throwable $exception)
4342
* Render an exception into an HTTP response.
4443
*
4544
* @param \Illuminate\Http\Request $request
46-
* @param \Throwable $exception
4745
* @return \Symfony\Component\HttpFoundation\Response
4846
*
4947
* @throws \Throwable

app/Http/Controllers/GitHubActionsController.php

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,38 @@
22

33
namespace App\Http\Controllers;
44

5-
use Illuminate\Http\Request;
6-
use App\Http\Services\PackageService;
75
use App\Http\Requests\GitHubVersionRequest;
6+
use App\Http\Services\PackageService;
7+
use Illuminate\Http\Request;
88

99
/**
1010
* Class GitHubActionsController
1111
*
1212
* @property PackageService $packageService
13-
* @package App\Htpp\Controllers\GitHubActionsController
1413
*/
1514
class GitHubActionsController extends Controller
1615
{
1716
/**
1817
* GitHubActionsController constructor
1918
*
20-
* @param PackageService $packageService
2119
*
2220
* @return void
2321
*/
24-
function __construct(PackageService $packageService)
22+
public function __construct(PackageService $packageService)
2523
{
2624
$this->packageService = $packageService;
2725
}
2826

2927
/**
3028
* GitHub Workflow http request to update the latest version of a package.
3129
*
32-
* @param GitHubVersionRequest $request
33-
* @param string $repository
34-
*
30+
* @param string $repository
3531
* @return \Illuminate\Http\JsonResponse
3632
*/
3733
public function version(GitHubVersionRequest $request, $repository)
3834
{
3935
$didSucceed = $this->packageService->updateVersion($repository, $request->version);
40-
if (!$didSucceed) {
36+
if (! $didSucceed) {
4137
return response()->json(['status' => 'failed', 'error_code' => 539]);
4238
}
4339

@@ -47,7 +43,6 @@ public function version(GitHubVersionRequest $request, $repository)
4743
/**
4844
* Webhook for Release event.
4945
*
50-
* @param Request $request
5146
*
5247
* @return \Illuminate\Http\JsonResponse
5348
*/
@@ -69,7 +64,7 @@ public function release(Request $request)
6964
$repositoryName = $repositoryData['name'];
7065

7166
$didSucceed = $this->packageService->updateVersion($repositoryName, $tagName);
72-
if (!$didSucceed) {
67+
if (! $didSucceed) {
7368
return response()->json(['status' => 'failed', 'error_code' => 539]);
7469
}
7570

app/Http/Controllers/LandingController.php

Lines changed: 68 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace App\Http\Controllers;
44

55
use App\Http\Services\DocService;
6-
use App\Http\Services\SeoService;
76
use App\Http\Services\PackageService;
7+
use App\Http\Services\SeoService;
88
use App\Models\OnlineEvent;
99

1010
/**
@@ -13,152 +13,150 @@
1313
* @property SeoService $seoService
1414
* @property DocService $docService
1515
* @property PackageService $packageService
16-
* @package App\Http\Controllers\LandingController
1716
*/
1817
class LandingController extends Controller
1918
{
20-
public function __construct(
21-
SeoService $seoService,
22-
DocService $docService,
23-
PackageService $packageService
24-
) {
25-
$this->seoService = $seoService;
26-
$this->docService = $docService;
27-
$this->packageService = $packageService;
28-
}
19+
public function __construct(
20+
SeoService $seoService,
21+
DocService $docService,
22+
PackageService $packageService
23+
) {
24+
$this->seoService = $seoService;
25+
$this->docService = $docService;
26+
$this->packageService = $packageService;
27+
}
2928

3029
/**
3130
* Download the latest version of Nylo.
3231
*
33-
* @param string $project
34-
*
32+
* @param string $project
3533
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
3634
*/
37-
public function download($project = 'nylo-core/nylo')
38-
{
39-
$downloadUrl = $this->docService->downloadFile($project);
35+
public function download($project = 'nylo-core/nylo')
36+
{
37+
$downloadUrl = $this->docService->downloadFile($project);
4038

41-
return redirect($downloadUrl);
42-
}
39+
return redirect($downloadUrl);
40+
}
4341

4442
/**
4543
* Index page for Nylo.
4644
*
4745
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
4846
*/
49-
public function index()
50-
{
51-
$this->seoService->setTitle(config('app.name') . ' - Powerful Flutter Micro-Framework');
47+
public function index()
48+
{
49+
$this->seoService->setTitle(config('app.name').' - Powerful Flutter Micro-Framework');
5250

5351
$event = cache()->remember('event', now()->addHours(1), function () {
5452
$events = OnlineEvent::where('end_date', '>', now())->get();
5553
if (empty($events)) {
5654
return null;
5755
}
56+
5857
return $events->first();
5958
});
6059

61-
return view('pages.index', compact('event'));
62-
}
60+
return view('pages.index', compact('event'));
61+
}
6362

6463
/**
6564
* Privacy policy page for Nylo.
6665
*
6766
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
6867
*/
69-
public function privacyPolicy()
70-
{
71-
$this->seoService->setTitle('Privacy policy');
68+
public function privacyPolicy()
69+
{
70+
$this->seoService->setTitle('Privacy policy');
7271

73-
return view('pages.privacy-policy');
74-
}
72+
return view('pages.privacy-policy');
73+
}
7574

7675
/**
7776
* Terms and conditions page for Nylo.
7877
*
7978
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
8079
*/
81-
public function termsAndConditions()
82-
{
83-
$this->seoService->setTitle('Terms and conditions');
80+
public function termsAndConditions()
81+
{
82+
$this->seoService->setTitle('Terms and conditions');
8483

85-
return view('pages.terms-and-conditions');
86-
}
84+
return view('pages.terms-and-conditions');
85+
}
8786

8887
/**
8988
* Resources page for Nylo.
9089
*
9190
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
9291
*/
93-
public function resources()
94-
{
95-
$this->seoService->setTitle('Resources');
96-
$resourceData = $this->packageService->getResourceMetaData();
92+
public function resources()
93+
{
94+
$this->seoService->setTitle('Resources');
95+
$resourceData = $this->packageService->getResourceMetaData();
9796

98-
return view('pages.resources', compact('resourceData'));
99-
}
97+
return view('pages.resources', compact('resourceData'));
98+
}
10099

101-
/**
100+
/**
102101
* Ecosystem page for Nylo.
103102
*
104103
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
105104
*/
106-
public function ecosystem()
107-
{
108-
$this->seoService->setTitle('Ecosystem');
105+
public function ecosystem()
106+
{
107+
$this->seoService->setTitle('Ecosystem');
109108
$resourceData = $this->packageService->getResourceMetaData();
110109

111-
return view('pages.ecosystem', compact('resourceData'));
112-
}
110+
return view('pages.ecosystem', compact('resourceData'));
111+
}
113112

114113
/**
115114
* Tutorials page for Nylo.
116115
*
117116
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
118117
*/
119-
public function tutorials($version = null, $page = 'introduction')
120-
{
121-
$this->seoService->setTitle('Tutorials');
118+
public function tutorials($version = null, $page = 'introduction')
119+
{
120+
$this->seoService->setTitle('Tutorials');
122121

123122
$latestVersionOfNylo = $this->docService->getLastestVersionNylo();
124123

125-
if ($version == null) {
126-
$version = $latestVersionOfNylo;
127-
}
124+
if ($version == null) {
125+
$version = $latestVersionOfNylo;
126+
}
128127
$this->docService->containsTutorialsForVersion($version);
129128
$section = $this->docService->findTutorialSection($version, $page);
130-
$viewingOldDocs = $this->docService->isViewingOldDocs($version);
129+
$viewingOldDocs = $this->docService->isViewingOldDocs($version);
131130
$tutorial = $this->docService->getTutorial($version, $page);
132131
abort_if(empty($tutorial), 404);
133132

134-
return view('docs.tutorials', compact('page', 'tutorial', 'version', 'section', 'latestVersionOfNylo', 'viewingOldDocs'));
135-
}
133+
return view('docs.tutorials', compact('page', 'tutorial', 'version', 'section', 'latestVersionOfNylo', 'viewingOldDocs'));
134+
}
136135

137136
/**
138137
* Documentation page for Nylo.
139138
*
140-
* @param string $version
141-
* @param string $page
142-
*
139+
* @param string $version
140+
* @param string $page
143141
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
144142
*/
145-
public function docs($version = null, $page = 'installation')
146-
{
147-
$this->seoService->setSeoViewingDocs($page);
148-
$latestVersionOfNylo = $this->docService->getLastestVersionNylo();
143+
public function docs($version = null, $page = 'installation')
144+
{
145+
$this->seoService->setSeoViewingDocs($page);
146+
$latestVersionOfNylo = $this->docService->getLastestVersionNylo();
149147

150-
if ($version == null) {
151-
$version = $latestVersionOfNylo;
152-
}
148+
if ($version == null) {
149+
$version = $latestVersionOfNylo;
150+
}
153151

154-
$mdDocPage = $this->docService->checkIfDocExists($version, $page);
152+
$mdDocPage = $this->docService->checkIfDocExists($version, $page);
155153

156-
$section = $this->docService->findDocSection($version, $page);
157-
$viewingOldDocs = $this->docService->isViewingOldDocs($version);
158-
$docsContainPage = $this->docService->checkDocsContainPage($version, $page);
154+
$section = $this->docService->findDocSection($version, $page);
155+
$viewingOldDocs = $this->docService->isViewingOldDocs($version);
156+
$docsContainPage = $this->docService->checkDocsContainPage($version, $page);
159157

160-
return view('docs.template', compact('page', 'version', 'mdDocPage', 'section', 'latestVersionOfNylo', 'viewingOldDocs', 'docsContainPage'));
161-
}
158+
return view('docs.template', compact('page', 'version', 'mdDocPage', 'section', 'latestVersionOfNylo', 'viewingOldDocs', 'docsContainPage'));
159+
}
162160

163161
/**
164162
* Learn more page for Nylo.

app/Http/Controllers/ProcessController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@
33
namespace App\Http\Controllers;
44

55
use Illuminate\Http\Request;
6-
use Illuminate\Support\Facades\Process;
76
use Illuminate\Support\Facades\Artisan;
7+
use Illuminate\Support\Facades\Process;
88

99
class ProcessController extends Controller
1010
{
1111
/**
1212
* Process to update the project.
1313
*
14-
* @param Request $request
1514
*
1615
* @return \Illuminate\Http\JsonResponse
1716
*/

app/Http/Kernel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ class Kernel extends HttpKernel
4747
'gh_actions' => [
4848
'throttle:60,1',
4949
\Illuminate\Routing\Middleware\SubstituteBindings::class,
50-
\App\Http\Middleware\AuthenticateGitHubMiddleware::class
50+
\App\Http\Middleware\AuthenticateGitHubMiddleware::class,
5151
],
5252

5353
'gh_webhook' => [
5454
'throttle:60,1',
5555
\Illuminate\Routing\Middleware\SubstituteBindings::class,
56-
\App\Http\Middleware\AuthenticateGitHubSignatureVerifyWebhook::class
56+
\App\Http\Middleware\AuthenticateGitHubSignatureVerifyWebhook::class,
5757
],
5858

5959
'web_process' => [
6060
'throttle:60,1',
61-
\App\Http\Middleware\WebProcessMiddleware::class
61+
\App\Http\Middleware\WebProcessMiddleware::class,
6262
],
6363
];
6464

app/Http/Middleware/AuthenticateGitHubMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class AuthenticateGitHubMiddleware
1616
public function handle(Request $request, Closure $next): Response
1717
{
1818
$ghApiKey = $request->header('X-GH-API-KEY');
19-
19+
2020
if (empty($ghApiKey) || $ghApiKey != config('project.meta.gh_auth_token')) {
2121
abort(403, 'API key is not valid');
2222
}

0 commit comments

Comments
 (0)