Skip to content
Code-Schnipsel Gruppen Projekte
Commit 1cde9b17 erstellt von Jan Wennrich's avatar Jan Wennrich
Dateien durchsuchen

Merge branch 'next' into 'main'

Next

See merge request !2
Übergeordnete 8e31fe57 fb498543
No related branches found
No related tags found
1 Merge Request!2Next
Pipeline #6640 bestanden mit Phase
in 10 Sekunden
......@@ -3,12 +3,20 @@ include:
- component: dev.quiqqer.com/$CI_PROJECT_PATH/php-syntax-check@$CI_COMMIT_SHA
inputs:
php-version: "8.1"
path: "tests/ValidPhp81Class.php"
job-stage: "test"
- component: dev.quiqqer.com/$CI_PROJECT_PATH/php-syntax-check@$CI_COMMIT_SHA
inputs:
php-version: "8.2"
path: "tests/ValidPhp81Class.php"
job-stage: "test"
- component: dev.quiqqer.com/$CI_PROJECT_PATH/php-syntax-check@$CI_COMMIT_SHA
inputs:
php-version: "8.3"
path: "tests/ValidPhp81Class.php"
job-stage: "test"
- component: dev.quiqqer.com/quiqqer/stabilization/ci-cd-components/release/release@1.0.2
stages:
- lint
\ No newline at end of file
- test
- release
\ No newline at end of file
......@@ -2,8 +2,10 @@ spec:
inputs:
php-version:
description: "Define a PHP version to use for linting"
#regex: /^\d+\.\d+(\.\d+)?$/
type: string
path:
description: "Optionally define a path/folder/file to (recursively) lint, default is '.'"
default: "."
job-prefix:
description: "Optionally define the prefix for the job name, default is 'php-syntax-check'"
default: "php-syntax-check"
......@@ -26,4 +28,4 @@ $[[ inputs.job-prefix ]]-$[[ inputs.php-version ]]:
before_script:
- php -r "if(!file_exists('${PHAR_FILE}')) {echo 'Downloading ${PHAR_FILE}...' . PHP_EOL; copy('https://github.com/php-parallel-lint/PHP-Parallel-Lint/releases/download/${PHAR_VERSION}/${PHAR_FILE}', '${PHAR_FILE}');}"
script:
- php ${PHAR_FILE} -j $(nproc --all) --colors --no-progress .
- php ${PHAR_FILE} -j $(nproc --all) --colors --no-progress $[[ inputs.path ]]
<?php
namespace A {
use N\{ClassName,
AnotherClassName,
OneMoreClassName
};
use Foo\Bar;
$instance = new class {
};
#[Attribute] #[Attribute(1, 2)] function foo()
{
return 0;
}
#[Attribute]
#[Attribute(1, 2)]
function test()
{
return 'hello';
}
function bar(
$x,
$y,
int $z = 1
) {
$x = 0;
// $x = 1
do {
$y += 1;
} while ($y < 10);
if (true) {
$x = 10;
} elseif ($y < 10) {
$x = 5;
} elseif (true) {
$x = 5;
}
for ($i = 0; $i < 10; $i++) {
$yy = $x > 2 ? 1 : 2;
}
while (true) {
$x = 0;
}
do {
$x += 1;
} while (true);
foreach (
array(
"a" => 0,
"b" => 1,
"c" => 2
) as $e1
) {
echo $e1;
}
$count = 10;
$x = array(
"x",
"y",
array(
1 => "abc",
2 => "def",
3 => "ghi"
)
);
$zz = array(
0.1,
0.2,
0.3,
0.4
);
$x = array(
0 => "zero",
123 => "one two three",
25 => "two five"
);
bar(
0,
bar(
1,
"b"
)
);
}
abstract class Foo extends
FooBaseClass implements Bar1,
Bar2,
Bar3
{
var $numbers = array(
"one",
"two",
"three",
"four",
"five",
"six"
);
var $v = 0; // comment
public $path = "root"; // comment
const FIRST = 'first';
const SECOND = 0;
const Z = -1;
function bar(
$v,
$w = "a"
) {
$y = $w;
$result = foo(
"arg1",
"arg2",
10
);
switch ($v) {
case 0:
return 1;
case 1:
echo '1';
break;
case 2:
break;
default:
$result = 10;
}
return $result;
}
public static function fOne(
#[Attribute(1, 2)] $argA,
$argB,
$argC,
$argD,
$argE,
$argF,
$argG,
$argH
) {
$x = $argA + $argB + $argC + $argD + $argE + $argF + $argG + $argH;
list($field1, $field2, $field3, $filed4, $field5, $field6) = explode(
",",
$x
);
fTwo(
$argA,
$argB,
$argC,
fThree(
$argD,
$argE,
$argF,
$argG,
$argH
)
);
$z = $argA == "Some string" ? "yes" : "no";
$colors = array(
"red",
"green",
"blue",
"black",
"white",
"gray"
);
$count = count($colors);
for ($i = 0; $i < $count; $i++) {
$colorString = $colors[$i];
}
}
function fTwo(
$strA,
$strB,
$strC,
$strD
) {
if ($strA == "one" || $strB == "two" || $strC == "three") {
return $strA + $strB + $strC;
}
$x = $foo->one(
"a",
"b"
)->two(
"c",
"d",
"e"
)->three("fg")->four();
$y = a()->b()->c();
return $strD;
}
function fThree(
$strA,
$strB,
$strC,
$strD,
$strE
) {
try {
} catch (Exception $e) {
foo();
} finally {
// do something
}
return $strA + $strB + $strC + $strD + $strE;
}
protected abstract function fFour();
}
function f($a, $ab, $abc)
{
}
f(
a: 1,
ab: 2,
abc: 3
);
$j = 0;
function f2(array $arr)
{
}
f2([
0 => 5,
1 => 7,
]);
echo match ($j) {
0 => 'zero',
2 => 'two',
42 => 'forty-two',
default => throw new Exception()
};
enum Suit: string
{
case Clubs = 'C';
case Diamonds = 'D';
case Hearts = 'H';
case Spades = 'S';
}
}
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren