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

[UPD] Refactoring app structure #50

Merged
merged 4 commits into from
May 3, 2022
Merged

[UPD] Refactoring app structure #50

merged 4 commits into from
May 3, 2022

Conversation

bim-g
Copy link
Collaborator

@bim-g bim-g commented May 3, 2022

fix proble with composer auto deployement cause of invalide schema rules.
closes #48

Problem with repetitive method on defferent class, refactor to remove repetitive method for the sema implementation
closes #49

@bim-g bim-g added bug Something isn't working enhancement New feature or request labels May 3, 2022
@bim-g bim-g added this to the Refacoring milestone May 3, 2022
@bim-g bim-g self-assigned this May 3, 2022
@bim-g bim-g merged commit ee2f8e1 into master May 3, 2022
@@ -21,7 +22,7 @@ class StringValidation {
* @throws Exception
*/
function __construct(array $source,array $schema) {
$this->init_app($source,$schema);
$this->initInstance($source,$schema);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename method to provide meaningfull name

"minimum-stability": "beta",
"support":{
"email": "ibmussafb@gmail.com"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add more detail about the support and project role


use Wepesi\App\Providers\Contracts\SchemaContracts;

abstract class SChemaProvider implements SchemaContracts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename astract class SChema to SChemaProvide


use Wepesi\App\Providers\Contracts\Contracts;

abstract class ValidationProvider implements Contracts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Relocate provider folder to app root because it should be accessed in the entire app

@@ -70,7 +71,7 @@ private function init_app($source, $schema){
* @param int $rule
*
*/
function min(int $rule):void
function min($rule):void
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove param datatype the have a general method the be re-used

* @param array $value
* @return void
*/
function addError(array $value): void
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add to addError and result method to be re-used by all class that inherit the class and avoid duplication

vendor
.phpunit.result.cache
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has been added but ist does not ignore the modification of the file

{"version":1,"defects":{"Test\\Schema\\SCHStringTest::testStringObject":4,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":3,"Test\\Schema\\SCHStringTest::testStringEmailKey":3,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":4,"Test\\Schema\\StringSchemaTest::testStringURLKey":4,"Test\\Schema\\StringSchemaTest::testStringMatchKey":4,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":4,"Test\\Schema\\NumberSchemaTest::testStringIsObject":4,"Test\\Schema\\NumberSchemaTest::testRequiredKey":4,"Test\\Schema\\DateSchemaTest::testDateTodayKey":4,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":4,"Test\\Script\\StringValidationTest::testStringIsObject":4,"Test\\Script\\StringValidationTest::testStringObjectException":4,"Test\\Script\\StringValidationTest::testException":3,"Test\\Script\\StringValidationTest::testStringMin":3,"Test\\Script\\StringValidationTest::testStringMaxError":4,"Test\\Script\\StringValidationTest::testStringMaxSuccess":3,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":4,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":4,"Test\\Script\\StringValidationTest::testStringMinError":4,"Test\\Script\\StringValidationTest::testStringMinSuccess":3,"Test\\Script\\StringValidationTest::testStringEmailError":3,"Test\\Script\\StringValidationTest::testStringURLSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":4,"Test\\Script\\StringValidationTest::testStringRequiredErrors":3,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":4,"Test\\Script\\StringValidationTest::testStringMatchSuccess":3,"Test\\Script\\StringValidationTest::testStringMatchErrors":3,"Test\\Schema\\StringSchemaTest::testStringIsObject":4,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\StringSchemaTest::testStringEmailKey":4,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":4,"Test\\Schema\\DateSchemaTest::testStringIsObject":4,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\DateSchemaTest::testDateNowKey":4,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":4,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":4},"times":{"Test\\Schema\\SCHStringTest::testStringObject":0.021,"Test\\Schema\\SCHStringTest::testStringObjectIsKey":0,"Test\\Schema\\SCHStringTest::testStringObjectIsNotKey":0.01,"Test\\Schema\\SCHStringTest::testStringEmailKey":0.001,"Test\\Schema\\SCHStringTest::testStringIsObject":0.008,"Test\\Schema\\StringSchemaTest::testStringIsObject":0.009,"Test\\Schema\\StringSchemaTest::testStringObjectIsKey":0.001,"Test\\Schema\\StringSchemaTest::testStringEmailKey":0.001,"Test\\Schema\\StringSchemaTest::testStringURLKey":0,"Test\\Schema\\StringSchemaTest::testStringMatchKey":0,"Test\\Schema\\StringSchemaTest::testStringMinimumKey":0,"Test\\Schema\\StringSchemaTest::testStringMaximumKey":0,"Test\\Schema\\NumberSchemaTest::testStringIsObject":0.008,"Test\\Schema\\NumberSchemaTest::testStringObjectIsKey":0,"Test\\Schema\\NumberSchemaTest::testRequiredKey":0,"Test\\Schema\\NumberSchemaTest::testNumberPositiveKey":0,"Test\\Schema\\DateSchemaTest::testStringIsObject":0.022,"Test\\Schema\\DateSchemaTest::testStringObjectIsKey":0.002,"Test\\Schema\\DateSchemaTest::testDateNowKey":0.002,"Test\\Schema\\DateSchemaTest::testDateTodayKey":0,"Test\\Schema\\BooleanSchemaTest::testBooleanIsObject":0.007,"Test\\Schema\\BooleanSchemaTest::testStringObjectIsKey":0.001,"Test\\Schema\\BooleanSchemaTest::testBooleanIsRequireddKey":0.001,"Test\\Schema\\BooleanSchemaTest::testBooleanIsValidKey":0,"Test\\Script\\StringValidationTest::testStringIsObject":0,"Test\\Script\\StringValidationTest::testStringObjectException":0.006,"Test\\Script\\StringValidationTest::testException":0.007,"Test\\Script\\StringValidationTest::testStringMin":0.001,"Test\\Script\\StringValidationTest::testStringValidationException":0.006,"Test\\Script\\StringValidationTest::testStringValidationSchemaException":0,"Test\\Script\\StringValidationTest::testStringValidationSourceDataException":0.007,"Test\\Script\\StringValidationTest::testStringMinError":0,"Test\\Script\\StringValidationTest::testStringMinSuccess":0,"Test\\Script\\StringValidationTest::testStringMaxError":0,"Test\\Script\\StringValidationTest::testStringMaxSuccess":0,"Test\\Script\\StringValidationTest::testStringEmailError":0.001,"Test\\Script\\StringValidationTest::testStringEmailSuccess":0,"Test\\Script\\StringValidationTest::testStringUrlError":0.008,"Test\\Script\\StringValidationTest::testStringURLError":0,"Test\\Script\\StringValidationTest::testStringURLSuccess":0.008,"Test\\Script\\StringValidationTest::testStringRequiredSuccess":0.001,"Test\\Script\\StringValidationTest::testStringRequiredErrors":0,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknow":0,"Test\\Script\\StringValidationTest::testStringRequiredErrorsUnknown":0,"Test\\Script\\StringValidationTest::testStringMatchErrors":0,"Test\\Script\\StringValidationTest::testStringMatchSuccess":0,"Test\\Script\\StringValidationTest::testStringValidationFieldNotDefinedException":0,"Test\\ValidationTest::testValidationObject":0.008}}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shoudl be reviewed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactoring app structure Block auto deploy cause of composer invalid schema
1 participant