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

Fix/page dto #18

Merged
merged 16 commits into from
Mar 17, 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
6 changes: 0 additions & 6 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ ARG VARIANT=8.2.8-apache
# Pull existing php image
FROM php:${VARIANT}

# Install Taskfile
RUN sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin

# Set the working dir
WORKDIR /var/www

Expand All @@ -25,9 +22,6 @@ RUN install-php-extensions opcache
RUN install-php-extensions zip
# RUN install-php-extensions xdebug

# Retrieve the lastest version of composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# Copy configuration files
COPY apache/vhosts.conf /etc/apache2/sites-available/000-default.conf
# COPY xdebug/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
Expand Down
36 changes: 32 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,45 @@
"service": "api",
"workspaceFolder": "/var/www",
"postCreateCommand": "task app:default:config",
// "remoteUser": "vscode",
"customizations": {
"vscode": {
"settings": {
"php.executablePath": "/usr/local/bin/php"
}
"php.executablePath": "/usr/local/bin/php",
"php.validate.executablePath": "/usr/local/bin/php",
"php.suggest.basic": false,
"php-cs-fixer.allowRisky": false,
"[php]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "junstyle.php-cs-fixer"
},
"[yaml][json][jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"extensions": [
// "hbenl.vscode-test-explorer",
// "ms-vscode.test-adapter-converter",
// "recca0120.vscode-phpunit",
"esbenp.prettier-vscode",
"MehediDracula.php-namespace-resolver",
"bmewburn.vscode-intelephense-client",
"neilbrayfield.php-docblocker",
"mikestead.dotenv",
"MehediDracula.php-namespace-resolver",
"mikestead.dotenv",
"EditorConfig.EditorConfig",
"junstyle.php-cs-fixer"
]
}
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
}
},
"ghcr.io/devcontainers-contrib/features/composer:1": {
"version": "latest"
},
"ghcr.io/audacioustux/devcontainers/taskfile:1": {}
}
}
10 changes: 4 additions & 6 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,17 @@ services:
- dev

maildev:
image: maildev/maildev
image: rnwood/smtp4dev
container_name: flashcard-mail
command: bin/maildev --web 80 --smtp 25 --hide-extensions STARTTLS
ports:
- 8082:80
- 8082:80
- 2525:25
networks:
- dev

phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: flashcard-phpmyadmin
links:
- database
environment:
PMA_HOST: database
PMA_PORT: 3306
Expand All @@ -48,7 +46,7 @@ services:
context: .
dockerfile: Dockerfile
args:
- VARIANT=8.2.8-apache
- VARIANT=8.2.16-apache
ports:
- 8080:80
volumes:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

.idea

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###
61 changes: 61 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php

declare(strict_types=1);

return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setFinder(PhpCsFixer\Finder::create()
->in(__DIR__)
->exclude('var')
->exclude('vendor'))
->setRules([
'@Symfony:risky' => true,
'@Symfony' => true,
// Each element of an array must be indented exactly once.
'array_indentation' => true,
// PHP attributes declared without arguments must (not) be followed by empty parentheses.
'attribute_empty_parentheses' => true,
// Converts FQCN strings to `*::class` keywords.
'class_keyword' => true,
// Using `isset($var) &&` multiple times should be done in one call.
'combine_consecutive_issets' => true,
// Calling `unset` on multiple items should be done in one call.
'combine_consecutive_unsets' => true,
// Concatenation should be spaced according to configuration.
'concat_space' => ['spacing' => 'one'],
// Class `DateTimeImmutable` should be used instead of `DateTime`.
'date_time_immutable' => true,
// Force strict types declaration in all files. Requires PHP >= 7.0.
'declare_strict_types' => true,
// Escape implicit backslashes in strings and heredocs to ease the understanding of which are special chars interpreted by PHP and which not.
'escape_implicit_backslashes' => true,
// Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax.
'explicit_string_variable' => true,
// List (`array` destructuring) assignment should be declared using the configured syntax. Requires PHP >= 7.1.
'list_syntax' => true,
// Replace non multibyte-safe functions with corresponding mb function.
'mb_str_functions' => true,
// Method chaining MUST be properly indented. Method chaining with different levels of indentation is not supported.
'method_chaining_indentation' => true,
// Forbid multi-line whitespace before the closing semicolon or move the semicolon to the new line for chained calls.
'multiline_whitespace_before_semicolons' => true,
// There should not be useless `else` cases.
'no_useless_else' => true,
// There should not be an empty `return` statement at the end of a function.
'no_useless_return' => true,
// Orders the interfaces in an `implements` or `interface extends` clause.
// All items of the given PHPDoc tags must be either left-aligned or (by default) aligned vertically.
'phpdoc_align' => ['align' => 'left'],
// Inside an enum or `final`/anonymous class, `self` should be preferred over `static`.
'self_static_accessor' => true,
// A return statement wishing to return `void` should not return `null`.
'simplified_null_return' => true,
// Handles implicit backslashes in strings and heredocs. Depending on the chosen strategy, it can escape implicit backslashes to ease the understanding of which are special chars interpreted by PHP and which not (`escape`), or it can remove these additional backslashes if you find them superfluous (`unescape`). You can also leave them as-is using `ignore` strategy.
'string_implicit_backslashes' => ['single_quoted' => 'escape'],
// Use `null` coalescing operator `??` where possible. Requires PHP >= 7.0.
'ternary_to_null_coalescing' => true,
// Add `void` return type to functions with missing or empty return statements, but priority is given to `@return` annotations. Requires PHP >= 7.1.
'void_return' => true,
// Write conditions in Yoda style (true), non-Yoda style (['equal' => false, 'identical' => false, 'less_and_greater' => false]) or ignore those conditions (null) based on configuration.
'yoda_style' => false,
]);
27 changes: 0 additions & 27 deletions .vscode/extensions.json

This file was deleted.

8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"doctrine/annotations": "^2.0",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"laravel/pint": "^1.12",
"friendsofphp/php-cs-fixer": "^3.51",
"pestphp/pest": "^1.23",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5",
Expand Down Expand Up @@ -83,8 +83,8 @@
"post-update-cmd": [
"@auto-scripts"
],
"cs:fix": "./vendor/bin/pint",
"cs:check": "@cs:fix --test",
"cs:fix": "./vendor/bin/php-cs-fixer fix",
"cs:check": "@cs:fix --dry-run",
"stan": "@stan:default --ansi --error-format=table",
"stan:default": "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit 500M",
"stan:github": "@stan:default --error-format=github --quiet",
Expand Down
Loading
Loading