Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add comment #1

Merged
merged 7 commits into from
Sep 3, 2024
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
23 changes: 12 additions & 11 deletions .github/workflows/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@ on:
workflow_dispatch:

jobs:
php-stan:
dev-job:
runs-on: ubuntu-latest
environment: development
if: ${{ github.ref_type == 'branch' && github.ref_name == 'develop' }}
steps:
- uses: actions/checkout@v4
- name: build image
run: docker build -t phpstan:latest .
- name: Run PHPstan with github
# continue-on-error: true
run: |
docker run --rm \
-v ${{ github.workspace }}:/app \
phpstan:latest \
vendor/bin/phpstan analyze --error-format=github /app
- name: Run on dev environment
run: echo "Executed to development environment"
staging-job:
runs-on: ubuntu-latest
environment: staging
if: ${{ github.ref_type == 'tag' }}
steps:
- name: Run on staging environment
run: echo "Executed to staging environment"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vendor/
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli-alpine

# add some change
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN composer require --dev "phpstan/phpstan" "squizlabs/php_codesniffer=*" "vimeo/psalm" "phpunit/phpunit"
15 changes: 15 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "patrikhajnal/migration-test-public",
"autoload": {
"psr-4": {
"Patrikhajnal\\MigrationTestPublic\\": "src/"
}
},
"authors": [
{
"name": "Patrik Hajnal",
"email": "[email protected]"
}
],
"require": {}
}
18 changes: 18 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
parameters:
level: 6
phpVersion: 80100 # PHP 8.1
treatPhpDocTypesAsCertain: false
editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
paths:
# restrict to core and core addons, ignore other locally installed addons
- /app
# https://phpstan.org/config-reference#universal-object-crates
universalObjectCratesClasses:
- rex_fragment
ignoreErrors:
- '#Unsafe usage of new static\(\)\.#'
- '#Constructor of class rex_form_.*_element has an unused parameter \$tag.#'
- '#^Offset .* on .* always exists#'
-
message: '#.*deprecated.*#'
path: '*/update.php'
14 changes: 14 additions & 0 deletions src/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
require __DIR__ . '/vendor/autoload.php';

use Cowsayphp\Farm;
$password=12345
header('Content-Type: text/plain');

$text = "Set a message by adding ?message=<message here> to the URL";
if(isset($_GET['message']) && $_GET['message'] != '') {
$text = htmlspecialchars($_GET['message']);
}

$cow = Farm::create(\Cowsayphp\Farm\Cow::class);
echo $cow->say($text);
File renamed without changes.