You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Tests/AbstractTestCase.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -23,10 +23,7 @@ public function __construct($name = null, array $data = [], $dataName = '')
23
23
{
24
24
parent::__construct($name, $data, $dataName);
25
25
if (!\defined('IMAGEMAGICK_DIR') || !\defined('TEST_RESOURCES_DIR')) {
26
-
thrownew \RuntimeException(
27
-
"The \"IMAGEMAGICK_DIR\" constant is not defined.\n".
28
-
'The bootstrap must be correctly included before executing test suite.'
29
-
);
26
+
thrownew \RuntimeException("The \"IMAGEMAGICK_DIR\" constant is not defined.\n".'The bootstrap must be correctly included before executing test suite.');
Copy file name to clipboardExpand all lines: src/Command.php
+8-26Lines changed: 8 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -89,12 +89,7 @@ public function __construct(?string $magickBinaryPath = '')
89
89
}
90
90
91
91
if (0 !== $code || !$process->isSuccessful()) {
92
-
thrownew \InvalidArgumentException(\sprintf(
93
-
"ImageMagick does not seem to work well, the test command resulted in an error.\n".
94
-
"Execution returned message: \"{$process->getExitCodeText()}\"\n".
95
-
"To solve this issue, please run this command and check your error messages to see if ImageMagick was correctly installed:\n%s",
96
-
$magickBinaryPath.' -version'
97
-
));
92
+
thrownew \InvalidArgumentException(\sprintf("ImageMagick does not seem to work well, the test command resulted in an error.\n"."Execution returned message: \"{$process->getExitCodeText()}\"\n"."To solve this issue, please run this command and check your error messages to see if ImageMagick was correctly installed:\n%s", $magickBinaryPath.' -version'));
98
93
}
99
94
100
95
$this->ref = newReferences();
@@ -123,10 +118,7 @@ public static function findMagickBinaryPath(?string $magickBinaryPath): string
123
118
}
124
119
125
120
if (!\is_executable($magickBinaryPath)) {
126
-
thrownew \InvalidArgumentException(\sprintf(
127
-
'The specified script (%s) is not executable.',
128
-
$magickBinaryPath
129
-
));
121
+
thrownew \InvalidArgumentException(\sprintf('The specified script (%s) is not executable.', $magickBinaryPath));
if (!\in_array($binary, static::ALLOWED_EXECUTABLES, true)) {
154
-
thrownew \InvalidArgumentException(\sprintf(
155
-
"The ImageMagick executable \"%s\" is not allowed.\n".
156
-
"The only binaries allowed to be executed are the following:\n%s",
157
-
$binary,
158
-
\implode(', ', static::ALLOWED_EXECUTABLES)
159
-
));
146
+
thrownew \InvalidArgumentException(\sprintf("The ImageMagick executable \"%s\" is not allowed.\n"."The only binaries allowed to be executed are the following:\n%s", $binary, \implode(', ', static::ALLOWED_EXECUTABLES)));
160
147
}
161
148
162
149
return [$this->magickBinaryPath, $binary];
@@ -179,7 +166,7 @@ public function newCommand(?string $binary = null): self
This command is not safe and therefore should not be used, unless you need to use an option that is not supported yet.
670
656
Use at your own risk!
671
657
If you are certain of what you are doing, you can silence this error using the "@" sign on the instruction that executes this method.
672
658
If the option you need is not supported, please open an issue or a pull-request at https://github.com/Orbitale/ImageMagickPHP in order for us to implement the option you need! 😃
673
659
MSG
674
660
;
675
-
@trigger_error($msg, E_STRICT);
661
+
@\trigger_error($msg, E_STRICT);
676
662
677
663
if ($append) {
678
664
$this->commandToAppend[] = $command;
@@ -784,11 +770,7 @@ public function polyline(array $coordinates, string $strokeColor = ''): self
'If the file really exists in your filesystem, then maybe it is not readable.',
790
-
$file
791
-
));
773
+
thrownew \InvalidArgumentException(\sprintf('The file "%s" is not found.'."\n".'If the file really exists in your filesystem, then maybe it is not readable.', $file));
Copy file name to clipboardExpand all lines: src/ReferenceClasses/Geometry.php
+2-11Lines changed: 2 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -64,10 +64,7 @@ public static function createFromParameters(
64
64
}
65
65
66
66
if ($aspectRatio && !\in_array($aspectRatio, self::$validRatios, true)) {
67
-
thrownew \InvalidArgumentException(\sprintf(
68
-
"Invalid aspect ratio value to generate geometry, \"%s\" given.\nAvailable: %s",
69
-
$aspectRatio, \implode(', ', self::$validRatios)
70
-
));
67
+
thrownew \InvalidArgumentException(\sprintf("Invalid aspect ratio value to generate geometry, \"%s\" given.\nAvailable: %s", $aspectRatio, \implode(', ', self::$validRatios)));
71
68
}
72
69
$geometry .= $aspectRatio;
73
70
@@ -139,13 +136,7 @@ public function validate(): string
139
136
}
140
137
141
138
if (\count($errors)) {
142
-
thrownew \InvalidArgumentException(\sprintf(
143
-
"The specified geometry (%s) is invalid.\n%s\n".
144
-
"Please refer to ImageMagick command line documentation about geometry:\n%s\n",
thrownew \InvalidArgumentException(\sprintf("The specified geometry (%s) is invalid.\n%s\n"."Please refer to ImageMagick command line documentation about geometry:\n%s\n", $this->value, \implode("\n", $errors), 'http://www.imagemagick.org/script/command-line-processing.php#geometry'));
0 commit comments