Skip to content

Commit

Permalink
bump deps (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Sep 8, 2022
1 parent 044c061 commit 02755d9
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/code_analysis.yaml
Expand Up @@ -16,6 +16,10 @@ jobs:
name: 'PHPStan'
run: composer phpstan

-
name: 'Coding Standard'
run: composer check-cs

runs-on: ubuntu-latest

name: ${{ matrix.actions.name }}
Expand Down
15 changes: 9 additions & 6 deletions composer.json
Expand Up @@ -3,21 +3,24 @@
"license": "MIT",
"description": "GitHub Action for splitting monorepo. Composer is for testing PHP code only, not for package shipment",
"require": {
"php": ">=8.0",
"phpstan/extension-installer": "^1.1"
"php": ">=8.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.85",
"symplify/phpstan-extensions": "^9.3",
"symplify/phpstan-rules": "^9.3"
"phpstan/phpstan": "^1.8.5",
"phpstan/extension-installer": "^1.1",
"symplify/phpstan-extensions": "^11.1",
"symplify/phpstan-rules": "^11.1",
"symplify/easy-coding-standard": "^11.1"
},
"autoload-dev": {
"files": [
"src/autoload.php"
]
},
"scripts": {
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify"
"phpstan": "vendor/bin/phpstan analyse --ansi --error-format symplify",
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi"
},
"config": {
"allow-plugins": {
Expand Down
20 changes: 20 additions & 0 deletions ecs.php
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;

return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
__DIR__ . '/ecs.php',
__DIR__ . '/entrypoint.php',
]);

$ecsConfig->sets([
SetList::COMMON,
SetList::PSR_12,
]);
};
13 changes: 7 additions & 6 deletions entrypoint.php
Expand Up @@ -27,7 +27,7 @@
$hostRepositoryOrganizationName = $config->getGitRepository();

// info
$clonedRepository='https://' . $hostRepositoryOrganizationName;
$clonedRepository = 'https://' . $hostRepositoryOrganizationName;
$cloningMessage = sprintf('Cloning "%s" repository to "%s" directory', $clonedRepository, $cloneDirectory);
note($cloningMessage);

Expand All @@ -43,11 +43,11 @@
note(sprintf('Trying to checkout %s branch', $config->getBranch()));

// if the given branch doesn't exist it returns empty string
$branchSwitchedSuccessfully = "" !== exec(sprintf('git checkout %s', $config->getBranch()));
$branchSwitchedSuccessfully = exec(sprintf('git checkout %s', $config->getBranch())) !== '';

// if the branch doesn't exist we creat it and push to origin
// otherwise we just checkout to the given branch
if (!$branchSwitchedSuccessfully) {
if (! $branchSwitchedSuccessfully) {
note(sprintf('Creating branch "%s" as it doesn\'t exist', $config->getBranch()));

exec_with_output_print(sprintf('git checkout -b %s', $config->getBranch()));
Expand Down Expand Up @@ -114,7 +114,7 @@
$message = sprintf('Pushing git commit with "%s" message to "%s"', $commitMessage, $config->getBranch());
note($message);

exec("git commit --message '$commitMessage'");
exec("git commit --message '{$commitMessage}'");
exec('git push --quiet origin ' . $config->getBranch());
} else {
note('No files to change');
Expand All @@ -141,7 +141,7 @@

function createCommitMessage(string $commitSha): string
{
exec("git show -s --format=%B $commitSha", $outputLines);
exec("git show -s --format=%B {$commitSha}", $outputLines);
return $outputLines[0] ?? '';
}

Expand All @@ -159,7 +159,8 @@ function error(string $message): void



function list_directory_files(string $directory): void {
function list_directory_files(string $directory): void
{
exec_with_output_print('ls -la ' . $directory);
}

Expand Down
6 changes: 4 additions & 2 deletions phpstan.neon
Expand Up @@ -3,12 +3,14 @@ includes:
- vendor/symplify/phpstan-rules/config/static-rules.neon

parameters:
level: max
level: 8

paths:
- src
- tests
- entrypoint.php

ignoreErrors:
-
message: '#"%s" in sprintf\(\) format must be quoted#'
message: '#Use separate function calls with readable variable names#'
path: entrypoint.php
11 changes: 0 additions & 11 deletions src/ConfigFactory.php
Expand Up @@ -18,17 +18,6 @@ final class ConfigFactory
*/
private const GITHUB = 'GITHUB';

/**
* @var string
*/
private const DEFAULT_BRANCH = 'main';

/**
* @todo verify
* @var string
*/
private const DEFAULT_GITLAB_HOST = 'gitlab.com';

private PublicAccessTokenResolver $publicAccessTokenResolver;

public function __construct()
Expand Down
2 changes: 1 addition & 1 deletion src/PublicAccessTokenResolver.php
Expand Up @@ -33,7 +33,7 @@ final class PublicAccessTokenResolver
];

/**
* @param array<string, mixed> $env
* @param array<string, string> $env
*/
public function resolve(array $env): string
{
Expand Down

0 comments on commit 02755d9

Please sign in to comment.