Skip to content
This repository was archived by the owner on May 21, 2021. It is now read-only.

ProjectCommon made dynamic#2

Merged
crs2 merged 2 commits into
developfrom
feature/adminClass
Feb 1, 2018
Merged

ProjectCommon made dynamic#2
crs2 merged 2 commits into
developfrom
feature/adminClass

Conversation

@GodsDev
Copy link
Copy Markdown
Owner

@GodsDev GodsDev commented Jan 19, 2018

MyCommon is ancestor for classes using MyCMS, i.e. MyController and (the new) MyAdmin

MyCommon is ancestor for classes using MyCMS, i.e. MyController and (the new) MyAdmin
@GodsDev GodsDev requested a review from crs2 January 19, 2018 22:32
@crs2 crs2 merged commit 5bc082e into develop Feb 1, 2018
@GodsDev GodsDev deleted the feature/adminClass branch February 12, 2018 12:36
@GodsDev GodsDev restored the feature/adminClass branch May 7, 2018 11:21
@GodsDev GodsDev deleted the feature/adminClass branch May 7, 2018 11:22
@GodsDev GodsDev restored the feature/adminClass branch September 20, 2018 00:25
@GodsDev GodsDev deleted the feature/adminClass branch September 20, 2018 00:27
GodsDev pushed a commit that referenced this pull request Sep 14, 2020
* fix MyCMSMonoLingual::csrfStart: Parameter #1 $min and #2 $max of function rand expects int, float given.
* fix MyController Access to an undefined properties GodsDev\MyCMS\MyController::$language and GodsDev\MyCMS\MyController::$requestUri.
* conf/constants.php: Predefining constants for PHPSTAN analysis as recommanded by <https://phpstan.org/user-guide/discovering-symbols>
* fix MyCMSMonoLingual Result of (!is_object($this->logger) || !($this->logger instanceof LoggerInterface)) is always false.
GodsDev pushed a commit that referenced this pull request Sep 16, 2020
…oject

Various minor bugs:
* fix TableAdmin: LogMysqli database object instead of vanilla \mysqli
* TableAdmin::customSave - typecast to fix parameter #1 $input of function str_pad expects string, int given.
* AdminProcess::adminProcess - fix Binary operation "+" between string and (float|int) results in an error. Parameter #1 $input of function str_pad expects string, (float|int) given.
* config.php: fix Parameter #2 $newvalue of function ini_set expects string, int given.
GodsDev pushed a commit that referenced this pull request Oct 25, 2020
* phpcs: 120 chars enforcement
* LogMysqli: int instead of bool Parameter #2 of method GodsDev\MyCMS\LogMysqli::query() so that it is compatible with method GodsDev\Backyard\BackyardMysqli::query()
* MyAdmin: definition of properties $ASSETS_SUBFOLDERS, $agendas instead of their definition in dist/classes/Admin.php
* MyAdmin: Method GodsDev\MyCMS\MyAdmin::projectSpecificSections() invoked with 1 parameter, 0 required.
* MyAdminProcess: fix type Tools::addMessage($result['success'], $result['messages']); (instead of message)
* MyAdminProcess: $salt = mt_rand((int) 1e8, (int) 1e9); (Fix: mt_rand expects int, float given)
* MyTableAdmin: removed __construct as it only duplicated parent
* MyTableLister::viewInputs - $option typo changed to $options
* comment todo added where the PHPStan indicated error doesn't have a clear solution
@GodsDev GodsDev mentioned this pull request Nov 15, 2020
GodsDev added a commit that referenced this pull request Nov 15, 2020
Code governance
* phpunit is only require-dev, so `webmozart/assert` MUST be required in the `composer.json` of this application
* Check composer --no-dev dependencies
* build.sh set Executable bit (+x) to fix Warnings found in [bash-exec] linter! [WARN ] Error: File:[/github/workspace/build.sh] is not executable
* CustomFilters::webalize renamed because Method name "CustomFilters::webalize_" is not in camel caps format
* context['article'] to context['content'] for article.latte
* .gitignore: .php_cs.cache
* PHPUnit: error_reporting(E_ALL); // incl E_NOTICE
* change of author email rejthar@stanislavrejthar.com
* bump version "godsdev/tools": "^0.3.7
* bump version backyard/3.2.9 ("minimum-stability": "stable")
* gitignore cache
* forgotten HOME_TOKEN settings hinted by PHPUnit
* phplint.yml uses actions/checkout@v2 version as well
* main branch (will replace `master` branch in due time)
* dist/build.sh: To work on low performing environments, the script accepts number of seconds as parameter to be used as a waiting time between steps.
* PHP/5.6 tested and PHP/7.2 tested

