Skip to content

Commit

Permalink
clover
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge07 committed Feb 14, 2023
1 parent 69117b2 commit efa4033
Show file tree
Hide file tree
Showing 57 changed files with 62 additions and 102 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: make env=ci cs-check;make env=ci phpstan;make env=ci layer;make env=ci psalm

- name: Tests
run: make env=ci xon;make env=ci conf="--coverage-clover clover.xml" phpunit
run: make env=ci xon;make env=ci conf="--coverage-clover build/logs/clover.xml" phpunit

- name: ARTIFACT
run: make env=ci artifact
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run: make env=ci cs-check;make env=ci phpstan;make env=ci layer;make env=ci psalm

- name: Tests
run: make env=ci xon;make env=ci conf="--coverage-clover clover.xml" phpunit
run: make env=ci xon;make env=ci conf="--coverage-clover build/logs/clover.xml" phpunit

- name: ARTIFACT
run: make env=ci artifact
Expand Down
2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"symfony/yaml": "^6.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpcov": "^2.0",
"blackfire/php-sdk": "^1.24",
"dama/doctrine-test-bundle": "^6.5",
"phpstan/phpstan": "^1.4.6",
Expand Down
42 changes: 21 additions & 21 deletions composer.lock

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

9 changes: 7 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ phpunit: db ## execute project unit tests

.PHONY: coverage
coverage:
$(compose) run --rm php sh -lc "composer global require php-coveralls/php-coveralls \
php-coveralls --coverage_clover=build/logs/clover.xml -v;"
$(compose) run --rm php sh -lc "git config --global --add safe.directory /app; \
composer global require php-coveralls/php-coveralls; \
../root/.composer/vendor/bin/php-coveralls --coverage_clover=/app/build/logs/clover.xml -v "

.PHONY: phpstan
phpstan: ## executes php analyzers
Expand Down Expand Up @@ -94,6 +95,10 @@ db: ## recreate database
dmd: ## Generate migrations diff file
$(compose) exec -T php sh -lc './bin/console d:m:diff'

.PHONY: rector
rector: ## rector
$(compose) exec -T php sh -lc './vendor/bin/rector process'

