Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nextcloud Notify Push
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Eduardo Trujillo
Nextcloud Notify Push
Commits
91b3421c
Commit
91b3421c
authored
4 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
stubs for psalm
parent
64c6dcc3
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/Controller/TestController.php
+5
-2
5 additions, 2 deletions
lib/Controller/TestController.php
psalm.xml
+3
-19
3 additions, 19 deletions
psalm.xml
tests/psalm-baseline.xml
+0
-10
0 additions, 10 deletions
tests/psalm-baseline.xml
tests/stub.phpstub
+55
-0
55 additions, 0 deletions
tests/stub.phpstub
with
63 additions
and
31 deletions
lib/Controller/TestController.php
+
5
−
2
View file @
91b3421c
...
...
@@ -23,6 +23,7 @@ declare(strict_types=1);
namespace
OCA\NotifyPush\Controller
;
use
OC\AppFramework\Http\Request
;
use
OCA\NotifyPush\Queue\IQueue
;
use
OCA\NotifyPush\Queue\RedisQueue
;
use
OCP\App\IAppManager
;
...
...
@@ -65,8 +66,10 @@ class TestController extends Controller {
*/
public
function
remote
():
DataDisplayResponse
{
if
(
$this
->
queue
instanceof
RedisQueue
)
{
$this
->
queue
->
getConnection
()
->
set
(
"notify_push_forwarded_header"
,
$this
->
request
->
getHeader
(
'x-forwarded-for'
));
$this
->
queue
->
getConnection
()
->
set
(
"notify_push_remote"
,
$this
->
request
->
server
[
'REMOTE_ADDR'
]);
if
(
$this
->
request
instanceof
Request
)
{
$this
->
queue
->
getConnection
()
->
set
(
"notify_push_forwarded_header"
,
$this
->
request
->
getHeader
(
'x-forwarded-for'
));
$this
->
queue
->
getConnection
()
->
set
(
"notify_push_remote"
,
$this
->
request
->
server
[
'REMOTE_ADDR'
]);
}
}
return
new
DataDisplayResponse
(
$this
->
request
->
getRemoteAddress
());
}
...
...
This diff is collapsed.
Click to expand it.
psalm.xml
+
3
−
19
View file @
91b3421c
...
...
@@ -4,7 +4,6 @@
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"https://getpsalm.org/schema/config"
xsi:schemaLocation=
"https://getpsalm.org/schema/config"
errorBaseline=
"tests/psalm-baseline.xml"
phpVersion=
"7.3"
>
<projectFiles>
...
...
@@ -13,22 +12,7 @@
<extraFiles>
<directory
name=
"vendor/christophwurst/nextcloud"
/>
</extraFiles>
<issueHandlers>
<UndefinedClass>
<errorLevel
type=
"suppress"
>
<referencedClass
name=
"OC"
/>
<referencedClass
name=
"OC\RedisFactory"
/>
</errorLevel>
</UndefinedClass>
<UndefinedDocblockClass>
<errorLevel
type=
"suppress"
>
<referencedClass
name=
"OC\RedisFactory"
/>
</errorLevel>
</UndefinedDocblockClass>
<MissingDependency>
<errorLevel
type=
"suppress"
>
<file
name=
"lib/AppInfo/Application.php"
/>
</errorLevel>
</MissingDependency>
</issueHandlers>
<stubs>
<file
name=
"tests/stub.phpstub"
preloadClasses=
"true"
/>
</stubs>
</psalm>
This diff is collapsed.
Click to expand it.
tests/psalm-baseline.xml
deleted
100644 → 0
+
0
−
10
View file @
64c6dcc3
<?xml version="1.0" encoding="UTF-8"?>
<files
psalm-version=
"4.x-dev@"
>
<file
src=
"lib/AppInfo/Application.php"
>
<InvalidArgument
occurrences=
"3"
>
<code>
addListener
</code>
<code>
addListener
</code>
<code>
addListener
</code>
</InvalidArgument>
</file>
</files>
This diff is collapsed.
Click to expand it.
tests/stub.phpstub
0 → 100644
+
55
−
0
View file @
91b3421c
<?php
declare
(
strict_types
=
1
);
/**
* @copyright Copyright (c) 2021 Robin Appelman <robin@icewind.nl>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
namespace
{
class
OC
{
/** @var string */
public
static
$configDir
;
}
}
namespace
OC
{
class
RedisFactory
{
public
function
getInstance
():
\Redis
{}
public
function
isAvailable
(){}
}
}
namespace
OC\AppFramework\Http
{
use
OCP\IRequest
;
abstract
class
Request
implements
IRequest
{
public
$server
=
[];
}
}
namespace
OC\Files\Cache
{
use
OCP\EventDispatcher\Event
;
use
OCP\Files\Cache\ICacheEvent
;
abstract
class
AbstractCacheEvent
extends
Event
implements
ICacheEvent
{
}
}
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