Skip to content

Commit

Permalink
run make fix
Browse files Browse the repository at this point in the history
  • Loading branch information
donatj committed Sep 10, 2024
1 parent a78629f commit 27b8d02
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 81 deletions.
57 changes: 35 additions & 22 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function output(int $depth)

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

## Class: donatj\MDDoc\Documentation\AbstractElement

Expand Down Expand Up @@ -205,7 +205,7 @@ function output(int $depth)

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

## Class: donatj\MDDoc\Documentation\Autoloader

Expand Down Expand Up @@ -273,7 +273,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -323,7 +323,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -372,7 +372,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand All @@ -393,7 +393,10 @@ function output(int $depth) : string
namespace donatj\MDDoc\Documentation\Badges;

class BadgePoser {
/** The type of badge to display. One of: "version" "downloads" "unstable" "license" "monthly" "daily" "phpversion" "composerlock" */
/**
* The type of badge to display. One of: "version" "downloads" "unstable" "license" "monthly" "daily" "phpversion"
* "composerlock"
*/
public const OPT_TYPE = 'type';
/** The packagist name of the package. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present. */
public const OPT_NAME = 'name';
Expand All @@ -420,7 +423,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand All @@ -441,7 +444,10 @@ function output(int $depth) : string
namespace donatj\MDDoc\Documentation\Badges;

class BadgeScrutinizer {
/** The packagist name of the Scrutinizer Project. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present. */
/**
* The packagist name of the Scrutinizer Project. Defaults to the name key of the composer.json file in the root of
* the project. Required if the composer.json file is not present.
*/
public const OPT_NAME = 'name';
/** The type of badge to display. One of: "quality" "coverage" "build-status" */
public const OPT_TYPE = 'type';
Expand Down Expand Up @@ -470,7 +476,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -518,7 +524,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand All @@ -539,7 +545,10 @@ function output(int $depth) : string
namespace donatj\MDDoc\Documentation\Badges;

class BadgeTravis {
/** The packagist name of the Travis Project. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present. */
/**
* The packagist name of the Travis Project. Defaults to the name key of the composer.json file in the root of the
* project. Required if the composer.json file is not present.
*/
public const OPT_NAME = 'name';
/** The branch to show. Defaults to "master" */
public const OPT_BRANCH = 'branch';
Expand All @@ -564,7 +573,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -604,7 +613,7 @@ function output(int $depth) : \donatj\MDDom\Paragraph

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand All @@ -628,7 +637,7 @@ function output(int $depth) : \donatj\MDDom\Paragraph

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -670,7 +679,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -722,7 +731,7 @@ function output(int $depth)

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -858,7 +867,7 @@ function output(int $depth)

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -946,7 +955,7 @@ function output(int $depth) : \donatj\MDDom\Document

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -1012,7 +1021,7 @@ function output(int $depth) : string

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -1074,7 +1083,7 @@ function output(int $depth) : \donatj\MDDom\DocumentDepth

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -1140,7 +1149,7 @@ function output(int $depth) : \donatj\MDDom\AbstractElement

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand All @@ -1164,7 +1173,7 @@ function output(int $depth) : \donatj\MDDom\AbstractElement

#### Returns:

- ***\donatj\MDDom\AbstractElement*** | ***string*** - Cannot be annotated as also accepts __toString-able objects
- ***\donatj\MDDom\AbstractElement*** | ***string*** | ***void*** - Cannot be annotated as also accepts __toString-able objects

---

Expand Down Expand Up @@ -1384,6 +1393,10 @@ function withAttr(array $attributes) : self

Returns a clone of this ImmutableAttributeTree with another depth of attributes appended.

#### Parameters:

- ***array<string,string>*** `$attributes`

#### Returns:

- ***$this*** - Clone of current ImmutableAttributeTree
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,8 @@ Include a badge "shield" image from Pugx Poser https://poser.pugx.org/

#### Attributes:

- `type` **(required)** - The type of badge to display. One of: "version" "downloads" "unstable" "license" "monthly" "daily" "phpversion" "composerlock"
- `type` **(required)** - The type of badge to display. One of: "version" "downloads" "unstable" "license" "monthly" "daily" "phpversion"
"composerlock"
- `name` - The packagist name of the package. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present.
- `suffix` - The poser endpoint to use. Defaults based on the type

Expand All @@ -309,7 +310,8 @@ Include a badge "shield" image from Travis CI

#### Attributes:

- `name` **(required)** - The packagist name of the Travis Project. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present.
- `name` **(required)** - The packagist name of the Travis Project. Defaults to the name key of the composer.json file in the root of the
project. Required if the composer.json file is not present.
- `branch` - The branch to show. Defaults to "master"

### `<badge-scrutinizer />`
Expand All @@ -318,7 +320,8 @@ Include a badge "shield" image from Scrutinizer CI

#### Attributes:

- `name` **(required)** - The packagist name of the Scrutinizer Project. Defaults to the name key of the composer.json file in the root of the project. Required if the composer.json file is not present.
- `name` **(required)** - The packagist name of the Scrutinizer Project. Defaults to the name key of the composer.json file in the root of
the project. Required if the composer.json file is not present.
- `type` **(required)** - The type of badge to display. One of: "quality" "coverage" "build-status"
- `suffix` - The Scrutinizer endpoint to use. Defaults based on the type
- `branch` - The branch to show. Defaults to "master"
Expand Down
3 changes: 1 addition & 2 deletions src/Autoloaders/MultiLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

namespace donatj\MDDoc\Autoloaders;

use Countable;
use donatj\MDDoc\Autoloaders\Interfaces\AutoloaderInterface;

/**
* A simple autoloader chain
*/
class MultiLoader implements AutoloaderInterface, Countable {
class MultiLoader implements AutoloaderInterface, \Countable {

/** @var AutoloaderInterface[] */
private $loaders;
Expand Down
2 changes: 1 addition & 1 deletion src/Autoloaders/Psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Psr4 implements AutoloaderInterface {

/**
* @param string $root_namespace Namespace prefix
* @param string $path Root path
* @param string $path Root path
*/
public function __construct( string $root_namespace, string $path ) {
$this->namespace = $this->trimSlashes($root_namespace);
Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/Badges/BadgeShielded.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function init() : void {
'title' => $title,
'text' => $text,
'color' => $color,
], static function( $v ) {
], static function ( $v ) {
return $v !== '';
}));

Expand Down
5 changes: 2 additions & 3 deletions src/Documentation/ComposerInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use donatj\MDDoc\Exceptions\PathNotReadableException;
use donatj\MDDom\CodeBlock;
use donatj\MDDom\Paragraph;
use RuntimeException;

class ComposerInstall extends AbstractDocPart {

Expand Down Expand Up @@ -56,7 +55,7 @@ public function output( int $depth ) : Paragraph {
foreach( $packageNames as $key => $packageName ) {
if( $packageName === '.' ) {
if( !$composerName ) {
throw new RuntimeException('Unable to determine composer package name from composer.json');
throw new \RuntimeException('Unable to determine composer package name from composer.json');
}

$packageNames[$key] = $composerName;
Expand All @@ -67,7 +66,7 @@ public function output( int $depth ) : Paragraph {
}

if( !$packageNames ) {
throw new RuntimeException('Unable to determine composer package name from composer.json and no package names provided');
throw new \RuntimeException('Unable to determine composer package name from composer.json and no package names provided');
}

$para = new Paragraph;
Expand Down
3 changes: 1 addition & 2 deletions src/Documentation/ExecOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use donatj\MDDom\Code;
use donatj\MDDom\CodeBlock;
use donatj\MDDom\Paragraph;
use RuntimeException;

class ExecOutput extends AbstractDocPart {

Expand Down Expand Up @@ -73,7 +72,7 @@ public function output( int $depth ) : AbstractElement {
case self::FORMAT_CODE_BLOCK:
return new CodeBlock($md, $this->getOption('lang'));
default:
throw new RuntimeException("unhandled format '$format'");
throw new \RuntimeException("unhandled format '$format'");
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/Documentation/PhpFileDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
use phpDocumentor\Reflection\Php\Method;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use RuntimeException;

class PhpFileDocs extends AbstractDocPart implements AutoloaderAware, LoggerAwareInterface {

Expand Down Expand Up @@ -689,7 +688,7 @@ private function logInvalidTag(
if( $this->logger ) {
$this->logger->notice($message, $ctx);
} else {
throw new RuntimeException($message);
throw new \RuntimeException($message);
}
}

Expand Down
19 changes: 7 additions & 12 deletions src/Documentation/RecursiveDirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@

namespace donatj\MDDoc\Documentation;

use ArrayIterator;
use donatj\MDDoc\Autoloaders\Interfaces\AutoloaderInterface;
use donatj\MDDoc\Documentation\Interfaces\AutoloaderAware;
use donatj\MDDom\Document;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use RecursiveDirectoryIterator;
use RecursiveIteratorIterator;
use RegexIterator;
use SplFileInfo;

class RecursiveDirectory extends AbstractNestedDoc implements AutoloaderAware, LoggerAwareInterface {

Expand Down Expand Up @@ -84,21 +79,21 @@ private function getFileList( string $path ) : iterable {
$path = rtrim($path, DIRECTORY_SEPARATOR);

if( is_dir($path) ) {
$dir = new RecursiveDirectoryIterator($path);
$ite = new RecursiveIteratorIterator($dir);
$dir = new \RecursiveDirectoryIterator($path);
$ite = new \RecursiveIteratorIterator($dir);
/** @var \Traversable<\SplFileInfo> $files */
$files = new RegexIterator($ite, "/\\.php$/");
$files = new \RegexIterator($ite, "/\\.php$/");

$fileArray = iterator_to_array($files, false);
usort($fileArray, function( SplFileInfo $a, SplFileInfo $b ) : int {
usort($fileArray, function ( \SplFileInfo $a, \SplFileInfo $b ) : int {
return strnatcasecmp($a->getRealPath(), $b->getRealPath());
});

return new ArrayIterator($fileArray);
return new \ArrayIterator($fileArray);
}

return new ArrayIterator([
new SplFileInfo($path),
return new \ArrayIterator([
new \SplFileInfo($path),
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Documentation/Replace.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Replace extends AbstractNestedDoc {
public const OPT_REGEX = 'regex';

public function output( int $depth ) : string {
/** @var "true"|"false" $regex */
/** @var "false"|"true" $regex */
$regex = $this->requireOption(self::OPT_REGEX);
$regex = strtolower($regex);

Expand Down
Loading

0 comments on commit 27b8d02

Please sign in to comment.