Skip to content

Commit

Permalink
Updated comments
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelgfeller committed Apr 26, 2024
1 parent bfda4e4 commit d61c854
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 20 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Slim Starter

[![Latest Version on Packagist](https://img.shields.io/github/release/samuelgfeller/slim-starter.svg)](https://packagist.org/packages/slim-starter)
[![Latest Version on Packagist](https://img.shields.io/github/release/samuelgfeller/slim-starter.svg)](https://packagist.org/packages/samuelgfeller/slim-starter)
[![Code Coverage](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/?branch=master)
[![Build Status](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/badges/build.png?b=master)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/build-status/master)
[![Quality Score](https://img.shields.io/scrutinizer/quality/g/samuelgfeller/slim-starter.svg)](https://scrutinizer-ci.com/g/samuelgfeller/slim-starter/?branch=master)
Expand Down Expand Up @@ -57,8 +57,7 @@ a lot more features and examples.
* [Query Builder](https://github.com/samuelgfeller/slim-example-project/wiki/Repository-and-Query-Builder) - [cakephp/database](https://book.cakephp.org/5/en/orm/query-builder.html)
* [Integration testing](https://github.com/samuelgfeller/slim-example-project/wiki/Writing-Tests) - [PHPUnit](https://github.com/sebastianbergmann/phpunit/)
* [Error handling](https://github.com/samuelgfeller/slim-example-project/wiki/Error-Handling) - [slim-error-renderer](https://github.com/samuelgfeller/slim-error-renderer)
* [GitHub Actions](https://github.com/samuelgfeller/slim-example-project/wiki/GitHub-Actions)
* [Scrutinizer](https://github.com/samuelgfeller/slim-example-project/wiki/How-to-set-up-Scrutinizer)
* [GitHub Actions](https://github.com/samuelgfeller/slim-example-project/wiki/GitHub-Actions) & [Scrutinizer](https://github.com/samuelgfeller/slim-example-project/wiki/How-to-set-up-Scrutinizer)
* [Coding standards fixer](https://github.com/samuelgfeller/slim-example-project/wiki/Coding-Standards-Fixer) - [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
* [Static code analysis](https://github.com/samuelgfeller/slim-example-project/wiki/PHPStan-Static-Code-Analysis) - [PHPStan](https://github.com/phpstan/phpstan)

Expand Down
2 changes: 1 addition & 1 deletion config/container.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
return $container->get(Psr17Factory::class);
},

// For PHP-View and the RedirectHandler
// Required to create urls with urlFor
RouteParserInterface::class => function (ContainerInterface $container) {
return $container->get(App::class)->getRouteCollector()->getRouteParser();
},
Expand Down
2 changes: 1 addition & 1 deletion config/env/env.prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Incorrect: $settings['db'] = [ 'key' => 'val', 'nextKey' => 'nextVal',];
*/

// Error handler. More controlled than ini
// Error handler
$settings['error']['display_error_details'] = false;

// Disable update of JS imports version in production
Expand Down
8 changes: 4 additions & 4 deletions public/assets/general/ajax/ajax-util/fail-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import {displayValidationErrorMessage} from "../../validation/form-validation.js
import {displayFlashMessage} from "../../page-component/flash-message/flash-message.js?v=0.0.0";

/**
* This function can be called with the Response or a TypeError
* If response is TypeError, only a flash message is shown
* If response is Response, the status code is checked and a flash message is shown or
* validation errors are highlighted in the form.
* This function can be called with the Response or a TypeError.
* If response is TypeError, only a flash message is shown.
* If response is Response, the status code is checked, and a flash message is shown,
* or the validation errors are highlighted in the form.
*
* @param {Response|TypeError} response
* @param {null|string} domFieldId css id of dom field the fail is about
Expand Down
2 changes: 1 addition & 1 deletion public/assets/general/ajax/fetch-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {basePath} from "../general-js/config.js?v=0.0.0";
import {handleFail} from "./ajax-util/fail-handler.js?v=0.0.0";

/**
* Sends a GET request and returns result in promise
* Sends a GET request and returns result in promise.
*
* @param {string} route the part after base path (e.g. 'users/1'). Query params have to be added with ?param=value
* @return {Promise<JSON>}
Expand Down
4 changes: 2 additions & 2 deletions public/assets/general/ajax/modal-submit-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import {handleFail} from "./ajax-util/fail-handler.js?v=0.0.0";
import {closeModal} from "../page-component/modal/modal.js?v=0.0.0";

/**
* Retrieves form data, checks form validity, disables form, submits modal form and closes it on success
* Retrieves form data, checks form validity, disables form, submits modal form and closes it on success.
*
* @param {string} modalFormId
* @param {string} moduleRoute POST module route like "users"
* @param {string} httpMethod POST or PUT
* @return void|Promise with as content server response as JSON
* @return {void|Promise} with as content server response as JSON
*/
export function submitModalForm(
modalFormId, moduleRoute, httpMethod
Expand Down
2 changes: 1 addition & 1 deletion public/assets/general/ajax/submit-delete-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {handleFail} from "./ajax-util/fail-handler.js?v=0.0.0";
* Send DELETE request.
*
* @param {string} route after base path (e.g. 'users/1')
* @return Promise with as content server response as JSON
* @return {Promise} with as content server response as JSON
*/
export function submitDelete(route) {
return fetch(basePath + route, {
Expand Down
8 changes: 4 additions & 4 deletions public/assets/general/ajax/submit-update-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {handleFail, removeValidationErrorMessages} from "./ajax-util/fail-handle

/**
* Send PUT update request.
* Fail handled by handleFail() method which supports forms
* On success validation errors are removed if there were any and response json returned
* Fail handled by handleFail() method which supports forms.
* On success validation errors are removed if there were any and response json returned.
*
* @param {object} formFieldsAndValues {field: value} e.g. {[input.name]: input.value}
* @param {string} route after base path (e.g. users/1)
* @param domFieldId field id to display the validation error message for the correct field
* @return Promise with as content server response as JSON
* @param {string} domFieldId field id to display the validation error message for the correct field
* @return {Promise} with as content server response as JSON
*/
export function submitUpdate(formFieldsAndValues, route, domFieldId = null) {

Expand Down
7 changes: 5 additions & 2 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

// Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Web-Server-Config-and-Bootstrapping
/**
* Bootstrap the application
*
* Documentation: https://github.com/samuelgfeller/slim-example-project/wiki/Web-Server-Config-and-Bootstrapping
*/

$app = require __DIR__ . '/../config/bootstrap.php';

Expand Down
2 changes: 1 addition & 1 deletion resources/schema/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ CREATE TABLE `user` (
`created_at` datetime DEFAULT current_timestamp(),
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC;

0 comments on commit d61c854

Please sign in to comment.