Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByApiPattern'. Open
Storage::move($filepath, $destination);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByHttp'. Open
if (Storage::exists($destination . '.' . $ext[1])) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Str' in method 'convertFilePathByHttp'. Open
$destination = sprintf($destinationPrefix . '%s', Str::slug(basename($filepath)));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByHttp'. Open
$info = getimagesize(Storage::path($destination));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByStorage'. Open
Storage::move($filepath, $destination);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByHttp'. Open
Storage::copy($destination, $destination . '.' . $ext[1]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByApiPattern'. Open
if (!Storage::exists($destination)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByHttp'. Open
Storage::put($destination, file_get_contents($filepath));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Illuminate\Support\Facades\Storage' in method 'convertFilePathByHttp'. Open
Storage::delete($destination . '.' . $ext[1]);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 20 and the first side effect is on line 8. Open
<?php
- Exclude checks
Possible parse error: class missing opening or closing brace Open
class Markdown
- Exclude checks
Possible parse error: class missing opening or closing brace Open
class Markdown
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
str_contains($filepath, 'storage') => $results[] = $this->convertFilePathByStorage($filepath, $destination),
- Exclude checks
Line exceeds 120 characters; contains 142 characters Open
str_contains($filepath, 'http') => $results[] = $this->convertFilePathByHttp($destinationPrefix, $filepath, $destination),
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
str_contains($filepath, 'api/images/img') => $results[] = $this->convertFilePathByApiPattern($destinationPrefix, $filepath, $destination),
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$pathInfo = pathinfo($destination);
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$destination = url('api/images/img?path=') . $destination;
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$pattern = parse_url($filepath);
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
return $match[0];
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const PATH_STRING_NAME = 'path';
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
private function convertFilePathByHttp(string $destinationPrefix, string $filepath, string &$destination): array
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const PASS_STRING_NAME = 'pass';
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
private function convertFilePathByApiPattern(
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$destination = $destination . '.' . $ext[1];
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
$destination = $vars['path'];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
}, $input);
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
{
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
if(str_contains($filepath, 'http') && !str_starts_with($filepath, url('/'))) {
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
$destination = sprintf($destinationPrefix . '%s', Str::slug(basename($filepath)));
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$ext = explode('/', $info['mime']);
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const PORT_STRING_NAME = 'port';
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
) {
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
Storage::copy($destination, $destination . '.' . $ext[1]);
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
{
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
}
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
if(str_contains($filepath, 'http') && !str_starts_with($filepath, url('/'))) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 12 Open
},
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Space before opening parenthesis of function call prohibited Open
match (true) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const SCHEME_STRING_NAME = 'scheme';
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 20 Open
default => $results[] = null,
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
if (strpos($filepath, 'api/images/img') !== false) {
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
return str_replace($match[2], $destination, $match[0]);
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const FRAGMENT_STRING_NAME = 'fragment';
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
public function getImagesPathsWithoutImageApi(string $input): string
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
parse_str($pattern[self::QUERY_STRING_NAME], $vars);
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const USER_STRING_NAME = 'user';
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$info = getimagesize(Storage::path($destination));
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
return [$filepath, $destination];
- Exclude checks
Closing brace indented incorrectly; expected 4 spaces, found 0 Open
}
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public function convertAssetPaths(string $input, string $destinationPrefix): array
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
Storage::put($destination, file_get_contents($filepath));
- Exclude checks
Line indented incorrectly; expected at least 20 spaces, found 16 Open
Storage::delete($destination . '.' . $ext[1]);
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 8 Open
if (!array_key_exists(self::EXT_STRING_NAME, $pathInfo) ||
- Exclude checks
Line indented incorrectly; expected at least 16 spaces, found 12 Open
$filepath = $match[2];
- Exclude checks
Line indented incorrectly; expected 12 spaces, found 16 Open
}
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 12 Open
if (Storage::exists($destination . '.' . $ext[1])) {
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
private function convertFilePathByStorage(
- Exclude checks
Line indented incorrectly; expected at least 12 spaces, found 8 Open
return preg_replace_callback('/!\[(.*)\]\s?\((.*)()(.*)\)/', function ($match) {
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const EXT_STRING_NAME = 'extension';
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
public const QUERY_STRING_NAME = 'query';
- Exclude checks
Line indented incorrectly; expected 0 spaces, found 4 Open
protected function unParseUrl(array $parsedUrl): string
- Exclude checks
Closing brace indented incorrectly; expected 12 spaces, found 4 Open
}
- Exclude checks
Line indented incorrectly; expected 8 spaces, found 4 Open
}
- Exclude checks