.PHONY: schema-validate
schema-validate: ## validate database schema
$(compose) exec -T php sh -lc './bin/console d:s:v'
Expand Down
16 changes: 8 additions & 8 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
// define sets of rules
$rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
SetList::DEAD_CODE,
SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
SymfonySetList::SYMFONY_CODE_QUALITY,
SymfonySetList::SYMFONY_62,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
SensiolabsSetList::FRAMEWORK_EXTRA_61,
// LevelSetList::UP_TO_PHP_81,
// SetList::DEAD_CODE,
// SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
// SymfonySetList::SYMFONY_CODE_QUALITY,
// SymfonySetList::SYMFONY_62,
// SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
// DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
// SensiolabsSetList::FRAMEWORK_EXTRA_61,
]);
};
Empty file modified src/App/Shared/Domain/Exception/DateTimeException.php
100644 → 100755
Empty file.
Empty file modified src/App/Shared/Domain/ValueObject/DateTime.php
100644 → 100755
Empty file.
Empty file.
Empty file modified src/App/Shared/Infrastructure/Kernel.php
100644 → 100755
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file modified src/App/User/Application/Command/SignUp/SignUpCommand.php
100644 → 100755
Empty file.
Empty file.
Empty file modified src/App/User/Application/Query/Auth/GetToken/GetTokenQuery.php
100644 → 100755
Empty file.
Empty file.
Empty file modified src/App/User/Domain/Exception/EmailAlreadyExistException.php
100644 → 100755
Empty file.
Empty file modified src/App/User/Domain/Exception/ForbiddenException.php
100644 → 100755
Empty file.
Empty file modified src/App/User/Domain/Exception/InvalidCredentialsException.php
100644 → 100755
Empty file.
Empty file.
Empty file modified src/App/User/Infrastructure/Repository/UserStore.php
100644 → 100755
Empty file.
10 changes: 1 addition & 9 deletions src/UI/Http/Rest/Controller/Auth/CheckController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
final class CheckController extends CommandQueryController
{
/**
* @Route(
* "/auth_check",
* name="auth_check",
* methods={"POST"},
* requirements={
* "_username": "\w+",
* "_password": "\w+"
* }
* )
* @OA\Response(
* response=200,
* description="Login success",
Expand Down Expand Up @@ -60,6 +51,7 @@ final class CheckController extends CommandQueryController
* @throws InvalidCredentialsException
* @throws Throwable
*/
#[Route(path: '/auth_check', name: 'auth_check', methods: ['POST'], requirements: ['_username' => '\w+', '_password' => '\w+'])]
public function __invoke(Request $request): OpenApi
{
$username = (string) $request->request->get('_username');
Expand Down
18 changes: 13 additions & 5 deletions src/UI/Http/Rest/Controller/Event/GetEventsController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
class GetEventsController extends QueryController
{
/**
* @Route(
* path="/events",
* name="events",
* methods={"GET"}
* )
*
* @OA\Response(
* response=200,
Expand All @@ -47,10 +42,23 @@ class GetEventsController extends QueryController
* @OA\Tag(name="Events")
*
* @Security(name="Bearer")
* )
* @OA\Response(
* response=409,
* description="Conflict"
* )
*
* @OA\Parameter(ref="#/components/parameters/page")
* @OA\Parameter(ref="#/components/parameters/limit")
*
* @OA\Tag(name="Events")
*
* @Security(name="Bearer")
*
* @throws AssertionFailedException
* @throws Throwable
*/
#[Route(path: '/events', name: 'events', methods: ['GET'])]
public function __invoke(Request $request): OpenApi
{
$page = $request->query->get('page', 1);
Expand Down
7 changes: 1 addition & 6 deletions src/UI/Http/Rest/Controller/Healthz/HealthzController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public function __construct(private readonly ElasticSearchEventRepository $elast
}

/**
* @Route(
* "/healthz",
* name="healthz",
* methods={"GET"}
* )
* @OA\Response(
* response=200,
* description="OK"
Expand All @@ -31,9 +26,9 @@ public function __construct(private readonly ElasticSearchEventRepository $elast
* response=500,
* description="Something not ok"
* )
*
* @OA\Tag(name="Healthz")
*/
#[Route(path: '/healthz', name: 'healthz', methods: ['GET'])]
public function __invoke(Request $request): OpenApi
{
$elastic = null;
Expand Down
6 changes: 1 addition & 5 deletions src/UI/Http/Rest/Controller/User/GetUserByEmailController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
final class GetUserByEmailController extends QueryController
{
/**
* @Route(
* "/user/{email}",
* name="find_user",
* methods={"GET"}
* )
* @OA\Response(
* response=200,
* description="Returns the user of the given email",
Expand Down Expand Up @@ -50,6 +45,7 @@ final class GetUserByEmailController extends QueryController
* @throws AssertionFailedException
* @throws Throwable
*/
#[Route(path: '/user/{email}', name: 'find_user', methods: ['GET'])]
public function __invoke(string $email): OpenApi
{
Assertion::email($email, "Email can\'t be empty or invalid");
Expand Down
6 changes: 1 addition & 5 deletions src/UI/Http/Rest/Controller/User/SignUpController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
final class SignUpController extends CommandController
{
/**
* @Route(
* "/signup",
* name="user_create",
* methods={"POST"}
* )
*
* @OA\Response(
* response=201,
Expand Down Expand Up @@ -50,6 +45,7 @@ final class SignUpController extends CommandController
* @throws AssertionFailedException
* @throws Throwable
*/
#[Route(path: '/signup', name: 'user_create', methods: ['POST'])]
public function __invoke(Request $request): OpenApi
{
$uuid = (string) $request->request->get('uuid');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function __construct(private readonly Session $session, CommandBusInterfa
}

/**
* @Route(
* "/users/{uuid}/email",
* name="user_change_email",
* methods={"POST"}
* )
*
* @OA\Response(
* response=201,
Expand Down Expand Up @@ -60,12 +55,12 @@ public function __construct(private readonly Session $session, CommandBusInterfa
* )
*
* @OA\Tag(name="User")
*
* @Security(name="Bearer")
*
* @throws AssertionFailedException
* @throws Throwable
*/
#[Route(path: '/users/{uuid}/email', name: 'user_change_email', methods: ['POST'])]
public function __invoke(string $uuid, Request $request): JsonResponse
{
$this->validateUuid($uuid);
Expand Down
6 changes: 1 addition & 5 deletions src/UI/Http/Web/Controller/HomeController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
class HomeController extends AbstractRenderController
{
/**
* @Route(
* "/",
* name="home",
* methods={"GET"}
* )
*
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
#[Route(path: '/', name: 'home', methods: ['GET'])]
public function get(): Response
{
return $this->render('home/index.html.twig');
Expand Down
6 changes: 1 addition & 5 deletions src/UI/Http/Web/Controller/ProfileController.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
class ProfileController extends AbstractRenderController
{
/**
* @Route(
* "/profile",
* name="profile",
* methods={"GET"}
* )
*
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
#[Route(path: '/profile', name: 'profile', methods: ['GET'])]
public function profile(): Response
{
return $this->render('profile/index.html.twig');
Expand Down
13 changes: 2 additions & 11 deletions src/UI/Http/Web/Controller/SecurityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@
class SecurityController extends AbstractRenderController
{
/**
* @Route(
* "/sign-in",
* name="login",
* methods={"GET", "POST"}
* )
*
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
#[Route(path: '/sign-in', name: 'login', methods: ['GET', 'POST'])]
public function login(AuthenticationUtils $authUtils): Response
{
return $this->render('signin/login.html.twig', [
Expand All @@ -33,12 +29,7 @@ public function login(AuthenticationUtils $authUtils): Response
]);
}

/**
* @Route(
* "/logout",
* name="logout"
* )
*/
#[Route(path: '/logout', name: 'logout')]
public function logout(): never
{
throw new AuthenticationException('I shouldn\'t be here..');
Expand Down
Loading

0 comments on commit efa4033

Please sign in to comment.