Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update php-cs-fixer #92

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we'll drop all the docblock? Since it's useless

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right! in the next PR! ;)

*
* @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