Skip to content
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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
php: ['8.2', '8.3', '8.4', '8.5']
name: 'PHP ${{ matrix.php }}'
steps:
- run: git config --global --add safe.directory /__w/ShellCommandBuilder/ShellCommandBuilder
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-json": "*"
},
"require-dev": {
"infection/infection": "^0.28.1 || ^0.29.14",
"phpunit/phpunit": "^10.0 || ^12.0",
"pluswerk/grumphp-config": "^7 || ^10",
"pluswerk/grumphp-config": "^11",
"spatie/phpunit-watcher": "^1.24 || dev-master#071fbbf"
},
"minimum-stability": "stable",
Expand All @@ -32,6 +32,7 @@
},
"config": {
"allow-plugins": {
"a9f/fractor-extension-installer": true,
"ergebnis/composer-normalize": true,
"infection/extension-installer": true,
"phpro/grumphp": true,
Expand Down
18 changes: 18 additions & 0 deletions fractor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use a9f\Fractor\Configuration\FractorConfiguration;
use PLUS\GrumPHPConfig\FractorSettings;

return FractorConfiguration::configure()
->withPaths(array_filter(explode("\n", (string)shell_exec("git ls-files | xargs ls -d 2>/dev/null"))))
->withSets([
...FractorSettings::sets(true),
])
->withRules([
...FractorSettings::rules(),
])
->withOptions([
...FractorSettings::options(),
]);
4 changes: 4 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ parameters:
convention.rector_config: rector.php
convention.rector_clear-cache: false
convention.phpstan_level: null
convention.fractor_ignore_pattern: { }
convention.fractor_enable: true
convention.fractor_config: fractor.php
convention.fractor_clear-cache: false
11 changes: 3 additions & 8 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
<?xml version="1.0"?>
<psalm
totallyTyped="true"
errorLevel="1"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
xmlns="https://getpsalm.org/schema/config" totallyTyped="true" errorLevel="1" resolveFromConfigFile="true" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd">
<projectFiles>
<directory name="src" />
<directory name="src"/>
<ignoreFiles>
<directory name="vendor" />
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
</psalm>
8 changes: 3 additions & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
declare(strict_types=1);

use PLUS\GrumPHPConfig\RectorSettings;
use Rector\Config\RectorConfig;
use Rector\Caching\ValueObject\Storage\FileCacheStorage;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->parallel();
Expand All @@ -21,22 +21,20 @@
$rectorConfig->sets(
[
...RectorSettings::sets(true),
...RectorSettings::setsTypo3(false),
]
],
);

// remove some rules
// ignore some files
$rectorConfig->skip(
[
...RectorSettings::skip(),
...RectorSettings::skipTypo3(),

/**
* rector should not touch these files
*/
//__DIR__ . '/src/Example',
//__DIR__ . '/src/Example.php',
]
],
);
};
18 changes: 0 additions & 18 deletions src/Conditional/ArithmeticExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ public static function create(bool $useBashBrackets = true, bool $negateExpressi
return new self($useBashBrackets, $negateExpression);
}

/**
* @return $this
*/
public function equal(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_EQUAL;
Expand All @@ -25,9 +22,6 @@ public function equal(ShellInterface|string $arg1, ShellInterface|string $arg2):
return $this;
}

