Skip to content
Snippets Groups Projects
Commit d08f34cc authored by Daniel Hürtgen's avatar Daniel Hürtgen
Browse files

TASK: Apply StandardInterface

parent 3aba9b48
Branches
Tags
2 merge requests!37Release 0.4.0,!32Implement PHPCodeSniffer Standards Finder Service
Pipeline #95 passed with stage
in 2 minutes and 50 seconds
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard; namespace Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard;
class Standard class Standard implements StandardInterface
{ {
const RULESET_FILENAME = 'ruleset.xml'; const RULESET_FILENAME = 'ruleset.xml';
...@@ -34,7 +34,9 @@ class Standard ...@@ -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() public function getName()
{ {
...@@ -42,7 +44,9 @@ class Standard ...@@ -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() public function getPath()
{ {
...@@ -50,7 +54,9 @@ class Standard ...@@ -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() public function getRuleSetXmlPath()
{ {
......
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
namespace Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer; namespace Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer;
use Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard\Standard; use Higidi\ComposerPhpCSStandardsPlugin\PHPCodeSniffer\Standard\StandardInterface;
class Standards implements \Iterator class Standards implements \Iterator
{ {
/** /**
* @var array|Standard[] * @var StandardInterface[]
*/ */
protected $standards; protected $standards;
/** /**
* @param array $standards * @param StandardInterface[] $standards
*/ */
public function __construct(array $standards = array()) public function __construct(array $standards = array())
{ {
...@@ -23,10 +23,10 @@ class Standards implements \Iterator ...@@ -23,10 +23,10 @@ class Standards implements \Iterator
} }
/** /**
* @param Standard $standard * @param StandardInterface $standard
* @return $this * @return $this
*/ */
public function addStandard(Standard $standard) public function addStandard(StandardInterface $standard)
{ {
$this->standards[$standard->getName()] = $standard; $this->standards[$standard->getName()] = $standard;
...@@ -34,7 +34,7 @@ class Standards implements \Iterator ...@@ -34,7 +34,7 @@ class Standards implements \Iterator
} }
/** /**
* @param string|Standard $standard * @param string|StandardInterface $standard
* @return bool * @return bool
*/ */
public function hasStandard($standard) public function hasStandard($standard)
...@@ -43,7 +43,7 @@ class Standards implements \Iterator ...@@ -43,7 +43,7 @@ class Standards implements \Iterator
} }
/** /**
* @param string|Standard $standard * @param string|StandardInterface $standard
* @return $this * @return $this
*/ */
public function removeStandard($standard) public function removeStandard($standard)
...@@ -56,8 +56,8 @@ class Standards implements \Iterator ...@@ -56,8 +56,8 @@ class Standards implements \Iterator
} }
/** /**
* @param string|Standard $standard * @param string|StandardInterface $standard
* @return Standard|null * @return StandardInterface|null
*/ */
public function getStandard($standard) public function getStandard($standard)
{ {
...@@ -69,7 +69,7 @@ class Standards implements \Iterator ...@@ -69,7 +69,7 @@ class Standards implements \Iterator
} }
/** /**
* @return array|Standard[] * @return array|StandardInterface[]
*/ */
public function getStandards() public function getStandards()
{ {
...@@ -77,12 +77,12 @@ class Standards implements \Iterator ...@@ -77,12 +77,12 @@ class Standards implements \Iterator
} }
/** /**
* @param string|Standard $standard * @param string|StandardInterface $standard
* @return string * @return string
*/ */
protected function getStandardName($standard) protected function getStandardName($standard)
{ {
if ($standard instanceof Standard) { if ($standard instanceof StandardInterface) {
return $standard->getName(); return $standard->getName();
} }
...@@ -92,7 +92,7 @@ class Standards implements \Iterator ...@@ -92,7 +92,7 @@ class Standards implements \Iterator
/** /**
* Return the current element * Return the current element
* @link http://php.net/manual/en/iterator.current.php * @link http://php.net/manual/en/iterator.current.php
* @return Standard Can return any type. * @return StandardInterface Can return any type.
* @since 5.0.0 * @since 5.0.0
*/ */
public function current() public function current()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment