-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
@@ -21,7 +22,7 @@ class StringValidation { | |||
* @throws Exception | |||
*/ | |||
function __construct(array $source,array $schema) { | |||
$this->init_app($source,$schema); | |||
$this->initInstance($source,$schema); |
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.
rename method to provide meaningfull name
"minimum-stability": "beta", | ||
"support":{ | ||
"email": "ibmussafb@gmail.com" |
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.
add more detail about the support and project role
|
||
use Wepesi\App\Providers\Contracts\SchemaContracts; | ||
|
||
abstract class SChemaProvider implements SchemaContracts |
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.
Rename astract class SChema to SChemaProvide
|
||
use Wepesi\App\Providers\Contracts\Contracts; | ||
|
||
abstract class ValidationProvider implements Contracts |
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.
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 |
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.
remove param datatype the have a general method the be re-used
* @param array $value | ||
* @return void | ||
*/ | ||
function addError(array $value): void |
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.
add to addError
and result
method to be re-used by all class that inherit the class and avoid duplication
vendor | ||
.phpunit.result.cache |
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.
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}} |
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.
this shoudl be reviewed
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