/**
* @return $this
*/
public function notEqual(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_NOT_EQUAL;
Expand All @@ -36,9 +30,6 @@ public function notEqual(ShellInterface|string $arg1, ShellInterface|string $arg
return $this;
}

/**
* @return $this
*/
public function less(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_LESS_THAN;
Expand All @@ -47,9 +38,6 @@ public function less(ShellInterface|string $arg1, ShellInterface|string $arg2):
return $this;
}

/**
* @return $this
*/
public function greater(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_GREATER_THAN;
Expand All @@ -58,9 +46,6 @@ public function greater(ShellInterface|string $arg1, ShellInterface|string $arg2
return $this;
}

/**
* @return $this
*/
public function lessEqual(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_LESS_EQUAL;
Expand All @@ -69,9 +54,6 @@ public function lessEqual(ShellInterface|string $arg1, ShellInterface|string $ar
return $this;
}

/**
* @return $this
*/
public function greaterEqual(ShellInterface|string $arg1, ShellInterface|string $arg2): self
{
$this->operator = ConditionalOperator::ARTITH_GREATER_EQUAL;
Expand Down
9 changes: 0 additions & 9 deletions src/Conditional/ShellExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,20 @@ public static function create(bool $useBashBrackets = true, bool $negateExpressi
return new self($useBashBrackets, $negateExpression);
}

/**
* @return $this
*/
public function isOptnameEnabled(ShellInterface|string $optname): self
{
$this->operator = ConditionalOperator::SHELL_OPTNAME_ENABLED;
$this->compareWith = $optname;
return $this;
}

/**
* @return $this
*/
public function isVariableSet(ShellInterface|string $variable): self
{
$this->operator = ConditionalOperator::SHELL_VARNAME_SET;
$this->compareWith = $variable;
return $this;
}

/**
* @return $this
*/
public function isVariableSetWithNamedReference(ShellInterface|string $variable): self
{
$this->operator = ConditionalOperator::SHELL_VARNAME_SET_NAMED_REFERENCE;
Expand Down
21 changes: 0 additions & 21 deletions src/Conditional/StringExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,20 @@ public static function create(bool $useBashBrackets = true, bool $negateExpressi
return new self($useBashBrackets, $negateExpression);
}

/**
* @return $this
*/
public function lenghtZero(ShellInterface|string $string): self
{
$this->operator = ConditionalOperator::STRING_LENGHT_ZERO;
$this->compareWith = $string;
return $this;
}

/**
* @return $this
*/
public function lengthNotZero(ShellInterface|string $string): self
{
$this->operator = ConditionalOperator::STRING_LENGHT_NOT_ZERO;
$this->compareWith = $string;
return $this;
}

/**
* @return $this
*/
public function eq(ShellInterface|string $stringA, ShellInterface|string $stringB): self
{
$this->operator = ConditionalOperator::STRING_EQUAL;
Expand All @@ -47,9 +38,6 @@ public function eq(ShellInterface|string $stringA, ShellInterface|string $string
return $this;
}

/**
* @return $this
*/
public function equal(ShellInterface|string $stringA, ShellInterface|string $stringB): self
{
$this->operator = ConditionalOperator::STRING_EQUAL_BASH;
Expand All @@ -59,9 +47,6 @@ public function equal(ShellInterface|string $stringA, ShellInterface|string $str
return $this;
}

/**
* @return $this
*/
public function notEqual(ShellInterface|string $stringA, ShellInterface|string $stringB): self
{
$this->operator = ConditionalOperator::STRING_NOT_EQUAL;
Expand All @@ -70,9 +55,6 @@ public function notEqual(ShellInterface|string $stringA, ShellInterface|string $
return $this;
}

/**
* @return $this
*/
public function sortsBefore(ShellInterface|string $stringA, ShellInterface|string $stringB): self
{
$this->operator = ConditionalOperator::STRING_SORTS_BEFORE;
Expand All @@ -81,9 +63,6 @@ public function sortsBefore(ShellInterface|string $stringA, ShellInterface|strin
return $this;
}

/**
* @return $this
*/
public function sortsAfter(ShellInterface|string $stringA, ShellInterface|string $stringB): self
{
$this->operator = ConditionalOperator::STRING_SORTS_AFTER;
Expand Down
12 changes: 0 additions & 12 deletions src/ShellBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function runAsynchronously(bool $isAsync = true, string $name = ''): self

/**
* @param bool $escape is the value instance of ShellInterface, then this variable is automatically false
* @return $this
* @throws ShellBuilderException
*/
public function addVariable(string $variable, ShellInterface|string $value, bool $useBackticks = false, bool $escape = true, bool $noSemicolon = false): self
Expand All @@ -95,7 +94,6 @@ public function removeVariable(string $variable): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function add(ShellInterface|string ...$commands): self
Expand All @@ -108,7 +106,6 @@ public function add(ShellInterface|string ...$commands): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function addSingle(ShellInterface|string $command, bool $raw = false): self
Expand All @@ -124,7 +121,6 @@ public function addSingle(ShellInterface|string $command, bool $raw = false): se
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function and(ShellInterface|string $command): self
Expand All @@ -134,7 +130,6 @@ public function and(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function or(ShellInterface|string $command): self
Expand All @@ -144,7 +139,6 @@ public function or(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function async(ShellInterface|string $command = ''): self
Expand All @@ -154,7 +148,6 @@ public function async(ShellInterface|string $command = ''): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function pipe(ShellInterface|string $command): self
Expand All @@ -164,7 +157,6 @@ public function pipe(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function pipeWithForward(ShellInterface|string $command): self
Expand All @@ -174,7 +166,6 @@ public function pipeWithForward(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function redirectOutput(ShellInterface|string $command, bool $append = false): self
Expand All @@ -185,7 +176,6 @@ public function redirectOutput(ShellInterface|string $command, bool $append = fa
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function redirectInput(ShellInterface|string $command): self
Expand All @@ -196,7 +186,6 @@ public function redirectInput(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function redirectError(ShellInterface|string $command): self
Expand All @@ -207,7 +196,6 @@ public function redirectError(ShellInterface|string $command): self
}

/**
* @return $this
* @throws ShellBuilderException
*/
public function redirect(ShellInterface|string $command, bool $toLeft = true): self
Expand Down
5 changes: 0 additions & 5 deletions src/ShellCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public function addOption(string $option, ShellInterface|string $value = '', boo

/**
* @throws ShellBuilderException
* @return $this
*/
public function addArgument(ShellInterface|string $argument, bool $escapeArgument = true): self
{
Expand All @@ -102,7 +101,6 @@ public function addArgument(ShellInterface|string $argument, bool $escapeArgumen
* This is an alias for argument, that automatically escapes the argument.
* It does in the end does not provide any additional functionality
*
* @return $this
* @throws ShellBuilderException
*/
public function addSubCommand(ShellInterface $argument): self
Expand All @@ -120,9 +118,6 @@ public function addNoSpaceArgument(ShellInterface|string $argument): self
return $this->add($word, false);
}

/**
* @return $this
*/
private function add(ShellWord $word, bool $escapeArgument, bool $withAssignOperator = false): self
{
$word->setEscape($escapeArgument);
Expand Down
Loading
Loading