Skip to content

Commit

Permalink
Implemented a few more PHP CS Fixer changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed May 3, 2019
1 parent 36381ea commit 51f9d2f
Show file tree
Hide file tree
Showing 78 changed files with 936 additions and 1,002 deletions.
323 changes: 185 additions & 138 deletions .php_cs.dist

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .phpunit.result.cache

This file was deleted.

2 changes: 0 additions & 2 deletions src/Dictionary/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -2255,8 +2255,6 @@ class Entity
* Utility function converts entities into their real unicode characters.
*
* @param string $input The input string.
*
* @return string
*/
public static function convertEntitiesToUnicode(string $input): string
{
Expand Down
4 changes: 0 additions & 4 deletions src/HandlerStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ public function registerNamespaces(Ns $ns): void

/**
* Returns information about the HandlerStack that is useful for debugging.
*
* @return array
*/
public function debugStack(): array
{
Expand Down Expand Up @@ -253,8 +251,6 @@ protected function logRegistration(callable $middleware, ?string $name = null):
*
* @param callable $middleware The middleware to add to the stack.
* @param string|null $name A name for the middleware. Can be used with `pushBefore()` and `pushAfter()`.
*
* @return string
*/
protected function exceptionMessage(callable $middleware, ?string $name = null): string
{
Expand Down
8 changes: 0 additions & 8 deletions src/HandlerStackInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ interface HandlerStackInterface extends C\SetLoggerInterface
* will be thrown.
*
* @throws MiddlewareException
*
* @return self
*/
public function append(callable $middleware, ?string $name = null, ?string $overrideType = null): self;

Expand All @@ -54,8 +52,6 @@ public function append(callable $middleware, ?string $name = null, ?string $over
* @param string|null $name A name for the middleware. Can be used with `pushBefore()` and `pushAfter()`.
*
* @throws MiddlewareException
*
* @return self
*/
public function appendClosure(string $overrideType, callable $middleware, ?string $name = null): self;

Expand All @@ -72,8 +68,6 @@ public function appendClosure(string $overrideType, callable $middleware, ?strin
* will be thrown.
*
* @throws MiddlewareException
*
* @return self
*/
public function prepend(callable $middleware, ?string $name = null, ?string $overrideType = null): self;

Expand All @@ -90,8 +84,6 @@ public function prepend(callable $middleware, ?string $name = null, ?string $ove
* @param string|null $name A name for the middleware. Can be used with `pushBefore()` and `pushAfter()`.
*
* @throws MiddlewareException
*
* @return self
*/
public function prependClosure(string $overrideType, callable $middleware, ?string $name = null): self;

Expand Down
2 changes: 0 additions & 2 deletions src/Middleware/AbstractMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ public function addArrayProperty(&$object, string $property): void
* @param array $arr The associative array to check.
* @param string $key The key in the associative array to return the value for.
* @param mixed $default The default value to return if there is no value. The default value is `null`.
*
* @return mixed
*/
public function get(array $arr, string $key, $default = null)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Middleware/Xml/AbstractXmlMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ abstract class AbstractXmlMiddleware extends AbstractMiddleware
* @param bool $makeInsensitive Whether or not the handling should be made case-insensitive. A value of `true`
* means that the handling should be case-insensitive. A value of `false` means that
* the handling should be case-sensitive. The default value is `true`.
*
* @return self
*/
public function setCaseInsensitive(bool $makeInsensitive = true): self
{
Expand All @@ -51,8 +49,6 @@ public function setCaseInsensitive(bool $makeInsensitive = true): self
*
* @param string $query An XPath query where `%s` is used in-place of the XML namespace alias.
* @param string $namespaceAlias The XML namespace alias to apply.
*
* @return string
*/
public function applyNsToQuery(string $query, string $namespaceAlias): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Middleware/Xml/XmlInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ public function __invoke(stdClass $feedRoot, string $namespaceAlias, DOMXPath $x
* 'http://www.w3.org/2005/Atom' => 'atom10'
* ];
* ```
*
* @return array
*/
public function getSupportedNamespaces(): array;
}
4 changes: 0 additions & 4 deletions src/Mixin/DateTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ trait DateTrait
*
* @param string $createFromFormat The format of the datestamp in the feed.
*
* @return self
*
* @see http://php.net/manual/en/datetime.createfromformat.php
*/
public function setDateFormat(string $createFromFormat): self
Expand All @@ -59,8 +57,6 @@ public function setDateFormat(string $createFromFormat): self
*
* @param string $timezone The timezone identifier to use. Must be compatible with `DateTimeZone`. The default
* value is `UTC`.
*
* @return self
*/
public function setOutputTimezone(string $timezone = 'UTC'): self
{
Expand Down
6 changes: 0 additions & 6 deletions src/Mixin/DeepTypeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ trait DeepTypeTrait
* looking at the response from `getRoot()`.
* @param string|null $namespaceAlias The XML namespace alias to apply.
*
* @return Node
*
* @phpcs:disable Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine
*/
protected function getScalarSingleValue(
Expand Down Expand Up @@ -65,8 +63,6 @@ protected function getScalarSingleValue(
* @param string $className The class name to instantiate when there is not a defined value.
* @param string|null $namespaceAlias The XML namespace alias to apply.
*
* @return TypeInterface
*
* @phpcs:disable Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine
*/
protected function getComplexSingleValue(
Expand Down Expand Up @@ -95,8 +91,6 @@ protected function getComplexSingleValue(
* looking at the response from `getRoot()`.
* @param string|null $namespaceAlias The XML namespace alias to apply.
*
* @return iterable
*
* @phpcs:disable Generic.Functions.OpeningFunctionBraceBsdAllman.BraceOnSameLine
*/
protected function getComplexMultipleValues(
Expand Down
2 changes: 0 additions & 2 deletions src/Mixin/DomDocumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ trait DomDocumentTrait

/**
* Gets the DOMDocument object which is being used to parse the content.
*
* @return DOMDocument
*/
public function getDomDocument(): DOMDocument
{
Expand Down
4 changes: 1 addition & 3 deletions src/Mixin/LoggerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait LoggerTrait
/**
* Sets the PSR-3 logger.
*
* @param LoggerInterface $logger
* @param LoggerInterface $logger A PSR-3 compatible logger.
*
* @return self
*/
Expand All @@ -48,8 +48,6 @@ public function setLogger(LoggerInterface $logger)

/**
* Retrieves the PSR-3 logger.
*
* @return LoggerInterface
*/
public function getLogger(): LoggerInterface
{
Expand Down
2 changes: 0 additions & 2 deletions src/Mixin/RawDocumentTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ trait RawDocumentTrait

/**
* Retrieves the raw, unparsed contents of the feed's stream.
*
* @return string
*/
public function getRawDocument(): string
{
Expand Down
2 changes: 0 additions & 2 deletions src/Mixin/RootTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ trait RootTrait

/**
* Retrieve the root-most node in the feed.
*
* @return object
*/
public function getRoot(): object
{
Expand Down
2 changes: 0 additions & 2 deletions src/Parser/AbstractParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ abstract class AbstractParser implements ParserInterface
*
* Note: Use of MD5 here is not cryptographically significant.
*
* @return string
*
* @see http://php.net/manual/en/language.oop5.magic.php#object.tostring
*/
public function __toString(): string
Expand Down
6 changes: 0 additions & 6 deletions src/Parser/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ public function __construct(

/**
* Get the input datestamp.
*
* @return string
*/
public function getDatestamp(): string
{
Expand All @@ -126,8 +124,6 @@ public function getDatestamp(): string

/**
* Get the requested output timezone.
*
* @return string
*/
public function getOutputTimezone(): string
{
Expand All @@ -136,8 +132,6 @@ public function getOutputTimezone(): string

/**
* Get the format used to assist date string parsing.
*
* @return string|null
*/
public function getCreateFromFormat(): ?string
{
Expand Down
8 changes: 0 additions & 8 deletions src/Parser/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,6 @@ public function __construct(

/**
* Get the XML namespace handler.
*
* @return Ns
*/
public function getNs(): Ns
{
Expand All @@ -179,8 +177,6 @@ public function getNs(): Ns

/**
* Get the preferred namespace alias.
*
* @return string|null
*/
public function getNamespaceAlias(): ?string
{
Expand Down Expand Up @@ -218,8 +214,6 @@ public function xpath()
* pointer to the next node, then the next until it finds a real XML node.
*
* @param DOMNode $node The `DOMNode` element to evaluate.
*
* @return DOMNode
*/
public function findNextRealNode(DOMNode $node): DOMNode
{
Expand All @@ -234,8 +228,6 @@ public function findNextRealNode(DOMNode $node): DOMNode

/**
* Retrieves the object which represents the top-level feed.
*
* @return Feed
*/
public function getFeed(): Feed
{
Expand Down
14 changes: 3 additions & 11 deletions src/SimplePie.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function __construct()
/**
* Sets the libxml value to use for parsing XML.
*
* @param int $libxml
* @param int $libxml TODO add a description here.
*
* @return int
*/
Expand All @@ -90,8 +90,6 @@ public function setLibxml(int $libxml)

/**
* Gets the libxml value to use for parsing XML.
*
* @return int
*/
public function getLibxml(): int
{
Expand All @@ -101,7 +99,7 @@ public function getLibxml(): int
/**
* Sets the handler stack which contains registered middleware.
*
* @param HandlerStackInterface $handlerStack
* @param HandlerStackInterface $handlerStack TODO add a description here.
*
* @return self
*/
Expand All @@ -115,8 +113,6 @@ public function setMiddlewareStack(HandlerStackInterface $handlerStack)

/**
* Gets the handler stack which contains registered middleware.
*
* @return HandlerStackInterface
*/
public function getMiddlewareStack(): HandlerStackInterface
{
Expand All @@ -133,19 +129,15 @@ public function getMiddlewareStack(): HandlerStackInterface
* should inject the entity definitions. A value of `false` means
* that SimplePie should NOT inject the entity definitions. The
* default value is `false`.
*
* @return XmlParser
*/
public function parseXml(StreamInterface $stream, bool $handleHtmlEntitiesInXml = false): XmlParser
{
$parser = new XmlParser(
return new XmlParser(
$stream,
$this->logger,
$this->middleware,
$this->libxml,
$handleHtmlEntitiesInXml
);

return $parser;
}
}
4 changes: 0 additions & 4 deletions src/Type/AbstractType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ abstract class AbstractType
* @param string $nodeName The name of the method being called.
* @param array $args Any arguments passed into that method.
*
* @return mixed
*
* @internal
*/
public function __call(string $nodeName, array $args)
Expand All @@ -49,8 +47,6 @@ public function __call(string $nodeName, array $args)
*
* @param string $nodeName The short version of the call (without the `get`).
*
* @return string
*
* @internal
*/
protected function getUnresolvableMessage(string $nodeName): string
Expand Down
2 changes: 0 additions & 2 deletions src/Type/BranchInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ interface BranchInterface
*
* @param string $nodeName The name of the method being called.
*
* @return string
*
* @internal
*/
public function getAlias(string $nodeName): string;
Expand Down
8 changes: 0 additions & 8 deletions src/Type/Entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public function __construct(

/**
* Converts this object into a string representation.
*
* @return string
*/
public function __toString(): string
{
Expand All @@ -105,8 +103,6 @@ public function __toString(): string

/**
* Gets the DOMNode element.
*
* @return DOMNode|null
*/
public function getNode(): ?DOMNode
{
Expand All @@ -117,8 +113,6 @@ public function getNode(): ?DOMNode
* Finds the common internal alias for a given method name.
*
* @param string $nodeName The name of the method being called.
*
* @return string
*/
public function getAlias(string $nodeName): string
{
Expand Down Expand Up @@ -160,8 +154,6 @@ public function getAlias(string $nodeName): string
*
* @throws SimplePieException
*
* @return mixed
*
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.MaxExceeded
*/
public function getHandler(string $nodeName, array $args = [])
Expand Down
4 changes: 0 additions & 4 deletions src/Type/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public function __construct(string $namespaceAlias)

/**
* Finds the default namespace alias for the feed type.
*
* @return string
*/
public function getDefaultNs(): string
{
Expand All @@ -93,8 +91,6 @@ public function getDefaultNs(): string
*
* @param string $nodeName The name of the method being called.
*
* @return string
*
* @phpcs:disable Generic.Metrics.CyclomaticComplexity.MaxExceeded
*/
public function getAlias(string $nodeName): string
Expand Down

0 comments on commit 51f9d2f

Please sign in to comment.