-
Notifications
You must be signed in to change notification settings - Fork 342
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
[Maintenance] Upgrade Recipes & Refine Project Structure #1028
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3824448
[Maintenance] Bump payum recipe
Rafikooo 0100798
[Maintenance] Remove phpspec dependency
Rafikooo a86a1cc
[Maintenance] Bump api-platform/core recipe
Rafikooo a8c4080
[Maintenance] Bump symfony recipes
Rafikooo 29640cc
[Maintenance] Bump sylius recipes
Rafikooo f750115
[Maintenance] Bump doctrine recipes
Rafikooo 58d0f64
[Maintenance] Rename phpstan.neon to phpstan.dist.neon
Rafikooo 35de309
[Maintenance] Update config/bootstrap.php
Rafikooo 73bf087
[Maintenance] Bump the rest of recipes
Rafikooo 1374326
[Maintenance] Remove obsolete annotations
Rafikooo 875fa3b
[Maintenance] Bump PHPStan to max level and resolve issues
Rafikooo cd58990
[Maintenance] Remove obsolete polishsymfonycommunity/symfony-mocker-c…
Rafikooo f021599
[Maintenance] Update PHPUnit config
Rafikooo b2bfdde
[Config] Add src/ApiResource mapping path
Rafikooo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
require dirname(__DIR__).'/vendor/autoload.php'; | ||
require dirname(__DIR__) . '/vendor/autoload.php'; | ||
|
||
// Load cached env vars if the .env.local.php file exists | ||
// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) | ||
if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { | ||
if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { | ||
$_SERVER += $env; | ||
$_ENV += $env; | ||
} elseif (!class_exists(Dotenv::class)) { | ||
throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); | ||
} elseif (method_exists(Dotenv::class, 'bootEnv')) { | ||
(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); | ||
|
||
return; | ||
} else { | ||
// load all the .env files | ||
(new Dotenv(true))->loadEnv(dirname(__DIR__).'/.env'); | ||
(new Dotenv())->loadEnv(dirname(__DIR__) . '/.env'); | ||
} | ||
|
||
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; | ||
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; | ||
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; | ||
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
framework: | ||
cache: | ||
# Unique name of your app: used to compute stable namespaces for cache keys. | ||
#prefix_seed: your_vendor_name/app_name | ||
|
||
# The "app" cache stores to the filesystem by default. | ||
# The data in this cache should persist between deploys. | ||
# Other options include: | ||
|
||
# Redis | ||
#app: cache.adapter.redis | ||
#default_redis_provider: redis://localhost | ||
|
||
# APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) | ||
#app: cache.adapter.apcu | ||
|
||
# Namespaced pools use the above "app" backend by default | ||
#pools: | ||
#my.dedicated.cache: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
when@dev: | ||
debug: | ||
# Forwards VarDumper Data clones to a centralized server allowing to inspect dumps on CLI or in your browser. | ||
# See the "server:dump" command to start a new server. | ||
dump_destination: "tcp://%env(VAR_DUMPER_SERVER)%" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
framework: | ||
messenger: | ||
# Uncomment this (and the failed transport below) to send failed messages to this transport for later handling. | ||
# failure_transport: failed | ||
|
||
transports: | ||
# https://symfony.com/doc/current/messenger.html#transport-configuration | ||
# async: '%env(MESSENGER_TRANSPORT_DSN)%' | ||
# failed: 'doctrine://default?queue_name=failed' | ||
# sync: 'sync://' | ||
|
||
routing: | ||
# Route your messages to the transports | ||
# 'App\Message\YourMessage': async | ||
|
||
# when@test: | ||
# framework: | ||
# messenger: | ||
# transports: | ||
# # replace with your transport name here (e.g., my_transport: 'in-memory://') | ||
# # For more Messenger testing tools, see https://github.com/zenstruck/messenger-test | ||
# async: 'in-memory://' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
monolog: | ||
channels: | ||
- deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists | ||
|
||
when@dev: | ||
monolog: | ||
handlers: | ||
main: | ||
type: stream | ||
path: "%kernel.logs_dir%/%kernel.environment%.log" | ||
level: debug | ||
channels: ["!event"] | ||
# uncomment to get logging in your browser | ||
# you may have to allow bigger header sizes in your Web server configuration | ||
#firephp: | ||
# type: firephp | ||
# level: info | ||
#chromephp: | ||
# type: chromephp | ||
# level: info | ||
console: | ||
type: console | ||
process_psr_3_messages: false | ||
channels: ["!event", "!doctrine", "!console"] | ||
|
||
when@test: | ||
monolog: | ||
handlers: | ||
main: | ||
type: fingers_crossed | ||
action_level: error | ||
handler: nested | ||
channels: ["!event"] | ||
nested: | ||
type: stream | ||
path: "%kernel.logs_dir%/%kernel.environment%.log" | ||
level: debug | ||
|
||
when@prod: | ||
monolog: | ||
handlers: | ||
main: | ||
type: fingers_crossed | ||
action_level: error | ||
handler: nested | ||
excluded_http_codes: [404, 405] | ||
buffer_size: 50 # How many messages should be saved? Prevent memory leaks | ||
nested: | ||
type: stream | ||
path: php://stderr | ||
level: debug | ||
formatter: monolog.formatter.json | ||
console: | ||
type: console | ||
process_psr_3_messages: false | ||
channels: ["!event", "!doctrine"] | ||
deprecation: | ||
type: stream | ||
channels: [deprecation] | ||
path: php://stderr | ||
formatter: monolog.formatter.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
when@dev: &dev | ||
nelmio_alice: | ||
functions_blacklist: | ||
- 'current' | ||
- 'shuffle' | ||
- 'date' | ||
- 'time' | ||
- 'file' | ||
- 'md5' | ||
- 'sha1' | ||
|
||
when@test: *dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
services: | ||
# Register nyholm/psr7 services for autowiring with PSR-17 (HTTP factories) | ||
Psr\Http\Message\RequestFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
Psr\Http\Message\ResponseFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
Psr\Http\Message\ServerRequestFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
Psr\Http\Message\StreamFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
Psr\Http\Message\UploadedFileFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
Psr\Http\Message\UriFactoryInterface: '@nyholm.psr7.psr17_factory' | ||
|
||
nyholm.psr7.psr17_factory: | ||
class: Nyholm\Psr7\Factory\Psr17Factory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#payum: | ||
# gateways: | ||
# offline: | ||
# factory: offline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# @see https://github.com/Sylius/SyliusResourceBundle/blob/master/docs/index.md | ||
sylius_resource: | ||
# Override default settings | ||
#settings: | ||
|
||
# Configure the mapping for your resources | ||
mapping: | ||
paths: | ||
- '%kernel.project_dir%/src/Entity' | ||
|
||
# Configure your resources | ||
resources: | ||
#app.book: | ||
#classes: | ||
#model: App\Entity\Book |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
api_platform: | ||
resource: . | ||
type: api_platform | ||
prefix: / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
when@dev: | ||
_errors: | ||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml' | ||
prefix: /_error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_security_logout: | ||
resource: security.route_loader.logout | ||
type: service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
sylius_crud_routes: | ||
resource: 'sylius.routing.loader.crud_routes_attributes' | ||
type: service | ||
|
||
sylius_routes: | ||
resource: 'sylius.routing.loader.routes_attributes' | ||
type: service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
when@dev: | ||
web_profiler_wdt: | ||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml' | ||
prefix: /_wdt | ||
|
||
web_profiler_profiler: | ||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml' | ||
prefix: /_profiler |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
parameters: | ||
level: 9 | ||
paths: | ||
- bin/ | ||
- config/ | ||
- public/ | ||
- src/ | ||
- tests/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html --> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.5/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/autoload.php"> | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
colors="true" | ||
bootstrap="tests/bootstrap.php" | ||
> | ||
<testsuites> | ||
<testsuite name="Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<php> | ||
<ini name="error_reporting" value="-1" /> | ||
|
||
<!-- ###+ symfony/framework-bundle ### --> | ||
<env name="APP_DEBUG" value="0"/> | ||
<env name="APP_ENV" value="test"/> | ||
<env name="SHELL_VERBOSITY" value="-1" /> | ||
<!-- ###- symfony/framework-bundle ### --> | ||
|
||
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" /> | ||
<server name="ESCAPE_JSON" value="true" /> | ||
|
||
<server name="KERNEL_CLASS" value="App\Kernel" /> | ||
</php> | ||
</phpunit> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be for removing this config as nyholm is a dev dependency and probably we should not force to have it in the config in the end application