Skip to content

Commit

Permalink
chore: update php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
JellyBellyDev committed Jan 3, 2023
1 parent 13f4ae7 commit d48ce01
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion spec/PUGX/Poser/PoserSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function getMatchers(): array
{
return [
'beAValidSVGImageContaining' => function ($object, $subject, $status) {
$regex = '/^<svg.*width="((.|\n)*)' . $subject . '((.|\n)*)' . $status . '((.|\n)*)<\/svg>$/';
$regex = '/^<svg.*width="((.|\n)*)' . $subject . '((.|\n)*)' . $status . '((.|\n)*)<\/svg>$/';
$matches = [];

return \preg_match($regex, $object, $matches, \PREG_OFFSET_CAPTURE, 0);
Expand Down
2 changes: 1 addition & 1 deletion spec/PUGX/Poser/Render/SvgFlatRenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getMatchers(): array
{
return [
'beAValidSVGImage' => function ($subject) {
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$matches = [];

return \preg_match($regex, (string) $subject, $matches, \PREG_OFFSET_CAPTURE, 0);
Expand Down
2 changes: 1 addition & 1 deletion spec/PUGX/Poser/Render/SvgFlatSquareRenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getMatchers(): array
{
return [
'beAValidSVGImage' => function ($subject) {
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$matches = [];

return \preg_match($regex, (string) $subject, $matches, \PREG_OFFSET_CAPTURE, 0);
Expand Down
2 changes: 1 addition & 1 deletion spec/PUGX/Poser/Render/SvgPlasticRenderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getMatchers(): array
{
return [
'beAValidSVGImage' => function ($subject) {
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$regex = '/^<svg.*width="((.|\n)*)<\/svg>$/';
$matches = [];

return \preg_match($regex, (string) $subject, $matches, \PREG_OFFSET_CAPTURE, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/Badge.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function escapeValue(string $value): string
'/--+/',
];
$replacement = [
//'$1 $2',
// '$1 $2',
'$1 ',
' $1',
'°§*¼',
Expand Down
10 changes: 0 additions & 10 deletions src/Poser.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class Poser

/**
* Constructor.
*
* @param $renders
*/
public function __construct(array $renders)
{
Expand All @@ -24,12 +22,6 @@ public function __construct(array $renders)

/**
* Generate and Render a badge according to the style.
*
* @param $subject
* @param $status
* @param $color
* @param $style
* @param $format
*/
public function generate(string $subject, string $status, string $color, string $style, string $format = Badge::DEFAULT_FORMAT): Image
{
Expand All @@ -41,8 +33,6 @@ public function generate(string $subject, string $status, string $color, string
/**
* Generate and Render a badge according to the format from an URI,
* eg license-MIT-blue.svg or I_m-liuggio-yellow.svg.
*
* @param $string
*/
public function generateFromURI(string $string): Image
{
Expand Down
3 changes: 1 addition & 2 deletions src/Render/LocalSvgRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use PUGX\Poser\Calculator\GDTextSizeCalculator;
use PUGX\Poser\Calculator\TextSizeCalculatorInterface;
use PUGX\Poser\Image;
use SimpleXMLElement;

/**
* Local SVG renderer.
Expand Down Expand Up @@ -80,7 +79,7 @@ private function renderSvg(string $render, array $parameters, string $style): Im
}

try {
$xml = new SimpleXMLElement($render);
$xml = new \SimpleXMLElement($render);
} catch (\Exception $e) {
throw new \RuntimeException('Generated string is not a valid XML');
}
Expand Down
7 changes: 3 additions & 4 deletions src/Render/SvgForTheBadgeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace PUGX\Poser\Render;

use EasySVG;
use PUGX\Poser\Badge;
use PUGX\Poser\Calculator\TextSizeCalculatorInterface;

Expand All @@ -24,17 +23,17 @@ class SvgForTheBadgeRenderer extends LocalSvgRenderer
public const TEXT_LETTER_SPACING = 0.1;
public const PADDING_X = 10;

private EasySVG $easy;
private \EasySVG $easy;

public function __construct(
?EasySVG $easySVG = null,
?\EasySVG $easySVG = null,
?TextSizeCalculatorInterface $textSizeCalculator = null,
?string $templatesDirectory = null
) {
parent::__construct($textSizeCalculator, $templatesDirectory);

if (null === $easySVG) {
$easySVG = new EasySVG();
$easySVG = new \EasySVG();
}

$this->easy = $easySVG;
Expand Down

0 comments on commit d48ce01

Please sign in to comment.