Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
simplesamlphp-module-proxystatistics
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
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
Perun
Perun ProxyIdP
v1
simplesamlphp-module-proxystatistics
Commits
8aa0c163
Verified
Commit
8aa0c163
authored
2 years ago
by
Dominik František Bučík
Browse files
Options
Downloads
Patches
Plain Diff
fix:
Fix ECS configuration (after update)
parent
c5b5b41f
No related branches found
No related tags found
1 merge request
!82
fix: 🐛 Fix possible exceptions
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ecs.php
+22
-18
22 additions, 18 deletions
ecs.php
lib/Config.php
+1
-1
1 addition, 1 deletion
lib/Config.php
lib/DatabaseCommand.php
+3
-3
3 additions, 3 deletions
lib/DatabaseCommand.php
with
26 additions
and
22 deletions
ecs.php
+
22
−
18
View file @
8aa0c163
...
@@ -5,12 +5,12 @@ declare(strict_types=1);
...
@@ -5,12 +5,12 @@ declare(strict_types=1);
use
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer
;
use
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer
;
use
PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer
;
use
PhpCsFixer\Fixer\FunctionNotation\FunctionTypehintSpaceFixer
;
use
PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer
;
use
PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer
;
use
Sym
fony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator
;
use
Sym
plify\EasyCodingStandard\Config\ECSConfig
;
use
Symplify\EasyCodingStandard\ValueObject\Option
;
use
Symplify\EasyCodingStandard\ValueObject\Option
;
use
Symplify\EasyCodingStandard\ValueObject\Set\SetList
;
use
Symplify\EasyCodingStandard\ValueObject\Set\SetList
;
return
static
function
(
ContainerConfigurator
$containerConfigurator
):
void
{
return
static
function
(
ECSConfig
$ecsConfig
):
void
{
$parameters
=
$
containerConfigurator
->
parameters
();
$parameters
=
$
ecsConfig
->
parameters
();
$parameters
->
set
(
Option
::
PATHS
,
[
$parameters
->
set
(
Option
::
PATHS
,
[
__DIR__
.
'/ecs.php'
,
__DIR__
.
'/ecs.php'
,
__DIR__
.
'/config-templates'
,
__DIR__
.
'/config-templates'
,
...
@@ -23,22 +23,26 @@ return static function (ContainerConfigurator $containerConfigurator): void {
...
@@ -23,22 +23,26 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$parameters
->
set
(
Option
::
PARALLEL
,
true
);
$parameters
->
set
(
Option
::
PARALLEL
,
true
);
$parameters
->
set
(
Option
::
SKIP
,
[
NotOperatorWithSuccessorSpaceFixer
::
class
,
FunctionTypehintSpaceFixer
::
class
]);
$parameters
->
set
(
Option
::
SKIP
,
[
NotOperatorWithSuccessorSpaceFixer
::
class
,
FunctionTypehintSpaceFixer
::
class
]);
$containerConfigurator
->
import
(
SetList
::
PHP_CS_FIXER
);
$ecsConfig
->
sets
(
$containerConfigurator
->
import
(
SetList
::
CLEAN_CODE
);
[
$containerConfigurator
->
import
(
SetList
::
SYMPLIFY
);
SetList
::
PHP_CS_FIXER
,
$containerConfigurator
->
import
(
SetList
::
ARRAY
);
SetList
::
CLEAN_CODE
,
$containerConfigurator
->
import
(
SetList
::
COMMON
);
SetList
::
SYMPLIFY
,
$containerConfigurator
->
import
(
SetList
::
COMMENTS
);
SetList
::
ARRAY
,
$containerConfigurator
->
import
(
SetList
::
CONTROL_STRUCTURES
);
SetList
::
COMMON
,
$containerConfigurator
->
import
(
SetList
::
DOCBLOCK
);
SetList
::
COMMENTS
,
$containerConfigurator
->
import
(
SetList
::
NAMESPACES
);
SetList
::
CONTROL_STRUCTURES
,
$containerConfigurator
->
import
(
SetList
::
PHPUNIT
);
SetList
::
DOCBLOCK
,
$containerConfigurator
->
import
(
SetList
::
SPACES
);
SetList
::
NAMESPACES
,
$containerConfigurator
->
import
(
SetList
::
STRICT
);
SetList
::
PHPUNIT
,
$containerConfigurator
->
import
(
SetList
::
SYMFONY
);
SetList
::
SPACES
,
$containerConfigurator
->
import
(
SetList
::
PSR_12
);
SetList
::
STRICT
,
SetList
::
SYMFONY
,
SetList
::
PSR_12
,
]
);
$services
=
$
containerConfigurator
->
services
();
$services
=
$
ecsConfig
->
services
();
$services
->
set
(
ArraySyntaxFixer
::
class
)
$services
->
set
(
ArraySyntaxFixer
::
class
)
->
call
(
'configure'
,
[[
->
call
(
'configure'
,
[[
'syntax'
=>
'short'
,
'syntax'
=>
'short'
,
...
...
This diff is collapsed.
Click to expand it.
lib/Config.php
+
1
−
1
View file @
8aa0c163
...
@@ -56,7 +56,7 @@ class Config
...
@@ -56,7 +56,7 @@ class Config
{
{
$this
->
config
=
Configuration
::
getConfig
(
self
::
CONFIG_FILE_NAME
);
$this
->
config
=
Configuration
::
getConfig
(
self
::
CONFIG_FILE_NAME
);
$this
->
store
=
$this
->
config
->
getConfigItem
(
self
::
STORE
,
null
);
$this
->
store
=
$this
->
config
->
getConfigItem
(
self
::
STORE
,
null
);
$this
->
tables
=
$this
->
config
->
getArray
(
'tables'
,
[]);
;
$this
->
tables
=
$this
->
config
->
getArray
(
'tables'
,
[]);
$this
->
sourceIdpEntityIdAttribute
=
$this
->
config
->
getString
(
self
::
SOURCE_IDP_ENTITY_ID_ATTRIBUTE
,
''
);
$this
->
sourceIdpEntityIdAttribute
=
$this
->
config
->
getString
(
self
::
SOURCE_IDP_ENTITY_ID_ATTRIBUTE
,
''
);
$this
->
mode
=
$this
->
config
->
getValueValidate
(
self
::
MODE
,
self
::
KNOWN_MODES
,
self
::
MODE_PROXY
);
$this
->
mode
=
$this
->
config
->
getValueValidate
(
self
::
MODE
,
self
::
KNOWN_MODES
,
self
::
MODE_PROXY
);
$this
->
keepPerUser
=
$this
->
config
->
getIntegerRange
(
self
::
KEEP_PER_USER
,
31
,
1827
,
31
);
$this
->
keepPerUser
=
$this
->
config
->
getIntegerRange
(
self
::
KEEP_PER_USER
,
31
,
1827
,
31
);
...
...
This diff is collapsed.
Click to expand it.
lib/DatabaseCommand.php
+
3
−
3
View file @
8aa0c163
...
@@ -289,11 +289,11 @@ class DatabaseCommand
...
@@ -289,11 +289,11 @@ class DatabaseCommand
];
];
if
(
Config
::
MODE_IDP
!==
$this
->
mode
&&
Config
::
MODE_MULTI_IDP
!==
$this
->
mode
)
{
if
(
Config
::
MODE_IDP
!==
$this
->
mode
&&
Config
::
MODE_MULTI_IDP
!==
$this
->
mode
)
{
$entities
[
Config
::
MODE_IDP
][
self
::
KEY_ID
]
=
$this
->
getIdpIdentifier
(
$request
);
$entities
[
Config
::
MODE_IDP
][
self
::
KEY_ID
]
=
$this
->
getIdpIdentifier
(
$request
);
$entities
[
Config
::
MODE_IDP
][
self
::
KEY_NAME
]
=
$this
->
getIdpName
(
$request
);
$entities
[
Config
::
MODE_IDP
][
self
::
KEY_NAME
]
=
$this
->
getIdpName
(
$request
);
}
}
if
(
Config
::
MODE_SP
!==
$this
->
mode
)
{
if
(
Config
::
MODE_SP
!==
$this
->
mode
)
{
$entities
[
Config
::
MODE_SP
][
self
::
KEY_ID
]
=
$this
->
getSpIdentifier
(
$request
);
$entities
[
Config
::
MODE_SP
][
self
::
KEY_ID
]
=
$this
->
getSpIdentifier
(
$request
);
$entities
[
Config
::
MODE_SP
][
self
::
KEY_NAME
]
=
$this
->
getSpName
(
$request
);
$entities
[
Config
::
MODE_SP
][
self
::
KEY_NAME
]
=
$this
->
getSpName
(
$request
);
}
}
if
(
Config
::
MODE_PROXY
!==
$this
->
mode
&&
Config
::
MODE_MULTI_IDP
!==
$this
->
mode
)
{
if
(
Config
::
MODE_PROXY
!==
$this
->
mode
&&
Config
::
MODE_MULTI_IDP
!==
$this
->
mode
)
{
...
@@ -320,7 +320,7 @@ class DatabaseCommand
...
@@ -320,7 +320,7 @@ class DatabaseCommand
$query
=
'INSERT INTO '
.
$this
->
tables
[
$table
]
.
'(identifier, name) VALUES (:identifier, :name1) '
;
$query
=
'INSERT INTO '
.
$this
->
tables
[
$table
]
.
'(identifier, name) VALUES (:identifier, :name1) '
;
if
(
$this
->
isPgsql
())
{
if
(
$this
->
isPgsql
())
{
$query
.
=
'ON CONFLICT (identifier) DO UPDATE SET name = :name2;'
;
$query
.
=
'ON CONFLICT (identifier) DO UPDATE SET name = :name2;'
;
}
else
if
(
$this
->
isMysql
())
{
}
elseif
(
$this
->
isMysql
())
{
$query
.
=
'ON DUPLICATE KEY UPDATE name = :name2'
;
$query
.
=
'ON DUPLICATE KEY UPDATE name = :name2'
;
}
else
{
}
else
{
$this
->
unknownDriver
();
$this
->
unknownDriver
();
...
...
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