Skip to content

Commit 6792a2d

Browse files
committed
Remove deprecated method calls
1 parent 803bed6 commit 6792a2d

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/Checks/ComposerWithDevDependenciesIsUpToDate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use BeyondCode\SelfDiagnosis\Composer;
66
use Illuminate\Support\Arr;
7+
use Illuminate\Support\Str;
78

89
class ComposerWithDevDependenciesIsUpToDate implements Check
910
{
@@ -42,7 +43,7 @@ public function check(array $config): bool
4243

4344
$this->output = $this->composer->installDryRun($additionalOptions);
4445

45-
return str_contains($this->output, 'Nothing to install or update');
46+
return Str::contains($this->output, 'Nothing to install or update');
4647
}
4748

4849
/**

src/Checks/ComposerWithoutDevDependenciesIsUpToDate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use BeyondCode\SelfDiagnosis\Composer;
66
use Illuminate\Support\Arr;
7+
use Illuminate\Support\Str;
78

89
class ComposerWithoutDevDependenciesIsUpToDate implements Check
910
{
@@ -42,7 +43,7 @@ public function check(array $config): bool
4243

4344
$this->output = $this->composer->installDryRun('--no-dev ' . $additionalOptions);
4445

45-
return str_contains($this->output, 'Nothing to install or update');
46+
return Str::contains($this->output, 'Nothing to install or update');
4647
}
4748

4849
/**

src/Checks/PhpExtensionsAreInstalled.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Filesystem\Filesystem;
66
use Illuminate\Support\Arr;
77
use Illuminate\Support\Collection;
8+
use Illuminate\Support\Str;
89

910
class PhpExtensionsAreInstalled implements Check
1011
{
@@ -77,10 +78,10 @@ public function getExtensionsRequiredInComposerFile()
7778
$extensions = [];
7879
foreach ($installedPackages as $installedPackage) {
7980
$filtered = Arr::where(array_keys(Arr::get($installedPackage, 'require', [])), function ($value, $key) {
80-
return starts_with($value, self::EXT);
81+
return Str::startsWith($value, self::EXT);
8182
});
8283
foreach ($filtered as $extension) {
83-
$extensions[] = str_replace_first(self::EXT, '', $extension);
84+
$extensions[] = Str::replaceFirst(self::EXT, '', $extension);
8485
}
8586
}
8687
return array_unique($extensions);

src/Checks/ServersArePingable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ private function parseConfiguredServers(array $servers): Collection
8888

8989
foreach ($servers as $server) {
9090
if (is_array($server)) {
91-
if (!empty(array_except($server, ['host', 'port', 'timeout']))) {
91+
if (!empty(Arr::except($server, ['host', 'port', 'timeout']))) {
9292
throw new InvalidConfigurationException('Servers in array notation may only contain a host, port and timeout parameter.');
9393
}
94-
if (!array_has($server, 'host')) {
94+
if (!Arr::has($server, 'host')) {
9595
throw new InvalidConfigurationException('For servers in array notation, the host parameter is required.');
9696
}
9797

0 commit comments

Comments
 (0)