Code changes and various minor bugs fixes
* TableAdmin.php: Localised field content\\url_## has language independant behaviour
* TableAdmin.php: TRANSLATIONS are defined through constructor, uses web app config
* LogMysqli: int instead of bool Parameter #2 of method GodsDev\MyCMS\LogMysqli::query() so that it is compatible with method GodsDev\Backyard\BackyardMysqli::query()
* MyAdmin: definition of properties $ASSETS_SUBFOLDERS, $agendas instead of their definition in dist/classes/Admin.php
* MyAdmin: Method GodsDev\MyCMS\MyAdmin::projectSpecificSections() invoked with 1 parameter, 0 required.
* MyAdminProcess: fix type Tools::addMessage($result['success'], $result['messages']); (instead of message)
* MyAdminProcess: $salt = mt_rand((int) 1e8, (int) 1e9); (Fix: mt_rand expects int, float given)
* MyTableAdmin: removed __construct as it only duplicated parent
* MyTableLister::viewInputs - $option typo changed to $options
* fix MyCMSMonoLingual::csrfStart: Parameter #1 $min and #2 $max of function rand expects int, float given.
* fix MyController Access to an undefined properties GodsDev\MyCMS\MyController::$language and GodsDev\MyCMS\MyController::$requestUri.
* fix MyCMSMonoLingual Result of (!is_object($this->logger) || !($this->logger instanceof LoggerInterface)) is always false.
* fix type for MyAdminProcess::$tableAdmin
* fix MyTableLister::setTable throw new \RunTimeException
* fix TableAdmin: LogMysqli database object instead of vanilla \mysqli
* LogMysqli::query does not throw \DBQueryException as it logs troubles instead
* LogMysqli::query @return \mysqli_result Object|false
* MyTableLister::viewTable argument \mysqli_result $query (instead of \mysqli)
* TableAdmin::customSave - typecast to fix parameter #1 $input of function str_pad expects string, int given.
* AdminProcess::adminProcess - fix Binary operation "+" between string and (float|int) results in an error. Parameter #1 $input of function str_pad expects string, (float|int) given.
* config.php: fix Parameter #2 $newvalue of function ini_set expects string, int given.
* fix MyFriendlyUrl::PAGE_NOT_FOUND - Visibility must be declared on all constants if your project supports PHP 7.1 or later
* fix MyFriendlyUrl - The first trait import statement must be declared on the first non-comment line after the class opening brace
* fix MyAdminProcess::processFilePack - Parentheses must be used when instantiating a new class (\ZipArchive)
* Parentheses must be used when instantiating a new class: MyCMSMonoLingual::renderLatte, MyAdminProcess::processFileUnpack

Code style
* PHP linter and super-linter for GitHub Actions
* $this->tableAdmin everywhere instead of $this->TableAdmin or $TableAdmin
* markdown lint README.md: MD010/no-hard-tabs, MD009/no-trailing-spaces, MD014/commands-show-output, MD025/single-title/single-h1, MD040/fenced-code-language, MD009/no-trailing-spaces, MD037/no-space-in-emphasis
* VALIDATE_CSS: false (stylelint seems to evaluate sass the same way as CSS; `.stylelintignore` prepared for future use)

PHPStan
* recommended fixes to PHPDocs
* removal of wrong code
* phpstan include structure (mycms includes dist, github/phpstan includes local; when PHPStan test dist/ as part of MyCMS, it knows the GodsDev\\MyCMS\\* classes, so they should be ignored only if dist/ lives in its own project) 
* ignoreErrors references to 3rd library objects
* reasonable ignoreErrors exceptions
* dynamicConstantNames instead of constant induced exceptions
* some mixed type hints replaced with more specific ones
* discovering-symbols, e.g. conf/constants.php: Predefining constants for PHPSTAN analysis as recommanded by <https://phpstan.org/user-guide/discovering-symbols> 

