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

PHPStan linting #62

Merged
merged 16 commits into from
Oct 5, 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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ APP_SECRET=
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8"
###< doctrine/doctrine-bundle ###
###> symfony/mailer ###
# MAILER_DSN=null://null
MAILER_DSN=null://null
###< symfony/mailer ###

REDIS_URI=redis://redis.app-sf.orb.local:6379
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
permissions:
contents: read

env:
# Used for PHPStan to initialize the Symfony check
APP_SECRET: TIRKxo3IEcWIr0x4EM6D

jobs:
lint:
runs-on: ubuntu-latest
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
.phpunit.result.cache
###< phpunit/phpunit ###

###> symfony/phpunit-bridge ###
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

###> symfony/asset-mapper ###
/public/assets/
/assets/vendor/
Expand Down
5 changes: 5 additions & 0 deletions .idea/app-sf.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions assets/app/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { startStimulusApp } from "@symfony/stimulus-bundle";

startStimulusApp();
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);
2 changes: 1 addition & 1 deletion assets/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ document.addEventListener("turbo:load", () => {
const tooltipTriggerList = document.querySelectorAll("[data-bs-toggle=\"tooltip\"]");
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));

// Destroy tooltips on navigating to a new page
// Destroy tooltips when navigating to a new page
document.addEventListener("turbo:before-visit", () => {
for (const tooltip of tooltipList) {
tooltip.dispose();
Expand Down
4 changes: 2 additions & 2 deletions assets/controllers/challenge_comment_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class extends Controller<HTMLElement> {
}

async connect() {
const $commentBlock = this.element.querySelector(".challenge-comments__comment");
const $commentBlock = this.element.querySelector(".app-challenge-comment__main");
if (!$commentBlock) {
console.warn("No comment element found. Cannot fade in.");
return;
Expand All @@ -22,7 +22,7 @@ export default class extends Controller<HTMLElement> {
$commentBlock.classList.remove("opacity-0");
}, 20 /* ms */);

const $confirmModal = this.element.querySelector<HTMLElement>(".challenge-comments__deletion_confirm");
const $confirmModal = this.element.querySelector<HTMLElement>(".app-challenge-comment__deletion_confirm");
if ($confirmModal) {
this.#modal = new bootstrap.Modal($confirmModal);
}
Expand Down
15 changes: 7 additions & 8 deletions assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ ul.credit {
}
}

.question-card {
.app-question-card {
@extend .card;
overflow: hidden;
min-height: 14em;
Expand Down Expand Up @@ -135,7 +135,7 @@ ul.credit {
@extend .d-flex, .gap-3, .justify-content-start, .align-items-center;
}

.question-card__pass-rate {
&__pass-rate {
&[data-pass-rate~="high"] {
@extend .text-success;
}
Expand All @@ -148,8 +148,7 @@ ul.credit {
}
}

/* ChallengeHeader */
.challenge-header {
.app-challenge-header {
&__title {
font-weight: bold;
}
Expand Down Expand Up @@ -184,11 +183,11 @@ ul.credit {
}
}

.challenge-result-event-presenter {
.app-challenge-result-event-presenter {
table-layout: fixed;
}

.challenge-primary {
.app-challenge-primary {
min-height: 55vh;
}

Expand Down Expand Up @@ -330,8 +329,8 @@ ul.credit {
}
}

.challenge-comments {
&__comment {
.app-challenge-comment {
&__main {
transition: opacity 300ms;
}
}
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"allow-plugins": {
"php-http/discovery": true,
"symfony/flex": true,
"symfony/runtime": true
"symfony/runtime": true,
"phpstan/extension-installer": true
},
"sort-packages": true
},
Expand Down Expand Up @@ -129,7 +130,12 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "dev-master",
"phpstan/extension-installer": "1.4.x-dev",
"phpstan/phpstan": "2.0.x-dev",
"phpstan/phpstan-doctrine": "2.0.x-dev",
"phpstan/phpstan-phpunit": "2.0.x-dev",
"phpstan/phpstan-strict-rules": "2.0.x-dev",
"phpstan/phpstan-symfony": "2.0.x-dev",
"phpunit/phpunit": "^10",
"symfony/browser-kit": "7.2.*",
"symfony/css-selector": "7.2.*",
Expand Down
Loading