Skip to content

Commit

Permalink
Remove deprecated method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Sep 3, 2019
1 parent 803bed6 commit 6792a2d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Checks/ComposerWithDevDependenciesIsUpToDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use BeyondCode\SelfDiagnosis\Composer;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;

class ComposerWithDevDependenciesIsUpToDate implements Check
{
Expand Down Expand Up @@ -42,7 +43,7 @@ public function check(array $config): bool

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

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

/**
Expand Down
3 changes: 2 additions & 1 deletion src/Checks/ComposerWithoutDevDependenciesIsUpToDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use BeyondCode\SelfDiagnosis\Composer;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;

class ComposerWithoutDevDependenciesIsUpToDate implements Check
{
Expand Down Expand Up @@ -42,7 +43,7 @@ public function check(array $config): bool

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

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

/**
Expand Down
5 changes: 3 additions & 2 deletions src/Checks/PhpExtensionsAreInstalled.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;

class PhpExtensionsAreInstalled implements Check
{
Expand Down Expand Up @@ -77,10 +78,10 @@ public function getExtensionsRequiredInComposerFile()
$extensions = [];
foreach ($installedPackages as $installedPackage) {
$filtered = Arr::where(array_keys(Arr::get($installedPackage, 'require', [])), function ($value, $key) {
return starts_with($value, self::EXT);
return Str::startsWith($value, self::EXT);
});
foreach ($filtered as $extension) {
$extensions[] = str_replace_first(self::EXT, '', $extension);
$extensions[] = Str::replaceFirst(self::EXT, '', $extension);
}
}
return array_unique($extensions);
Expand Down
4 changes: 2 additions & 2 deletions src/Checks/ServersArePingable.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ private function parseConfiguredServers(array $servers): Collection

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

Expand Down

0 comments on commit 6792a2d

Please sign in to comment.