PHPCS
* 120 chars limit enforced
* multi-line control structure
* loosen rules where it makes sense

TODO fix (CRS2)
* MyTableAdmin: the right correction is replacing #3 $cols and #4 $rows false,false by 60,5 as int is expected?
* MyTableLister: addPage() invoked with 6 parameters, 3-5 required; Parameter #1 $types of method GodsDev\MyCMS\MyTableLister::filterKeys() expects array, string given

Authored-by: Stanislav Rejthar, rejthar@stanislavrejthar.com
GodsDev added a commit that referenced this pull request Dec 13, 2020
* MyTableLister: method addPage has just 5 parameters
* AdminProcess: use TableAdmin (instead of MyTableAdmin) so that $this->tableAdmin->customDelete() refers to an existing method
* MyTableAdmin: recordSave() $field instead of $value; check for $this->fields being be an array with at least one element
* If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator: fix Binary operation "+=" between arrays results in an error ==> for simplicity and better readability use simple assignment, i.e.
`$input['class'] = 'form-control input-date';` instead of `$input += [/* 'type' => 'date', */ 'class' => 'form-control input-date'];` which should be anyway `$input = ['class' => 'form-control input-date'] + $input;`
* AdminProcess: method adminProcess() fix Binary operation "+=" between array&nonEmpty and array|false results in an error.
GodsDev added a commit that referenced this pull request Dec 13, 2020
* MyTableLister: method addPage has just 5 parameters
* AdminProcess: use TableAdmin (instead of MyTableAdmin) so that $this->tableAdmin->customDelete() refers to an existing method
* MyTableAdmin: recordSave() $field instead of $value; check for $this->fields being be an array with at least one element
* If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator: fix Binary operation "+=" between arrays results in an error ==> for simplicity and better readability use simple assignment, i.e.
`$input['class'] = 'form-control input-date';` instead of `$input += [/* 'type' => 'date', */ 'class' => 'form-control input-date'];` which should be anyway `$input = ['class' => 'form-control input-date'] + $input;`
* AdminProcess: method adminProcess() fix Binary operation "+=" between array&nonEmpty and array|false results in an error.
GodsDev added a commit that referenced this pull request Dec 13, 2020
* MyTableLister: method addPage has just 5 parameters
* AdminProcess: use TableAdmin (instead of MyTableAdmin) so that $this->tableAdmin->customDelete() refers to an existing method
* MyTableAdmin: recordSave() $field instead of $value; check for $this->fields being be an array with at least one element
* If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator: fix Binary operation "+=" between arrays results in an error ==> for simplicity and better readability use simple assignment, i.e.
`$input['class'] = 'form-control input-date';` instead of `$input += [/* 'type' => 'date', */ 'class' => 'form-control input-date'];` which should be anyway `$input = ['class' => 'form-control input-date'] + $input;`
* AdminProcess: method adminProcess() fix Binary operation "+=" between array&nonEmpty and array|false results in an error.
@GodsDev GodsDev mentioned this pull request Dec 13, 2020
GodsDev added a commit that referenced this pull request Dec 13, 2020
* MyTableLister: method addPage has just 5 parameters
* AdminProcess: use TableAdmin (instead of MyTableAdmin) so that $this->tableAdmin->customDelete() refers to an existing method
* MyTableAdmin: recordSave() $field instead of $value; check for $this->fields being be an array with at least one element
* If you want to append array elements from the second array to the first array while not overwriting the elements from the first array and not re-indexing, use the + array union operator: fix Binary operation "+=" between arrays results in an error ==> for simplicity and better readability use simple assignment, i.e.
`$input['class'] = 'form-control input-date';` instead of `$input += [/* 'type' => 'date', */ 'class' => 'form-control input-date'];` which should be anyway `$input = ['class' => 'form-control input-date'] + $input;`
* AdminProcess: method adminProcess() fix Binary operation "+=" between array&nonEmpty and array|false results in an error.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants