Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
composer-phpcodesniffer-standards-plugin
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
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
Daniel Hürtgen
composer-phpcodesniffer-standards-plugin
Commits
d08f34cc
There was a problem fetching the latest pipeline status.
Commit
d08f34cc
authored
7 years ago
by
Daniel Hürtgen
Browse files
Options
Downloads
Patches
Plain Diff
TASK: Apply StandardInterface
parent
3aba9b48
2 merge requests
!37
Release 0.4.0
,
!32
Implement PHPCodeSniffer Standards Finder Service
Pipeline
#95
passed with stage
in 2 minutes and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/PHPCodeSniffer/Standard/Standard.php
+10
-4
10 additions, 4 deletions
src/PHPCodeSniffer/Standard/Standard.php
src/PHPCodeSniffer/Standards.php
+13
-13
13 additions, 13 deletions
src/PHPCodeSniffer/Standards.php
with
23 additions
and
17 deletions
src/PHPCodeSniffer/Standard/Standard.php
+
10
−
4
View file @
d08f34cc
...
...
@@ -2,7 +2,7 @@
namespace
Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard
;
class
Standard
class
Standard
implements
StandardInterface
{
const
RULESET_FILENAME
=
'ruleset.xml'
;
...
...
@@ -34,7 +34,9 @@ class Standard
}
/**
* @return string
* Get the name of the PHPCodeSniffer standard.
*
* @return string The name of the PHPCodeSniffer standard.
*/
public
function
getName
()
{
...
...
@@ -42,7 +44,9 @@ class Standard
}
/**
* @return string
* Get the path to PHPCodeSniffer standard.
*
* @return string The path to the PHPCodeSniffer standard.
*/
public
function
getPath
()
{
...
...
@@ -50,7 +54,9 @@ class Standard
}
/**
* @return string
* Get the path to the PHPCodeSniffer ruleset.xml file.
*
* @return string The path to the PHPCodeSniffer ruleset.xml file.
*/
public
function
getRuleSetXmlPath
()
{
...
...
This diff is collapsed.
Click to expand it.
src/PHPCodeSniffer/Standards.php
+
13
−
13
View file @
d08f34cc
...
...
@@ -2,18 +2,18 @@
namespace
Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer
;
use
Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard\Standard
;
use
Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard\Standard
Interface
;
class
Standards
implements
\Iterator
{
/**
* @var
array|
Standard[]
* @var Standard
Interface
[]
*/
protected
$standards
;
/**
* @param
array
$standards
* @param
StandardInterface[]
$standards
*/
public
function
__construct
(
array
$standards
=
array
())
{
...
...
@@ -23,10 +23,10 @@ class Standards implements \Iterator
}
/**
* @param Standard $standard
* @param Standard
Interface
$standard
* @return $this
*/
public
function
addStandard
(
Standard
$standard
)
public
function
addStandard
(
Standard
Interface
$standard
)
{
$this
->
standards
[
$standard
->
getName
()]
=
$standard
;
...
...
@@ -34,7 +34,7 @@ class Standards implements \Iterator
}
/**
* @param string|Standard $standard
* @param string|Standard
Interface
$standard
* @return bool
*/
public
function
hasStandard
(
$standard
)
...
...
@@ -43,7 +43,7 @@ class Standards implements \Iterator
}
/**
* @param string|Standard $standard
* @param string|Standard
Interface
$standard
* @return $this
*/
public
function
removeStandard
(
$standard
)
...
...
@@ -56,8 +56,8 @@ class Standards implements \Iterator
}
/**
* @param string|Standard $standard
* @return Standard|null
* @param string|Standard
Interface
$standard
* @return Standard
Interface
|null
*/
public
function
getStandard
(
$standard
)
{
...
...
@@ -69,7 +69,7 @@ class Standards implements \Iterator
}
/**
* @return array|Standard[]
* @return array|Standard
Interface
[]
*/
public
function
getStandards
()
{
...
...
@@ -77,12 +77,12 @@ class Standards implements \Iterator
}
/**
* @param string|Standard $standard
* @param string|Standard
Interface
$standard
* @return string
*/
protected
function
getStandardName
(
$standard
)
{
if
(
$standard
instanceof
Standard
)
{
if
(
$standard
instanceof
Standard
Interface
)
{
return
$standard
->
getName
();
}
...
...
@@ -92,7 +92,7 @@ class Standards implements \Iterator
/**
* Return the current element
* @link http://php.net/manual/en/iterator.current.php
* @return Standard Can return any type.
* @return Standard
Interface
Can return any type.
* @since 5.0.0
*/
public
function
current
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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