Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
adapayments
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lidonation
adapayments
Commits
5df7ec18
Commit
5df7ec18
authored
1 year ago
by
Darlington
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
b4a94bf0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#5348
failed
1 year ago
Stage: build
Stage: test
Stage: production
Stage: performance
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.idea/adapayments.io.iml
+2
-2
2 additions, 2 deletions
.idea/adapayments.io.iml
src/Router.php
+9
-8
9 additions, 8 deletions
src/Router.php
src/routes.php
+3
-1
3 additions, 1 deletion
src/routes.php
with
14 additions
and
11 deletions
.idea/adapayments.io.iml
+
2
−
2
View file @
5df7ec18
...
...
@@ -2,8 +2,8 @@
<module
type=
"WEB_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
>
<content
url=
"file://$MODULE_DIR$"
>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
packagePrefix=
"Lido
N
ation\Adapayments\"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/tests"
isTestSource=
"true"
packagePrefix=
"Lido
N
ation\Adapayments\Tests\"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src"
isTestSource=
"false"
packagePrefix=
"Lido
n
ation\Adapayments\"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/tests"
isTestSource=
"true"
packagePrefix=
"Lido
n
ation\Adapayments\Tests\"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/vendor/brianium/paratest"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/vendor/brick/math"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/vendor/composer"
/>
...
...
This diff is collapsed.
Click to expand it.
src/Router.php
+
9
−
8
View file @
5df7ec18
...
...
@@ -4,12 +4,13 @@ declare(strict_types=1);
namespace
Lidonation\Adapayments
;
use
JetBrains\PhpStorm\NoReturn
;
class
Router
{
protected
$routes
=
[];
protected
array
$routes
=
[];
public
function
add
(
$method
,
$uri
,
$controller
)
public
function
add
(
$method
,
$uri
,
$controller
)
:
static
{
$this
->
routes
[]
=
[
'uri'
=>
$uri
,
...
...
@@ -21,27 +22,27 @@ class Router
return
$this
;
}
public
function
get
(
$uri
,
$controller
)
public
function
get
(
$uri
,
$controller
)
:
static
{
return
$this
->
add
(
'GET'
,
$uri
,
$controller
);
}
public
function
post
(
$uri
,
$controller
)
public
function
post
(
$uri
,
$controller
)
:
static
{
return
$this
->
add
(
'POST'
,
$uri
,
$controller
);
}
public
function
delete
(
$uri
,
$controller
)
public
function
delete
(
$uri
,
$controller
)
:
static
{
return
$this
->
add
(
'DELETE'
,
$uri
,
$controller
);
}
public
function
patch
(
$uri
,
$controller
)
public
function
patch
(
$uri
,
$controller
)
:
static
{
return
$this
->
add
(
'PATCH'
,
$uri
,
$controller
);
}
public
function
put
(
$uri
,
$controller
)
public
function
put
(
$uri
,
$controller
)
:
static
{
return
$this
->
add
(
'PUT'
,
$uri
,
$controller
);
}
...
...
@@ -62,7 +63,7 @@ class Router
return
$_SERVER
[
'HTTP_REFERER'
];
}
protected
function
abort
()
#
[
NoReturn
]
protected
function
abort
()
{
require
app_base_path
(
"src/resources/views/abort.php"
);
...
...
This diff is collapsed.
Click to expand it.
src/routes.php
+
3
−
1
View file @
5df7ec18
<?php
<?php
declare
(
strict_types
=
1
);
$router
=
new
\Lidonation\Adapayments\Router
();
$router
->
get
(
'/'
,
'index.php'
);
$router
->
get
(
'/store'
,
'store/index.php'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment